Package: websvn
when websvn does an svn blame against a file, if that file is binary
then the apache logs get "Skipping binary file" in them.
This patch fixes that and puts a suitable comment on the screen instead.
Adrian
--
Email: [email protected] -*- GPG key available on public key servers
Debian GNU/Linux - the maintainable distribution -*- www.debian.org
--- include/svnlook.php.orig 2009-07-01 12:10:33.000000000 +0100
+++ include/svnlook.php 2009-07-01 12:15:21.000000000 +0100
@@ -837,7 +837,7 @@
global $config;
$path = encodepath($this->getSvnpath($path));
- $cmd = $config->svn." blame ".$this->repConfig->svnParams().quote($path.'@'.$rev).' > '.quote($filename);
+ $cmd = $config->svn." blame ".$this->repConfig->svnParams().quote($path.'@'.$rev).' > '.quote($filename) . ' 2>&1';
$retcode = 0;
execCommand($cmd, $retcode);
--- blame.php.orig 2009-07-01 12:15:43.000000000 +0100
+++ blame.php 2009-07-01 12:28:18.000000000 +0100
@@ -101,7 +101,15 @@
while (!feof($blame) && !feof($file)) {
$blameline = fgets($blame);
- if ($blameline != '') {
+ if (preg_match("/^Skipping binary file:/", $blameline)) {
+ $listing[$index]['lineno'] = "N/A";
+ $listing[$index]['revision'] = "N/A";
+ $listing[$index]['author'] = "N/A";
+ $listing[$index]['line'] = "Skipping binary file";
+ $row_class = ($row_class == 'light') ? 'dark' : 'light';
+ $listing[$index]['row_class'] = $row_class;
+ $index++;
+ } else if ($blameline != '') {
list($revision, $author, $remainder) = sscanf($blameline, '%d %s %s');
$empty = !$remainder;