[PATCH 4 of 6 STABLE] graphlog: multiple --branch must be or'ed
Patrick Mezard
patrick at mezard.eu
Sat Feb 18 19:57:41 UTC 2012
# HG changeset patch
# User Patrick Mezard <patrick at mezard.eu>
# Date 1329594705 -3600
# Branch stable
# Node ID e9c7bf70d3bb0e2cf7d34c857f19236ee184f85f
# Parent 06c28764a4c7b41728404e3d4b83c3823797e1a9
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
@@ -1359,9 +1359,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
@@ -1407,9 +1411,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