mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
filectx: make renamed a property cache
See previous patch for context - mainly to avoid code duplication.
This commit is contained in:
parent
fbe796f9ab
commit
a24f7109e4
@ -797,6 +797,8 @@ class basefilectx(object):
|
||||
return self._changectx.manifest()
|
||||
def changectx(self):
|
||||
return self._changectx
|
||||
def renamed(self):
|
||||
return self._copied
|
||||
def repo(self):
|
||||
return self._repo
|
||||
|
||||
@ -1149,7 +1151,8 @@ class filectx(basefilectx):
|
||||
def size(self):
|
||||
return self._filelog.size(self._filerev)
|
||||
|
||||
def renamed(self):
|
||||
@propertycache
|
||||
def _copied(self):
|
||||
"""check if file was actually renamed in this changeset revision
|
||||
|
||||
If rename logged in file revision, we report copy for changeset only
|
||||
@ -2064,8 +2067,6 @@ class memfilectx(committablefilectx):
|
||||
return self._data
|
||||
def size(self):
|
||||
return len(self.data())
|
||||
def renamed(self):
|
||||
return self._copied
|
||||
|
||||
def remove(self, ignoremissing=False):
|
||||
"""wraps unlink for a repo's working directory"""
|
||||
|
Loading…
Reference in New Issue
Block a user