mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
fastmanifest: fallback to old manifest in readshallowfast
Summary: fastmanifest makes bundling slower because fastmanifest `readshallowfast` always returns full manifest. That's a big problem for infinitepush. Let's copy-paste readshallowfast implementation from upstream. It uses readshallowdelta() if possible. Test Plan: 1) Run all the tests for fb-hgext 2) Run infinitepush with this extension enabled. Make it is fast Reviewers: durham, simonfar, rmcelroy, quark Reviewed By: quark Subscribers: mjpieters, #sourcecontrol Differential Revision: https://phabricator.intern.facebook.com/D4088360 Tasks: 13907166 Signature: t1:4088360:1477580931:746e4054380403abbc52d1922583021b81f31bb6
This commit is contained in:
parent
79b9423cee
commit
8b420cd314
@ -221,7 +221,7 @@ class FastManifestExtension(object):
|
||||
extensions.wrapfunction(manifest.manifest, 'read', factory.read)
|
||||
try:
|
||||
extensions.wrapfunction(manifest.manifest, 'readshallowfast',
|
||||
factory.read)
|
||||
factory.readshallowfast)
|
||||
except AttributeError:
|
||||
# The function didn't use to be defined in previous versions
|
||||
# of hg
|
||||
|
@ -779,6 +779,23 @@ class manifestfactory(object):
|
||||
loadflat=lambda: orig(*args, **kwargs),
|
||||
node=args[1])
|
||||
|
||||
def readshallowfast(self, orig, *args, **kwargs):
|
||||
# copy-paste from manifest.readshallowfast
|
||||
manifest = args[0]
|
||||
if len(args) == 2:
|
||||
node = args[1]
|
||||
else:
|
||||
node = kwargs['node']
|
||||
r = manifest.rev(node)
|
||||
deltaparent = manifest.deltaparent(r)
|
||||
if (deltaparent != revlog.nullrev and
|
||||
deltaparent in manifest.parentrevs(r)):
|
||||
return manifest.readshallowdelta(node)
|
||||
return hybridmanifest(self.ui,
|
||||
args[0].opener,
|
||||
loadflat=lambda: orig(*args, **kwargs),
|
||||
node=args[1])
|
||||
|
||||
def newgetitem(self, orig, *args, **kwargs):
|
||||
# args[0] == instance of manifestlog
|
||||
# args[1] = node
|
||||
|
Loading…
Reference in New Issue
Block a user