changeset 47796:16c60e90a496 stable

rebase: 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/D11221
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 28 Jul 2021 13:45:41 +0300
parents 6c86f96042c9
children e69c82bf3a01
files hgext/rebase.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/rebase.py	Mon Aug 02 16:23:45 2021 +0200
+++ b/hgext/rebase.py	Wed Jul 28 13:45:41 2021 +0300
@@ -362,10 +362,7 @@
         skippedset = set(self.obsolete_with_successor_in_destination)
         skippedset.update(self.obsolete_with_successor_in_rebase_set)
         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
-        allowdivergence = self.ui.configbool(
-            b'experimental', b'evolution.allowdivergence'
-        )
-        if allowdivergence:
+        if obsolete.isenabled(self.repo, obsolete.allowdivergenceopt):
             self.obsolete_with_successor_in_rebase_set = set()
         else:
             for rev in self.repo.revs(
@@ -1652,7 +1649,7 @@
     successors in destination or no non-obsolete successor.
     """
     # Obsolete node with successors not in dest leads to divergence
-    divergenceok = ui.configbool(b'experimental', b'evolution.allowdivergence')
+    divergenceok = obsolete.isenabled(repo, obsolete.allowdivergenceopt)
     divergencebasecandidates = rebaseobsrevs - rebaseobsskipped
 
     if divergencebasecandidates and not divergenceok: