[PATCH 2 of 3 evolve-ext] config: enable all obsolete options

Durham Goode durham at fb.com
Tue Mar 17 21:17:27 CDT 2015


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1426644207 25200
#      Tue Mar 17 19:03:27 2015 -0700
# Branch stable
# Node ID 43acc42c7a8d117c5e8a89a8aff08e44906f8d51
# Parent  e9da6b7083a5869a59b3ed14d709761aa2d30822
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.

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -367,6 +367,19 @@ def _resolveoptions(ui, opts):
 getrevs = obsolete.getrevs
 
 #####################################################################
+### Option configuration                                          ###
+#####################################################################
+
+ at eh.prereposetup
+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)
+
+#####################################################################
 ### Additional Utilities                                          ###
 #####################################################################
 


More information about the Mercurial-devel mailing list