Changeset 3966 for trunk/tools/database/www/cvs.php3
- Timestamp:
- Aug 7, 2000, 12:40:40 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/www/cvs.php3
r3965 r3966 299 299 { 300 300 if ($iColon = strpos($sVal, ":")) 301 $asValue[substr($sVal, 0, $iColon -1)] = substr($sVal, $iColon+1);301 $asValue[substr($sVal, 0, $iColon)] = substr($sVal, $iColon+1); 302 302 else 303 303 echo "\n<!-- error in symbols parsing -->\n"; … … 406 406 * Prints the contents of the file to stdout. 407 407 * 408 * Color coding is enabled. (TODO)408 * Color coding is enabled. 409 409 * 410 410 * Currently only $sRevision == head revision is supported … … 420 420 { 421 421 $this->sError = "CVSFile::PrintRevision is called with an invalid revision number. ($sRevision)"; 422 return 0;423 }424 /* to-be-removed - TODO - FIXME */425 if ($sRevision != $this->aasKeys["head"][0])426 {427 $this->sError = "CVSFile::PrintRevision is called with an invalid revision number (not head).";428 422 return 0; 429 423 } … … 511 505 */ 512 506 $Timer = Odin32DBTimerStart("Write timer"); 513 echo "<tr><td bgcolor=#020286><pre><font size=-0 face=\"System VIO, System Monospaced\" color=#02FEFE>\n"; 514 515 for ($cLines = sizeof($this->aasDeltas[$sRevision]), $iLine = 0; 516 ($iLine < $cLines); 517 $iLine++) 518 { 507 echo "<tr><td bgcolor=#020286><pre><font size=-0 face=\"System VIO, System Monospaced\" color=#02FEFE>"; 508 if ($sRevision == $this->aasKeys["head"][0]) 509 { 510 //head revision 511 for ($cLines = sizeof($this->aasDeltas[$sRevision]), $iLine = 0; 512 ($iLine < $cLines); 513 $iLine++) 514 { 515 /* 516 * Preprocessing... Color coding 517 */ 518 echo "<a name=$iLine>"; 519 switch ($iColorEncoder) 520 { 521 case 1: 522 echo str_replace("\t", " ", C_ColorEncode(htmlspecialchars($this->aasDeltas[$sRevision][$iLine]), $aVariables)); 523 break; 524 case 2: 525 echo str_replace("\t", " ", ASM_ColorEncode(htmlspecialchars($this->aasDeltas[$sRevision][$iLine]), $aVariables)); 526 break; 527 case 3: 528 echo str_replace("\t", " ", Make_ColorEncode(htmlspecialchars($this->aasDeltas[$sRevision][$iLine]), $aVariables)); 529 break; 530 default: 531 echo str_replace("\t", " ", htmlspecialchars($this->aasDeltas[$sRevision][$iLine])); 532 } 533 echo "</a>"; 534 } 535 } 536 else 537 { 538 //build revision 539 $sRev = $this->aasKeys["head"][0]; 540 $asText = $this->aasDeltas[$sRev]; 541 $sBranch = substr($sRevision, 0, strrpos($sRevision, ".")+1); 542 //echo "<!-- \$sBranch=$sBranch -->"; 543 do 544 { 545 /* 546 * determin revision. 547 * (hope this works ok...) 548 */ 549 reset($this->aaasRevs[$sRev]["branches"]); 550 while (list($sIgnore, $sB) = each($this->aaasRevs[$sRev]["branches"])) 551 { 552 $sB = trim($sB); 553 if ($f = (substr($sB, 0, strrpos($sB, ".")+1) == $sBranch)) 554 { 555 $sRev = $sB; 556 break; 557 } 558 } 559 if (!$f) $sRev = $this->aaasRevs[$sRev]["next"][0]; 560 //echo "<!-- \$sRev=$sRev -->"; 561 562 563 /* 564 * Apply the delta. 565 */ 566 $asOrg = $asText; 567 $asText = array(); 568 $iOrg = 0; 569 $cOrg = sizeof($asOrg); 570 $iDelta = 0; 571 $cDelta = sizeof($this->aasDeltas[$sRev]); 572 $iText = 0; 573 while ($cDelta > $iDelta) 574 { 575 //get the next diff chunk 576 $iDiff = (int)substr($this->aasDeltas[$sRev][$iDelta], 1, strpos($this->aasDeltas[$sRev], " ") - 1) - 1; 577 578 //skip to it 579 while ($iDiff > $iOrg && $iOrg < $cOrg) 580 $asText[$iText++] = $asOrg[$iOrg++]; 581 582 //apply it 583 $c = (int)substr($this->aasDeltas[$sRev][$iDelta], 584 strpos($this->aasDeltas[$sRev][$iDelta], " ") + 1); 585 $iDelta++; 586 if ($this->aasDeltas[$sRev][$iDelta][0] == 'a') 587 { 588 while ($iDelta < $cDelta && $c-- > 0) 589 $asText[$iText++] = $this->aasDeltas[$sRev][$iDelta++]; 590 591 while ($c-- > 0) 592 $asText[$iText++] = ""; 593 } 594 else 595 $iOrg += $c; 596 } 597 598 //copy remaining 599 while ($iOrg < $cOrg) 600 $asText[$iText++] = $asOrg[$iOrg++]; 601 602 } while ($sRev != "" && $sRev != $sRevision); 603 519 604 /* 520 * Pr eprocessing... Color coding605 * Print it 521 606 */ 522 echo "<a name=$iLine>"; 523 switch ($iColorEncoder) 607 for ($cLines = sizeof($asText), $iLine = 0; $iLine < $cLines; $iLine++) 524 608 { 525 case 1: 526 echo str_replace("\t", " ", C_ColorEncode(htmlspecialchars($this->aasDeltas[$sRevision][$iLine]), $aVariables)); 527 break; 528 case 2: 529 echo str_replace("\t", " ", ASM_ColorEncode(htmlspecialchars($this->aasDeltas[$sRevision][$iLine]), $aVariables)); 530 break; 531 case 3: 532 echo str_replace("\t", " ", Make_ColorEncode(htmlspecialchars($this->aasDeltas[$sRevision][$iLine]), $aVariables)); 533 break; 534 default: 535 echo str_replace("\t", " ", htmlspecialchars($this->aasDeltas[$sRevision][$iLine])); 609 /* 610 * Preprocessing... Color coding 611 */ 612 echo "<a name=$iLine>"; 613 switch ($iColorEncoder) 614 { 615 case 1: 616 echo str_replace("\t", " ", C_ColorEncode(htmlspecialchars($asText[$iLine]), $aVariables)); 617 break; 618 case 2: 619 echo str_replace("\t", " ", ASM_ColorEncode(htmlspecialchars($asText[$iLine]), $aVariables)); 620 break; 621 case 3: 622 echo str_replace("\t", " ", Make_ColorEncode(htmlspecialchars($asText[$iLine]), $aVariables)); 623 break; 624 default: 625 echo str_replace("\t", " ", htmlspecialchars($asText[$iLine])); 626 } 627 echo "</a>"; 536 628 } 537 echo "</a>"; 538 } 539 629 } 540 630 echo " \n", //80-columns line 541 631 "</pre></td></tr></table>\n";
Note:
See TracChangeset
for help on using the changeset viewer.