hgext/children.py
changeset 21780 2d3fb8476d7a
parent 21248 48e859e30cbf
child 24482 3eb9045396b0
equal deleted inserted replaced
21779:a57deb45c744 21780:2d3fb8476d7a
    12 
    12 
    13 This extension is deprecated. You should use :hg:`log -r
    13 This extension is deprecated. You should use :hg:`log -r
    14 "children(REV)"` instead.
    14 "children(REV)"` instead.
    15 '''
    15 '''
    16 
    16 
    17 from mercurial import cmdutil, commands
    17 from mercurial import cmdutil
    18 from mercurial.commands import templateopts
    18 from mercurial.commands import templateopts
    19 from mercurial.i18n import _
    19 from mercurial.i18n import _
    20 
    20 
    21 cmdtable = {}
    21 cmdtable = {}
    22 command = cmdutil.command(cmdtable)
    22 command = cmdutil.command(cmdtable)
    24 
    24 
    25 @command('children',
    25 @command('children',
    26     [('r', 'rev', '',
    26     [('r', 'rev', '',
    27      _('show children of the specified revision'), _('REV')),
    27      _('show children of the specified revision'), _('REV')),
    28     ] + templateopts,
    28     ] + templateopts,
    29     _('hg children [-r REV] [FILE]'))
    29     _('hg children [-r REV] [FILE]'),
       
    30     inferrepo=True)
    30 def children(ui, repo, file_=None, **opts):
    31 def children(ui, repo, file_=None, **opts):
    31     """show the children of the given or working directory revision
    32     """show the children of the given or working directory revision
    32 
    33 
    33     Print the children of the working directory's revisions. If a
    34     Print the children of the working directory's revisions. If a
    34     revision is given via -r/--rev, the children of that revision will
    35     revision is given via -r/--rev, the children of that revision will
    44 
    45 
    45     displayer = cmdutil.show_changeset(ui, repo, opts)
    46     displayer = cmdutil.show_changeset(ui, repo, opts)
    46     for cctx in ctx.children():
    47     for cctx in ctx.children():
    47         displayer.show(cctx)
    48         displayer.show(cctx)
    48     displayer.close()
    49     displayer.close()
    49 
       
    50 commands.inferrepo += " children"