children: define inferrepo in command decorator
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 04 May 2014 22:25:28 -0700
changeset 21780 2d3fb8476d7a
parent 21779 a57deb45c744
child 21781 f0c3b95af47f
children: define inferrepo in command decorator
hgext/children.py
--- a/hgext/children.py	Sun May 04 22:24:38 2014 -0700
+++ b/hgext/children.py	Sun May 04 22:25:28 2014 -0700
@@ -14,7 +14,7 @@
 "children(REV)"` instead.
 '''
 
-from mercurial import cmdutil, commands
+from mercurial import cmdutil
 from mercurial.commands import templateopts
 from mercurial.i18n import _
 
@@ -26,7 +26,8 @@
     [('r', 'rev', '',
      _('show children of the specified revision'), _('REV')),
     ] + templateopts,
-    _('hg children [-r REV] [FILE]'))
+    _('hg children [-r REV] [FILE]'),
+    inferrepo=True)
 def children(ui, repo, file_=None, **opts):
     """show the children of the given or working directory revision
 
@@ -46,5 +47,3 @@
     for cctx in ctx.children():
         displayer.show(cctx)
     displayer.close()
-
-commands.inferrepo += " children"