changeset 16314:16ec050490fc

graphlog: improve --only-branch handling The previous code was correct for command line as opts always contains the default empty lists for --branch and --only-branch options. But calling graphlog.revset() directly with only --only-branch set would leave it unprocessed.
author Patrick Mezard <patrick@mezard.eu>
date Thu, 29 Mar 2012 16:55:08 +0200
parents 8ac2c91855cf
children f89284d72a61
files hgext/graphlog.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/graphlog.py	Thu Mar 29 22:16:56 2012 +0900
+++ b/hgext/graphlog.py	Thu Mar 29 16:55:08 2012 +0200
@@ -296,9 +296,7 @@
     opts = dict(opts)
     # 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['branch'] = opts['branch'] + opts.pop('only_branch')
-
+    opts['branch'] = opts.get('branch', []) + opts.get('only_branch', [])
     follow = opts.get('follow') or opts.get('follow_first')
     followfirst = opts.get('follow_first')
     if 'follow' in opts: