commit cloud: check that the secondary path is not the same as the first.

Summary:
add this check to avoid overhead

we don't need to backup to the secondary place if it is the same as the first.

Reviewed By: singhsrb

Differential Revision: D14187754

fbshipit-source-id: 6ee59ae2f0846716ca99253958af7088d0538df9
This commit is contained in:
Liubov Dmitrieva 2019-02-22 12:51:21 -08:00 committed by Facebook Github Bot
parent ac751a0ac1
commit 65b628a472

View File

@ -431,7 +431,11 @@ def cloudsync(ui, repo, cloudrefs=None, **opts):
except error.RepoError:
path = None
if infinitepushbackup and path:
if (
infinitepushbackup
and path
and path.loc != commitcloudutil.getremotepath(repo, ui, None)
):
highlightdebug(ui, _("starting background backup to %s\n") % path.loc)
infinitepushbackup._dobackgroundbackup(
ui, repo, other, ["hg", "pushbackup"], **opts