changeset 14082:176b3abb5b8b

graphlog: fix log -G --removed Current version was mispelled and processed like a valued argument.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 30 Apr 2011 19:42:00 +0200
parents 8670e3694b85
children 2520ebfd9f5c
files hgext/graphlog.py tests/test-glog.t
diffstat 2 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/graphlog.py	Sat Apr 30 19:42:00 2011 +0200
+++ b/hgext/graphlog.py	Sat Apr 30 19:42:00 2011 +0200
@@ -223,20 +223,22 @@
 def revset(pats, opts):
     """Return revset str built of revisions, log options and file patterns.
     """
-    opt2revset = dict(only_merges='merge',
+    opt2revset = dict(only_merges='merge()',
                       only_branch='branch',
-                      no_merges='not merge',
+                      no_merges='not merge()',
                       include='file',
                       exclude='not file',
-                      prune='not follow')
+                      prune='not follow',
+                      follow='follow()',
+                      removed='removes("*")')
     revset = []
     for op, val in opts.iteritems():
         if not val:
             continue
         revop = opt2revset.get(op, op)
-        if op in ('follow', 'only_merges', 'no_merges'):
-            revset.append('%s()' % revop)
-        elif op in ('date', 'remove'):
+        if op in ('follow', 'only_merges', 'no_merges', 'removed'):
+            revset.append('%s' % revop)
+        elif op in ('date',):
             revset.append('%s(%s)' % (revop, val))
         elif op in ('include', 'exclude', 'user', 'branch', 'keyword',
                     'prune', 'only_branch'):
--- a/tests/test-glog.t	Sat Apr 30 19:42:00 2011 +0200
+++ b/tests/test-glog.t	Sat Apr 30 19:42:00 2011 +0200
@@ -1405,4 +1405,12 @@
   abort: unknown revision 'something nice'!
   [255]
   $ hg log -G --include 'some file' --exclude 'another file'
+  $ hg log -G --follow  --template 'nodetag {rev}\n' | grep nodetag | wc -l
+  \s*36 (re)
+  $ hg log -G --removed --template 'nodetag {rev}\n' | grep nodetag | wc -l
+  \s*0 (re)
+  $ hg log -G --only-merges --template 'nodetag {rev}\n' | grep nodetag | wc -l
+  \s*28 (re)
+  $ hg log -G --no-merges --template 'nodetag {rev}\n' | grep nodetag | wc -l
+  \s*9 (re)