# HG changeset patch # User Anton Shestakov # Date 2021-07-28 10:47:21 # Node ID 82c87566bfc0d85e9f8ec890ff93d58861ed7652 # Parent 0044a7ad9f2fc895e40fecb7f825a71940c232f1 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 diff --git a/hgext/fix.py b/hgext/fix.py --- a/hgext/fix.py +++ b/hgext/fix.py @@ -147,6 +147,7 @@ from mercurial import ( mdiff, merge, mergestate as mergestatemod, + obsolete, pycompat, registrar, rewriteutil, @@ -451,10 +452,7 @@ def checkfixablectx(ui, repo, ctx): """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' )