Commit ac437989 authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

annotate: mark lines affected by skip-annotate with *

This is to prevent weird surprises from happening with skips being attributed
to the wrong changeset.

.. feature::

   `hg annotate --skip` now prints a `*` on lines with skipped revisions

Differential Revision: https://phab.mercurial-scm.org/D900
parent 2f5a135b2b04
......@@ -400,7 +400,11 @@ def annotate(ui, repo, *pats, **opts):
for f, p, l in zip(zip(*formats), zip(*pieces), lines):
fm.startitem()
fm.write(fields, "".join(f), *p)
fm.write('line', ": %s", l[1])
if l[0].skip:
fmt = "* %s"
else:
fmt = ": %s"
fm.write('line', fmt, l[1])
if not lines[-1][1].endswith('\n'):
fm.plain('\n')
......
......@@ -261,8 +261,8 @@ because the pure code comes up with slightly different deltas internally.
$ hg annotate -nlf b --skip 6
0 a:1: a
1 a:2: z (no-pure !)
0 a:1: z (pure !)
1 a:2* z
1 a:3: a
3 b:4: b4
4 b:5: c
......@@ -275,9 +275,9 @@ because the pure code comes up with slightly different deltas internally.
0 a:1: a
6 b:2: z
1 a:3: a
1 a:3: b4
1 a:3* b4
4 b:5: c
1 a:3: b5
1 a:3* b5
7 b:7: d
$ hg annotate -nlf b --skip 4
......@@ -285,7 +285,7 @@ because the pure code comes up with slightly different deltas internally.
6 b:2: z
1 a:3: a
3 b:4: b4
1 a:3: c
1 a:3* c
3 b:5: b5
7 b:7: d
......@@ -293,9 +293,9 @@ because the pure code comes up with slightly different deltas internally.
0 a:1: a
6 b:2: z
1 a:3: a
1 a:3: b4
1 a:3: c
1 a:3: b5
1 a:3* b4
1 a:3* c
1 a:3* b5
7 b:7: d
$ hg annotate -nlf b --skip 'merge()'
......@@ -305,18 +305,18 @@ because the pure code comes up with slightly different deltas internally.
3 b:4: b4
4 b:5: c
3 b:5: b5
3 b:5: d
3 b:5* d
--skip everything -- use the revision the file was introduced in
$ hg annotate -nlf b --skip 'all()'
0 a:1: a
0 a:1: z
0 a:1: a
0 a:1: b4
0 a:1: c
0 a:1: b5
0 a:1: d
0 a:1* z
0 a:1* a
0 a:1* b4
0 a:1* c
0 a:1* b5
0 a:1* d
Issue2807: alignment of line numbers with -l
......
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