[PATCH 5 of 7] graphlog: fix --removed
Patrick Mezard
patrick at mezard.eu
Sun Feb 26 16:14:28 UTC 2012
# HG changeset patch
# User Patrick Mezard <patrick at mezard.eu>
# Date 1330272657 -3600
# Node ID bfc4a8eee8b02f92dbcac8f5fc636e2de1a19773
# Parent f032e6d7b8ee19a3d205fd43bc3f7b6c26a9d829
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.
diff --git a/hgext/graphlog.py b/hgext/graphlog.py
--- a/hgext/graphlog.py
+++ b/hgext/graphlog.py
@@ -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 '),
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -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
More information about the Mercurial-devel
mailing list