function populateGrid($row, $col) { global $grid, $branches; /* Figure out the starting revision this function uses */ $rev = $grid[$row][$col]; /* For every branch that is known, try to see if it forks here */ $brkeys = array_keys($branches); /* NOTE: do not optimise to use foreach () or each() here, as that * really screws up the $branches pointer array due to the * recursion, and parallel branches fail - avsm */ for ($a = 0; $a < sizeof($brkeys); $a++) { $brrev = $brkeys[$a]; $brcont = $branches[$brrev]; /* Check to see if current point matches a branch point */ if (!strcmp($rev, VC_Revision::strip($brrev, 1))) { /* If it does, figure out how many rows we have to add */ $numRows = sizeof($brcont); /* Check rows in columns to the right, until one is free */ $insCol = $col + 1; while (true) { /* Look in the current column for a set value */ $inc = false; for ($i = $row; $i <= $row + $numRows; $i++) { if (isset($grid[$i][$insCol])) { $inc = true; } } /* If a set value was found, shift to the right and * try again. Otherwise, break out of the loop */ if ($inc) { if (!isset($grid[$row][$insCol])) { $grid[$row][$insCol] = ':' . $brcont[0]; } $insCol++; } else { break; } } /* Put a fork marker in the top of the branch */ $grid[$row][$insCol] = $brrev; /* Populate the grid with the branch values at this point */ for ($i = 0; $i < $numRows; $i++) { $grid[1 + $i + $row][$insCol] = $brcont[$i]; } /* For each value just set, check for sub-branches, * - but in reverse (VERY IMPORTANT!) */ for ($i = $numRows - 1; $i >= 0; $i--) { populateGrid(1 + $i + $row, $insCol); } } } }
$commitDate = strftime('%c', $lg->date); $readableDate = VC_File::readableTime($lg->date, true); $aid = $lg->queryAuthor(); $author = Chora::showAuthorName($aid, true); if (!empty($lg->tags)) { $commitTags = implode(', ', $lg->tags); } else { $commitTags = ''; } $branchPointsArr = array(); foreach ($lg->querySymbolicBranches() as $symb => $bra) { $branchPointsArr[] = '<a href="' . Chora::url('cvs', $where, array('onb' => $bra)) . '">' . $symb . '</a>'; } /* Calculate the current branch name and revision. */ $branchPoints = implode(' , ', $branchPointsArr); $branchRev = VC_Revision::strip($rev, 1); if (@isset($fl->branches[$branchRev])) { $branchName = $fl->branches[$branchRev]; } else { $branchName = ''; } if ($prevRevision = $fl->queryPreviousRevision($lg->queryRevision())) { $changedLines = $lg->queryChangedLines(); $coloredDiffURL = Chora::url('diff', $where, array('r1' => $prevRevision, 'r2' => $rev, 'ty' => 'h')); $longDiffURL = Chora::url('diff', $where, array('r1' => $prevRevision, 'r2' => $rev, 'ty' => 'h', 'num' => 10)); $uniDiffURL = Chora::url('diff', $where, array('r1' => $prevRevision, 'r2' => $rev, 'ty' => 'u')); $nowsDiffURL = Chora::url('diff', $where, array('ws' => 0, 'r1' => $prevRevision, 'r2' => $rev, 'ty' => 'u')); } $manyRevisions = !($fl->queryRevision() === '1.1'); if ($manyRevisions) { $selCvsURL = Chora::url('cvs', $where, array('r1' => $rev, 'onb' => $onb));