evolution: drop the old __temporary__.advertiseobsolete option
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Thu, 09 Mar 2017 17:50:50 -0800
changeset 2075 a7c0685ba6d9
parent 2074 081d54b3e7f0
child 2076 5c6d05c34ba4
evolution: drop the old __temporary__.advertiseobsolete option Mercurial code supports such feature directly though its 'experimental.evolution' config option. So we drop the old code and config.
README
hgext3rd/evolve/obsdiscovery.py
hgext3rd/evolve/obsexchange.py
--- a/README	Thu Mar 09 17:34:30 2017 -0800
+++ b/README	Thu Mar 09 17:50:50 2017 -0800
@@ -89,7 +89,8 @@
     only the part related to exchange and is intended to be used by server.
 
     Using the extension will enable evolution, use 'experimental.evolution=!'
-    to disable obsmarkers echange.
+    to disable obsmarkers echange.  The old '__temporary__.advertiseobsolete'
+    option is no longer supported.
 
 5.6.1 -- 2017-02-28
 
--- a/hgext3rd/evolve/obsdiscovery.py	Thu Mar 09 17:34:30 2017 -0800
+++ b/hgext3rd/evolve/obsdiscovery.py	Thu Mar 09 17:50:50 2017 -0800
@@ -271,8 +271,7 @@
 def _obshash_capabilities(orig, repo, proto):
     """wrapper to advertise new capability"""
     caps = orig(repo, proto)
-    advertise = repo.ui.configbool('__temporary__', 'advertiseobsolete', True)
-    if obsolete.isenabled(repo, obsolete.exchangeopt) and advertise:
+    if obsolete.isenabled(repo, obsolete.exchangeopt):
         caps = caps.split()
         caps.append('_evoext_obshash_0')
         caps.append('_evoext_obshash_1')
--- a/hgext3rd/evolve/obsexchange.py	Thu Mar 09 17:34:30 2017 -0800
+++ b/hgext3rd/evolve/obsexchange.py	Thu Mar 09 17:50:50 2017 -0800
@@ -47,23 +47,6 @@
 
 _bestformat = max(obsolete.formats.keys())
 
-##################################
-### Control evolve advertising ###
-##################################
-
-# This is useful to not enable evolution on all repositories on an install
-
-def _nslist(orig, repo):
-    rep = orig(repo)
-    if not repo.ui.configbool('__temporary__', 'advertiseobsolete', True):
-        rep.pop('obsolete')
-    return rep
-
-@eh.extsetup
-def extsetup_advertise(ui):
-    extensions.wrapfunction(pushkey, '_nslist', _nslist)
-    pushkey._namespaces['namespaces'] = (lambda *x: False, pushkey._nslist)
-
 #####################################################
 ### Support for subset specification in getbundle ###
 #####################################################
@@ -106,8 +89,7 @@
 def _obscommon_capabilities(orig, repo, proto):
     """wrapper to advertise new capability"""
     caps = orig(repo, proto)
-    advertise = repo.ui.configbool('__temporary__', 'advertiseobsolete', True)
-    if obsolete.isenabled(repo, obsolete.exchangeopt) and advertise:
+    if obsolete.isenabled(repo, obsolete.exchangeopt):
         caps = caps.split()
         caps.append('_evoext_getbundle_obscommon')
         caps.sort()
@@ -423,8 +405,7 @@
 def _legacypush_capabilities(orig, repo, proto):
     """wrapper to advertise new capability"""
     caps = orig(repo, proto)
-    advertise = repo.ui.configbool('__temporary__', 'advertiseobsolete', True)
-    if obsolete.isenabled(repo, obsolete.exchangeopt) and advertise:
+    if obsolete.isenabled(repo, obsolete.exchangeopt):
         caps = caps.split()
         caps.append('_evoext_pushobsmarkers_0')
         caps.append('_evoext_pullobsmarkers_0')