graphlog: fix --removed
authorPatrick Mezard <patrick@mezard.eu>
Sun, 26 Feb 2012 17:10:57 +0100
changeset 16184 6863caf01daa
parent 16183 112a70c56d6a
child 16185 352053e6cd8e
graphlog: fix --removed "hg log --removed FILE" does not return changesets where FILE was removed, but ones where FILE was changed and possibly removed. The flag is really here to disable walkchangerevs() fast path, which cannot see file removals by scanning filelogs.
hgext/graphlog.py
tests/test-glog.t
--- a/hgext/graphlog.py	Sun Feb 26 17:10:56 2012 +0100
+++ b/hgext/graphlog.py	Sun Feb 26 17:10:57 2012 +0100
@@ -250,7 +250,6 @@
         'follow_first':     ('_followfirst()', None),
         'no_merges':        ('not merge()', None),
         'only_merges':      ('merge()', None),
-        'removed':          ('removes("*")', None),
         'date':             ('date(%(val)r)', None),
         'branch':           ('branch(%(val)r)', ' or '),
         '_patslog':         ('filelog(%(val)r)', ' or '),
--- a/tests/test-glog.t	Sun Feb 26 17:10:56 2012 +0100
+++ b/tests/test-glog.t	Sun Feb 26 17:10:57 2012 +0100
@@ -1454,8 +1454,6 @@
   ('group', ('group', ('or', ('or', ('func', ('symbol', 'branch'), ('string', 'default')), ('func', ('symbol', 'branch'), ('string', 'branch'))), ('func', ('symbol', 'branch'), ('string', 'branch')))))
   $ testlog -k expand -k merge
   ('group', ('group', ('or', ('func', ('symbol', 'keyword'), ('string', 'expand')), ('func', ('symbol', 'keyword'), ('string', 'merge')))))
-  $ hg log -G --removed --template 'nodetag {rev}\n' | grep nodetag | wc -l
-  \s*0 (re)
   $ testlog --only-merges
   ('group', ('func', ('symbol', 'merge'), None))
   $ testlog --no-merges
@@ -1646,3 +1644,14 @@
   ('group', ('group', ('func', ('symbol', '_matchfiles'), ('list', ('string', 'r:'), ('string', 'i:set:copied()')))))
   $ testlog -r "sort(file('set:copied()'), -rev)"
   ('group', ('group', ('func', ('symbol', 'sort'), ('list', ('func', ('symbol', 'file'), ('string', 'set:copied()')), ('negate', ('symbol', 'rev'))))))
+
+Test --removed
+
+  $ testlog --removed
+  ('func', ('symbol', 'all'), None)
+  $ testlog --removed a
+  ('group', ('group', ('func', ('symbol', '_matchfiles'), ('list', ('string', 'r:'), ('string', 'p:a')))))
+  $ testlog --removed --follow a
+  abort: can only follow copies/renames for explicit filenames
+  abort: can only follow copies/renames for explicit filenames
+  abort: can only follow copies/renames for explicit filenames