--- cdn/www/sources.html 2003/02/20 21:52:12 1.31 +++ cdn/www/sources.html 2003/02/21 16:40:39 1.65 @@ -15,29 +15,35 @@ 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('/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 +60,29 @@ 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 '
'; +/* + for($i=0; $i < count($contents); ++$i) + { + echo htmlspecialchars($contents[$i]); + } +*/ + + echo htmlspecialchars($contents[count($contents)]); + + echo ''; + $len=count($contents); $r = -1; - // echo '
' . $contents[0] . ''; $_project = $project; @@ -69,7 +91,9 @@ cvs -d :pserver:guest@mozdev.org:/cvs co $_project = PROJECT; } - 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,22 +142,36 @@ 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) || ereg("[[:space:]]{9}", $checkins) )
{
- // $checkins = trim($checkins);
- $identifier = trim(substr($checkins, 0, 14));
+ $identifier = trim(substr($checkins, 0, 15)); // echo $identifier . '';
+
+ $checkins = substr($checkins, 15); // echo $checkins . '';
- $checkins = ereg_replace('[[:space:]]{1,}', ' ', substr($checkins, 14) );
+ // find first non-space character
+ // if > 16, chances are the files are in the directory defined in the previous line ?
+
+ $_16 = strpos($checkins, ' '); // echo '$_16 ' . $_16 . '';
+
+ $_path = substr( $checkins, 0, $_16); // echo $_path . '';
+
+ // if ( $_16 > 16 ) // not going to happen frequently : )
+ $checkins = ereg_replace('[[:space:]]{1,}', ' ', trim( substr ( $checkins, $_16 ) ) );
+
+ $__path = trim($_path);
+
+ if ( !empty( $__path ) )
+ {
+ $chkA1 = $_path;
+ }
$checkinsA = explode(' ', $checkins);
@@ -122,28 +182,46 @@ cvs -d :pserver:guest@mozdev.org:/cvs co
$checkinsA[$z] = trim($checkinsA[$z]);
}
- $checkins = $identifier;
-
- $chkA1 = $checkinsA[0];
+ if ( !empty($identifier) )
+ $checkins = $identifier;
- $webcvs .= '/' . $chkA1;
-
- if(!empty($chkA1))
+ if ( !empty($_path))
{
+ $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // reset important !
+ $webcvs .= '/' . $_path;
+ $_path_ = $_path;
$checkins .= ' ' . $chkA1 . '';
+ $checkins .= '">' . $_path . '';
}
- // reset($checkinsA);
- for($y=1; $y < count($checkinsA); ++$y)
+ for($y=0; $y < count($checkinsA); ++$y)
{
- $checkins .= ' ';
- $checkins .= $checkinsA[$y] . '';
+
+ if( !isset($_tagged))
+ {
+ $_tagged = ereg('Tag:', $checkinsA[$y]);
+ $_tagtracker = 1;
+ }
+
+ if(!($_tagged && $_tagtracker <= 2))
+ {
+ $checkins .= ' ';
+ }
+ else
+ {
+ $checkins .= ' '; ++$_tagtracker;
+ }
+
+ $checkins .= $checkinsA[$y];
+
+ if(!($_tagged && $_tagtracker <= 2)): $checkins .= ''; endif;
+
}
+
}
$result[$r] .= ' ' . $checkins .
- " \n";
+ "\n"; // what
}
$result[$r] .= " |