# HG changeset patch # User Marcin Kuzminski # Date 2017-11-06 20:35:42 # Node ID 4934d096e186973bc4738857f466e1a38db38c0f # Parent 3e2c3a48ab3a0daff545e2a75907a3f46ab3372c mercurial: fixed code against latest mercurial release. - annotation now returns different format from version 4.4+ - demandimport has changed to module diff --git a/vcsserver/hg.py b/vcsserver/hg.py --- a/vcsserver/hg.py +++ b/vcsserver/hg.py @@ -453,10 +453,9 @@ class HgRemote(object): fctx = ctx.filectx(path) result = [] - for i, annotate_data in enumerate(fctx.annotate()): + for i, (a_line, content) in enumerate(fctx.annotate()): ln_no = i + 1 - node_info, content = annotate_data - sha = hex(node_info[0].node()) + sha = hex(a_line.fctx.node()) result.append((ln_no, sha, content)) return result diff --git a/vcsserver/hgcompat.py b/vcsserver/hgcompat.py --- a/vcsserver/hgcompat.py +++ b/vcsserver/hgcompat.py @@ -20,10 +20,10 @@ Mercurial libs compatibility """ import mercurial -import mercurial.demandimport +from mercurial import demandimport # patch demandimport, due to bug in mercurial when it always triggers # demandimport.enable() -mercurial.demandimport.enable = lambda *args, **kwargs: 1 +demandimport.enable = lambda *args, **kwargs: 1 from mercurial import ui from mercurial import patch