push: check if local and remote support evolution during discovery
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 20 Aug 2014 17:36:54 -0700
changeset 22269 03cc81a28228
parent 22268 ca2e9cf77033
child 22270 e5adb6935239
push: check if local and remote support evolution during discovery We can now directly prevent any evolution-related operation from happening by using an empty set for outgoing markers. So we detect if no transfers should occur and use an empty set in this case.
mercurial/exchange.py
--- a/mercurial/exchange.py	Tue Aug 19 16:46:17 2014 -0700
+++ b/mercurial/exchange.py	Wed Aug 20 17:36:54 2014 -0700
@@ -280,7 +280,10 @@
 
 @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):
@@ -652,8 +655,7 @@
     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):