push: exit obsexchange early if disabled
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 07 Mar 2017 14:45:02 +0100
changeset 2056 b96ca1b51e04
parent 2055 ce3d68029ed7
child 2057 4c195eb4d2c5
push: exit obsexchange early if disabled We were exiting the function later, in particular -after- issuing a message about exchanging obsmarkers.
hgext3rd/evolve/obsexchange.py
--- a/hgext3rd/evolve/obsexchange.py	Tue Mar 07 14:41:53 2017 +0100
+++ b/hgext3rd/evolve/obsexchange.py	Tue Mar 07 14:45:02 2017 +0100
@@ -63,6 +63,8 @@
 @eh.wrapfunction(exchange, '_pushobsolete')
 def _pushobsolete(orig, pushop):
     """utility function to push obsolete markers to a remote"""
+    if not obsolete.isenabled(pushop.repo, obsolete.exchangeopt):
+        return
     if 'obsmarkers' in pushop.stepsdone:
         return
     pushop.stepsdone.add('obsmarkers')
@@ -71,8 +73,7 @@
     pushop.ui.debug('try to push obsolete markers to remote\n')
     repo = pushop.repo
     remote = pushop.remote
-    if (obsolete.isenabled(repo, obsolete.exchangeopt) and repo.obsstore and
-        'obsolete' in remote.listkeys('namespaces')):
+    if (repo.obsstore and 'obsolete' in remote.listkeys('namespaces')):
         markers = pushop.outobsmarkers
         if not markers:
             obsexcmsg(repo.ui, "no marker to push\n")