changeset 2991:f4956eb3a456

topics: improve the function signature by accepting arguments as **opts
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 25 Sep 2017 03:04:42 +0530
parents c2102598adf5
children db3c85c2cb47
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: