[BUG] Merging an MD into a different branch causes a cherrypick
John Arbash Meinel
john at arbash-meinel.com
Tue Oct 30 20:34:40 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I feel like it should be possible to merge a MD into a branch that it is not
directed towards, as long as you have the required revisions (this may be
contentious, so I'm stating it up front.)
However if you create a MD against one branch, it actually creates a
cherry-pick against that branch (by default). So when I merge it into a
different branch, it fails.
For example:
bzr init-repo test
cd test
bzr init trunk
cd trunk
echo a > a
bzr add
bzr commit -m a
cd ..
bzr branch trunk feature_b
cd feature_b
echo b >> a
bzr commit -m b
cd ../trunk
echo c >> a
bzr commit -m "feature c"
# Third party fixes conflicts
cd ..
bzr branch trunk fix_b
cd fix_b
bzr merge ../feature_b
echo -e "a\nb\nc\n" > a
bzr resolve
bzr commit -m "merge and fix feature_b conflicts"
bzr send ../trunk -o ../fixed_feature_b.patch
At this point, trying to do:
cd feature_b
bzr merge ../fixed_feature_b.patch
Will fail. Because the "send" command sets the "base_revision_id" to the tip of
trunk. So it is the same as saying:
cd feature_b
bzr merge ../fix_b -r -2..-1
Rather than
cd feature_b
bzr merge ../fix_b
I *think* the solution would be to not set "base_revision_id" as the merge base
unless the user actually requested a cherry pick from the beginning.
The workaround is that 'pull' will ignore base_revision_id.
cd test
bzr branch feature_b tmp-fix
cd tmp-fix
bzr pull --overwrite ../fixed_feature_b.patch
cd ../feature_b
bzr merge ../tmp-fix
At a minimum, I think "bzr merge ../foo.patch" should give a warning or some
sort of indication that it is doing a cherry pick, rather than a regular merge.
affects bzr
status triaged
importance medium
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHJ5VgJdeBCYSNAAMRAvyIAKDXC031YBsgTGd0Swk9YePhyJyJ9wCeP5m+
WT1RBWL8p2LEdu7oiBy6BNw=
=wZH+
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list