Description
We had some developers changing svn:keywords property, which caused merge conflicts for other people pulling in the changes via sync merges. The developers merging the change into their branch were surprised to get merge conflicts in files they had not changed. I figured out that svn merge was actually correct in flagging a conflict, but does not present the conflicting lines correctly. The presentation is not correct, since what is shown in the merged file as the right side of the merge does not match the file.merge-right.rREV file. We noticed the behavior in 1.7.3 command-line client on Linux, then reproduced it in 1.7.4 command-line on Windows. I could not find a relevant bug in the issues list. In the user-list discussion, Stephen Butler confirmed that the bug does not exist in 1.6.17. http://mail-archives.apache.org/mod_mbox/subversion-users/201203.mbox/% 3cFB509DD8-95B7-46BC-907E-5E201BC30889@elego.de%3e I admit that the scenario to get to the incorrect behavior is not something one would normally do intentionally (hence P5 priority). It involves removing a keyword from the svn:keywords property, while leaving the expanded keyword in the contents of the file. Shell script to reproduce is below. REPO=file:///work/repo svn co $REPO/trunk trunk cd trunk echo '$Date$ $Revision$' > keyfile svn add keyfile svn propset svn:keywords 'Date Revision' keyfile svn ci -m 'initial keyfile' svn up cat keyfile # expanded keywords cd .. svn cp -m "side branch" $REPO/trunk $REPO/branches/br1 svn co $REPO/branches/br1 br1 cd trunk echo " some changes" >> keyfile svn ci -m "new content" cd ../br1 svn merge ^/trunk svn ci -m "sync merge" svn up cd ../trunk svn propset svn:keywords 'Id' keyfile # whoops, inadvertantly replaced Date and Revision echo '$Id$' >> keyfile svn ci -m "chg for Id keyword" cd ../br1 svn merge --accept postpone ^/trunk # second sync merge flags a conflict # since the Date and Revision keywords are being removed from svn:keywords # Should the file content show the line from trunk (r6) or from branch (r5) #------------------------------------------------------------------ ### Here's the bug -- why do both sides of conflict show same content? cat keyfile <<<<<<< .working $Date: 2012-03-26 10:09:19 -0700 (Mon, 26 Mar 2012) $ $Revision: 5 $ ======= $Date: 2012-03-26 10:09:19 -0700 (Mon, 26 Mar 2012) $ $Revision: 5 $ >>>>>>> .merge-right.r6 some changes $Id$ ### If we look at merge files, we see a different story cat keyfile.working $Date: 2012-03-26 10:09:19 -0700 (Mon, 26 Mar 2012) $ $Revision: 5 $ some changes cat keyfile.merge-left.r4 $Date$ $Revision$ some changes cat keyfile.merge-right.r6 $Date: 2012-03-26 10:09:18 -0700 (Mon, 26 Mar 2012) $ $Revision: 4 $ some changes $Id: keyfile 5 2012-03-26 17:09:19Z svarnau $
http://mid.gmane.org/DE3053E1A0BA2443A0152E2C804E85D953F4FFC6@G9W0763.americas.hpqcorp.net
Original issue reported by svarnau