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

mail settings
Submitter Sean Farley
Date Dec. 21, 2012, 5:37 a.m.
Message ID <4916048729c65cd1c5d4.1356068279@laptop.local>
Download mbox | patch
Permalink /patch/244/
State Superseded
Headers show


Sean Farley - Dec. 21, 2012, 5:37 a.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley at>
# 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/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -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: