changeset 21780:2d3fb8476d7a

children: define inferrepo in command decorator
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 04 May 2014 22:25:28 -0700
parents a57deb45c744
children f0c3b95af47f
files hgext/children.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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"