} function clearVars() { global $listing, $index; $listing[$index]['newpath'] = null; $listing[$index]['endpath'] = null; $listing[$index]['info'] = null; $listing[$index]['diffclass'] = null; $listing[$index]['difflines'] = null; $listing[$index]['enddifflines'] = null; $listing[$index]['properties'] = null; } $vars['success'] = false; if (!$noinput) { // TODO: Report warning/error if comparison encounters any problems if ($diff = popenCommand($cmd, 'r')) { $index = 0; $indiff = false; $indiffproper = false; $getLine = true; $node = null; $bufferedLine = false; $vars['success'] = true; while (!feof($diff)) { if ($getLine) { if ($bufferedLine === false) { $bufferedLine = rtrim(fgets($diff), "\r\n"); } $newlineR = strpos($bufferedLine, "\r"); $newlineN = strpos($bufferedLine, "\n"); if ($newlineR === false && $newlineN === false) {
function listFileContents($path, $rev = 0, $peg = '') { global $config, $extEnscript; $ext = strrchr($path, '.'); if ($config->useGeshi && ($geshiLang = $this->highlightLanguageUsingGeshi($ext))) { $tempname = tempnam($config->getTempDir(), 'wsvn'); print toOutputEncoding($this->applyGeshi($path, $tempname, $geshiLang, $rev, $peg, true)); @unlink($tempname); } else { $pre = false; $path = encodepath($this->getSvnPath($path)); $pegrev = $peg ? '@' . $peg : ''; $cmd = $config->getSvnCommand() . ' cat -r ' . $rev . ' ' . $this->repConfig->svnParams() . quote($path . $pegrev); if ($config->useEnscript) { $l = @$extEnscript[$ext]; $cmd .= ' | ' . $config->enscript . ' --language=html ' . ($l ? '--color --pretty-print=' . $l : '') . ' -o - | ' . $config->sed . ' -n ' . $config->quote . '/^<PRE.$/,/^<\\/PRE.$/p' . $config->quote; } else { $pre = true; } if ($result = popenCommand($cmd, 'r')) { if ($pre) { echo '<pre>'; } while (!feof($result)) { $line = fgets($result, 1024); if ($pre) { $line = replaceEntities($line, $this->repConfig); } else { $line = toOutputEncoding($line); } print hardspace($line); } if ($pre) { echo '</pre>'; } pclose($result); } } }