hgext/children.py
changeset 21248 48e859e30cbf
parent 17773 434e5bd615fc
child 21780 2d3fb8476d7a
equal deleted inserted replaced
21247:b1e64c6720d8 21248:48e859e30cbf
    16 
    16 
    17 from mercurial import cmdutil, commands
    17 from mercurial import cmdutil, commands
    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 = {}
       
    22 command = cmdutil.command(cmdtable)
    21 testedwith = 'internal'
    23 testedwith = 'internal'
    22 
    24 
       
    25 @command('children',
       
    26     [('r', 'rev', '',
       
    27      _('show children of the specified revision'), _('REV')),
       
    28     ] + templateopts,
       
    29     _('hg children [-r REV] [FILE]'))
    23 def children(ui, repo, file_=None, **opts):
    30 def children(ui, repo, file_=None, **opts):
    24     """show the children of the given or working directory revision
    31     """show the children of the given or working directory revision
    25 
    32 
    26     Print the children of the working directory's revisions. If a
    33     Print the children of the working directory's revisions. If a
    27     revision is given via -r/--rev, the children of that revision will
    34     revision is given via -r/--rev, the children of that revision will
    38     displayer = cmdutil.show_changeset(ui, repo, opts)
    45     displayer = cmdutil.show_changeset(ui, repo, opts)
    39     for cctx in ctx.children():
    46     for cctx in ctx.children():
    40         displayer.show(cctx)
    47         displayer.show(cctx)
    41     displayer.close()
    48     displayer.close()
    42 
    49 
    43 cmdtable = {
       
    44     "children":
       
    45         (children,
       
    46          [('r', 'rev', '',
       
    47            _('show children of the specified revision'), _('REV')),
       
    48          ] + templateopts,
       
    49          _('hg children [-r REV] [FILE]')),
       
    50 }
       
    51 
       
    52 commands.inferrepo += " children"
    50 commands.inferrepo += " children"