- whitespace diff working
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 28 Aug 2005 04:43:23 +0000 (04:43 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 28 Aug 2005 04:43:23 +0000 (04:43 +0000)
- colours in test working

dev/difftest.php
includes/svnlib.php

index 1c74be09c3eaa645dc269e27a103deaaee34d781..bcd46de8e21c9bef605b62624dab1ab369fb7517 100644 (file)
@@ -29,17 +29,32 @@ foreach ($diff->fetch() AS $hunk)
                if ($key == 'hunk' AND isset($line['old']))
                {
                        echo '
-               <tr style="background-color: grey">
-                       <td colspan="3">' . print_r($line, true) . '</td>
+               <tr style="background-color: #F7F7F7">
+                       <td colspan="3">&nbsp;</td>
                </tr>';
                        continue;
                }
                
+               if ($line['act'] == '+')
+               {
+                       $color = '#DDFFDD';
+                       $textc = '#99EE99';
+               }
+               else if ($line['act'] == '-')
+               {
+                       $color = '#FFDDDD';
+                       $textc = '#EE9999';
+               }
+               else
+               {
+                       $color = 'white';
+               }
+               
                echo '
-               <tr style="background-color: white">
+               <tr style="background-color: #EEEEDD">
                        <td>' . $line['oldlineno'] . '</td>
                        <td>' . $line['newlineno'] . '</td>
-                       <td>' . $viewsvn->svn->format($line['line']) . '</td>
+                       <td style="background-color: ' . $color . '">' . $viewsvn->svn->format($line['line']) . '</td>
                </tr>';
        }
 }
index 5e7801297e928a81239901839a7a6aad0561c939..290393b1819fb75af1e902a5bd4a9561dcb4b34a 100644 (file)
@@ -567,8 +567,17 @@ class SVNDiff
                                        );
                                }
                        }
+                       // whitespace lines
+                       else
+                       {
+                               $this->diff["$chunk"][] = array(
+                                       'line'          => '',
+                                       'act'           => '',
+                                       'oldlineno'     => ++$lines['old'],
+                                       'newlineno'     => ++$lines['new']
+                               );
+                       }
                }
-
        }
 }