mercurial/context.py
changeset 45499 19590b126764
parent 45489 a108f7ff7778
child 45896 e359af6517ce
--- a/mercurial/context.py	Tue Sep 15 11:17:24 2020 -0700
+++ b/mercurial/context.py	Tue Sep 15 16:10:16 2020 -0700
@@ -2528,6 +2528,7 @@
         return path in self._cache
 
     def clean(self):
+        self._mergestate = None
         self._cache = {}
 
     def _compact(self):
@@ -2592,6 +2593,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)
+        return self._mergestate
+
 
 class overlayworkingfilectx(committablefilectx):
     """Wrap a ``workingfilectx`` but intercepts all writes into an in-memory