Changeset 3967 for trunk/tools/database/www/cvs.php3
- Timestamp:
- Aug 7, 2000, 3:07:59 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/www/cvs.php3
r3966 r3967 539 539 $sRev = $this->aasKeys["head"][0]; 540 540 $asText = $this->aasDeltas[$sRev]; 541 $sBranch = substr($sRevision, 0, strrpos($sRevision, ".")+1);542 //echo "<!-- \$sBranch=$sBranch -->";543 541 do 544 542 { … … 547 545 * (hope this works ok...) 548 546 */ 549 reset($this->aaasRevs[$sRev]["branches"]); 550 while (list($sIgnore, $sB) = each($this->aaasRevs[$sRev]["branches"])) 547 $sPrevRev = $sRev; 548 $asBranches = $this->aaasRevs[$sRev]["branches"]; 549 for ($f = 0, $i = 0; $i < sizeof($asBranches); $i++) 551 550 { 552 $sB = trim($sB); 553 if ($f = (substr($sB, 0, strrpos($sB, ".")+1) == $sBranch)) 551 if (($sB = trim($asBranches[$i])) != "") 554 552 { 555 $sRev = $sB; 556 break; 553 $sB2 = substr($sB, 0, strrpos($sB, ".") + 1); 554 if ($f = ($sB2 == substr($sRevision, 0, strlen($sB2)))) 555 { 556 $sRev = $sB; 557 break; 558 } 557 559 } 558 560 } 561 559 562 if (!$f) $sRev = $this->aaasRevs[$sRev]["next"][0]; 560 //echo "<!-- \$sRev=$sRev -->";563 echo "<!-- \$sRev=$sRev -->"; 561 564 562 565 … … 582 585 //apply it 583 586 $c = (int)substr($this->aasDeltas[$sRev][$iDelta], 584 strpos($this->aasDeltas[$sRev][$iDelta], " ") + 1); 585 $iDelta++; 587 (int)strpos($this->aasDeltas[$sRev][$iDelta], " ") + 1); 586 588 if ($this->aasDeltas[$sRev][$iDelta][0] == 'a') 587 589 { 590 $iDelta++; 588 591 while ($iDelta < $cDelta && $c-- > 0) 589 592 $asText[$iText++] = $this->aasDeltas[$sRev][$iDelta++]; … … 593 596 } 594 597 else 598 { 599 $iDelta++; 595 600 $iOrg += $c; 601 } 596 602 } 597 603 … … 725 731 function getBranch($sRev) 726 732 { 727 if (strpos(strpos($sRev, "."), ".") <= 0) 733 $aiDots = array(); 734 735 for ($i = strlen($sRev) - 1; $i >= 0; $i--) 736 if ($sRev[$i] == ".") 737 $aiDots[] = $i; 738 739 if (sizeof($aiDots) == 1) 728 740 return "MAIN"; 729 return "<i>not implemented</i>"; //TODO FIXME 741 742 $sBranch = substr($sRev, 0, $aiDots[1]).".0"; 743 $cchBranch = strlen($sBranch); 744 reset($this->aasKeys["symbols"]); 745 while (list($sTag, $sTagRev) = each($this->aasKeys["symbols"])) 746 { 747 $j = strrpos($sTagRev, "."); 748 //echo "<!-- $j $cchBranch ($sBranch, ".substr($sTagRev, 0, $j).")-->"; 749 if ($cchBranch == $j && $sBranch == substr($sTagRev, 0, $j)) 750 return $sTag; 751 } 752 753 return ""; 730 754 } 731 755 … … 811 835 echo "<table>\n"; 812 836 //do we have to sort the array first? no... 813 while (list($sRevision, $aasRev) = each($this->aaasRevs)) 837 $i = 0; //max is 256!!! (ChangeLog,v is _very_ big). 838 while ($i++ < 256 && list($sRevision, $aasRev) = each($this->aaasRevs)) 814 839 { 815 840 echo "<tr><td bgcolor=#d0dce0>Rev. <a href=\"cvs.php?sFile=$this->sDir/$this->sName,v&sRevision=$sRevision\"", … … 858 883 859 884 echo "</table>\n"; 885 return 1; 860 886 } 861 887 }
Note:
See TracChangeset
for help on using the changeset viewer.