changeset 47907:82c87566bfc0

fix: use obsolete.isenabled() to check for experimental.allowdivergence Now that obsolete.isenabled() can also check if divergence is allowed, let's use it for consistency. Other experimental.evolution options are already checked via this function. Differential Revision: https://phab.mercurial-scm.org/D11222
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 28 Jul 2021 13:47:21 +0300
parents 0044a7ad9f2f
children b1e1559f5a45
files hgext/fix.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fix.py	Wed Jul 28 13:45:41 2021 +0300
+++ b/hgext/fix.py	Wed Jul 28 13:47:21 2021 +0300
@@ -147,6 +147,7 @@
     mdiff,
     merge,
     mergestate as mergestatemod,
+    obsolete,
     pycompat,
     registrar,
     rewriteutil,
@@ -451,10 +452,7 @@
     """Aborts if the revision shouldn't be replaced with a fixed one."""
     if ctx.obsolete():
         # It would be better to actually check if the revision has a successor.
-        allowdivergence = ui.configbool(
-            b'experimental', b'evolution.allowdivergence'
-        )
-        if not allowdivergence:
+        if not obsolete.isenabled(repo, obsolete.allowdivergenceopt):
             raise error.Abort(
                 b'fixing obsolete revision could cause divergence'
             )