This is an archive of the discontinued Mercurial Phabricator instance.

rebase: register status file generator only once when using single transaction
ClosedPublic

Authored by martinvonz on Mar 21 2018, 2:10 PM.

Details

Summary

rebase.storestatus() behaved differently depending on whether a
transaction is passed to it. If a transaction is passed, it registers
a "file generator" that runs when the transaction commits. If no
transaction was passed, it writes the rebase state immediately. This
imprecise timing of the writing makes it hard to reason about, so
let's make it more explicit which behavior we're getting by checking
if we have a transaction before calling it. For the single-transaction
case, move the call to storestatus(tr) early and do it only once since
it's only going to write the file (at most) once anyway.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Mar 21 2018, 2:10 PM
indygreg accepted this revision.Mar 21 2018, 7:28 PM
This revision is now accepted and ready to land.Mar 21 2018, 7:28 PM
This revision was automatically updated to reflect the committed changes.