version 1.50, 2003/02/21 13:56:30
|
version 1.102, 2003/02/22 22:18:36
|
Line 15 cvs -d :pserver:guest@mozdev.org:/cvs co
|
Line 15 cvs -d :pserver:guest@mozdev.org:/cvs co
|
</pre> |
</pre> |
|
|
</li> |
</li> |
</ul><?php $doNotCapitalise = 1; $project='orbits'; // testing ?> | </ul><?php $doNotCapitalise = 1; // $project='orbits'; // testing ?> |
|
|
<?php |
<?php |
|
|
Line 29 cvs -d :pserver:guest@mozdev.org:/cvs co
|
Line 29 cvs -d :pserver:guest@mozdev.org:/cvs co
|
|
|
$today = date("y/m/d"); |
$today = date("y/m/d"); |
$day = (int)date('d'); |
$day = (int)date('d'); |
--$day; | --$day; // --$day; |
$yesterday = date("y/m/" . sprintf('%2u', $day)); |
$yesterday = date("y/m/" . sprintf('%2u', $day)); |
$commit_log = "cvs@$project.mozdev.org"; |
$commit_log = "cvs@$project.mozdev.org"; |
|
|
$today = '03/02/14'; | function cvs_parse ($contents, $day, $len) { |
|
|
if(!$local_conf_commits) | $r = -1; |
print '<span id="CVS-local-conf-commits">' . $local_conf_commits_msg . "</span>\n"; | |
|
|
//BEGIN BLOCK | // if(ereg(" Date: [0-9]{2}/[0-9]{2}/[0-9]{2}", $contents[$i])) { |
if(file_exists(COMMIT_PATH.$commit_log) && $local_conf_commits) { | // if(ereg(" Date: $yesterday", $contents[$i])) { |
// if(file_exists('/tmp/commit_test') && $local_conf_commits) { | // if(ereg(" Date: $today", $contents[$i])) { |
|
|
$size = filesize(COMMIT_PATH.$commit_log); | if(ereg(" Date: $day", $contents)) { |
// $size = filesize('/tmp/commit_test'); | $r++; |
$contents = array(); | |
if ($size > MAX_READ_SIZE) { | |
// print "<!-- Log File is greater than 500K -->\n"; | |
|
|
$fp = fopen (COMMIT_PATH.$commit_log, "r"); | $yy = substr(YEAR, 0, 2); |
fseek($fp, $size - MAX_READ); | |
if ($contents) { | |
print "$contents\n"; | |
exit; | |
} | |
$tok = strtok(fread($fp, MAX_READ),"\n"); | |
while ($tok) { | |
array_push($contents, $tok); | |
$tok = strtok("\n"); | |
} | |
fclose($fp); | |
} | |
| |
if (!$contents) | |
{ | |
$contents = file(COMMIT_PATH.$commit_log); | |
// $contents = file('/tmp/commit_test'); | |
} | |
|
|
echo '<pre>' . $contents . '</pre>'; | $_timestamp = str_replace('Date: ', '', ltrim($contents[$i])); |
| $_timestamp = str_replace("\n", '', $_timestamp); |
$len=count($contents); | |
$r = -1; | |
| |
| |
$_project = $project; | |
| |
if ( !isset($doNotCapitalise) ) | |
{ | |
$_project = PROJECT; | |
} | |
| |
// print '<h4 id="CVS-h4">' . "Today's CVS Commits for " . $_project . " Project</h4>\n"; | |
// print '<h4 id="CVS-h4">' . "Yesterday's CVS Commits for " . $_project . " Project</h4>\n"; | |
print '<h4 id="CVS-h4">' . "Some day's CVS Commits for " . $_project . " Project</h4>\n"; | |
print '<table border="0" cellpadding="0" cellspacing="2" id="CVS-table">' . "\n"; | |
|
|
if($len) { | $_ts_link = $yy . ereg_replace('[\ \/]', '_', $_timestamp); |
for($i=0;$i<$len;$i++) { | |
if(ereg("Modified: www", $contents[$l]) && !$local_conf_commits) | |
break; | |
|
|
// if(ereg(" Date: [0-9]{2}/[0-9]{2}/[0-9]{2}", $contents[$i])) { | $_timestamp = '<a name="' . $_ts_link . '">'; |
// if(ereg(" Date: $yesterday", $contents[$i])) { | |
if(ereg(" Date: $today", $contents[$i])) { | $result[$r] = '<tr class="CVS-tr-header" valign="top"><td class="CVS-td-900">' . "\n"; |
$r++; | |
$result[$r] = | // who |
'<tr class="CVS-tr-header" valign="top"><td class="CVS-td-900">' . "\n" . | $result[$r] .= "<strong>" . $_timestamp . htmlspecialchars($contents[$i-1]) . "</a></strong>\n" . // who |
"<strong>" . htmlspecialchars($contents[$i-1]) . "</strong>\n" . | |
"</td></tr>\n" . |
"</td></tr>\n" . |
'<tr class="CVS-tr-date">' . |
'<tr class="CVS-tr-date">' . |
'<td class="CVS-td-f90">' . "\n" . htmlspecialchars($contents[$i]) . | '<td class="CVS-td-f90">' . "\n"; |
"\n</td></tr>\n" . | |
| $_time = htmlspecialchars($contents[$i]); |
| |
| // when |
| $result[$r] .= '<a class="CVS-td-f90" href="' . '#' . $_ts_link . '">' . $_time . '</a>'; // when |
| |
| $result[$r] .= "\n</td></tr>\n" . |
'<tr class="CVS-tr-checkins"><td class="CVS-td-checkins">' . "\n"; |
'<tr class="CVS-tr-checkins"><td class="CVS-td-checkins">' . "\n"; |
|
|
$webcvs = 'http://www.mozdev.org/source/browse/' . $project; // . '/'; | $webcvs = 'http://www.mozdev.org/source/browse/' . $project; |
|
|
for($l=$i+1;$l<$len;$l++) { |
for($l=$i+1;$l<$len;$l++) { |
if(ereg(" Revision Changes Path", $contents[$l])) | if(ereg(" Revision Changes Path", $contents[$l])) { |
break; |
break; |
|
} |
|
|
if(ereg(" User:", $contents[$l])) | if(ereg(" User:", $contents[$l])) { |
break; |
break; |
|
} |
|
|
$checkins = eregi_replace("((https|http|mailto|ftp):\/\/[^[:space:]<>]{1,})", |
$checkins = eregi_replace("((https|http|mailto|ftp):\/\/[^[:space:]<>]{1,})", |
"<a href='\\1'>\\1</a>", htmlspecialchars($contents[$l])); | "<a href=\"\\1\">\\1</a>", htmlspecialchars($contents[$l])); |
|
|
// ' Added: www/img background.png' |
// ' Added: www/img background.png' |
// ' Modified: www cdn.css' |
// ' Modified: www cdn.css' |
// ' Removed: www/protected sources.html' |
// ' 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 . '<p />'; | if ( !strstr($checkins, "New directory") ) { |
| $identifier = trim(substr($checkins, 0, 15)); // may change to group |
|
|
$checkins = substr($checkins, 15); // echo $checkins . '<p />'; | $checkins = substr($checkins, 15); |
| } |
// find first non-space character | else { |
// if > 16, chances are the files are in the directory defined in the previous line ? | $checkins = str_replace('- New directory', '-_New_directory', $checkins); |
|
|
$_16 = strpos($checkins, ' '); // echo '$_16 ' . $_16 . '<p />'; | $webcvs = 'http://www.mozdev.org/source/browse'; |
|
|
$_path = substr( $checkins, 0, $_16); // echo $_path . '<p />'; | unset($identifier); |
| } |
|
|
// if ( $_16 > 16 ) // not going to happen frequently : ) | $_16 = strpos($checkins, ' '); |
$checkins = ereg_replace('[[:space:]]{1,}', ' ', trim( substr ( $checkins, $_16 ) ) ); | |
|
|
$__path = trim($_path); | $_path = substr( $checkins, 0, $_16); |
|
|
if ( !empty( $__path ) ) | $checkins = ereg_replace('[[:space:]]{1,}', ' ', trim( substr ( $checkins, $_16 ) ) ); |
{ | |
$chkA1 = $_path; | |
} | |
|
|
$checkinsA = explode(' ', $checkins); |
$checkinsA = explode(' ', $checkins); |
|
|
unset($checkins); |
unset($checkins); |
|
|
for($z=0; $z < count($checkinsA); ++$z) | for($z=0; $z < count($checkinsA); ++$z) { |
{ | |
$checkinsA[$z] = trim($checkinsA[$z]); |
$checkinsA[$z] = trim($checkinsA[$z]); |
} |
} |
|
|
if ( !empty($identifier) ) | if ( !empty($identifier) ) { |
$checkins = $identifier; |
$checkins = $identifier; |
|
} |
|
|
if ( !empty($_path)) | if ( !empty($_path)) { |
{ | |
$webcvs = 'http://www.mozdev.org/source/browse/' . $project; // reset important ! |
$webcvs = 'http://www.mozdev.org/source/browse/' . $project; // reset important ! |
$webcvs .= '/' . $_path; |
$webcvs .= '/' . $_path; |
$_path_ = $_path; |
$_path_ = $_path; |
Line 166 cvs -d :pserver:guest@mozdev.org:/cvs co
|
Line 132 cvs -d :pserver:guest@mozdev.org:/cvs co
|
$checkins .= '">' . $_path . '</a>'; |
$checkins .= '">' . $_path . '</a>'; |
} |
} |
|
|
for($y=0; $y < count($checkinsA); ++$y) | for($y=0; $y < count($checkinsA); ++$y) { |
{ | |
|
|
if(!$checkinsA[$y] == 'Tag:' && !$checkinsA[$y-1] == 'Tag:') | if (ereg('Tag:', $checkinsA[$y]) || ereg('Tag:', $checkinsA[$y-1]) || $_tag || |
{ | strstr($checkinsA[$y], '-_New_directory') |
$checkins .= ' <a href="' . $webcvs . '/' . $checkinsA[$y] . '">'; | ) { |
| $TAG = true; |
| } |
| else { |
| $TAG = false; |
} |
} |
else | |
{ | if(!$TAG) { |
| $checkins .= ' <a href="' . $webcvs . '/'; |
| |
| if( $identifier == 'Removed:' || $idRemoved ) { |
| $checkins .= 'Attic/'; |
| } |
| |
| $checkins .= $checkinsA[$y] . '">'; |
| } |
| else { |
$checkins .= ' '; |
$checkins .= ' '; |
} |
} |
|
|
|
$checkinsA[$y] = str_replace('-_New_directory', '- New directory', $checkinsA[$y]); |
|
|
$checkins .= $checkinsA[$y]; |
$checkins .= $checkinsA[$y]; |
|
|
if(!$checkinsA[$y] == 'Tag:' && !$checkinsA[$y-1] == 'Tag:'): $checkins .= '</a>'; endif; | if ( ereg("Tag\:$", trim($checkinsA[$y])) && empty($checkinsA[$y+1])) { |
| $_tag = true; |
| } |
| else { |
| $_tag = false; |
| } |
| |
| if(!$TAG) { |
| $checkins .= '</a>'; |
| } |
|
|
} |
} |
|
|
|
if ( $identifier == 'Removed:' ) { |
|
$idRemoved = true; |
|
} |
|
else { |
|
$idRemoved = false; |
|
} |
|
|
} |
} |
|
|
$result[$r] .= '<div class="CVS-div-checkins">' . $checkins . | // what |
"</div>\n"; | $result[$r] .= '<div class="CVS-div-checkins">' . $checkins . "</div>\n"; // what |
} |
} |
|
|
$result[$r] .= "</td></tr>\n"; |
$result[$r] .= "</td></tr>\n"; |
} |
} |
|
|
|
return $result; |
|
} |
|
|
|
// $today = '03/02/14'; |
|
|
|
if(!$local_conf_commits) { |
|
print '<span id="CVS-local-conf-commits">' . $local_conf_commits_msg . "</span>\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 "<!-- Log File is greater than 500K -->\n"; |
|
|
|
$fp = fopen (COMMIT_PATH.$commit_log, "r"); |
|
fseek($fp, $size - MAX_READ); |
|
if ($contents) { |
|
print "$contents\n"; |
|
exit; |
|
} |
|
$tok = strtok(fread($fp, MAX_READ),"\n"); |
|
while ($tok) { |
|
array_push($contents, $tok); |
|
$tok = strtok("\n"); |
|
} |
|
fclose($fp); |
|
} |
|
|
|
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); |
|
|
|
$_project = $project; |
|
|
|
if ( !isset($doNotCapitalise) ) { |
|
$_project = PROJECT; |
|
} |
|
|
|
print '<h4 id="CVS-h4">' . "Today's CVS Commits for " . $_project . " Project</h4>\n"; |
|
// print '<h4 id="CVS-h4">' . "Yesterday's CVS Commits for " . $_project . " Project</h4>\n"; |
|
// print '<h4 id="CVS-h4">' . "Some day's CVS Commits for " . $_project . " Project</h4>\n"; |
|
print '<table border="0" cellpadding="0" cellspacing="2" id="CVS-table">' . "\n"; |
|
|
|
if($len) { |
|
for($i=0;$i<$len;$i++) { |
|
if(ereg("Modified: www", $contents[$l]) && !$local_conf_commits) |
|
break; |
|
|
|
//start of parse of commitlog for $today / $yesterday |
|
|
|
$result = cvs_parse($contents, $today, $len); |
|
|
|
// end of parse of commitlog for $today / $yesterday |
|
|
} |
} |
} |
} |
|
|