Patchwork [2,of,4,evolve-ext] oldobsolete: remove use of obsolete._enabled

login
register
mail settings
Submitter Durham Goode
Date March 20, 2015, 12:46 a.m.
Message ID <af2f360a45bf54d13203.1426812417@dev2000.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8185/
State Accepted
Headers show

Comments

Durham Goode - March 20, 2015, 12:46 a.m.
# HG changeset patch
# User Durham Goode <durham@fb.com>
# Date 1426797747 25200
#      Thu Mar 19 13:42:27 2015 -0700
# Node ID af2f360a45bf54d132033d5891f207d23cdcc72b
# Parent  ebd12d85d718759a344c74e234e10080bccdc2dd
oldobsolete: remove use of obsolete._enabled

obsolete._enabled is deprecated. Switch to the newer obsolete.isenabled() logic.

Patch

diff --git a/hgext/obsolete.py b/hgext/obsolete.py
--- a/hgext/obsolete.py
+++ b/hgext/obsolete.py
@@ -14,8 +14,6 @@  from mercurial import util
 
 try:
     from mercurial import obsolete
-    if not obsolete._enabled:
-        obsolete._enabled = True
 except ImportError:
     raise util.Abort('Obsolete extension requires Mercurial 2.3 (or later)')
 
@@ -40,6 +38,10 @@  def reposetup(ui, repo):
     """
     if not repo.local():
         return
+    evolveopts = ui.configlist('experimental', 'evolution')
+    if not evolveopts:
+        evolveopts = ['all']
+        ui.setconfig('experimental', 'evolution', evolveopts)
     for arg in sys.argv:
         if 'debugc' in arg:
             break