From c12dee997d73bf52840e00be9bcab94ec581023f Mon Sep 17 00:00:00 2001 From: vrana Date: Mon, 26 Nov 2012 14:45:50 -0800 Subject: [PATCH] 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 --- src/repository/api/ArcanistRepositoryAPI.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/repository/api/ArcanistRepositoryAPI.php b/src/repository/api/ArcanistRepositoryAPI.php index b27241ac..82f9fdcb 100644 --- a/src/repository/api/ArcanistRepositoryAPI.php +++ b/src/repository/api/ArcanistRepositoryAPI.php @@ -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)."); -- 2.43.0