# HG changeset patch # User Yuya Nishihara # Date 2018-02-25 07:36:38 # Node ID 9e3c37c367afd88f24b58ac78b721aa849d6560f # Parent e71a3c0a90b0c038544e7d26c759ff357273d022 templatekw: inline getfiles() It's just three lines. We don't need a separate function for that. diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -216,11 +216,6 @@ def _showlist(name, values, mapping, plu 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 showextras(**args): 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')