Skip to content
Snippets Groups Projects
Commit be3a94d3 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

pullbundle: attempt to save stablerange cache after each computation

Since we do not serve the full repository, we use more stablerange starting from
a random point. These are probably not loaded yet and should be cached.

This is best effort caching, if we can't save them we won't.
parent 47f1d7b4
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,8 @@
head = max(localmissing)
allslices.extend(localslices)
# unknown subrange might had to be computed
repo.stablerange.save(repo)
return [(rangeid, outgoingfromnodes(repo, nodes))
for rangeid, nodes in allslices]
......@@ -250,6 +252,9 @@
prerange = (headrev, precut)
size = stablerange.rangelength(repo, prerange)
sub = stablerange.subranges(repo, prerange)[:-1]
# This power of two check is too simplistic and misbehave when too many
# merge are involved. because de merge, there can be "canonical" range
# with various size.
while not poweroftwo(tailsize):
for prerange in reversed(sub):
if tailsize <= 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment