mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
remotefilelog: call setuprepo unconditionally in clone_shallow -> pull_shallow
Summary: Before this change, pull_shallow only calls setuprepo if the remotefilelog requirement is not in repo. With D21011401, the remotefilelog requirement will be added by clone.py and pull_shallow can skip calling setuprepo, causing the pull code paths to write file logs (and fail). Change the pull_shallow to always call `setuprepo` to solve the issue. The final fix is probably moving more remotefilelog related clone logic to core. Right now I just did the minimal change to fix things. Reviewed By: sfilipco Differential Revision: D21632429 fbshipit-source-id: 17775ac0df18cda10247419b40f9c27436b22606
This commit is contained in:
parent
acfa7f4291
commit
c2869d6ca9
@ -345,26 +345,25 @@ def cloneshallow(orig, ui, repo, *args, **opts):
|
||||
repos = []
|
||||
|
||||
def pull_shallow(orig, self, *args, **kwargs):
|
||||
if shallowrepo.requirement not in self.requirements:
|
||||
repos.append(self.unfiltered())
|
||||
# set up the client hooks so the post-clone update works
|
||||
setupclient(self.ui, self.unfiltered())
|
||||
repos.append(self.unfiltered())
|
||||
# set up the client hooks so the post-clone update works
|
||||
setupclient(self.ui, self.unfiltered())
|
||||
|
||||
# setupclient fixed the class on the repo itself
|
||||
# but we also need to fix it on the repoview
|
||||
if isinstance(self, repoview.repoview):
|
||||
self.__class__.__bases__ = (
|
||||
self.__class__.__bases__[0],
|
||||
self.unfiltered().__class__,
|
||||
)
|
||||
# setupclient fixed the class on the repo itself
|
||||
# but we also need to fix it on the repoview
|
||||
if isinstance(self, repoview.repoview):
|
||||
self.__class__.__bases__ = (
|
||||
self.__class__.__bases__[0],
|
||||
self.unfiltered().__class__,
|
||||
)
|
||||
|
||||
if shallowrepo.requirement not in self.requirements:
|
||||
self.requirements.add(shallowrepo.requirement)
|
||||
self._writerequirements()
|
||||
|
||||
# Since setupclient hadn't been called, exchange.pull was not
|
||||
# wrapped. So we need to manually invoke our version of it.
|
||||
return exchangepull(orig, self, *args, **kwargs)
|
||||
else:
|
||||
return orig(self, *args, **kwargs)
|
||||
# Since setupclient hadn't been called, exchange.pull was not
|
||||
# wrapped. So we need to manually invoke our version of it.
|
||||
return exchangepull(orig, self, *args, **kwargs)
|
||||
|
||||
wrapfunction(exchange, "pull", pull_shallow)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user