Patchwork D2913: rebase: store rebase state after each commit

login
register
mail settings
Submitter phabricator
Date March 21, 2018, 11:34 p.m.
Message ID <3e4650d7467520df07ffb00720eb0833@localhost.localdomain>
Download mbox | patch
Permalink /patch/29732/
State Not Applicable
Headers show

Comments

phabricator - March 21, 2018, 11:34 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG98663bed146e: rebase: store rebase state after each commit (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2913?vs=7176&id=7205

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-collapse.t
  tests/test-rebase-conflicts.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -239,7 +239,6 @@ 
   rebase status stored
   rebasing 9:e31216eec445 "more changes to f1"
    future parents are 2 and -1
-  rebase status stored
    update to 2:4bc80088dc6b
   resolving manifests
    branchmerge: False, force: True, partial: False
@@ -264,9 +263,9 @@ 
   committing changelog
   updating the branch cache
   rebased as 19c888675e13
+  rebase status stored
   rebasing 10:2f2496ddf49d "merge" (tip)
    future parents are 11 and 7
-  rebase status stored
    already in destination
    merge against 10:2f2496ddf49d
      detach base 9:e31216eec445
@@ -284,6 +283,7 @@ 
   committing changelog
   updating the branch cache
   rebased as 2a7f09cac94c
+  rebase status stored
   rebase merging completed
   update back to initial working directory parent
   resolving manifests
diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t
--- a/tests/test-rebase-collapse.t
+++ b/tests/test-rebase-collapse.t
@@ -813,19 +813,7 @@ 
   |/
   o  0: 4a2df7238c3b 'A'
   
-BROKEN: should not result in a conflict
   $ hg rebase --continue
   already rebased 1:f899f3910ce7 "B" (B) as 82b8abf9c185
-  rebasing 3:63668d570d21 "C" (C tip)
-  merging A
-  warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
-  unresolved conflicts (see hg resolve, then hg rebase --continue)
-  [1]
-  $ cat A
-  <<<<<<< dest:   82b8abf9c185 D - test: D
-  BD
-  ||||||| base
-  B
-  =======
-  C
-  >>>>>>> source: 63668d570d21 C tip - test: C
+  already rebased 3:63668d570d21 "C" (C tip) as 82b8abf9c185
+  saved backup bundle to $TESTTMP/aborted-editor/.hg/strip-backup/f899f3910ce7-7cab5e15-rebase.hg
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -484,8 +484,6 @@ 
             p1, p2, base = defineparents(repo, rev, self.destmap,
                                          self.state, self.skipped,
                                          self.obsoletenotrebased)
-            if not tr:
-                self.storestatus()
             if len(repo[None].parents()) == 2:
                 repo.ui.debug('resuming interrupted rebase\n')
             else:
@@ -546,6 +544,12 @@ 
         else:
             ui.status(_('already rebased %s as %s\n') %
                       (desc, repo[self.state[rev]]))
+        if not tr:
+            # When not using single transaction, store state after each
+            # commit is completely done. On InterventionRequired, we thus
+            # won't store the status. Instead, we'll hit the "len(parents) == 2"
+            # case and realize that the commit was in progress.
+            self.storestatus()
 
     def _finishrebase(self):
         repo, ui, opts = self.repo, self.ui, self.opts