record: declare commands using decorator
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 04 May 2014 22:35:37 -0700
changeset 21251 a836fa58b512
parent 21250 8d354d58147c
child 21252 da0eb4970913
record: declare commands using decorator
hgext/record.py
--- a/hgext/record.py	Sun May 04 21:31:51 2014 -0700
+++ b/hgext/record.py	Sun May 04 22:35:37 2014 -0700
@@ -459,6 +459,8 @@
     # backup all changed files
     dorecord(ui, repo, committomq, 'qrefresh', True, *pats, **opts)
 
+# This command registration is replaced during uisetup().
+@command('qrecord', [], _('hg qrecord [OPTION]... PATCH [FILE]...'))
 def qrecord(ui, repo, patch, *pats, **opts):
     '''interactively record a new patch
 
@@ -637,10 +639,6 @@
     finally:
         ui.write = oldwrite
 
-cmdtable["qrecord"] = \
-    (qrecord, [], # placeholder until mq is available
-     _('hg qrecord [OPTION]... PATCH [FILE]...'))
-
 def uisetup(ui):
     try:
         mq = extensions.find('mq')