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

This is an archive of the discontinued Mercurial Phabricator instance.

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

Authored by martinvonz on Mar 8 2018, 5:07 PM.

Details

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.

Note that in the affected .t file, the test that uses --collapse still
appears to create two transactions (it prints "rebase status stored"
twice). However, only a single transaction is actually created and the
second printout comes from cmdutil.commitforceeditor() that explicitly
calls tr.writepending().

Also note the that we now roll back any commits if the user closes the
commit message editor with an error code (or leaves the message
empty). That might be unfortunate, but it's consistent with how we
behave in the --no-collapse case (if the user passed --edit). If we
want to change that, I think it should be done consistently in a
separate patch.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

martinvonz created this revision.Mar 8 2018, 5:07 PM
quark accepted this revision.Mar 8 2018, 5:15 PM
martinvonz planned changes to this revision.Mar 9 2018, 12:51 AM

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

martinvonz edited the summary of this revision. (Show Details)Mar 9 2018, 1:36 PM
martinvonz updated this revision to Diff 6768.

This is now ready for review again

yuja accepted this revision.Mar 13 2018, 10:48 AM
This revision is now accepted and ready to land.Mar 13 2018, 10:48 AM
This revision was automatically updated to reflect the committed changes.