compat: drop special code handling change in push/pull op API
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 07 Mar 2017 14:41:53 +0100
changeset 2055 ce3d68029ed7
parent 2054 f9d65d24b9f9
child 2056 b96ca1b51e04
compat: drop special code handling change in push/pull op API All version of Mercurial we support have the same API.
hgext3rd/evolve/obsexchange.py
--- a/hgext3rd/evolve/obsexchange.py	Tue Mar 07 14:29:43 2017 +0100
+++ b/hgext3rd/evolve/obsexchange.py	Tue Mar 07 14:41:53 2017 +0100
@@ -63,11 +63,9 @@
 @eh.wrapfunction(exchange, '_pushobsolete')
 def _pushobsolete(orig, pushop):
     """utility function to push obsolete markers to a remote"""
-    stepsdone = getattr(pushop, 'stepsdone', None)
-    if stepsdone is not None:
-        if 'obsmarkers' in stepsdone:
-            return
-        stepsdone.add('obsmarkers')
+    if 'obsmarkers' in pushop.stepsdone:
+        return
+    pushop.stepsdone.add('obsmarkers')
     if pushop.cgresult == 0:
         return
     pushop.ui.debug('try to push obsolete markers to remote\n')
@@ -173,9 +171,7 @@
 def _pullobsolete(orig, pullop):
     if not obsolete.isenabled(pullop.repo, obsolete.exchangeopt):
         return None
-    if 'obsmarkers' not in getattr(pullop, 'todosteps', ['obsmarkers']):
-        return None
-    if 'obsmarkers' in getattr(pullop, 'stepsdone', []):
+    if 'obsmarkers' in pullop.stepsdone:
         return None
     wirepull = pullop.remote.capable('_evoext_pullobsmarkers_0')
     if not wirepull: