Rebase on to ancestor on different branch

John Peberdy johnpeb at gmail.com
Wed Nov 10 10:46:24 CST 2010


This and variants (rebasing only the tip of a multi commit branch results in
a strange merge changeset & it's not possible to collapse-rebase if you're
not moving anywhere) are common questions I hear about Mercurial so I would
also be interested in the answer to this. People think of rebase as a
utility to move edges on the commit graph which is not really correct but it
would be nice if it had fewer limitations like this.

I understand if people used more powerful extensions like Mq this would not
be an issue but for people coming from CVS rebase is daunting, let alone Mq,
and rebase is sufficient for most workflows.

Is there a reason why this is not supported? If it were to be implemented
would it be accepted?

Thanks,
John

On Mon, Nov 8, 2010 at 9:36 AM, Chris Gorman <chris at gormania.net> wrote:

> Hi,
>
> I would like to know why the following pattern is not possible.
>
> Having created a local feature branch (minor_feature - not intended to be
> shared with the world) I would like to rebase the work on it on to the tip
> of a well known branch (stable). However I have discovered that rebase finds
> nothing to be rebased in the case where stable has not progressed since
> branching away from it.
>
> I appreciate that this breaks the rule that the destination of rebase can
> not be an ancestor of the source but can't work out why this should be
> prohibited in the simple case shown. I also understand that, branches aside,
> the topology would not actually change during the rebase. But given that the
> branch names are indeed significant to the topology, it only seems to be a
> special case in that stable has no further revisions commited to it. With a
> single extra revision on the tip of stable (say pulled in from elsewhere) I
> can of course perform the rebase.
>
> o  branch:minor_feature
> |  rev:4
> |  changeset:746d8191aa5d
> |
> o  branch:minor_feature
> |  rev:3
> |  changeset:520f565ba7f2
> |
> @  branch:stable
> |  rev:2
> |  changeset:64e7c753c090
> |
> o  branch:stable
> |  rev:1
> |  changeset:3dc55a5c9971
> |
> o  branch:stable
>    rev:0
>    changeset:fbf1f426945c
>
> $hg rebase -b minor_feature
> nothing to rebase
>
> --
> Thanks
> Chris Gorman
>
>
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial
>
>


-- 
John Peberdy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20101110/458b2b40/attachment.htm>


More information about the Mercurial mailing list