Mercurial > evolve
changeset 1215:004e21b8d67b
server4simple: remove use of obsolete._enabled
obsolete._enabled is deprecated, so let's replace it's uses.
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 19 Mar 2015 13:41:58 -0700 |
parents | 4b10e2c6f7e3 |
children | a307eea46f96 |
files | hgext/simple4server.py |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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)