Basic diff stuff is kind of working
[viewsvn.git] / dev / difftest.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # ViewSVN [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 chdir('./../');
14 require_once('./global.php');
15
16 //$output = $viewsvn->svn->blame('bugtrack', '/trunk/index.php', 0);
17
18 // diff /bugtrack/trunk/index@351:359
19
20 $diff = new SVNDiff('bugtrack', '/trunk/index.php', 351, 359);
21
22 echo '<table cellspacing="1" cellpadding="1" style="background-color: #EFEFEF" width="100%">';
23
24 foreach ($diff->fetch() AS $hunk)
25 {
26 //print_r($hunk);
27 foreach ($hunk AS $key => $line)
28 {
29 if ($key == 'hunk' AND isset($line['old']))
30 {
31 echo '
32 <tr style="background-color: grey">
33 <td colspan="3">' . print_r($line, true) . '</td>
34 </tr>';
35 continue;
36 }
37
38 echo '
39 <tr style="background-color: white">
40 <td>' . $line['oldlineno'] . '</td>
41 <td>' . $line['newlineno'] . '</td>
42 <td>' . $viewsvn->svn->format($line['line']) . '</td>
43 </tr>';
44 }
45 }
46
47 echo '
48 </table>';
49
50 print_r($diff);
51
52 /*=====================================================================*\
53 || ###################################################################
54 || # $HeadURL$
55 || # $Id$
56 || ###################################################################
57 \*=====================================================================*/
58 ?>