Incorrect merge - Lines missing inside conflict markers

Bug #616749 reported by Max Bowsher
8
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

I have been experiencing an incorrect merge in some circumstances - lines are missing inside the conflict markers, such that chosing entirely one branch of the conflict markers produces code with missing parts.

Here is a reproducer:

First, a sample branch (lp:~maxb/bzr/odd-merge-reproducer):

maxb@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@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):
=== 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@z61p:~/wc/bzr/mctest$ bzr branch -r 1 trunk cpbranch
Branched 1 revision(s).
maxb@z61p:~/wc/bzr/mctest$ cd cpbranch/
maxb@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 */
||||||| BASE-REVISION
            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' or 'BASE-REVISION' section in its entirety, there is a line missing from
the result!*

John A Meinel (jameinel)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.