if ($config_trace_mode) {
echo "Loading phutil library '{$name}' from '{$location}'...\n";
}
- $library_root = Filesystem::resolvePath(
+ $resolved_location = Filesystem::resolvePath(
$location,
$working_copy->getProjectRoot());
- phutil_load_library($library_root);
+ if (Filesystem::pathExists($resolved_location)) {
+ $location = $resolved_location;
+ }
+ phutil_load_library($location);
}
}
protected $svnInfoRaw = array();
protected $svnDiffRaw = array();
-
+
private $svnBaseRevisionNumber;
public function getSourceControlSystemName() {
$info = $this->getSVNInfo('/');
return $info['URL'].'@'.$this->getSVNBaseRevisionNumber();
}
-
+
public function getSVNBaseRevisionNumber() {
if ($this->svnBaseRevisionNumber) {
return $this->svnBaseRevisionNumber;
$info = $this->getSVNInfo('/');
return $info['Revision'];
}
-
+
public function overrideSVNBaseRevisionNumber($effective_base_revision) {
$this->svnBaseRevisionNumber = $effective_base_revision;
return $this;
continue;
}
$proj_raw = Filesystem::readFile($config_file);
- $config = self::parseRawConfigFile($proj_raw);
+ $config = self::parseRawConfigFile($proj_raw, $config_file);
$project_root = $dir;
break;
}
return new ArcanistWorkingCopyIdentity($project_root, $config);
}
- public static function newFromRootAndConfigFile($root, $config_raw) {
- $config = self::parseRawConfigFile($config_raw);
+ public static function newFromRootAndConfigFile(
+ $root,
+ $config_raw,
+ $from_where) {
+
+ $config = self::parseRawConfigFile($config_raw, $from_where);
return new ArcanistWorkingCopyIdentity($root, $config);
}
- private static function parseRawConfigFile($raw_config) {
+ private static function parseRawConfigFile($raw_config, $from_where) {
$proj = json_decode($raw_config, true);
if (!is_array($proj)) {
throw new Exception(
- "Unable to parse '.arcconfig' file in '{$dir}'. The file contents ".
- "should be valid JSON.");
+ "Unable to parse '.arcconfig' file '{$from_where}'. The file contents ".
+ "should be valid JSON.\n\n".
+ "FILE CONTENTS\n".
+ substr($raw_config, 0, 2048));
}
$required_keys = array(
'project_id',
foreach ($required_keys as $key) {
if (!array_key_exists($key, $proj)) {
throw new Exception(
- "Required key '{$key}' is missing from '.arcconfig' file in ".
- "'{$dir}'.");
+ "Required key '{$key}' is missing from '.arcconfig' file ".
+ "'{$from_where}'.");
}
}
return $proj;