Commit d8183501 authored by Ion Savin's avatar Ion Savin
Browse files

annotate: append newline after non newline-terminated file listings

The last line of a non newline-terminated file would mix with the first line of
the next file in multiple-file listings before this patch.

Possible compatibility issue: no longer possible to tell from the annotate
output if the file is terminated by new line or not.
parent 4bc715f2a356
......@@ -299,6 +299,9 @@ def annotate(ui, repo, *pats, **opts):
for p, l in zip(zip(*pieces), lines):
ui.write("%s: %s" % ("".join(p), l[1]))
if lines and not lines[-1][1].endswith('\n'):
[('', 'no-decode', None, _('do not pass files through decoders')),
('p', 'prefix', '', _('directory prefix for files in archive'),
......@@ -255,6 +255,18 @@ missing file
abort: nosuchfile: no such file in rev e9e6b4fa872f
annotate file without '\n' on last line
$ printf "" > c
$ hg ci -A -m test -u nobody -d '1 0'
adding c
$ hg annotate c
$ printf "a\nb" > c
$ hg ci -m test
$ hg annotate c
[0-9]+: a (re)
[0-9]+: b (re)
Test annotate with whitespace options
$ cd ..
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment