# HG changeset patch # User Durham Goode # Date 1426644256 25200 # Node ID 4b10e2c6f7e35590eb17525c53f2c0cfe2e9cd4b # Parent 7118996bdf434f1e6a5df7ed2af005a79a203ed0 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. diff -r 7118996bdf43 -r 4b10e2c6f7e3 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'