Patchwork D1061: context: add is `isinmemory()` to filectx

login
register
mail settings
Submitter phabricator
Date Oct. 13, 2017, 7:55 p.m.
Message ID <differential-rev-PHID-DREV-f7egli4kh5qgmgt7mhrh-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/24854/
State Superseded
Headers show

Comments

phabricator - Oct. 13, 2017, 7:55 p.m.
phillco created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This will make it easier to skip certain behavior when running an in-memory
  merge.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: phillco, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 13, 2017, 10:10 p.m.
quark accepted this revision.
quark added a comment.


  Looks good to me.

REPOSITORY
  rHG Mercurial

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

To: phillco, #hg-reviewers, quark
Cc: quark, mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -623,6 +623,9 @@ 
     def hidden(self):
         return self._rev in repoview.filterrevs(self._repo, 'visible')
 
+    def isinmemory(self):
+        return False
+
     def children(self):
         """return contexts for each child changeset"""
         c = self._repo.changelog.children(self._node)
@@ -1402,6 +1405,9 @@ 
     def extra(self):
         return self._extra
 
+    def isinmemory(self):
+        return False
+
     def tags(self):
         return []
 
@@ -1979,6 +1985,9 @@ 
         else:
             return self._wrappedctx[path].data()
 
+    def isinmemory(self):
+        return True
+
     def filedate(self, path):
         if self.isdirty(path):
             return self._cache[path]['date']