[PATCH 4 of 6 STABLE v2] graphlog: multiple --branch must be or'ed

Patrick Mezard patrick at mezard.eu
Wed Feb 22 05:31:35 CST 2012


# HG changeset patch
# User Patrick Mezard <patrick at mezard.eu>
# Date 1329910215 -3600
# Branch stable
# Node ID 2baf35d8321870300d766bd548c73e3149a41511
# Parent  8e8f128d12d41157c4fb8df720527a162daf966d
graphlog: multiple --branch must be or'ed

diff --git a/hgext/graphlog.py b/hgext/graphlog.py
--- a/hgext/graphlog.py
+++ b/hgext/graphlog.py
@@ -254,7 +254,7 @@
         'only_merges': ('merge()', None),
         'removed':     ('removes("*")', None),
         'date':        ('date($)', None),
-        'branch':      ('branch($)', ' and '),
+        'branch':      ('branch($)', ' or '),
         'exclude':     ('not file($)', ' and '),
         'include':     ('file($)', ' and '),
         'keyword':     ('keyword($)', ' and '),
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -1377,9 +1377,13 @@
 
 Do not crash or produce strange graphs if history is buggy
 
+  $ hg branch branch
+  marked working directory as branch branch
+  (branches are permanent and global, did you want a bookmark?)
   $ commit 36 "buggy merge: identical parents" 35 35
   $ hg glog -l5
-  @  changeset:   36:95fa8febd08a
+  @  changeset:   36:08a19a744424
+  |  branch:      branch
   |  tag:         tip
   |  parent:      35:9159c3644c5e
   |  parent:      35:9159c3644c5e
@@ -1425,9 +1429,12 @@
 
   $ 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]
+  $ testlog -b not-a-branch
+  ('group', ('group', ('func', ('symbol', 'branch'), ('string', 'not-a-branch'))))
+  abort: unknown revision 'not-a-branch'!
+  abort: unknown revision 'not-a-branch'!
+  $ testlog -b default -b branch
+  ('group', ('group', ('or', ('func', ('symbol', 'branch'), ('string', 'default')), ('func', ('symbol', 'branch'), ('string', 'branch')))))
   $ hg log -G --print-revset -k 'something' -k 'nice'
   ('group', ('group', ('and', ('func', ('symbol', 'keyword'), ('string', 'something')), ('func', ('symbol', 'keyword'), ('string', 'nice')))))
   $ hg log -G --only-branch 'something nice'


More information about the Mercurial-devel mailing list