mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
remotefilelog: avoid _fileid in remotefilelogctx
_fileid is only set in some cases. We should access the file node through _filenode instead, which can compute the node from either the _fileid or the _changeid. This will be useful in a future diff where we construct remotefilelogctx with just a path and a commit hash, and not a file id.
This commit is contained in:
parent
4a6289577f
commit
4467b77ca1
@ -87,18 +87,18 @@ class remotefilectx(context.filectx):
|
|||||||
|
|
||||||
@propertycache
|
@propertycache
|
||||||
def _linkrev(self):
|
def _linkrev(self):
|
||||||
if self._fileid == nullid:
|
if self._filenode == nullid:
|
||||||
return nullrev
|
return nullrev
|
||||||
|
|
||||||
ancestormap = self.ancestormap()
|
ancestormap = self.ancestormap()
|
||||||
p1, p2, linknode, copyfrom = ancestormap[self._fileid]
|
p1, p2, linknode, copyfrom = ancestormap[self._filenode]
|
||||||
rev = self._repo.changelog.nodemap.get(linknode)
|
rev = self._repo.changelog.nodemap.get(linknode)
|
||||||
if rev is not None:
|
if rev is not None:
|
||||||
return rev
|
return rev
|
||||||
|
|
||||||
# Search all commits for the appropriate linkrev (slow, but uncommon)
|
# Search all commits for the appropriate linkrev (slow, but uncommon)
|
||||||
path = self._path
|
path = self._path
|
||||||
fileid = self._fileid
|
fileid = self._filenode
|
||||||
cl = self._repo.unfiltered().changelog
|
cl = self._repo.unfiltered().changelog
|
||||||
mfl = self._repo.manifestlog
|
mfl = self._repo.manifestlog
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ class remotefilectx(context.filectx):
|
|||||||
if self.rev() != introrev:
|
if self.rev() != introrev:
|
||||||
introctx = remotefilectx(self._repo, self._path,
|
introctx = remotefilectx(self._repo, self._path,
|
||||||
changeid=introrev,
|
changeid=introrev,
|
||||||
fileid=self._fileid,
|
fileid=self._filenode,
|
||||||
filelog=self._filelog,
|
filelog=self._filelog,
|
||||||
ancestormap=self._ancestormap)
|
ancestormap=self._ancestormap)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user