Changeset - 5e7bdf4fb156
[Not reviewed]
default
0 1 0
Mads Kiilerich - 8 years ago 2018-05-11 14:26:48
mads@kiilerich.com
hg: refactor annotation to generate a list of normalized annotation lines before iterating

This makes it easier to add support for future annotion structures.

Temporarily add redundant conditional to preserve formatting and reduce churn.
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -296,13 +296,13 @@ class MercurialChangeset(BaseChangeset):
 
        Returns a generator of four element tuples with
 
            lineno, sha, changeset lazy loader and line
 
        """
 

	
 
        annotations = self._get_filectx(path).annotate(linenumber=False)
 
        for i, (aline, l) in enumerate(annotations):
 
        if True:
 
            try:
 
                fctx = aline.fctx
 
                annotation_lines = [(aline.fctx, l) for aline, l in annotations]
 
            except AttributeError: # aline.fctx was introduced in Mercurial 4.4
 
                fctx = aline[0]
 
                annotation_lines = [(aline[0], l) for aline, l in annotations]
 
        for i, (fctx, l) in enumerate(annotation_lines):
 
            sha = fctx.hex()
 
            yield (i + 1, sha, lambda sha=sha, l=l: self.repository.get_changeset(sha), l)
 

	
0 comments (0 inline, 0 general)