Patchwork [2,of,4] templatekw: keep status tuple in cache dict and rename cache key accordingly

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 13, 2018, 2:10 p.m.
Message ID <4b894ac398b708df9c2f.1536847829@mimosa>
Download mbox | patch
Permalink /patch/34601/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 13, 2018, 2:10 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1532869662 -32400
#      Sun Jul 29 22:07:42 2018 +0900
# Node ID 4b894ac398b708df9c2f4e7b8715bd4be1617342
# Parent  f1e582f01fcc7382196eb51e03a7864f66f2b87e
templatekw: keep status tuple in cache dict and rename cache key accordingly

There's no point to drop tail elements, which are mostly empty lists.

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -294,9 +294,9 @@  def showextras(context, mapping):
 def _getfilestatus(context, mapping):
     ctx = context.resource(mapping, 'ctx')
     revcache = context.resource(mapping, 'revcache')
-    if 'files' not in revcache:
-        revcache['files'] = ctx.p1().status(ctx)[:3]
-    return revcache['files']
+    if 'filestatus' not in revcache:
+        revcache['filestatus'] = ctx.p1().status(ctx)
+    return revcache['filestatus']
 
 def _showfilesbystat(context, mapping, name, index):
     stat = _getfilestatus(context, mapping)