[PATCH 09 of 10 RFC] templatekw: add labels to getfiles

Sean Farley sean.michael.farley at gmail.com
Thu Dec 20 23:37:59 CST 2012


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1356046498 21600
# Node ID 4916048729c65cd1c5d433153c054c2dd1b2becc
# Parent  17ff3c6ffb3fb21e6431fc01626ba29e1e448a1b
templatekw: add labels to getfiles

Adds label data to each array of modifiend, added, or removed files

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -101,11 +101,17 @@
         yield templ(endname, **args)
 
 def getfiles(repo, ctx, revcache):
     if 'files' not in revcache:
         revcache['files'] = repo.status(ctx.p1().node(), ctx.node())[:3]
-    return revcache['files']
+
+    f = revcache['files']
+    m = [labelify(x, 'status.modified') for x in f[0]]
+    a = [labelify(x, 'status.added') for x in f[1]]
+    r = [labelify(x, 'status.removed') for x in f[2]]
+    return [m, a, r]
+
 
 def getlatesttags(repo, ctx, cache):
     '''return date, distance and name for the latest tag of rev'''
 
     if 'latesttags' not in cache:


More information about the Mercurial-devel mailing list