# HG changeset patch # User Phil Cohen # Date 1507924486 25200 # Node ID 4dc8a2ee0f4f3ae9f1a5d3960e0b6d6fb906ac2e # Parent c0a524f77e8afc61d2ebcd518ecf65955b4afb35 context: add is `isinmemory()` to filectx This will make it easier to skip certain behavior when running an in-memory merge. Differential Revision: https://phab.mercurial-scm.org/D1061 diff -r c0a524f77e8a -r 4dc8a2ee0f4f mercurial/context.py --- a/mercurial/context.py Fri Oct 06 06:48:43 2017 -0700 +++ b/mercurial/context.py Fri Oct 13 12:54:46 2017 -0700 @@ -622,6 +622,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) @@ -1401,6 +1404,9 @@ def extra(self): return self._extra + def isinmemory(self): + return False + def tags(self): return [] @@ -1978,6 +1984,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']