rebase: don't call rewriteutil.precheck() with to-be-skipped commits
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 23 Mar 2021 22:48:27 -0700
changeset 46837 27ba8acd5684
parent 46836 80cac9936324
child 46838 d083c12032c6
rebase: don't call rewriteutil.precheck() with to-be-skipped commits 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. Differential Revision: https://phab.mercurial-scm.org/D10259
hgext/rebase.py
--- a/hgext/rebase.py	Tue Mar 23 14:15:40 2021 -0700
+++ b/hgext/rebase.py	Tue Mar 23 22:48:27 2021 -0700
@@ -441,8 +441,10 @@
         # Calculate self.obsolete_* sets
         self._handleskippingobsolete()
 
-        rebaseset = destmap.keys()
         if not self.keepf:
+            rebaseset = set(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: