Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 34681:4dc8a2ee0f4f
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
author | Phil Cohen <phillco@fb.com> |
---|---|
date | Fri, 13 Oct 2017 12:54:46 -0700 |
parents | 7a8a16f8ea22 |
children | 6036e6e205ca |
comparison
equal
deleted
inserted
replaced
34680:c0a524f77e8a | 34681:4dc8a2ee0f4f |
---|---|
619 return self._repo.nodebookmarks(self._node) | 619 return self._repo.nodebookmarks(self._node) |
620 def phase(self): | 620 def phase(self): |
621 return self._repo._phasecache.phase(self._repo, self._rev) | 621 return self._repo._phasecache.phase(self._repo, self._rev) |
622 def hidden(self): | 622 def hidden(self): |
623 return self._rev in repoview.filterrevs(self._repo, 'visible') | 623 return self._rev in repoview.filterrevs(self._repo, 'visible') |
624 | |
625 def isinmemory(self): | |
626 return False | |
624 | 627 |
625 def children(self): | 628 def children(self): |
626 """return contexts for each child changeset""" | 629 """return contexts for each child changeset""" |
627 c = self._repo.changelog.children(self._node) | 630 c = self._repo.changelog.children(self._node) |
628 return [changectx(self._repo, x) for x in c] | 631 return [changectx(self._repo, x) for x in c] |
1399 def closesbranch(self): | 1402 def closesbranch(self): |
1400 return 'close' in self._extra | 1403 return 'close' in self._extra |
1401 def extra(self): | 1404 def extra(self): |
1402 return self._extra | 1405 return self._extra |
1403 | 1406 |
1407 def isinmemory(self): | |
1408 return False | |
1409 | |
1404 def tags(self): | 1410 def tags(self): |
1405 return [] | 1411 return [] |
1406 | 1412 |
1407 def bookmarks(self): | 1413 def bookmarks(self): |
1408 b = [] | 1414 b = [] |
1976 raise error.ProgrammingError("No such file or directory: %s" % | 1982 raise error.ProgrammingError("No such file or directory: %s" % |
1977 self._path) | 1983 self._path) |
1978 else: | 1984 else: |
1979 return self._wrappedctx[path].data() | 1985 return self._wrappedctx[path].data() |
1980 | 1986 |
1987 def isinmemory(self): | |
1988 return True | |
1989 | |
1981 def filedate(self, path): | 1990 def filedate(self, path): |
1982 if self.isdirty(path): | 1991 if self.isdirty(path): |
1983 return self._cache[path]['date'] | 1992 return self._cache[path]['date'] |
1984 else: | 1993 else: |
1985 return self._wrappedctx[path].date() | 1994 return self._wrappedctx[path].date() |