# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1506288882 -19800 # Node ID f4956eb3a456b135718979fb14bb668fd65b85cb # Parent c2102598adf51db7473c6a15001044bbda0c5c0a topics: improve the function signature by accepting arguments as **opts diff -r c2102598adf5 -r f4956eb3a456 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Tue Sep 26 12:58:10 2017 +0200 +++ b/hgext3rd/topic/__init__.py Mon Sep 25 03:04:42 2017 +0530 @@ -382,7 +382,7 @@ ('', 'current', None, 'display the current topic only'), ] + commands.formatteropts, _('hg topics [TOPIC]')) -def topics(ui, repo, topic=None, clear=False, rev=None, list=False, **opts): +def topics(ui, repo, topic=None, **opts): """View current topic, set current topic, change topic for a set of revisions, or see all topics. Clear topic on existing topiced revisions:: @@ -418,7 +418,11 @@ The --verbose version of this command display various information on the state of each topic.""" + clear = opts.get('clear') + list = opts.get('list') + rev = opts.get('rev') current = opts.get('current') + if current and topic: raise error.Abort(_("cannot use --current when setting a topic")) if current and clear: