diff mercurial/commands.py @ 37069:b33b91ca2ec2

annotate: pack line content into annotateline object (API) Just for code readability. We can do that since the annotateline type is no longer used while computing the history.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 18 Mar 2018 12:28:19 +0900
parents b235bde38a83
children f0b6fbea00cf
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Mar 13 22:18:06 2018 +0900
+++ b/mercurial/commands.py	Sun Mar 18 12:28:19 2018 +0900
@@ -396,7 +396,7 @@
         pieces = []
 
         for f, sep in funcmap:
-            l = [f(n) for n, dummy in lines]
+            l = [f(n) for n in lines]
             if fm.isplain():
                 sizes = [encoding.colwidth(x) for x in l]
                 ml = max(sizes)
@@ -405,7 +405,7 @@
                 formats.append(['%s' for x in l])
             pieces.append(l)
 
-        for f, p, (n, l) in zip(zip(*formats), zip(*pieces), lines):
+        for f, p, n in zip(zip(*formats), zip(*pieces), lines):
             fm.startitem()
             fm.context(fctx=n.fctx)
             fm.write(fields, "".join(f), *p)
@@ -413,9 +413,9 @@
                 fmt = "* %s"
             else:
                 fmt = ": %s"
-            fm.write('line', fmt, l)
-
-        if not lines[-1][1].endswith('\n'):
+            fm.write('line', fmt, n.text)
+
+        if not lines[-1].text.endswith('\n'):
             fm.plain('\n')
         fm.end()