Mercurial > hg
changeset 36516:9e3c37c367af
templatekw: inline getfiles()
It's just three lines. We don't need a separate function for that.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 25 Feb 2018 16:36:38 +0900 |
parents | e71a3c0a90b0 |
children | 69477bac8926 |
files | mercurial/templatekw.py |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templatekw.py Sun Feb 25 16:35:34 2018 +0900 +++ b/mercurial/templatekw.py Sun Feb 25 16:36:38 2018 +0900 @@ -216,11 +216,6 @@ if endname in templ: yield templ(endname, **strmapping) -def getfiles(repo, ctx, revcache): - if 'files' not in revcache: - revcache['files'] = repo.status(ctx.p1(), ctx)[:3] - return revcache['files'] - def getlatesttags(repo, ctx, cache, pattern=None): '''return date, distance and name for the latest tag of rev''' @@ -466,7 +461,9 @@ def _showfilesbystat(args, name, index): repo, ctx, revcache = args['repo'], args['ctx'], args['revcache'] - files = getfiles(repo, ctx, revcache)[index] + if 'files' not in revcache: + revcache['files'] = repo.status(ctx.p1(), ctx)[:3] + files = revcache['files'][index] return showlist(name, files, args, element='file') @templatekeyword('file_adds')