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

login
register
mail settings
Submitter Gregory Szorc
Date May 5, 2014, 5:51 a.m.
Message ID <24499eebef38fd7fc3a6.1399269093@vm-ubuntu-main.gateway.sonic.net>
Download mbox | patch
Permalink /patch/4619/
State Accepted
Commit 2d3fb8476d7a94ca8f03a55bd28d2e5237800211
Headers show

Comments

Gregory Szorc - May 5, 2014, 5:51 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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

Patch

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"