[PATCH 3 of 3 evolve-ext] config: remove uses of obsolete._enabled
Durham Goode
durham at fb.com
Tue Mar 17 21:17:28 CDT 2015
# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1426644256 25200
# Tue Mar 17 19:04:16 2015 -0700
# Branch stable
# Node ID 9b38d0d9e859376aa538186e0608f9cf6549f535
# Parent 43acc42c7a8d117c5e8a89a8aff08e44906f8d51
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 --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -2319,7 +2319,7 @@ def obsexcprg(ui, *args, **kwargs):
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
@@ -2361,7 +2361,7 @@ if getattr(exchange, '_pushdiscoveryobsm
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
@@ -2496,7 +2496,7 @@ def _pushobsolete(orig, pushop):
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:
@@ -2660,7 +2660,7 @@ if getattr(exchange, '_getbundleobsmarke
@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
@@ -2864,7 +2864,7 @@ def debugobsconvert(ui, repo, new_format
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'
More information about the Mercurial-devel
mailing list