From patchwork Thu Aug 21 03:20:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2, of, 7] push: check if local and remote support evolution during discovery From: Pierre-Yves David X-Patchwork-Id: 5539 Message-Id: <2d424c3abcfb14aec61b.1408591252@marginatus.alto.octopoid.net> To: mercurial-devel@selenic.com Cc: Pierre-Yves David Date: Wed, 20 Aug 2014 20:20:52 -0700 # HG changeset patch # User Pierre-Yves David # Date 1408581414 25200 # Wed Aug 20 17:36:54 2014 -0700 # Node ID 2d424c3abcfb14aec61bf5d585cf847ea77e4470 # Parent 0cb2d84fd1f94e2d2088f4f2cd8a149360af6caa push: check if local and remote support evolution during discovery We can now directly prevent any evolution related operation to happen by using an empty set as outgoing markers. So we detect if no transfers should occurs and use an empty set in this case. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -278,11 +278,14 @@ def _pushdiscoveryphase(pushop): pushop.outdatedphases = future pushop.fallbackoutdatedphases = fallback @pushdiscovery('obsmarker') def _pushdiscoveryobsmarkers(pushop): - pushop.outobsmarkers = pushop.repo.obsstore + if (obsolete._enabled + and pushop.repo.obsstore + and 'obsolete' in pushop.remote.listkeys('namespaces')): + pushop.outobsmarkers = pushop.repo.obsstore @pushdiscovery('bookmarks') def _pushdiscoverybookmarks(pushop): ui = pushop.ui repo = pushop.repo.unfiltered() @@ -650,12 +653,11 @@ def _pushobsolete(pushop): return pushop.ui.debug('try to push obsolete markers to remote\n') repo = pushop.repo remote = pushop.remote pushop.stepsdone.add('obsmarkers') - if (obsolete._enabled and repo.obsstore and - 'obsolete' in remote.listkeys('namespaces')): + if (pushop.outobsmarkers): rslts = [] remotedata = obsolete._pushkeyescape(pushop.outobsmarkers) for key in sorted(remotedata, reverse=True): # reverse sort to ensure we end with dump0 data = remotedata[key]