Patchwork D4001: templatekw: use ctx1.status(ctx2) instead of repo.status(ctx1, ctx2)

login
register
mail settings
Submitter phabricator
Date Aug. 1, 2018, 5:09 p.m.
Message ID <695174b4ba19678bc3d8ba0ad2bab5e0@localhost.localdomain>
Download mbox | patch
Permalink /patch/33023/
State Not Applicable
Headers show

Comments

phabricator - Aug. 1, 2018, 5:09 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG87a581d1391c: templatekw: use ctx1.status(ctx2) instead of repo.status(ctx1, ctx2) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4001?vs=9692&id=9711

REVISION DETAIL
  https://phab.mercurial-scm.org/D4001

AFFECTED FILES
  mercurial/templatekw.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

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')
 
-@templatekeyword('file_adds', requires={'repo', 'ctx', 'revcache'})
+@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')
 
-@templatekeyword('file_dels', requires={'repo', 'ctx', 'revcache'})
+@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)
 
-@templatekeyword('file_mods', requires={'repo', 'ctx', 'revcache'})
+@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)