This is an archive of the discontinued Mercurial Phabricator instance.

rebase: don't run IMM if running rebase in a transaction
ClosedPublic

Authored by phillco on Dec 27 2017, 6:34 PM.

Details

Summary

Some callers to rebase.rebase(), like _moverelative in fbamend/movement.py,
wrap the entire rebase call in a transaction. This raises havoc when IMM tries
to retry the rebase when it hits merge conflicts, because the abort will fail
the whole transaction, not the subset. It also fails at the end, losing any
conflict resolution, as @sid0 noticed.

The right long-term fix that @quark and I have discussed is to change the
restarting logic such that it doesn't abort at all, but simply switches between
IMM and non-IMM fluidly for each commit, which has other nice properties. In
the meantime this will do for now.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

phillco created this revision.Dec 27 2017, 6:34 PM
quark accepted this revision.Dec 27 2017, 6:35 PM
quark added inline comments.
hgext/rebase.py
783

The indentation is usually like:

if (opts.get('continue') or opts.get('abort') or
    repo.currenttransaction() is None):
phillco updated this revision to Diff 4645.Dec 27 2017, 6:36 PM
phillco updated this revision to Diff 4647.
phillco updated this revision to Diff 4648.Dec 27 2017, 6:44 PM
This revision was automatically updated to reflect the committed changes.