# HG changeset patch # User Gregory Szorc # Date 1399267528 25200 # Node ID 2d3fb8476d7a94ca8f03a55bd28d2e5237800211 # Parent a57deb45c744d982d0ab2e115347168eb6830228 children: define inferrepo in command decorator diff -r a57deb45c744 -r 2d3fb8476d7a 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"