# HG changeset patch # User Jason Harris # Date 2010-07-03 03:24:16 # Node ID 6faf015e0ba05cded2e3ad4d76788630dd6e0e50 # Parent 898a5305f34200ee592db69a1a323da373488f3f templates: 'children' keyword The template keyword 'parents' is already present and this just provides the complimentary template keyword. diff --git a/mercurial/help/templates.txt b/mercurial/help/templates.txt --- a/mercurial/help/templates.txt +++ b/mercurial/help/templates.txt @@ -28,6 +28,8 @@ keywords are usually available for templ :branches: String. The name of the branch on which the changeset was committed. Will be empty if the branch name was default. +:children: List of strings. The children of the changeset. + :date: Date information. The date when the changeset was committed. :desc: String. The text of the changeset description. diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -151,6 +151,11 @@ def showbranches(**args): branch = encoding.tolocal(branch) return showlist('branch', [branch], plural='branches', **args) +def showchildren(**args): + ctx = args['ctx'] + childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()] + return showlist('children', childrevs, **args) + def showdate(repo, ctx, templ, **args): return ctx.date() @@ -245,6 +250,7 @@ def showtags(**args): keywords = { 'author': showauthor, 'branches': showbranches, + 'children': showchildren, 'date': showdate, 'desc': showdescription, 'diffstat': showdiffstat,