[Updated] [+ ] D8568: overlayworkingctx: implement mergestate() using in-memory mergestate

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Jun 11 16:08:43 UTC 2020


durin42 updated this revision to Diff 21612.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8568?vs=21595&id=21612

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8568/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8568

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2526,6 +2526,7 @@
         return len(self._cache) == 0
 
     def clean(self):
+        self._mergestate = None
         self._cache = {}
 
     def _compact(self):
@@ -2586,6 +2587,11 @@
             self._repo, path, parent=self, filelog=filelog
         )
 
+    def mergestate(self, clean=False):
+        if clean or self._mergestate is None:
+            self._mergestate = mergestatemod.memmergestate(self._repo, self)
+        return self._mergestate
+
 
 class overlayworkingfilectx(committablefilectx):
     """Wrap a ``workingfilectx`` but intercepts all writes into an in-memory



To: durin42, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200611/79f5ff3d/attachment-0002.html>


More information about the Mercurial-patches mailing list