Bug 3010 - Rebase to ancestor
Summary: Rebase to ancestor
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal feature
Assignee: Pierre-Yves David
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 13:09 UTC by Ethan Tira-Thompson
Modified: 2011-09-19 15:00 UTC (History)
11 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 Ethan Tira-Thompson 2011-09-15 13:09 UTC
(summarizing from mailing list, links below)

Rebase currently supports non-ancestor destinations, but it would be helpful 
to also support ancestoral destinations.  This case may require a different 
implementation than is used for the case of rebasing onto a branch, but is 
still a valid operation that comes up in practice.  (e.g. a bugfix (A) that 
should be moved into a new branch off of a previous 'public' changeset, so 
that the bugfix can be pushed without having to share the incomplete feature 
development (B)).

In other words, given:

  ... [A0] --- [B0] --- [B1] ... [Bm] --- [A1] --- [A2] ... [An]

desired outcome of ' rebase -s A1 -d A0 ':

  ... [A0] --- [B0] --- [B1] ... [Bm]
          \
           [A1'] --- [A2'] ... [An']

I've used this approach to kickoff the rebase:
  hg update -r A0
  hg transplant A1 #becomes A1'
  hg rebase -s A2 -d A1'
  hg strip A1

Martin Geisler suggested this approach:
  hg update Bm
  hg revert --all --rev A0
  hg commit -m "A0'"
  hg rebase --base An
  hg export A1' A2' ... An'
  hg update A0
  hg import A1' A2' ... An'
  hg strip A0'

I don't know the subtleties well enough to evaluate the "right" way to do 
this, which is why I'd rather have rebase handle this natively to be less 
cumbersome/error-prone.

See mailing list thread:
http://selenic.com/pipermail/mercurial/2011-September/039712.html
http://selenic.com/pipermail/mercurial/2011-September/039713.html
http://selenic.com/pipermail/mercurial/2011-September/039727.html
http://selenic.com/pipermail/mercurial/2011-September/039728.html
http://selenic.com/pipermail/mercurial/2011-September/039729.html
http://selenic.com/pipermail/mercurial/2011-September/039730.html

Thanks!
Comment 1 Pierre-Yves David 2011-09-19 03:49 UTC
I'm very much interrested in such feature. I'll probably give it a look in
the coming weeks
Comment 2 HG Bot 2011-09-19 15:00 UTC
Fixed by http://selenic.com/repo/hg/rev/81f76098211e
Pierre-Yves David <pierre-yves.david@logilab.fr>
rebase: allow rebase to ancestor (issue3010)

(please test the fix)
Comment 3 Bugzilla 2012-05-12 09:23 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:23 EDT  ---

This bug was previously known as _bug_ 3010 at http://mercurial.selenic.com/bts/issue3010