From 12a62fa2ef969e93839776bd78e6b839a02e9b42 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 28 Aug 2005 04:43:23 +0000 Subject: [PATCH] - whitespace diff working - colours in test working --- dev/difftest.php | 23 +++++++++++++++++++---- includes/svnlib.php | 11 ++++++++++- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/dev/difftest.php b/dev/difftest.php index 1c74be0..bcd46de 100644 --- a/dev/difftest.php +++ b/dev/difftest.php @@ -29,17 +29,32 @@ foreach ($diff->fetch() AS $hunk) if ($key == 'hunk' AND isset($line['old'])) { echo ' - - ' . print_r($line, true) . ' + +   '; continue; } + if ($line['act'] == '+') + { + $color = '#DDFFDD'; + $textc = '#99EE99'; + } + else if ($line['act'] == '-') + { + $color = '#FFDDDD'; + $textc = '#EE9999'; + } + else + { + $color = 'white'; + } + echo ' - + ' . $line['oldlineno'] . ' ' . $line['newlineno'] . ' - ' . $viewsvn->svn->format($line['line']) . ' + ' . $viewsvn->svn->format($line['line']) . ' '; } } diff --git a/includes/svnlib.php b/includes/svnlib.php index 5e78012..290393b 100644 --- a/includes/svnlib.php +++ b/includes/svnlib.php @@ -567,8 +567,17 @@ class SVNDiff ); } } + // whitespace lines + else + { + $this->diff["$chunk"][] = array( + 'line' => '', + 'act' => '', + 'oldlineno' => ++$lines['old'], + 'newlineno' => ++$lines['new'] + ); + } } - } } -- 2.43.5