[Request] [+ ] D8560: templatekw: get mergestate via context

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Mon May 18 22:10:45 UTC 2020


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

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:



To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200518/7117bdde/attachment.html>


More information about the Mercurial-patches mailing list