1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Prefer Mercurial and Git over Subversion in discovering repository

Summary: `svn info` is the slowest command for discovering repository (up to 300 ms) and Subversion is probably the least used repository type with Arcanist. Let's discover it last.

Test Plan:
  $ arc lint --trace

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4039
This commit is contained in:
vrana 2012-11-26 14:45:50 -08:00
parent db25adb069
commit c12dee997d

View file

@ -56,14 +56,6 @@ abstract class ArcanistRepositoryAPI {
"any parent directory. Create an '.arcconfig' file to configure arc.");
}
// check if we're in an svn working copy
list($err) = exec_manual('svn info');
if (!$err) {
$api = new ArcanistSubversionAPI($root);
$api->workingCopyIdentity = $working_copy;
return $api;
}
if (Filesystem::pathExists($root.'/.hg')) {
$api = new ArcanistMercurialAPI($root);
$api->workingCopyIdentity = $working_copy;
@ -83,6 +75,14 @@ abstract class ArcanistRepositoryAPI {
return $api;
}
// check if we're in an svn working copy
list($err) = exec_manual('svn info');
if (!$err) {
$api = new ArcanistSubversionAPI($root);
$api->workingCopyIdentity = $working_copy;
return $api;
}
throw new ArcanistUsageException(
"The current working directory is not part of a working copy for a ".
"supported version control system (svn, git or mercurial).");