From patchwork Mon May 18 22:10:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D8560: templatekw: get mergestate via context From: phabricator X-Patchwork-Id: 46346 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Mon, 18 May 2020 22:10:45 +0000 durin42 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Happily, this resolves an import cycle! REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D8560 AFFECTED FILES mercurial/templatekw.py CHANGE DETAILS To: durin42, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -419,9 +419,7 @@ else: merge_nodes = cache.get(b'merge_nodes') if merge_nodes is None: - from . import mergestate as mergestatemod - - mergestate = mergestatemod.mergestate.read(repo) + mergestate = repo[None].mergestate() if mergestate.active(): merge_nodes = (mergestate.local, mergestate.other) else: