##// END OF EJS Templates
hgk: display committer name when set by hg-git
hgk: display committer name when set by hg-git

File last commit:

r24482:3eb90453 default
r24604:ce8dd4fd default
Show More
children.py
51 lines | 1.6 KiB | text/x-python | PythonLexer
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 # Mercurial extension to provide the 'hg children' command
#
# Copyright 2007 by Intevation GmbH <intevation@intevation.de>
Martin Geisler
add blank line after copyright notices and after header
r8228 #
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 # Author(s):
# Thomas Arendsen Hein <thomas@intevation.de>
#
Martin Geisler
updated license to be explicit about GPL version 2
r8225 # This software may be used and distributed according to the terms of the
Matt Mackall
Update license to GPLv2+
r10263 # GNU General Public License version 2 or any later version.
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
Augie Fackler
children: mark extension as deprecated
r16668 '''command to display child changesets (DEPRECATED)
Martin Geisler
children: use hg reST role for example
r16670 This extension is deprecated. You should use :hg:`log -r
"children(REV)"` instead.
Augie Fackler
children: mark extension as deprecated
r16668 '''
Dirkjan Ochtman
help: add/fix docstrings for a bunch of extensions
r8873
Gregory Szorc
children: define inferrepo in command decorator
r21780 from mercurial import cmdutil
Thomas Arendsen Hein
Introduce templateopts and logopts to reduce duplicate option definitions.
r6192 from mercurial.commands import templateopts
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 from mercurial.i18n import _
Gregory Szorc
children: declare command using decorator
r21248 cmdtable = {}
command = cmdutil.command(cmdtable)
Augie Fackler
hgext: mark all first-party extensions as such
r16743 testedwith = 'internal'
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
Gregory Szorc
children: declare command using decorator
r21248 @command('children',
[('r', 'rev', '',
_('show children of the specified revision'), _('REV')),
] + templateopts,
Gregory Szorc
children: define inferrepo in command decorator
r21780 _('hg children [-r REV] [FILE]'),
inferrepo=True)
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 def children(ui, repo, file_=None, **opts):
Martin Geisler
expand "dir" to "directory" in help texts
r8026 """show the children of the given or working directory revision
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
Martin Geisler
children: wrap docstrings at 70 characters
r9253 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.
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 """
rev = opts.get('rev')
if file_:
Yuya Nishihara
children: don't pass filectx to displayer...
r24482 fctx = repo.filectx(file_, changeid=rev)
childctxs = [fcctx.changectx() for fcctx in fctx.children()]
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783 else:
Matt Mackall
use repo[changeid] to get a changectx
r6747 ctx = repo[rev]
Yuya Nishihara
children: don't pass filectx to displayer...
r24482 childctxs = ctx.children()
Thomas Arendsen Hein
Add extension to provide the 'hg children' command (with tests)
r4783
displayer = cmdutil.show_changeset(ui, repo, opts)
Yuya Nishihara
children: don't pass filectx to displayer...
r24482 for cctx in childctxs:
Dirkjan Ochtman
cmdutil: use change contexts for cset-printer and cset-templater
r7369 displayer.show(cctx)
Robert Bachmann
Added support for templatevar "footer" to cmdutil.py
r10152 displayer.close()