--- cdn/www/sources.html 2003/02/21 14:33:59 1.56 +++ cdn/www/sources.html 2003/02/22 15:10:23 1.100 @@ -15,11 +15,11 @@ 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) { + // + 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'); @@ -62,126 +64,123 @@ cvs -d :pserver:guest@mozdev.org:/cvs co fclose($fp); } - if (!$contents) - { + if (!$contents) { + // $contents = file(COMMIT_PATH.$commit_log); - // $contents = file('/tmp/commit_test'); + // $contents = file('/tmp/commit_test'); // echo 'boing '; echo $contents; } - echo '
';
+    // preprocess Tag: stuff
     
-    for($i=0; $i < count($contents); ++$i)
-    {
-      echo htmlspecialchars($contents[$i]);
-    }
+    // /preprocess Tag: stuff
     
-    echo '
'; - $len=count($contents); $r = -1; $_project = $project; - if ( !isset($doNotCapitalise) ) - { + if ( !isset($doNotCapitalise) ) { $_project = PROJECT; } - // print '

' . "Today's CVS Commits for " . $_project . " Project

\n"; + print '

' . "Today's CVS Commits for " . $_project . " Project

\n"; // print '

' . "Yesterday's CVS Commits for " . $_project . " Project

\n"; - print '

' . "Some day's CVS Commits for " . $_project . " Project

\n"; + // print '

' . "Some day's CVS Commits for " . $_project . " Project

\n"; print '' . "\n"; if($len) { for($i=0;$i<$len;$i++) { - if(ereg("Modified: www", $contents[$l]) && !$local_conf_commits) + if(ereg("Modified: www", $contents[$l]) && !$local_conf_commits) { break; + } // if(ereg(" Date: [0-9]{2}/[0-9]{2}/[0-9]{2}", $contents[$i])) { // if(ereg(" Date: $yesterday", $contents[$i])) { if(ereg(" Date: $today", $contents[$i])) { $r++; - + $yy = substr(YEAR, 0, 2); $_timestamp = str_replace('Date: ', '', ltrim($contents[$i])); $_timestamp = str_replace("\n", '', $_timestamp); - $_timestamp = str_replace(':', '.', $_timestamp); - $_ts_link = '#' . $yy . ereg_replace('[\ \/]', '_', $_timestamp); + $_ts_link = $yy . ereg_replace('[\ \/]', '_', $_timestamp); $_timestamp = ''; - $result[$r] = - '\n" . '' . '\n" . '\n";
' . "\n" . - "" . $_timestamp . htmlspecialchars($contents[$i-1]) . "\n" . // who + $result[$r] = '
' . "\n"; + +// who + $result[$r] .= "" . $_timestamp . htmlspecialchars($contents[$i-1]) . "\n" . // who "
' . "\n"; $_time = htmlspecialchars($contents[$i]); - $result[$r] .= '' . $_time . ''; // when +// when + $result[$r] .= '' . $_time . ''; // when $result[$r] .= "\n
' . "\n"; - $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // . '/'; + $webcvs = 'http://www.mozdev.org/source/browse/' . $project; for($l=$i+1;$l<$len;$l++) { - if(ereg(" Revision Changes Path", $contents[$l])) + if(ereg(" Revision Changes Path", $contents[$l])) { break; + } - if(ereg(" User:", $contents[$l])) + if(ereg(" User:", $contents[$l])) { 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' ? + // ' www/compact index.html' + // ' mozpos/downloads - New directory' - if ( ereg("((Added|Modified|Removed):)", $checkins) || ereg("[[:space:]]{9}", $checkins) ) - { + if ( ereg("((Added|Modified|Removed):)", $checkins) || ereg("^[[:space:]]{9}", $checkins) || + strstr($checkins, "New directory") + ) { - $identifier = trim(substr($checkins, 0, 15)); // echo $identifier . '

'; + if ( !strstr($checkins, "New directory") ) { + $identifier = trim(substr($checkins, 0, 15)); // may change to   group - $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 ? + $checkins = substr($checkins, 15); + } + else { + $checkins = str_replace('- New directory', '-_New_directory', $checkins); - $_16 = strpos($checkins, ' '); // echo '$_16 ' . $_16 . '

'; + $webcvs = 'http://www.mozdev.org/source/browse'; - $_path = substr( $checkins, 0, $_16); // echo $_path . '

'; + unset($identifier); + } - // if ( $_16 > 16 ) // not going to happen frequently : ) - $checkins = ereg_replace('[[:space:]]{1,}', ' ', trim( substr ( $checkins, $_16 ) ) ); + $_16 = strpos($checkins, ' '); - $__path = trim($_path); + $_path = substr( $checkins, 0, $_16); - if ( !empty( $__path ) ) - { - $chkA1 = $_path; - } + $checkins = ereg_replace('[[:space:]]{1,}', ' ', trim( substr ( $checkins, $_16 ) ) ); $checkinsA = explode(' ', $checkins); unset($checkins); - for($z=0; $z < count($checkinsA); ++$z) - { + for($z=0; $z < count($checkinsA); ++$z) { $checkinsA[$z] = trim($checkinsA[$z]); } - if ( !empty($identifier) ) + if ( !empty($identifier) ) { $checkins = $identifier; + } - if ( !empty($_path)) - { + if ( !empty($_path)) { $webcvs = 'http://www.mozdev.org/source/browse/' . $project; // reset important ! $webcvs .= '/' . $_path; $_path_ = $_path; @@ -189,28 +188,58 @@ cvs -d :pserver:guest@mozdev.org:/cvs co $checkins .= '">' . $_path . ''; } - for($y=0; $y < count($checkinsA); ++$y) - { + for($y=0; $y < count($checkinsA); ++$y) { - if(!$checkinsA[$y] == 'Tag:') // && !$checkinsA[$y-1] == 'Tag:') - { - $checkins .= ' '; + if (ereg('Tag:', $checkinsA[$y]) || ereg('Tag:', $checkinsA[$y-1]) || $_tag || + strstr($checkinsA[$y], '-_New_directory') + ) { + $TAG = true; + } + else { + $TAG = false; } - else - { + + if(!$TAG) { + $checkins .= ' '; + } + else { $checkins .= ' '; } + $checkinsA[$y] = str_replace('-_New_directory', '- New directory', $checkinsA[$y]); + $checkins .= $checkinsA[$y]; - if(!$checkinsA[$y] == 'Tag:'): $checkins .= ''; endif; + if ( ereg("Tag\:$", trim($checkinsA[$y])) && empty($checkinsA[$y+1])) { + $_tag = true; + } + else { + $_tag = false; + } + + if(!$TAG) { + $checkins .= ''; + } + + } + if ( $identifier == 'Removed:' ) { + $idRemoved = true; + } + else { + $idRemoved = false; } } - $result[$r] .= '

' . $checkins . - "
\n"; // what +// what + $result[$r] .= '
' . $checkins . "
\n"; // what } $result[$r] .= "