config: remove uses of obsolete._enabled
authorDurham Goode <durham@fb.com>
Tue, 17 Mar 2015 19:04:16 -0700
changeset 1214 4b10e2c6f7e3
parent 1213 7118996bdf43
child 1215 004e21b8d67b
config: remove uses of obsolete._enabled Upstream Mercurial will be removing obsolete._enabled soon, so switch all our uses of it to use the new obsolete.isenabled(repo, option) function.
hgext/evolve.py
--- a/hgext/evolve.py	Tue Mar 17 19:03:27 2015 -0700
+++ b/hgext/evolve.py	Tue Mar 17 19:04:16 2015 -0700
@@ -2308,7 +2308,7 @@
 if getattr(exchange, '_pushdiscoveryobsmarkers', None) is not None:
     @eh.wrapfunction(exchange, '_pushdiscoveryobsmarkers')
     def _pushdiscoveryobsmarkers(orig, pushop):
-        if (obsolete._enabled
+        if (obsolete.isenabled(pushop.repo, obsolete.exchangeopt)
             and pushop.repo.obsstore
             and 'obsolete' in pushop.remote.listkeys('namespaces')):
             repo = pushop.repo
@@ -2350,7 +2350,7 @@
 def discocapabilities(orig, repo, proto):
     """wrapper to advertise new capability"""
     caps = orig(repo, proto)
-    if obsolete._enabled:
+    if obsolete.isenabled(repo, obsolete.exchangeopt):
         caps += ' _evoext_obshash_0'
     return caps
 
@@ -2485,7 +2485,7 @@
     remote = pushop.remote
     unfi = repo.unfiltered()
     cl = unfi.changelog
-    if (obsolete._enabled and repo.obsstore and
+    if (obsolete.isenabled(repo, obsolete.exchangeopt) and repo.obsstore and
         'obsolete' in remote.listkeys('namespaces')):
         markers = pushop.outobsmarkers
         if not markers:
@@ -2649,7 +2649,7 @@
 
 @eh.wrapfunction(exchange, '_pullobsolete')
 def _pullobsolete(orig, pullop):
-    if not obsolete._enabled:
+    if not obsolete.isenabled(pullop.repo, obsolete.exchangeopt):
         return None
     if 'obsmarkers' not in getattr(pullop, 'todosteps', ['obsmarkers']):
         return None
@@ -2853,7 +2853,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 += ' _evoext_pushobsmarkers_0'
         caps += ' _evoext_pullobsmarkers_0'
         caps += ' _evoext_obshash_0'