--- cdn/www/sources.html 2003/02/20 21:17:29 1.29 +++ cdn/www/sources.html 2003/02/22 12:01:08 1.97 @@ -15,29 +15,38 @@ cvs -d :pserver:guest@mozdev.org:/cvs co - + ' . $local_conf_commits_msg . "\n"; //BEGIN BLOCK - if(file_exists(COMMIT_PATH.$commit_log) && $local_conf_commits) { + // + if(file_exists(COMMIT_PATH.$commit_log) && $local_conf_commits) { + // if(file_exists('/tmp/commit_test') && $local_conf_commits) { $size = filesize(COMMIT_PATH.$commit_log); + // $size = filesize('/tmp/commit_test'); $contents = array(); if ($size > MAX_READ_SIZE) { // print "\n"; @@ -54,13 +63,22 @@ cvs -d :pserver:guest@mozdev.org:/cvs co $tok = strtok("\n"); } fclose($fp); - } // echo '
' . $contents[0] . ''; + } + if (!$contents) + { + // $contents = file(COMMIT_PATH.$commit_log); + // $contents = file('/tmp/commit_test'); // echo 'boing '; echo $contents; + } + + // preprocess Tag: stuff + + // /preprocess Tag: stuff + $len=count($contents); $r = -1; - // echo '
' . $contents[0] . ''; $_project = $project; @@ -70,6 +88,8 @@ cvs -d :pserver:guest@mozdev.org:/cvs co } print '
' . "\n" . - "" . htmlspecialchars($contents[$i-1]) . "\n" . + "" . $_timestamp . htmlspecialchars($contents[$i-1]) . "\n" . // who " |
' . "\n" . htmlspecialchars($contents[$i]) . - "\n | ' . "\n"; + + $_time = htmlspecialchars($contents[$i]); + + $result[$r] .= '' . $_time . ''; // when + + $result[$r] .= "\n | \n" . '
' . "\n";
+ $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // . '/';
+
for($l=$i+1;$l<$len;$l++) {
if(ereg(" Revision Changes Path", $contents[$l]))
break;
@@ -96,20 +137,28 @@ cvs -d :pserver:guest@mozdev.org:/cvs co
break;
$checkins = eregi_replace("((https|http|mailto|ftp):\/\/[^[:space:]<>]{1,})",
- "\\1", htmlspecialchars($contents[$l]));
+ "\\1", htmlspecialchars($contents[$l]));
// ' Added: www/img background.png'
// ' Modified: www cdn.css'
// ' Removed: www/protected sources.html'
// ' www/compact index.html' ?
- $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // . '/';
-
- if ( ereg("((Added|Modified|Removed):)", $checkins) || eregi("[^[:space:]<>]+/+[^[:space:]<>]", $checkins) )
+ if ( ereg("((Added|Modified|Removed):)", $checkins) || ereg("^[[:space:]]{9}", $checkins) )
{
- $checkins = trim($checkins);
- $checkins = ereg_replace('[[:space:]]{1,}', ' ', $checkins);
+ $identifier = trim(substr($checkins, 0, 15)); // may change to group
+
+ $checkins = substr($checkins, 15);
+
+ // find first non-space character
+ // if > 16, chances are the files are in the directory defined in the previous line ?
+
+ $_16 = strpos($checkins, ' ');
+
+ $_path = substr( $checkins, 0, $_16);
+
+ $checkins = ereg_replace('[[:space:]]{1,}', ' ', trim( substr ( $checkins, $_16 ) ) );
$checkinsA = explode(' ', $checkins);
@@ -120,36 +169,67 @@ cvs -d :pserver:guest@mozdev.org:/cvs co
$checkinsA[$z] = trim($checkinsA[$z]);
}
- $checkins = $checkinsA[0];
-
- $chkA1 = $checkinsA[1];
+ if ( !empty($identifier) )
+ $checkins = $identifier;
- if(eregi("[a-z0-9_-\./]{1,}", $checkinsA[0]))
+ if ( !empty($_path))
{
- $checkins = '' . $checkinsA[0] . '';
- $chkA1 = $checkinsA[0];
+ $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // reset important !
+ $webcvs .= '/' . $_path;
+ $_path_ = $_path;
+ $checkins .= ' ' . $_path . '';
}
- $webcvs .= '/' . $chkA1;
-
- $checkins .= ' ' . $chkA1 . '';
-
- // reset($checkinsA);
for($y=0; $y < count($checkinsA); ++$y)
{
- // how can $webcvs not have $chkA1 as part of it ?
- if($y >= 2)
+ if (ereg('Tag:', $checkinsA[$y]) || ereg('Tag:', $checkinsA[$y-1]) || $_tag)
+ {
+ $TAG = true;
+ }
+ else
+ {
+ $TAG = false;
+ }
+
+ if(!$TAG)
{
- $checkins .= ' ';
- $checkins .= $checkinsA[$y] . '';
+ $checkins .= ' ';
}
+ else
+ {
+ $checkins .= ' ';
+ }
+
+ $checkins .= $checkinsA[$y];
+
+ if ( ereg("Tag\:$", trim($checkinsA[$y])) && empty($checkinsA[$y+1])) {
+ $_tag = true;
+ }
+ else {
+ $_tag = false;
+ }
+
+ if(!$TAG): $checkins .= ''; endif;
+
+ }
+
+ if ( $identifier == 'Removed:' ) {
+ $idRemoved = true;
}
+ else {
+ $idRemoved = false;
+ }
+
}
$result[$r] .= ' ' . $checkins .
- " \n";
+ "\n"; // what
}
$result[$r] .= " |