This is an archive of the discontinued Mercurial Phabricator instance.

rebase: move working parent and bookmark for obsoleted revs (BC)
ClosedPublic

Authored by quark on Aug 27 2017, 5:39 AM.

Details

Summary

Previously, obsoleted revs with successors in destination are completely
ignored. That caused some inconvenience when working copy is obsoleted. Most
commands avoid working copy being obsoleted, but hg pull is an exception.

This patch makes rebase able to move bookmarks or working parent for those
obsoleted revs. It does so by keeping the obsoleted revs in state and
marking them as "skipped, rebased to desired destination" during run-time.

This reverts part of the behavior change of 3b7cb3d17137 and D24.

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

quark created this revision.Aug 27 2017, 5:39 AM
quark retitled this revision from rebase: move wd and bookmark for obsoleted revs (BC) to rebase: move working parent and bookmark for obsoleted revs (BC).Aug 27 2017, 5:49 AM
quark updated this revision to Diff 1333.Aug 28 2017, 3:23 AM
martinvonz added inline comments.
hgext/rebase.py
406

this looks like it would be the same as on line 401

423–424

Why do we still need the adjustment in clearrebased() when we do it here? What kinds of nodes will be adjusted here and what kinds will be left for clearrebased?

martinvonz added inline comments.Aug 29 2017, 7:53 PM
hgext/rebase.py
412

Is the use of unfi necessary? Can the successor be hidden? Only if the destination is hidden, it seems.

(And yes, "hg rebase --continue" after "hg --hidden -r ... -d <hidden>" got interrupted will probably fail, but that should be fixed by adding the destination(s) in _setrebasesetvisibility().)

413–415

looks like this can use _ctxdesc(succctx)

quark added inline comments.Aug 29 2017, 7:55 PM
hgext/rebase.py
423–424

Good question. The reason is this is "skipped" has two cases - 1. obsolete skip 2. "create no commit" skip (line 477), which uses a slightly different p1.

I think we might be able to remove the adjustment in clearrebased. I'll send a follow-up once I figure out the minor differences.

quark marked 3 inline comments as done.Aug 29 2017, 9:40 PM
quark updated this revision to Diff 1421.
This revision was automatically updated to reflect the committed changes.