[rfc] cherrypicking merge (revision range)

John Arbash Meinel john at arbash-meinel.com
Mon Nov 20 16:36:02 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Recently I do much cherrypicking and actually revision range looks not
> so good.
> 
> If I need changes from revision 10, I need 'bzr merge -r9..10'
> Not so good if you need to repeat it tn times. I remember there was
> plans about '-c N' flag that could be equivalent to -r N-1..N.
> 
> But things really ugly when I need cherrypick 9-11, then 12-15, then
> 16-18. Each time I need to calculate in my mind N-1. (If you ask me why
> I need cherrypick sequent ranges: because in each range revisions
> together represent logical union of changes).
> 
> Why 'merge -rN-1..M' and not 'merge -rN..M'?
> 
> This revisions range is similar to diff command, but merge is very
> different command, is not?
> 
> (I understand that we can't change this for merge because of backward
> compatibility.)
> 
> Alexander
> 

Well, to start with, 'bzr diff -r X..Y' should give the same content as
'bzr merge -r X..Y'. To do otherwise would confuse people. We changed
'bzr uncommit' so that it would interpret '-r' the same way that 'bzr
revert' does, for reasons like that. (It became 'uncommit to this
revision' and not 'uncommit this revision').

I can understand your point, where you feel like you want to say: "Merge
revisions 10 through 20". Whereas bzr only lets you say "Merge the
changes from base revision 9 to the target revision 20". Or
alternatively, "Merge the changes from revision 20 using revision 9 as
the base".

Which is what the command is doing, but may not be the nicest way to say
it. In reality, it doesn't look at any of the intervening revisions, it
just looks at the endpoints, computes a diff, and applies it.

We *might* want to follow what Monotone did, and add a 'bzr cherrypick'
command. Where you give it the actual revisions you are wanting to
select, rather than giving it the 'diff' that you want merged.

I can't say that I like the N-1 syntax either. So it would be good to
get our stories straight, and keep the commands usable.

I'd like to hear what other people think. Do we want 'bzr merge -r X..Y'
mean merge revisions 'X through Y' rather than 'merge the difference
from X to Y'.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFYdlyJdeBCYSNAAMRAjiyAKCTgXSlnUpPUh1myD6TKfa5WZ6bbQCgkGh/
Whycc5NaVN+b/SDFtlLP6J8=
=qa9e
-----END PGP SIGNATURE-----




More information about the bazaar mailing list