[PATCH 28 of 35] children: define inferrepo in command decorator

Gregory Szorc gregory.szorc at gmail.com
Mon May 5 00:51:33 CDT 2014


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1399267528 25200
#      Sun May 04 22:25:28 2014 -0700
# Branch stable
# Node ID 24499eebef38fd7fc3a67467bbdab9a17b0169f0
# Parent  026a998061da9f149cf080592533bef9d2a5b911
children: define inferrepo in command decorator

diff --git a/hgext/children.py b/hgext/children.py
--- a/hgext/children.py
+++ b/hgext/children.py
@@ -21,17 +21,18 @@ from mercurial.i18n import _
 cmdtable = {}
 command = cmdutil.command(cmdtable)
 testedwith = 'internal'
 
 @command('children',
     [('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
 
     Print the children of the working directory's revisions. If a
     revision is given via -r/--rev, the children of that revision will
     be printed. If a file argument is given, revision in which the
     file was last changed (after the working directory revision or the
     argument to --rev if given) is printed.
@@ -41,10 +42,8 @@ def children(ui, repo, file_=None, **opt
         ctx = repo.filectx(file_, changeid=rev)
     else:
         ctx = repo[rev]
 
     displayer = cmdutil.show_changeset(ui, repo, opts)
     for cctx in ctx.children():
         displayer.show(cctx)
     displayer.close()
-
-commands.inferrepo += " children"


More information about the Mercurial-devel mailing list