Weird incorrect merge - now actually with simple reproducer
Max Bowsher
maxb at f2s.com
Fri Aug 6 02:11:25 BST 2010
I've managed to produce a small reproducer for the weird merge issue
I've mentioned on this list before. My sample branch looks like this:
> maxb at z61p:~/wc/bzr/mctest/trunk$ bzr log --line
> 3: Max Bowsher 2010-08-06 Eliminate tab character.
> 2: Max Bowsher 2010-08-06 Drop RejectedException.
> 1: Max Bowsher 2010-08-06 Base.
r1 adds a file
r2 looks like this:
> maxb at z61p:~/wc/bzr/mctest/trunk$ bzr di -c 2
> === modified file 'MergeIssue.java'
> --- MergeIssue.java 2010-08-06 00:53:13 +0000
> +++ MergeIssue.java 2010-08-06 00:54:24 +0000
> @@ -3,7 +3,7 @@
> public class MergeIssue extends BaseClass {
>
> @Override
> - public void filterDown(Message msg, Resources res) throws RejectedException, BreakoutException {
> + public void filterDown(Message msg, Resources res) throws BreakoutException {
> if(msg.getFlag(MessageFlag.SEEN)) { /* Allow msg through if we've already processed it */
> return;
> }
r3 looks like this (it changes a single tab character into four spaces):
> maxb at z61p:~/wc/bzr/mctest/trunk$ bzr di -c 3
> === modified file 'MergeIssue.java'
> --- MergeIssue.java 2010-08-06 00:54:24 +0000
> +++ MergeIssue.java 2010-08-06 00:55:28 +0000
> @@ -4,7 +4,7 @@
>
> @Override
> public void filterDown(Message msg, Resources res) throws BreakoutException {
> - if(msg.getFlag(MessageFlag.SEEN)) { /* Allow msg through if we've already processed it */
> + if(msg.getFlag(MessageFlag.SEEN)) { /* Allow msg through if we've already processed it */
> return;
> }
>
>
Now, the merge I'm doing is to branch r1 and then to try to cherrypick
r3 on top of that:
> maxb at z61p:~/wc/bzr/mctest$ bzr branch -r 1 trunk cpbranch
> Branched 1 revision(s).
> maxb at z61p:~/wc/bzr/mctest$ cd cpbranch/
> maxb at z61p:~/wc/bzr/mctest/cpbranch$ bzr merge -c 3 ../trunk
> M MergeIssue.java
> Text conflict in MergeIssue.java
> 1 conflicts encountered.
Now, the conflict is expected. What's wrong, is that the conflict
markers look like this:
> public class MergeIssue extends BaseClass {
>
> @Override
> <<<<<<< TREE
> public void filterDown(Message msg, Resources res) throws RejectedException, BreakoutException {
> if(msg.getFlag(MessageFlag.SEEN)) { /* Allow msg through if we've already processed it */
> =======
> if(msg.getFlag(MessageFlag.SEEN)) { /* Allow msg through if we've already processed it */
> >>>>>>> MERGE-SOURCE
> return;
> }
>
*Observe that if I delete the 'TREE' section in its entirety and keep
the 'MERGE-SOURCE' section in its entirety, there is a line missing from
the result!*
That's a bug, right?
(The branch mentioned in the above is pushed at
lp:~maxb/bzr/odd-merge-reproducer.)
Max.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20100806/6a653d0c/attachment.pgp
More information about the bazaar
mailing list