mercurial/commands.py
changeset 22477 3c8ae79eacb0
parent 22452 75e166b82c7a
child 22478 a6b1413511f1
--- a/mercurial/commands.py	Wed Sep 17 22:21:01 2014 +0900
+++ b/mercurial/commands.py	Fri Aug 29 05:36:52 2014 +0200
@@ -313,6 +313,7 @@
 
         lines = fctx.annotate(follow=follow, linenumber=linenumber,
                               diffopts=diffopts)
+        formats = []
         pieces = []
 
         for f, sep in funcmap:
@@ -320,11 +321,13 @@
             if l:
                 sized = [(x, encoding.colwidth(x)) for x in l]
                 ml = max([w for x, w in sized])
-                pieces.append(["%s%s%s" % (sep, ' ' * (ml - w), x)
-                               for x, w in sized])
-
-        for p, l in zip(zip(*pieces), lines):
-            ui.write("%s: %s" % ("".join(p), l[1]))
+                formats.append([sep + ' ' * (ml - w) + '%s'
+                                for x, w in sized])
+                pieces.append(l)
+
+        for f, p, l in zip(zip(*formats), zip(*pieces), lines):
+            ui.write("".join(f) % p)
+            ui.write(": %s" % l[1])
 
         if lines and not lines[-1][1].endswith('\n'):
             ui.write('\n')