From: Geoffrey T. D. <da...@us...> - 2001-12-16 16:47:19
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory usw-pr-cvs1:/tmp/cvs-serv23598/lib Modified Files: difflib.php Added Files: diff3.php Log Message: Added three-way diff engine. (Beginning of support for MergeConflictingEdits.) ***** Error reading new file: [Errno 2] No such file or directory: 'diff3.php' Index: difflib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/difflib.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** difflib.php 2001/12/15 02:39:43 1.3 --- difflib.php 2001/12/16 16:47:17 1.4 *************** *** 22,25 **** --- 22,33 ---- trigger_error("pure virtual", E_USER_ERROR); } + + function norig() { + return $this->orig ? sizeof($this->orig) : 0; + } + + function nfinal() { + return $this->final ? sizeof($this->final) : 0; + } } *************** *** 101,111 **** class _DiffEngine { - var $xv = array(), $yv = array(); - function diff ($from_lines, $to_lines) { $n_from = sizeof($from_lines); $n_to = sizeof($to_lines); - // Skip leading common lines. for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) { --- 109,123 ---- class _DiffEngine { function diff ($from_lines, $to_lines) { $n_from = sizeof($from_lines); $n_to = sizeof($to_lines); + $this->xchanged = $this->ychanged = array(); + $this->xv = $this->yv = array(); + $this->xind = $this->yind = array(); + unset($this->seq); + unset($this->in_seq); + unset($this->lcs); + // Skip leading common lines. for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) { *************** *** 580,584 **** return $lines; } ! /** * Check a Diff for validity. --- 592,596 ---- return $lines; } ! /** * Check a Diff for validity. *************** *** 610,623 **** } } - ! if (!function_exists('array_map')) { ! function array_map($map_func, $array) { ! $result = array(); ! foreach ($array as $x) ! $result[] = call_user_func($map_func, $x); ! return $result; ! } ! } --- 622,627 ---- } } ! |