Mercurial > hg
comparison mercurial/templatekw.py @ 39367:83f8f7b9fa60
templatekw: alias {file} of files list to {path}
This is a part of the name unification. All {path}s will be changed to
repository-absolute (i.e. canonical) paths.
https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 05 Aug 2018 16:14:18 +0900 |
parents | 390287321b4b |
children | 5b1d406b39f1 |
comparison
equal
deleted
inserted
replaced
39366:a41497b5117c | 39367:83f8f7b9fa60 |
---|---|
295 ctx = context.resource(mapping, 'ctx') | 295 ctx = context.resource(mapping, 'ctx') |
296 revcache = context.resource(mapping, 'revcache') | 296 revcache = context.resource(mapping, 'revcache') |
297 if 'files' not in revcache: | 297 if 'files' not in revcache: |
298 revcache['files'] = ctx.p1().status(ctx)[:3] | 298 revcache['files'] = ctx.p1().status(ctx)[:3] |
299 files = revcache['files'][index] | 299 files = revcache['files'][index] |
300 return compatlist(context, mapping, name, files, element='file') | 300 return templateutil.compatfileslist(context, mapping, name, files) |
301 | 301 |
302 @templatekeyword('file_adds', requires={'ctx', 'revcache'}) | 302 @templatekeyword('file_adds', requires={'ctx', 'revcache'}) |
303 def showfileadds(context, mapping): | 303 def showfileadds(context, mapping): |
304 """List of strings. Files added by this changeset.""" | 304 """List of strings. Files added by this changeset.""" |
305 return _showfilesbystat(context, mapping, 'file_add', 1) | 305 return _showfilesbystat(context, mapping, 'file_add', 1) |
357 def showfiles(context, mapping): | 357 def showfiles(context, mapping): |
358 """List of strings. All files modified, added, or removed by this | 358 """List of strings. All files modified, added, or removed by this |
359 changeset. | 359 changeset. |
360 """ | 360 """ |
361 ctx = context.resource(mapping, 'ctx') | 361 ctx = context.resource(mapping, 'ctx') |
362 return compatlist(context, mapping, 'file', ctx.files()) | 362 return templateutil.compatfileslist(context, mapping, 'file', ctx.files()) |
363 | 363 |
364 @templatekeyword('graphnode', requires={'repo', 'ctx'}) | 364 @templatekeyword('graphnode', requires={'repo', 'ctx'}) |
365 def showgraphnode(context, mapping): | 365 def showgraphnode(context, mapping): |
366 """String. The character representing the changeset node in an ASCII | 366 """String. The character representing the changeset node in an ASCII |
367 revision graph.""" | 367 revision graph.""" |