From 34bbc8751411ff2d1480baaa1452ef420dca3861 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 24 Aug 2010 16:47:14 +0200 Subject: [PATCH] Provide status in patchsets, don't parse trailing empty line. --- framework/Vcs/lib/Horde/Vcs/Svn.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/Vcs/lib/Horde/Vcs/Svn.php b/framework/Vcs/lib/Horde/Vcs/Svn.php index e7e123a65..5417bab63 100644 --- a/framework/Vcs/lib/Horde/Vcs/Svn.php +++ b/framework/Vcs/lib/Horde/Vcs/Svn.php @@ -362,8 +362,8 @@ class Horde_Vcs_Log_Svn extends Horde_Vcs_Log $line = fgets($fl->logpipe); - if (feof($fl->logpipe)) { - return; + if (feof($fl->logpipe) || !$line) { + throw new Horde_Vcs_Exception('No more data'); } if (preg_match('/^r([0-9]*) \| (.*?) \| (.*) \(.*\) \| ([0-9]*) lines?$/', $line, $matches)) { @@ -433,11 +433,14 @@ class Horde_Vcs_Patchset_Svn extends Horde_Vcs_Patchset $action = substr($file, 0, 1); $file = preg_replace('/.*?\s(.*?)(\s|$).*/', '\\1', $file); $to = $rev; + $status = self::MODIFIED; if ($action == 'A') { - $from = 'INITIAL'; + $from = null; + $status = self::ADDED; } elseif ($action == 'D') { $from = $to; - $to = '(DEAD)'; + $to = null; + $status = self::DELETED; } else { // This technically isn't the previous revision, // but it works for diffing purposes. @@ -446,7 +449,8 @@ class Horde_Vcs_Patchset_Svn extends Horde_Vcs_Patchset $this->_patchsets[$rev]['members'][] = array('file' => $file, 'from' => $from, - 'to' => $to); + 'to' => $to, + 'status' => $status); } } -- 2.11.0