[rfc] about cherrypicking

Alexander Belchenko bialix at ukr.net
Tue May 15 09:12:08 BST 2007


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

Last days I many think about cherrypicking.
It's important feature for me, and I have some rough idea
to use unique id for lines (similar to unique id for files
in bzr).

But I have a problem to figure out how cherrypicking should work
in complex scenario when user try to pick changes to the code
non-existent in his working tree.

Per example, very simple example:

revno.1) user have file with some lines:

foo
bar
eggs

revno.2) in another branch to this file was added another line

 foo
 bar
+spam
 eggs

revno.3) in another branch in next revision new and old lines was changed

- -foo
+line1
 bar
- -spam
+line3
 eggs

At this point user want to cherrypick changes from revno.3 to revno.1

Changes [foo => line1] will applied cleanly because this line existed in both
branches.

But change [spam => line3] is not clear for me. When I use cherrypicking
I want to pick changes from some revision (or revisons range) that related to
my code, and don't want to pick changes for lines that I don't have in my tree.
So I prefer to ignore change [spam => line3], because it cannot be cleanly applied
to my tree and should produce conflict.

As I can see bzr now do in another way. bzr pick all changes and therefore pick
changes from another branch outside of requested cherrypicking range,
i.e. bzr pick not only 3, but and 2 as well. This behavior I personally don't like.
But IIUC this is done deliberately to prevent loss of information. But I don't like
this way.

Am I wrong here? Or another people have another experience with cherrypicking
(not necessary in bzr).

[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSWtXzYr338mxwCURAgd4AJ41opmTOgJtnysuvRoSDOWdTR+XaQCghTZc
5Fnmaw8TA3fk4WgC09yIXqE=
=HPml
-----END PGP SIGNATURE-----



More information about the bazaar mailing list