D6124: patch: include newline at EOF in help text for interactive patch
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Tue Mar 12 18:13:53 EDT 2019
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
The lack of a newline means that some "editors" that are useful in
tests, such as `echo "+new line" >> "$1"` don't work. It's obviously
easy to work around it, but newline at EOF seems like a good practice
diff --git a/mercurial/patch.py b/mercurial/patch.py
@@ -1117,7 +1117,7 @@
f = util.nativeeolwriter(os.fdopen(patchfd, r'wb'))
- f.write('\n'.join(['# ' + i for i in phelp.splitlines()]))
+ f.write(''.join(['# ' + i + '\n' for i in phelp.splitlines()]))
# Start the editor and wait for it to complete
editor = ui.geteditor()
To: martinvonz, #hg-reviewers
More information about the Mercurial-devel