1 # Mercurial extension to provide the 'hg children' command
3 # Copyright 2007 by Intevation GmbH <intevation@intevation.de>
6 # Thomas Arendsen Hein <thomas@intevation.de>
8 # This software may be used and distributed according to the terms of the
9 # GNU General Public License version 2, incorporated herein by reference.
11 '''command to display child changesets'''
13 from mercurial import cmdutil
14 from mercurial.commands import templateopts
15 from mercurial.i18n import _
18 def children(ui, repo, file_=None, **opts):
19 """show the children of the given or working directory revision
21 Print the children of the working directory's revisions. If a
22 revision is given via -r/--rev, the children of that revision will
23 be printed. If a file argument is given, revision in which the
24 file was last changed (after the working directory revision or the
25 argument to --rev if given) is printed.
29 ctx = repo.filectx(file_, changeid=rev)
33 displayer = cmdutil.show_changeset(ui, repo, opts)
34 for cctx in ctx.children():
41 [('r', 'rev', '', _('show children of the specified revision')),
43 _('hg children [-r REV] [FILE]')),