Patchwork D900: annotate: mark lines affected by skip-annotate with *

login
register
mail settings
Submitter phabricator
Date Oct. 2, 2017, 5:23 p.m.
Message ID <2f9610f0e591a38535b1203d9a9ab20f@localhost.localdomain>
Download mbox | patch
Permalink /patch/24405/
State Not Applicable
Headers show

Comments

phabricator - Oct. 2, 2017, 5:23 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG884b595f5195: annotate: mark lines affected by skip-annotate with * (authored by sid0, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D900?vs=2330&id=2342

REVISION DETAIL
  https://phab.mercurial-scm.org/D900

AFFECTED FILES
  mercurial/commands.py
  tests/test-annotate.t

CHANGE DETAILS




To: sid0, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/tests/test-annotate.t b/tests/test-annotate.t
--- a/tests/test-annotate.t
+++ b/tests/test-annotate.t
@@ -261,8 +261,8 @@ 
 
   $ 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,27 +275,27 @@ 
   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
   0 a:1: a
   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
 
   $ hg annotate -nlf b --skip 3 --skip 4
   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 @@ 
   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
 
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -400,7 +400,11 @@ 
         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')