Bug 3813 - rebase loses active bookmark if it's not on a head
Summary: rebase loses active bookmark if it's not on a head
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: rebase (show other bugs)
Version: earlier
Hardware: PC Mac OS
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-09 10:50 UTC by Kevin Bullock
Modified: 2017-11-01 18:05 UTC (History)
6 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Bullock 2013-02-09 10:50 UTC
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.
Comment 1 Pierre-Yves David 2013-02-09 11:09 UTC
evolve should not have effect on the way rebase handle bookmarks.
Comment 2 Siddharth Agarwal 2013-02-10 07:10 UTC
I think this happens with merge as well.
Comment 3 Kevin Bullock 2013-04-28 23:06 UTC
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).
Comment 4 Pierre-Yves David 2013-09-20 12:51 UTC
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)
Comment 5 Durham Goode 2013-09-20 12:54 UTC
I'd vote for #1.  I wouldn't expect rebase to change the parent of my working copy (which it currently does).
Comment 6 HG Bot 2013-10-19 21:00 UTC
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)
Comment 7 HG Bot 2013-10-19 21:00 UTC
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)
Comment 8 HG Bot 2013-10-19 21:00 UTC
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)