config: enable all obsolete options
authorDurham Goode <durham@fb.com>
Tue, 17 Mar 2015 19:03:27 -0700
changeset 1213 7118996bdf43
parent 1212 2c1b6e2ec59a
child 1214 4b10e2c6f7e3
config: enable all obsolete options Upstream Mercurial has moved away from obsolete._enabled as the obsolete flag to a series of options. This patch makes evolve enable all the options automatically if the user hasn't enabled any already. This preserves the existing evolve experience of not having to configure anything.
hgext/evolve.py
--- a/hgext/evolve.py	Fri Mar 13 10:49:02 2015 -0700
+++ b/hgext/evolve.py	Tue Mar 17 19:03:27 2015 -0700
@@ -327,6 +327,20 @@
 reposetup = eh.final_reposetup
 
 #####################################################################
+### Option configuration                                          ###
+#####################################################################
+
+@eh.reposetup # must be the first of its kin.
+def _configureoptions(ui, repo):
+    # If no capabilities are specified, enable everything.
+    # This is so existing evolve users don't need to change their config.
+    evolveopts = ui.configlist('experimental', 'evolution')
+    if not evolveopts:
+        evolveopts = ['all']
+        ui.setconfig('experimental', 'evolution', evolveopts)
+
+
+#####################################################################
 ### experimental behavior                                         ###
 #####################################################################