Summary:
When you run one copy of arcanist against another copy, you previously got a
meaningless error. After D311 you get a slightly more meaningful error.
Capture the new exception and raise an extremely specific error.
NOTE: Adding arcanist to .arcconfig forces the library conflict error to
trigger; otherwise there's just an implicit conflict because 'arc' reads the
running-copy library amp instead of the working-copy library map. This only
worked before because arcanist includes itself.
Test Plan:
Ran arcanist on a different copy of arcanist, got a good error message.
Reviewed By: jungejason
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, jungejason, epriestley
Differential Revision: 312
"lint_engine" : "PhutilLintEngine",
"unit_engine" : "PhutilUnitTestEngine",
"remote_hooks_installed" : true,
- "copyright_holder" : "Facebook, Inc."
+ "copyright_holder" : "Facebook, Inc.",
+ "phutil_libraries" : {
+ "arcanist" : "src/"
+ }
}
$name,
$location);
throw new ArcanistUsageException($error_msg);
+ } catch (PhutilLibraryConflictException $ex) {
+ if ($ex->getLibrary() != 'arcanist') {
+ throw $ex;
+ }
+
+ $arc_dir = dirname(dirname(__FILE__));
+ $error_msg =
+ "You are trying to run one copy of Arcanist on another copy of ".
+ "Arcanist. This operation is not supported. To execute Arcanist ".
+ "operations against this working copy, run './bin/arc' (from the ".
+ "current working copy) not some other copy of 'arc' (you ran one ".
+ "from '{$arc_dir}').";
+
+ throw new ArcanistUsageException($error_msg);
}
}
}