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

login
register
mail settings
Submitter Durham Goode
Date March 18, 2015, 2:17 a.m.
Message ID <43acc42c7a8d117c5e8a.1426645047@dev2000.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8139/
State Accepted
Headers show

Comments

Durham Goode - March 18, 2015, 2:17 a.m.
# HG changeset patch
# User Durham Goode <durham@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.

Patch

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                                          ###
+#####################################################################
+
+@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                                          ###
 #####################################################################