changeset 1217:196c650d5ba9

pushexperiment: remove use of obsolete._enabled pushexperiment.py was using obsolete._enabled but it didn't cause any tests to fail so I didn't see it. Let's go ahead and replace it with the new obsolete.isenabled() api.
author Durham Goode <durham@fb.com>
date Thu, 19 Mar 2015 17:42:21 -0700
parents a307eea46f96
children dd5e62979100
files hgext/pushexperiment.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/pushexperiment.py	Thu Mar 19 13:42:27 2015 -0700
+++ b/hgext/pushexperiment.py	Thu Mar 19 17:42:21 2015 -0700
@@ -49,7 +49,8 @@
 
 def syncpush(orig, repo, remote):
     """wraper for obsolete.syncpush to use the fast way if possible"""
-    if not (obsolete._enabled and repo.obsstore):
+    if not (obsolete.isenabled(repo, obsolete.exchangeopt) and
+            repo.obsstore):
         return
     if remote.capable('_push_experiment_pushobsmarkers_0'):
         return # already pushed before changeset
@@ -75,7 +76,7 @@
     """push wrapped that call the wire protocol command"""
     if not remote.canpush():
         raise util.Abort(_("destination does not support push"))
-    if (obsolete._enabled and repo.obsstore
+    if (obsolete.isenabled(repo, obsolete.exchangeopt) and repo.obsstore
         and remote.capable('_push_experiment_pushobsmarkers_0')):
         # push marker early to limit damage of pushing too early.
         try:
@@ -94,7 +95,7 @@
 def capabilities(orig, repo, proto):
     """wrapper to advertise new capability"""
     caps = orig(repo, proto)
-    if obsolete._enabled:
+    if obsolete.isenabled(repo, obsolete.exchangeopt):
         caps += ' _push_experiment_pushobsmarkers_0'
     caps += ' _push_experiment_notifypushend_0'
     return caps