changeset 39615:a5da906306c9

templatekw: add option to include ignored/clean/unknown files in cache They will be necessary to provide {status} of files.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 29 Jul 2018 21:52:01 +0900
parents 42209f55c599
children 87428152e820
files mercurial/templatekw.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatekw.py	Sun Jul 29 22:07:42 2018 +0900
+++ b/mercurial/templatekw.py	Sun Jul 29 21:52:01 2018 +0900
@@ -291,11 +291,14 @@
     return _hybrid(f, extras, makemap,
                    lambda k: '%s=%s' % (k, stringutil.escapestr(extras[k])))
 
-def _getfilestatus(context, mapping):
+def _getfilestatus(context, mapping, listall=False):
     ctx = context.resource(mapping, 'ctx')
     revcache = context.resource(mapping, 'revcache')
-    if 'filestatus' not in revcache:
-        revcache['filestatus'] = ctx.p1().status(ctx)
+    if 'filestatus' not in revcache or revcache['filestatusall'] < listall:
+        stat = ctx.p1().status(ctx, listignored=listall, listclean=listall,
+                               listunknown=listall)
+        revcache['filestatus'] = stat
+        revcache['filestatusall'] = listall
     return revcache['filestatus']
 
 def _showfilesbystat(context, mapping, name, index):