Logs now have changed files
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 28 Aug 2005 21:44:27 +0000 (21:44 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 28 Aug 2005 21:44:27 +0000 (21:44 +0000)
includes/svnlib.php
log.php

index eae18d9b9ac590c319d54d1bab409ccca73bbfd7..6cf296a87322836a63f2d415ae8ee1d8aa1e8a10 100644 (file)
@@ -246,7 +246,7 @@ class SVNLib
                
                $repospath = $viewsvn->repos->fetch_path($repos, false);
                
-               return $this->svn('log -r' . $hirev . ':' . $lorev . ' ' . $repospath . $path);
+               return $this->svn('log -v -r' . $hirev . ':' . $lorev . ' ' . $repospath . $path);
        }
        
        /**
@@ -632,9 +632,19 @@ class SVNLog
                                
                                $lastrev = $matches[1];
                        }
+                       else if (preg_match('#^\s+([ADM])\s(.*)#', $line, $matches))
+                       {
+                               $this->logs["$lastrev"]['files'][] = array(
+                                       'action'        => $matches[1],
+                                       'file'          => $matches[2]
+                               );
+                       }
                        else
                        {
-                               $this->logs["$lastrev"]['message'] .= $line . "\n";
+                               if (trim($line) != 'Changed paths:')
+                               {
+                                       $this->logs["$lastrev"]['message'] .= $line . "\n";
+                               }
                        }
                }
                
diff --git a/log.php b/log.php
index 8c81f91d3e62f80f84429c86f9a13c44cda51e95..21665f78428546372f66e06a2f007901cf54e247 100644 (file)
--- a/log.php
+++ b/log.php
@@ -36,7 +36,25 @@ foreach ($logs->fetch() AS $log)
        echo "\n";
        foreach ($log AS $key => $val)
        {
-               echo '<li>' . $key . ': ' . nl2br(htmlspecialchars($val)) . '</li>';
+               if ($key == 'files')
+               {
+                       echo "\n";
+                       echo '<li>files:</li>';
+                       echo "\n";
+                       echo '<ul>';
+                       echo "\n";
+                       foreach ($val AS $file)
+                       {
+                               echo '<li>' . $file['action'] . ' : ' . $file['file'] . '</li>';
+                               echo "\n";
+                       }
+                       echo '</ul>';
+                       echo "\n";
+               }
+               else
+               {
+                       echo '<li>' . $key . ': ' . nl2br(htmlspecialchars($val)) . '</li>';
+               }
                echo "\n";
        }
        echo '</ul>';