Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.3

Bug #17502 Text_Diff3 merge conflicts without reason
Submitted: 2010-06-18 14:49 UTC
From: stoefln Assigned:
Status: Open Package: Text_Diff (version 1.1.1)
PHP Version: 5.2.12 OS: MacOs X, Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2010-06-18 14:49 UTC] stoefln (Stephan Petzl)
Description: ------------ try to merge the files underneith, you will get an merge conflict. diff3 on my mac system merges this without problems. ====BASE FILE==== // some merge test aaa bbb ccc ccc ddd eee fff ggg hhh ====CHANGED FILE1==== // some merge test aaa bbb-this line is changed ccc ddd eee fff ggg hhh ====CHANGED FILE2==== // some merge test aaa bbb ccc ccc ddd eee fff this line added ggg hhh Test script: --------------- <?php $PATH_typo3conf = '/Applications/MAMP/htdocs/typo3_svn/typo3conf/'; require_once $PATH_typo3conf . 'ext/extbase_kickstarter/lib/pear/' . "Text/Diff/Engine/native.php"; require_once $PATH_typo3conf . 'ext/extbase_kickstarter/lib/pear/' . "Text/Diff3.php"; $base = $PATH_typo3conf .'ext/extbase_kickstarter/testmerge/Box_base.php'; $file2 = $PATH_typo3conf .'ext/extbase_kickstarter/testmerge/Box_generated.php'; $file3 = $PATH_typo3conf .'ext/extbase_kickstarter/testmerge/Box.php'; $merger = new Text_Diff3(file($base), file($file2),file($file3)); echo "<h1>merged</h1><pre>"; print_r($merger); echo "<hr>"; print_r($merger->mergedOutput()); echo "</pre>"; ?> Expected result: ---------------- ====SUCCESSFULLY MERGED FILE==== // some merge test aaa bbb-this line is changed ccc ddd eee fff this line added ggg hhh Actual result: -------------- Array ( [0] => // some merge test [1] => aaa [2] => bbb-this line is changed [3] => ccc [4] => ddd [5] => eee [6] => fff [7] => <<<<<<< [8] => this line added [9] => ======= [10] => ggg [11] => hhh [12] => >>>>>>> [13] => ggg [14] => hhh )

Comments

 [2010-06-18 15:56 UTC] stoefln (Stephan Petzl)
if you use this FILE2 instead, it works: ====CHANGED FILE2==== // some merge test aaa bbb ccc ccc ddd eee fff this line added ggg - this line was changed hhh