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

login
register
mail settings
Submitter phabricator
Date March 8, 2018, 10:07 p.m.
Message ID <differential-rev-PHID-DREV-sp3y3pmp536kwlicicxi-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29133/
State Superseded
Headers show

Comments

phabricator - March 8, 2018, 10:07 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  When rebase.singletransaction is set, we still used to create a second
  transaction when committing with --collapse. It's simpler to create a
  single transaction. I don't see a reason to create that second
  transaction, and neither do the test cases.

REPOSITORY
  rHG Mercurial

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

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

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - March 9, 2018, 5:51 a.m.
martinvonz planned changes to this revision.
martinvonz added a comment.


  Please don't queue yet. I'm going to add tests.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers, durham, quark
Cc: mercurial-devel
phabricator - March 9, 2018, 6:37 p.m.
martinvonz added a comment.


  This is now ready for review again

REPOSITORY
  rHG Mercurial

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

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

Patch

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
@@ -32,7 +32,6 @@ 
 - the end.
   $ hg rebase --debug -b D -d Z | grep 'status stored'
   rebase status stored
-  rebase status stored
   $ hg tglog
   o  5: D
   |
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):