mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
deprecate 4 commits at a time limitation for unhydrated pulls
Summary: deprecate 4 commits at a time limitation for unhydrated pulls This could speedify cloud join commands significantly (by many X times) and hg cloud sync --full command. Reviewed By: farnz Differential Revision: D28351849 fbshipit-source-id: f9f3d7a5c07d61cb51a5bb6284afaad963662c94
This commit is contained in:
parent
dd72cd4c2d
commit
2c3edb0989
@ -102,6 +102,9 @@ Configs::
|
||||
# Enable reporting of background sync progress in the smartlog.
|
||||
enableprogress = True
|
||||
|
||||
# Limit for number of commits in a group when pull (if unhydratedcommits enabled)
|
||||
unhydratedpullsizelimit = 5000
|
||||
|
||||
[infinitepushbackup]
|
||||
# Whether to enable automatic backups. If this option is True then a backup
|
||||
# process will be started after every mercurial command that modifies the
|
||||
@ -188,6 +191,7 @@ configitem("commitcloud", "automigratehostworkspace", default=False)
|
||||
configitem("commitcloud", "synccheckoutlocations", default=False)
|
||||
configitem("commitcloud", "enablestatus", default=True)
|
||||
configitem("commitcloud", "enableprogress", default=True)
|
||||
configitem("commitcloud", "unhydratedpullsizelimit", 5000)
|
||||
configitem(
|
||||
"commitcloud", "get_command", default="jf download --filepath {filename} {handle}"
|
||||
)
|
||||
|
@ -484,7 +484,7 @@ def _applycloudchanges(repo, remotepath, lastsyncstate, cloudrefs, maxage, state
|
||||
if remotebookmarknewnodes or newheads:
|
||||
# Partition the heads into groups we can pull together.
|
||||
headgroups = _partitionheads(
|
||||
list(remotebookmarknewnodes) + newheads, cloudrefs.headdates
|
||||
repo.ui, list(remotebookmarknewnodes) + newheads, cloudrefs.headdates
|
||||
)
|
||||
_pullheadgroups(repo, remotepath, headgroups)
|
||||
|
||||
@ -605,7 +605,21 @@ def _pullheadgroups(repo, remotepath, headgroups):
|
||||
repo.connectionpool.close()
|
||||
|
||||
|
||||
def _partitionheads(heads, headdates=None, sizelimit=4, spanlimit=86400):
|
||||
def _partitionheads(ui, heads, headdates=None):
|
||||
if ui.configbool("infinitepush", "wantsunhydratedcommits"):
|
||||
# partition commits to larger groups because unhydratedcommits is faster and easier to pull
|
||||
# split by 6 month timespans with some reasonably high (configurable) sizelimit
|
||||
return _partitionheadsgroups(
|
||||
heads,
|
||||
headdates,
|
||||
sizelimit=ui.config("commitcloud", "unhydratedpullsizelimit"),
|
||||
spanlimit=86400 * 30 * 6,
|
||||
)
|
||||
else:
|
||||
return _partitionheadsgroups(heads, headdates)
|
||||
|
||||
|
||||
def _partitionheadsgroups(heads, headdates=None, sizelimit=4, spanlimit=86400):
|
||||
"""partition a list of heads into groups limited by size and timespan
|
||||
|
||||
Partitions the list of heads into a list of head groups. Each head group
|
||||
@ -779,7 +793,7 @@ def _forcesyncremotebookmarks(repo, cloudrefs, lastsyncstate, remotepath, tr):
|
||||
repo, cloudremotebookmarks, lastsyncstate
|
||||
)
|
||||
if newnodes:
|
||||
_pullheadgroups(repo, remotepath, _partitionheads(newnodes))
|
||||
_pullheadgroups(repo, remotepath, _partitionheads(repo.ui, newnodes))
|
||||
omittedremotebookmarks = _updateremotebookmarks(repo, tr, updates)
|
||||
|
||||
# We have now synced the repo to the cloud version. Store this.
|
||||
|
Loading…
Reference in New Issue
Block a user