diff hgext/graphlog.py @ 16157:4a828d3bc04a

graphlog: --branch and --only-branch are the same Handling the aliasing in fancyopts would be cleaner but I do not want to make this change for stable.
author Patrick Mezard <patrick@mezard.eu>
date Thu, 23 Feb 2012 11:21:04 +0100
parents 0424f3c7d7ac
children e04cc21b01b2
line wrap: on
line diff
--- a/hgext/graphlog.py	Wed Feb 22 17:41:22 2012 -0600
+++ b/hgext/graphlog.py	Thu Feb 23 11:21:04 2012 +0100
@@ -258,10 +258,16 @@
         'exclude':     ('not file($)', ' and '),
         'include':     ('file($)', ' and '),
         'keyword':     ('keyword($)', ' or '),
-        'only_branch': ('branch($)', ' and '),
         'prune':       ('not ($ or ancestors($))', ' and '),
         'user':        ('user($)', ' or '),
         }
+
+    # branch and only_branch are really aliases and must be handled at
+    # the same time
+    if 'branch' in opts and 'only_branch' in opts:
+        opts = dict(opts)
+        opts['branch'] = opts['branch'] + opts.pop('only_branch')
+
     optrevset = []
     revset = []
     for op, val in opts.iteritems():