--- cdn/www/sources.html 2003/02/20 17:47:40 1.12 +++ 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,16 +142,86 @@ 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' ?
+
+ if ( ereg("((Added|Modified|Removed):)", $checkins) || ereg("[[:space:]]{9}", $checkins) )
+ {
+
+ $identifier = trim(substr($checkins, 0, 15)); // echo $identifier . '';
+
+ $checkins = substr($checkins, 15); // echo $checkins . '';
+
+ // 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);
+
+ unset($checkins);
+
+ for($z=0; $z < count($checkinsA); ++$z)
+ {
+ $checkinsA[$z] = trim($checkinsA[$z]);
+ }
+
+ if ( !empty($identifier) )
+ $checkins = $identifier;
+
+ if ( !empty($_path))
+ {
+ $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // reset important !
+ $webcvs .= '/' . $_path;
+ $_path_ = $_path;
+ $checkins .= ' ' . $_path . '';
+ }
+
+ for($y=0; $y < count($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;
- // ' Added: www/img background.png'
- // ' Modified: www cdn.css'
- // ' Removed: www/protected sources.html'
+ }
- $checkins =
+ }
$result[$r] .= ' ' . $checkins .
- " \n";
+ "\n"; // what
}
$result[$r] .= " |