changeset 11655:6faf015e0ba0

templates: 'children' keyword The template keyword 'parents' is already present and this just provides the complimentary template keyword.
author Jason Harris <jason@jasonfharris.com>
date Sat, 03 Jul 2010 05:24:16 +0200
parents 898a5305f342
children 83eb6b1465bf
files mercurial/help/templates.txt mercurial/templatekw.py
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/help/templates.txt	Thu Jul 22 16:51:45 2010 +0200
+++ b/mercurial/help/templates.txt	Sat Jul 03 05:24:16 2010 +0200
@@ -28,6 +28,8 @@
 :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.
--- a/mercurial/templatekw.py	Thu Jul 22 16:51:45 2010 +0200
+++ b/mercurial/templatekw.py	Sat Jul 03 05:24:16 2010 +0200
@@ -151,6 +151,11 @@
         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 @@
 keywords = {
     'author': showauthor,
     'branches': showbranches,
+    'children': showchildren,
     'date': showdate,
     'desc': showdescription,
     'diffstat': showdiffstat,