This is an archive of the discontinued Mercurial Phabricator instance.

rebase: move bookmarks with --keep (issue5682)
ClosedPublic

Authored by quark on Sep 18 2017, 2:58 PM.

Details

Summary

This is a regression caused by 3b7cb3d17137. We have documented the behavior
in rebase help:

Rebase will destroy original commits unless you use "--keep". It will
also move your bookmarks (even if you do).

So let's restore the old behavior.

It is done by changing scmutil.cleanupnodes to accept more information so
a node could have different "movement destination" from "successors". It
also helps simplifying the callsite as a side effect - the special bookmark
movement logic in rebase is removed.

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.Sep 18 2017, 2:58 PM
quark updated this revision to Diff 1868.Sep 18 2017, 3:03 PM
quark added inline comments.Sep 18 2017, 3:04 PM
mercurial/scmutil.py
635–657

This is unchanged if viewed with whitespace ignored: https://phab.mercurial-scm.org/D727?whitespace=ignore-all

I'm tired, so I don't think I reviewed this properly, but seemed to make sense.

hgext/rebase.py
512–515

Can combine to one condition now

1363

drop "not", right?

martinvonz added inline comments.Sep 20 2017, 12:57 PM
mercurial/scmutil.py
589–595

This felt to me like it should be two separate maps, so I sent D748-D750. Let me know how that looks to you.

martinvonz requested changes to this revision.Sep 20 2017, 12:57 PM
This revision now requires changes to proceed.Sep 20 2017, 12:57 PM
quark added a subscriber: simonfar.Sep 21 2017, 6:33 PM

I'm tired, so I don't think I reviewed this properly, but seemed to make sense.

Take your time! Nowadays none of my upstream patches are urgent (for fb) - for important fixes, they are already committed internally as hotfixes. Kudos to @simonfar and Kostia who make hotfixes very easy to work with.

This revision was automatically updated to reflect the committed changes.