diff mercurial/dagop.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 e7aa113b14f7
line wrap: on
line diff
--- a/mercurial/dagop.py	Tue Mar 13 22:18:06 2018 +0900
+++ b/mercurial/dagop.py	Sun Mar 18 12:28:19 2018 +0900
@@ -368,6 +368,7 @@
     lineno = attr.ib()
     # Whether this annotation was the result of a skip-annotate.
     skip = attr.ib(default=False)
+    text = attr.ib(default=None)
 
 @attr.s(slots=True, frozen=True)
 class _annotatedfile(object):
@@ -514,9 +515,8 @@
             del pcache[f]
 
     a = hist[base]
-    return [(annotateline(fctx, lineno, skip), line)
-            for fctx, lineno, skip, line
-            in zip(a.fctxs, a.linenos, a.skips, mdiff.splitnewlines(a.text))]
+    return [annotateline(*r) for r in zip(a.fctxs, a.linenos, a.skips,
+                                          mdiff.splitnewlines(a.text))]
 
 def toposort(revs, parentsfunc, firstbranch=()):
     """Yield revisions from heads to roots one (topo) branch at a time.