Mercurial > hg
comparison mercurial/templatekw.py @ 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 | 4612cded5176 |
children | 6c375e07d673 |
comparison
equal
deleted
inserted
replaced
11654:898a5305f342 | 11655:6faf015e0ba0 |
---|---|
149 branch = args['ctx'].branch() | 149 branch = args['ctx'].branch() |
150 if branch != 'default': | 150 if branch != 'default': |
151 branch = encoding.tolocal(branch) | 151 branch = encoding.tolocal(branch) |
152 return showlist('branch', [branch], plural='branches', **args) | 152 return showlist('branch', [branch], plural='branches', **args) |
153 | 153 |
154 def showchildren(**args): | |
155 ctx = args['ctx'] | |
156 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()] | |
157 return showlist('children', childrevs, **args) | |
158 | |
154 def showdate(repo, ctx, templ, **args): | 159 def showdate(repo, ctx, templ, **args): |
155 return ctx.date() | 160 return ctx.date() |
156 | 161 |
157 def showdescription(repo, ctx, templ, **args): | 162 def showdescription(repo, ctx, templ, **args): |
158 return ctx.description().strip() | 163 return ctx.description().strip() |
243 # cache - a cache dictionary for the whole templater run | 248 # cache - a cache dictionary for the whole templater run |
244 # revcache - a cache dictionary for the current revision | 249 # revcache - a cache dictionary for the current revision |
245 keywords = { | 250 keywords = { |
246 'author': showauthor, | 251 'author': showauthor, |
247 'branches': showbranches, | 252 'branches': showbranches, |
253 'children': showchildren, | |
248 'date': showdate, | 254 'date': showdate, |
249 'desc': showdescription, | 255 'desc': showdescription, |
250 'diffstat': showdiffstat, | 256 'diffstat': showdiffstat, |
251 'extras': showextras, | 257 'extras': showextras, |
252 'file_adds': showfileadds, | 258 'file_adds': showfileadds, |