Patchwork D10259: rebase: don't call rewriteutil.precheck() with to-be-skipped commits

login
register
mail settings
Submitter phabricator
Date March 24, 2021, 6:25 a.m.
Message ID <differential-rev-PHID-DREV-r3sjgt3c2glbccccjzni-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48573/
State Superseded
Headers show

Comments

phabricator - March 24, 2021, 6:25 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It's clearly incorrect to call `rewriteutil.precheck()` for commits
  that we're not about to rewrite. We haven't noticed yet because the
  function doesn't check for divergence, but I'm about to teach it to do
  that.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: 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
@@ -441,8 +441,10 @@ 
         # Calculate self.obsolete_* sets
         self._handleskippingobsolete()
 
-        rebaseset = destmap.keys()
         if not self.keepf:
+            rebaseset = destmap.keys()
+            rebaseset -= set(self.obsolete_with_successor_in_destination)
+            rebaseset -= self.obsolete_with_successor_in_rebase_set
             try:
                 rewriteutil.precheck(self.repo, rebaseset, action=b'rebase')
             except error.Abort as e: