# HG changeset patch # User Durham Goode # Date 1426797718 25200 # Node ID 004e21b8d67bc32b0494eac2da247a98ca9753c8 # Parent 4b10e2c6f7e35590eb17525c53f2c0cfe2e9cd4b server4simple: remove use of obsolete._enabled obsolete._enabled is deprecated, so let's replace it's uses. diff -r 4b10e2c6f7e3 -r 004e21b8d67b hgext/simple4server.py --- a/hgext/simple4server.py Tue Mar 17 19:04:16 2015 -0700 +++ b/hgext/simple4server.py Thu Mar 19 13:41:58 2015 -0700 @@ -12,7 +12,6 @@ buglink = 'https://bitbucket.org/marmoute/mutable-history/issues' import mercurial.obsolete -mercurial.obsolete._enabled = True import struct from mercurial import util @@ -30,8 +29,6 @@ gboptslist = gboptsmap = None try: from mercurial import obsolete - if not obsolete._enabled: - obsolete._enabled = True from mercurial import wireproto gboptslist = getattr(wireproto, 'gboptslist', None) gboptsmap = getattr(wireproto, 'gboptsmap', None) @@ -233,7 +230,7 @@ """wrapper to advertise new capability""" caps = orig(repo, proto) advertise = repo.ui.configbool('__temporary__', 'advertiseobsolete', True) - if obsolete._enabled and advertise: + if obsolete.isenabled(repo, obsolete.exchangeopt) and advertise: caps += ' _evoext_pushobsmarkers_0' caps += ' _evoext_pullobsmarkers_0' caps += ' _evoext_obshash_0' @@ -280,3 +277,8 @@ extensions.wrapfunction(pushkey, '_nslist', _nslist) pushkey._namespaces['namespaces'] = (lambda *x: False, pushkey._nslist) +def reposetup(ui, repo): + evolveopts = ui.configlist('experimental', 'evolution') + if not evolveopts: + evolveopts = 'all' + ui.setconfig('experimental', 'evolution', evolveopts)