[PATCH 0 of 2] rebase: add --detach and --cherrypick options

Stefano Tortarolo stefano.tortarolo at gmail.com
Wed Dec 30 19:50:15 CST 2009


The first patch of this series tackles the issue1950.
To sum up, rebase is designed to keep parent relationships with the original  
branch if an intermediate revision is chosen as source.
The main reason behind this choice was that each changeset is strongly related
to its ancestors and simply removing that relationship we had to 'collapse'
every previous change in the rebased revision.

Matt suggested the use of what it called 'virtual null merges', in order to 
revert every change happened in the source's ancestors.
A 'virtual null merge' consists in merging two revisions throwing away the 
changes from one of them and without committing the result. 
In this situation we drop every change from the source's ancestors.
Specifying --detach rebase is thus able to behave like this.

While developing this feature, I came up with the idea that applying virtual 
null merges up to a specified revision and then rebasing just that revision we
could have a 'cherry picking' feature almost for free.
That's what the second patch is intended for.
At the moment, rebase can only cherrypick one revision.

I post these patches, even though I feel they need some improvements here and
there, to get some feedbacks.
Let me know what you think.



More information about the Mercurial-devel mailing list