[PATCH 2 of 4] graphlog: unblock --line-range option
Yuya Nishihara
yuya at tcha.org
Sun Feb 11 20:04:58 EST 2018
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1516518299 -32400
# Sun Jan 21 16:04:59 2018 +0900
# Node ID cd8ada5bfb23a9143a022ee0002a8fdba5fb9f0d
# Parent 4ac232e6bbda8ab3c219c9cf9e647e18db11bb35
graphlog: unblock --line-range option
It should work now.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3420,11 +3420,6 @@ def log(ui, repo, *pats, **opts):
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)
diff --git a/tests/test-log-linerange.t b/tests/test-log-linerange.t
--- a/tests/test-log-linerange.t
+++ b/tests/test-log-linerange.t
@@ -173,8 +173,76 @@ Add some changes with two diff hunks
+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.
More information about the Mercurial-devel
mailing list