graphlog: unblock --line-range option
authorYuya Nishihara <yuya@tcha.org>
Sun, 21 Jan 2018 16:04:59 +0900
changeset 36197 db26e6a0a677
parent 36196 1abf089a1d70
child 36198 7bc10d3f68b4
graphlog: unblock --line-range option It should work now.
mercurial/commands.py
tests/test-log-linerange.t
--- a/mercurial/commands.py	Sun Jan 21 16:03:14 2018 +0900
+++ b/mercurial/commands.py	Sun Jan 21 16:04:59 2018 +0900
@@ -3420,11 +3420,6 @@
 
     repo = scmutil.unhidehashlikerevs(repo, opts.get('rev'), 'nowarn')
     revs, differ = logcmdutil.getrevs(repo, pats, opts)
-
-    if opts.get('graph'):
-        if linerange:
-            raise error.Abort(_('graph not supported with line range patterns'))
-
     if linerange:
         revs, differ = logcmdutil.getlinerangerevs(repo, revs, opts)
 
--- a/tests/test-log-linerange.t	Sun Jan 21 16:03:14 2018 +0900
+++ b/tests/test-log-linerange.t	Sun Jan 21 16:04:59 2018 +0900
@@ -173,8 +173,76 @@
   +4
   
   $ hg log -f --graph -L foo,5:7 -p
-  abort: graph not supported with line range patterns
-  [255]
+  @  changeset:   5:cfdf972b3971
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
+  |
+  |  diff --git a/foo b/foo
+  |  --- a/foo
+  |  +++ b/foo
+  |  @@ -4,7 +4,7 @@
+  |   0
+  |    1
+  |   2+
+  |  -3
+  |  +3+
+  |   4
+  |   5
+  |   6
+  |
+  o  changeset:   4:eaec41c1a0c9
+  :  user:        test
+  :  date:        Thu Jan 01 00:00:00 1970 +0000
+  :  summary:     11 -> 11+; leading space before "1"
+  :
+  :  diff --git a/foo b/foo
+  :  --- a/foo
+  :  +++ b/foo
+  :  @@ -2,7 +2,7 @@
+  :   0
+  :   0
+  :   0
+  :  -1
+  :  + 1
+  :   2+
+  :   3
+  :   4
+  :
+  o  changeset:   2:63a884426fd0
+  :  user:        test
+  :  date:        Thu Jan 01 00:00:00 1970 +0000
+  :  summary:     2 -> 2+; added bar
+  :
+  :  diff --git a/foo b/foo
+  :  --- a/foo
+  :  +++ b/foo
+  :  @@ -3,6 +3,6 @@
+  :   0
+  :   0
+  :   1
+  :  -2
+  :  +2+
+  :   3
+  :   4
+  :
+  o  changeset:   0:5ae1f82b9a00
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     init
+  
+     diff --git a/foo b/foo
+     new file mode 100644
+     --- /dev/null
+     +++ b/foo
+     @@ -0,0 +1,5 @@
+     +0
+     +1
+     +2
+     +3
+     +4
+  
 
 With --template.