I have a case where I'm on a bookmark behind the topological head, the head itself is another bookmark, and I've pulled some upstream changes that diverge from the topo-branch I'm on. Now I rebase my local changes (remember this includes -both- bookmarks, the further-back one is active). Rebase updates me to the tip and deletes .hg/bookmarks.current, leaving me with no active bookmark and sitting on a different change than I was on before. I have evolve enabled; not sure if this makes a difference or not.
evolve should not have effect on the way rebase handle bookmarks.
I think this happens with merge as well.
Merge isn't really at issue here; remember, it's the _older_ bookmark that's active here. Rebase is smart enough to figure out where a bookmark that's on a head should end up. And the bookmarks both seem to end up in the right place. The issue here is twofold: 1. I end up at the _head_ of the rebased changes, unconditionally; and 2. my active bookmark is no longer active. It'd be nice if rebase could land me on the equivalent changeset to where I was (and keep the bookmark active).
What should le correct behavior be ? 1) Update to the rebased version of "."? (and keep bookmark active?) 2) Still update do head but keep bookmark active ? (does that makes sense?) The proper answer is probably (1)
I'd vote for #1. I wouldn't expect rebase to change the parent of my working copy (which it currently does).
Fixed by http://selenic.com/repo/hg/rev/c23c62209cc4 Pierre-Yves David <pierre-yves.david@ens-lyon.org> tests: prepare rebase test for wc parent preservation In the way to solving issue3813 we'll preserve the working directory parent after the rebase. Multiple rebases test expect the working directory parent to be tip after rebase. We patches them before the actual change to prevent confusion. (please test the fix)
Fixed by http://selenic.com/repo/hg/rev/9c78ed396075 Pierre-Yves David <pierre-yves.david@ens-lyon.org> rebase: preserve working directory parent (BC) Prior to this changeset, rebase always left the working directory as a parent of the last rebased changeset. The is dubious when, before the rebase, the working directory was not a parent of the tip most rebased changeset. With this changeset, we move the working directory back to its original parent. If the original parent was rebased, we use it's successors. This is a step toward solving issue3813 (rebase loses active bookmark if it's not on a head) (please test the fix)
Fixed by http://selenic.com/repo/hg/rev/0f99747202f9 Pierre-Yves David <pierre-yves.david@ens-lyon.org> rebase: preserve active bookmark when not at head (issue3813) Now that the working directory parent is preserved, we can preserve the active bookmark too. (please test the fix)