[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svn merge produced conflict with bad merge

From: Kevin Ballard <kevin_at_sb.org>
Date: 2004-08-11 18:58:48 CEST

I just did an svn merge to merge some changes from trunk to my branch.
A file conflicted (which isn't terribly surprising). I used FileMerge
to open the conflict files and FileMerge told me there were 0
conflicts. Upon examining the left, right, and working files around the
area of conflict in the merge file I discovered it was indeed correct.
I then looked at the merge file and discovered something a bit
disturbing. Inside the so-called conflict it was missing some code.

Here's the code in the left file:

        [_title drawAtPoint:NSMakePoint( 55., 40. )
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont
boldSystemFontOfSize:13.], NSFontAttributeName, [NSColor
controlTextColor], NSForegroundColorAttributeName, nil]];
        [_text drawInRect:NSMakeRect( 55., 10., 200., 30. )];

        if( [_icon size].width > 32. || [_icon size].height > 32. ) { //
Assume a square image.
                NSImageRep *sourceImageRep = [_icon bestRepresentationForDevice:nil];

Here's the code in the right file:

        [_title drawAtPoint:NSMakePoint( 55., 40. )
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont
boldSystemFontOfSize:13.], NSFontAttributeName, [NSColor
controlTextColor], NSForegroundColorAttributeName, nil]];
        [_text drawInRect:NSMakeRect( 55., 10., 200., 30. )];

        NSSize iconSize = [_icon size];
        if( iconSize.width > 32. || iconSize.height > 32. ) { // Assume a
square image.
                NSRect newBounds = { { 0., 0. }, { 32., 32.} };
                NSImageRep *sourceImageRep = [_icon bestRepresentationForDevice:nil];

Here's the code in my working file:

        [_title drawAtPoint:NSMakePoint( 55., heightOffset - 15. )
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont
boldSystemFontOfSize:13.], NSFontAttributeName, [NSColor
controlTextColor], NSForegroundColorAttributeName, nil]];
        [_text drawInRect:NSMakeRect( 55., 10., 200., heightOffset - 25. )];

        if( [_icon size].width > 32. || [_icon size].height > 32. ) { //
Assume a square image.
                NSImageRep *sourceImageRep = [_icon bestRepresentationForDevice:nil];

So upon examination all that should change is the if statement along
with thew 2 variable declarations added. Here's the merge file:

<<<<<<< .working
        [_title drawAtPoint:NSMakePoint( 55., heightOffset - 15. )
withAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont
boldSystemFontOfSize:13.], NSFontAttributeName, [NSColor
controlTextColor], NSForegroundColorAttributeName, nil]];
        [_text drawInRect:NSMakeRect( 55., 10., 200., heightOffset - 25. )];

        if( [_icon size].width > 32. || [_icon size].height > 32. ) { //
Assume a square image.
=======
        NSSize iconSize = [_icon size];
        if( iconSize.width > 32. || iconSize.height > 32. ) { // Assume a
square image.
                NSRect newBounds = { { 0., 0. }, { 32., 32.} };
>>>>>>> .merge-right.r217
                NSImageRep *sourceImageRep = [_icon bestRepresentationForDevice:nil];

If you look, the left side contains my working code and the right side
contains the "conflict", which if I decided I'd want to toss my working
code and use the "new" code I'd lose 2 drawing operations *which are
present in the left and right merge files* (although slightly
modified). This is very disturbing to me. If I didn't have FileMerge
and I Wasn't paying attention I could have easily lost code and not
known it.

-- 
Kevin Ballard
kevin@sb.org
http://www.tildesoft.com
http://kevin.sb.org

  • application/pkcs7-signature attachment: smime.p7s
Received on Wed Aug 11 18:59:13 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.