From 1077d0a560d85b71188786d0fb15649662cbe5ca Mon Sep 17 00:00:00 2001 From: Liubov Dmitrieva Date: Wed, 5 Oct 2022 10:10:47 -0700 Subject: [PATCH] tidy up: remove extra cloud sync attempts Summary: tidy up: remove extra cloud sync attempts The extra attempts were a hack to provide best possible sync result for workspaces with old commits issue. As a result of the "old commits cleanup project & infinitepush deprecation", all workspaces have been fixed and no longer contain any references to any commit that is not in Mononoke. So, nowadays, syncing "2 years, 3 years and then everything" logic just significantly slows down `hg cloud sync --full` command. Reviewed By: yancouto Differential Revision: D40096067 fbshipit-source-id: d9b69140164c38d91d2793b3e0b8c4416d801909 --- eden/scm/edenscm/ext/commitcloud/sync.py | 31 +------------------ .../tests/test-commitcloud-sync-omission.t | 10 ------ 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/eden/scm/edenscm/ext/commitcloud/sync.py b/eden/scm/edenscm/ext/commitcloud/sync.py index 78bcadd30b..8220cd843d 100644 --- a/eden/scm/edenscm/ext/commitcloud/sync.py +++ b/eden/scm/edenscm/ext/commitcloud/sync.py @@ -147,36 +147,7 @@ def _sync( start = util.timer() startnode = repo["."].node() - - if full: - # split the full sync into few passes: - # sync the first 2 years of commits (commits should be present on the server) - # sync the first 3 years of commits (commits should be probably present on the server for most of repos) - # sync the rest of commits (some commits could be missing, haven't been migrated from the old backend) - for years in [2, 3]: - with ui.configoverride({("commitcloud", "max_sync_age"): years * 365}): - ui.status( - _( - "latest %d years of commits will be attempted to synchronize first\n" - ) - % years, - component="commitcloud", - ) - _sync( - repo, - cloudrefs=cloudrefs, - full=False, - cloudversion=cloudversion, - cloudworkspace=cloudworkspace, - connect_opts=connect_opts, - ) - ui.status( - _("latest %d years of commits synchronized\n") % years, - component="commitcloud", - ) - maxage = None - else: - maxage = ui.configint("commitcloud", "max_sync_age", None) + maxage = None if full else ui.configint("commitcloud", "max_sync_age", None) # Work out which repo and workspace we are synchronizing with. reponame = ccutil.getreponame(repo) diff --git a/eden/scm/tests/test-commitcloud-sync-omission.t b/eden/scm/tests/test-commitcloud-sync-omission.t index 7d14e80638..d512882faa 100644 --- a/eden/scm/tests/test-commitcloud-sync-omission.t +++ b/eden/scm/tests/test-commitcloud-sync-omission.t @@ -562,7 +562,6 @@ Move the bookmark locally - this still gets synced ok. A full sync pulls the old commits in $ cd ../client3 $ hgfakedate 1990-03-05T12:01Z cloud sync --full - commitcloud: latest 2 years of commits will be attempted to synchronize first commitcloud: synchronizing 'server' with 'user/test/default' pulling d133b886da68 from ssh://user@dummy/server searching for changes @@ -571,15 +570,6 @@ A full sync pulls the old commits in adding file changes commitcloud: commits synchronized finished in * (glob) - commitcloud: latest 2 years of commits synchronized - commitcloud: latest 3 years of commits will be attempted to synchronize first - commitcloud: synchronizing 'server' with 'user/test/default' - commitcloud: commits synchronized - finished in * (glob) - commitcloud: latest 3 years of commits synchronized - commitcloud: synchronizing 'server' with 'user/test/default' - commitcloud: commits synchronized - finished in * (glob) $ tglogp o d133b886da68 draft 'midstack-feb9'