[PATCH 3 of 6 STABLE] graphlog: multiple --user must be or'ed

Patrick Mezard patrick at mezard.eu
Sat Feb 18 13:57:40 CST 2012


# HG changeset patch
# User Patrick Mezard <patrick at mezard.eu>
# Date 1329594705 -3600
# Branch stable
# Node ID 06c28764a4c7b41728404e3d4b83c3823797e1a9
# Parent  8fd124b5231f470c654afbd8c4fe207adfd44b6a
graphlog: multiple --user must be or'ed

diff --git a/hgext/graphlog.py b/hgext/graphlog.py
--- a/hgext/graphlog.py
+++ b/hgext/graphlog.py
@@ -260,7 +260,7 @@
         'keyword':     ('keyword($)', ' and '),
         'only_branch': ('branch($)', ' and '),
         'prune':       ('not ($ or ancestors($))', ' and '),
-        'user':        ('user($)', ' and '),
+        'user':        ('user($)', ' or '),
         }
     optrevset = []
     revset = []
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -1396,7 +1396,17 @@
 
 Test log -G options
 
-  $ hg log -G -u 'something nice'
+  $ testlog() {
+  >   hg log -G --print-revset "$@"
+  >   hg log --template 'nodetag {rev}\n' "$@" | grep nodetag \
+  >     | sed 's/.*nodetag/nodetag/' > log.nodes
+  >   hg log -G --template 'nodetag {rev}\n' "$@" | grep nodetag \
+  >     | sed 's/.*nodetag/nodetag/' > glog.nodes
+  >   diff -u log.nodes glog.nodes
+  > }
+
+  $ testlog -u test -u not-a-user
+  ('group', ('group', ('or', ('func', ('symbol', 'user'), ('string', 'test')), ('func', ('symbol', 'user'), ('string', 'not-a-user')))))
   $ hg log -G -b 'something nice'
   abort: unknown revision 'something nice'!
   [255]


More information about the Mercurial-devel mailing list