From 65b628a47213843095847b92aad11a0ed465a93f Mon Sep 17 00:00:00 2001 From: Liubov Dmitrieva Date: Fri, 22 Feb 2019 12:51:21 -0800 Subject: [PATCH] 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 --- edenscm/hgext/commitcloud/commitcloudcommands.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/edenscm/hgext/commitcloud/commitcloudcommands.py b/edenscm/hgext/commitcloud/commitcloudcommands.py index ab55e8ed40..684e1a84fb 100644 --- a/edenscm/hgext/commitcloud/commitcloudcommands.py +++ b/edenscm/hgext/commitcloud/commitcloudcommands.py @@ -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