mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
commitcloud: use filternodes for faster "hasnode" tests
Summary: The filternodes is an API that can batch hasnode checks. It is more efficient if the commit hashes are lazy. Reviewed By: sfilipco Differential Revision: D27636341 fbshipit-source-id: 69cd708a46c719624d654c53de3d92968392d572
This commit is contained in:
parent
a585f6c1cc
commit
53d84ff13f
@ -410,7 +410,13 @@ def _applycloudchanges(repo, remotepath, lastsyncstate, cloudrefs, maxage, state
|
||||
# filter cloudrefs before pull as pull doesn't check if a rev is present
|
||||
# locally.
|
||||
unfi = repo
|
||||
newheads = [head for head in cloudrefs.heads if head not in unfi]
|
||||
newheads = [
|
||||
nodemod.hex(n)
|
||||
for n in repo.changelog.filternodes(
|
||||
[nodemod.bin(h) for h in cloudrefs.heads], inverse=True
|
||||
)
|
||||
]
|
||||
assert newheads == newheads
|
||||
if maxage is not None and maxage >= 0:
|
||||
mindate = time.time() - maxage * 86400
|
||||
omittedheads = [
|
||||
|
Loading…
Reference in New Issue
Block a user