{
global $FORKS; //??? why?
- static $tools; // we cache the lookups... - we could use the config for this... (as per original..)
- // but that would only be needed or realy heavily loaded sites.
+ static $tools; // we cache the lookups...
+ //- we could use the config for this... (as per original..)
+ // but that would only be needed or realy heavily loaded sites.
+
require_once 'System.php';
$tool = isset($tools[$toolname]) ? $tools[$toolname] : System::which($toolname);
$tools[$toolname] = $tool;
+
+
if (empty($tool)) {
throw new Exception("Could not find '$toolname'");
}
$FORKS[$cmd] = 0;
}
$FORKS[$cmd]++;
-
+ //echo $cmd;
// debugging....
- if (false) {
+ if (true) {
if (php_sapi_name() == 'cli') {
echo $cmd, "\n";
} else {
return self::makeDisplayName($this);
}
- public function resolveRevision($rev, $object, $ident) {
- if ($rev !== null) {
- return $rev;
- }
- if ($object === null) {
- return null;
- }
- switch ($object) {
- case 'rev':
- $rev = $ident;
- break;
- case 'branch':
- $branches = $this->getBranches();
- $rev = isset($branches[$ident]) ? $branches[$ident] : null;
- break;
- case 'tag':
- $tags = $this->getTags();
- $rev = isset($tags[$ident]) ? $tags[$ident] : null;
- break;
- }
- if ($rev === null) {
- throw new Exception(
- "don't know which revision to use ($rev,$object,$ident)");
- }
- return $rev;
- }
+ public function resolveRevision($rev, $object, $ident)
+ {
+ if ($rev !== null) {
+ return $rev;
+ }
+
+ if ($object === null) {
+ return null;
+ }
+
+ switch ($object) {
+ case 'rev':
+ $rev = $ident;
+ break;
+
+ case 'branch':
+ $branches = $this->getBranches();
+ $rev = isset($branches[$ident]) ? $branches[$ident] : null;
+ break;
+
+ case 'tag':
+ $tags = $this->getTags();
+ $rev = isset($tags[$ident]) ? $tags[$ident] : null;
+ break;
+ }
+ if ($rev === null) {
+ throw new Exception(
+ "don't know which revision to use ($rev,$object,$ident)");
+ }
+ return $rev;
+ }
}