mercurial/context.py
changeset 45499 19590b126764
parent 45489 a108f7ff7778
child 45896 e359af6517ce
equal deleted inserted replaced
45498:cc5f811b1f15 45499:19590b126764
  2526 
  2526 
  2527     def isdirty(self, path):
  2527     def isdirty(self, path):
  2528         return path in self._cache
  2528         return path in self._cache
  2529 
  2529 
  2530     def clean(self):
  2530     def clean(self):
       
  2531         self._mergestate = None
  2531         self._cache = {}
  2532         self._cache = {}
  2532 
  2533 
  2533     def _compact(self):
  2534     def _compact(self):
  2534         """Removes keys from the cache that are actually clean, by comparing
  2535         """Removes keys from the cache that are actually clean, by comparing
  2535         them with the underlying context.
  2536         them with the underlying context.
  2589 
  2590 
  2590     def filectx(self, path, filelog=None):
  2591     def filectx(self, path, filelog=None):
  2591         return overlayworkingfilectx(
  2592         return overlayworkingfilectx(
  2592             self._repo, path, parent=self, filelog=filelog
  2593             self._repo, path, parent=self, filelog=filelog
  2593         )
  2594         )
       
  2595 
       
  2596     def mergestate(self, clean=False):
       
  2597         if clean or self._mergestate is None:
       
  2598             self._mergestate = mergestatemod.memmergestate(self._repo)
       
  2599         return self._mergestate
  2594 
  2600 
  2595 
  2601 
  2596 class overlayworkingfilectx(committablefilectx):
  2602 class overlayworkingfilectx(committablefilectx):
  2597     """Wrap a ``workingfilectx`` but intercepts all writes into an in-memory
  2603     """Wrap a ``workingfilectx`` but intercepts all writes into an in-memory
  2598     cache, which can be flushed through later by calling ``flush()``."""
  2604     cache, which can be flushed through later by calling ``flush()``."""