Patchwork D11221: rebase: use obsolete.isenabled() to check for experimental.allowdivergence

login
register
mail settings
Submitter phabricator
Date July 28, 2021, 12:32 p.m.
Message ID <differential-rev-PHID-DREV-2dwvcnhnjfyzqorp3tor-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49536/
State Superseded
Headers show

Comments

phabricator - July 28, 2021, 12:32 p.m.
av6 created this revision.
Herald added a reviewer: martinvonz.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11221

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: av6, martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -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: