graphlog: multiple --user must be or'ed
authorPatrick Mezard <patrick@mezard.eu>
Wed, 22 Feb 2012 12:30:15 +0100
changeset 16148 184cc3c3e0a6
parent 16147 5607d829bf17
child 16149 6acbbb0c7381
graphlog: multiple --user must be or'ed
hgext/graphlog.py
tests/test-glog.t
--- a/hgext/graphlog.py	Wed Feb 22 12:30:15 2012 +0100
+++ b/hgext/graphlog.py	Wed Feb 22 12:30:15 2012 +0100
@@ -260,7 +260,7 @@
         'keyword':     ('keyword($)', ' and '),
         'only_branch': ('branch($)', ' and '),
         'prune':       ('not ($ or ancestors($))', ' and '),
-        'user':        ('user($)', ' and '),
+        'user':        ('user($)', ' or '),
         }
     optrevset = []
     revset = []
--- a/tests/test-glog.t	Wed Feb 22 12:30:15 2012 +0100
+++ b/tests/test-glog.t	Wed Feb 22 12:30:15 2012 +0100
@@ -1414,7 +1414,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]