Patchwork D7826: rebase: stop relying on having two parents to resume rebase

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2020, 12:24 a.m.
Message ID <f6d14acf8a7c1d7074e2435cde92463f@localhost.localdomain>
Download mbox | patch
Permalink /patch/45112/
State Not Applicable
Headers show

Comments

phabricator - Feb. 11, 2020, 12:24 a.m.
martinvonz updated this revision to Diff 20096.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7826?vs=19860&id=20096

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7826/new/

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -178,6 +178,7 @@ 
         # --continue or --abort)), the original repo should be used so
         # visibility-dependent revsets are correct.
         self.prepared = False
+        self.resume = False
         self._repo = repo
 
         self.ui = ui
@@ -367,6 +368,7 @@ 
         _checkobsrebase(self.repo, self.ui, obsoleteset, skippedset)
 
     def _prepareabortorcontinue(self, isabort, backup=True, suppwarns=False):
+        self.resume = True
         try:
             self.restorestatus()
             self.collapsemsg = restorecollapsemsg(self.repo, isabort)
@@ -606,8 +608,9 @@ 
                 self.skipped,
                 self.obsoletenotrebased,
             )
-            if not self.inmemory and len(repo[None].parents()) == 2:
+            if self.resume and self.wctx.p1().rev() == p1:
                 repo.ui.debug(b'resuming interrupted rebase\n')
+                self.resume = False
             else:
                 overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')}
                 with ui.configoverride(overrides, b'rebase'):