From d3b123d36dc948bf8b6f733ff0009ee59aa6a9aa Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 20 Jan 2011 13:44:04 -0700 Subject: [PATCH] Fix +/- determination for CVS files --- framework/Vcs/lib/Horde/Vcs/Log/Cvs.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/framework/Vcs/lib/Horde/Vcs/Log/Cvs.php b/framework/Vcs/lib/Horde/Vcs/Log/Cvs.php index 2a96a1e08..742932232 100644 --- a/framework/Vcs/lib/Horde/Vcs/Log/Cvs.php +++ b/framework/Vcs/lib/Horde/Vcs/Log/Cvs.php @@ -40,11 +40,17 @@ class Horde_Vcs_Log_Cvs extends Horde_Vcs_Log /* Found revision and filename, now looking for date */ case 'date': $line = array_shift($raw); - if (preg_match("|^date:\s+(\d+)[-/](\d+)[-/](\d+)\s+(\d+):(\d+):(\d+).*?;\s+author:\s+(.+);\s+state:\s+(\S+);(\s+lines:\s+([0-9\s+-]+))?|", $line, $parts)) { + if (preg_match("|^date:\s+(\d+)[-/](\d+)[-/](\d+)\s+(\d+):(\d+):(\d+).*?;\s+author:\s+(.+);\s+state:\s+(\S+);(\s+lines:\s+\+(\d+)\s\-(\d+))?|", $line, $parts)) { $this->_date = gmmktime($parts[4], $parts[5], $parts[6], $parts[2], $parts[3], $parts[1]); $this->_author = $parts[7]; $this->_state = $parts[8]; - $this->_lines = isset($parts[10]) ? $parts[10] : ''; + if (isset($parts[9])) { + $this->_lines = '+' . $parts[10] . ' -' . $parts[11]; + $this->_files[$this->_file->queryModulePath()] = array( + 'added' => $parts[10], + 'deleted' => $parts[11] + ); + } $state = 'branches'; } break; @@ -92,4 +98,4 @@ class Horde_Vcs_Log_Cvs extends Horde_Vcs_Log { $this->_branch = array($branch); } -} \ No newline at end of file +} -- 2.11.0