D4001: templatekw: use ctx1.status(ctx2) instead of repo.status(ctx1, ctx2)
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Wed Aug 1 16:30:42 UTC 2018
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4001
AFFECTED FILES
mercurial/templatekw.py
CHANGE DETAILS
diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -293,15 +293,14 @@
lambda k: '%s=%s' % (k, stringutil.escapestr(extras[k])))
def _showfilesbystat(context, mapping, name, index):
- repo = context.resource(mapping, 'repo')
ctx = context.resource(mapping, 'ctx')
revcache = context.resource(mapping, 'revcache')
if 'files' not in revcache:
- revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
+ revcache['files'] = ctx.p1().status(ctx)[:3]
files = revcache['files'][index]
return compatlist(context, mapping, name, files, element='file')
- at templatekeyword('file_adds', requires={'repo', 'ctx', 'revcache'})
+ at templatekeyword('file_adds', requires={'ctx', 'revcache'})
def showfileadds(context, mapping):
"""List of strings. Files added by this changeset."""
return _showfilesbystat(context, mapping, 'file_add', 1)
@@ -345,12 +344,12 @@
key='name', value='source', fmt='%s (%s)',
plural='file_copies')
- at templatekeyword('file_dels', requires={'repo', 'ctx', 'revcache'})
+ at templatekeyword('file_dels', requires={'ctx', 'revcache'})
def showfiledels(context, mapping):
"""List of strings. Files removed by this changeset."""
return _showfilesbystat(context, mapping, 'file_del', 2)
- at templatekeyword('file_mods', requires={'repo', 'ctx', 'revcache'})
+ at templatekeyword('file_mods', requires={'ctx', 'revcache'})
def showfilemods(context, mapping):
"""List of strings. Files modified by this changeset."""
return _showfilesbystat(context, mapping, 'file_mod', 0)
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list