Commits

Patrick Mézard committed 176b3ab

graphlog: fix log -G --removed

Current version was mispelled and processed like a valued argument.

Comments (0)

Files changed (2)

hgext/graphlog.py

 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'):

tests/test-glog.t

   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)