D2728: rebase: also include commit of collapsed commits in single transaction

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Mar 13 10:55:19 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG67e18654a9eb: rebase: also include commit of collapsed commits in single transaction (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2728?vs=6768&id=6984

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-transaction.t

CHANGE DETAILS

diff --git a/tests/test-rebase-transaction.t b/tests/test-rebase-transaction.t
--- a/tests/test-rebase-transaction.t
+++ b/tests/test-rebase-transaction.t
@@ -29,11 +29,9 @@
   >   |/
   >   A
   > EOF
-- We should only see two status stored messages. One from the start, one from
-- the end.
+- We should only see one status stored message. It comes from the start.
   $ hg rebase --debug -b D -d Z | grep 'status stored'
   rebase status stored
-  rebase status stored
   $ hg tglog
   o  5: D
   |
@@ -64,7 +62,7 @@
   >   A
   > EOF
 - We should only see two status stored messages. One from the start, one from
-- the end.
+- cmdutil.commitforceeditor() which forces tr.writepending()
   $ hg rebase --collapse --debug -b D -d Z | grep 'status stored'
   rebase status stored
   rebase status stored
@@ -162,12 +160,14 @@
   rebasing 1:112478962961 "B" (B)
   rebasing 3:26805aba1e60 "C" (C)
   rebasing 5:f585351a92f8 "D" (D tip)
+  transaction abort!
+  rollback completed
   abort: edit failed: false exited with status 1
   [255]
   $ hg tglog
   o  5: D
   |
-  | @  4: Z
+  | o  4: Z
   | |
   o |  3: C
   | |
@@ -178,9 +178,9 @@
   o  0: A
   
   $ hg rebase --continue
-  already rebased 1:112478962961 "B" (B) as e9b22a392ce0
-  already rebased 3:26805aba1e60 "C" (C) as e9b22a392ce0
-  already rebased 5:f585351a92f8 "D" (D tip) as e9b22a392ce0
+  rebasing 1:112478962961 "B" (B)
+  rebasing 3:26805aba1e60 "C" (C)
+  rebasing 5:f585351a92f8 "D" (D tip)
   saved backup bundle to $TESTTMP/collapse-cancel-editor/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg
   $ hg tglog
   o  3: Collapsed revision
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -573,16 +573,12 @@
                     keepbranches=self.keepbranchesf,
                     date=self.date, wctx=self.wctx)
             else:
-                dsguard = None
-                if ui.configbool('rebase', 'singletransaction'):
-                    dsguard = dirstateguard.dirstateguard(repo, 'rebase')
-                with util.acceptintervention(dsguard):
-                    newnode = concludenode(repo, revtoreuse, p1, self.external,
-                        commitmsg=commitmsg,
-                        extrafn=_makeextrafn(self.extrafns),
-                        editor=editor,
-                        keepbranches=self.keepbranchesf,
-                        date=self.date)
+                newnode = concludenode(repo, revtoreuse, p1, self.external,
+                    commitmsg=commitmsg,
+                    extrafn=_makeextrafn(self.extrafns),
+                    editor=editor,
+                    keepbranches=self.keepbranchesf,
+                    date=self.date)
             if newnode is not None:
                 newrev = repo[newnode].rev()
                 for oldrev in self.state:
@@ -864,8 +860,7 @@
                 dsguard = dirstateguard.dirstateguard(repo, 'rebase')
             with util.acceptintervention(dsguard):
                 rbsrt._performrebase(tr)
-
-        rbsrt._finishrebase()
+                rbsrt._finishrebase()
 
 def _definedestmap(ui, repo, rbsrt, destf=None, srcf=None, basef=None,
                    revf=None, destspace=None):



To: martinvonz, #hg-reviewers, durham, quark, yuja
Cc: mercurial-devel


More information about the Mercurial-devel mailing list