Changeset - bc5e635afef7
[Not reviewed]
default
0 1 0
Mads Kiilerich - 8 years ago 2018-05-11 14:26:48
mads@kiilerich.com
hg: support annotate refactoring in Mercurial 4.6 for returning annotateline objeccts

Attempts at using annotateline.fctx will fail with AttributeError if we didn't
get an annotateline but an old tuple.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/hg/changeset.py
Show inline comments
 
@@ -297,7 +297,9 @@ class MercurialChangeset(BaseChangeset):
 
            lineno, sha, changeset lazy loader and line
 
        """
 
        annotations = self._get_filectx(path).annotate()
 
        if True:
 
        try:
 
            annotation_lines = [(annotateline.fctx, annotateline.text) for annotateline in annotations]
 
        except AttributeError: # annotateline was introduced in Mercurial 4.6 (b33b91ca2ec2)
 
            try:
 
                annotation_lines = [(aline.fctx, l) for aline, l in annotations]
 
            except AttributeError: # aline.fctx was introduced in Mercurial 4.4
0 comments (0 inline, 0 general)