Created
June 9, 2014 23:53
-
-
Save yiding/0c6779fbca92282ce7a1 to your computer and use it in GitHub Desktop.
phabricator basic stgit compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php | |
index ba7adb4..8c4031c 100644 | |
--- a/src/__phutil_library_map__.php | |
+++ b/src/__phutil_library_map__.php | |
@@ -157,6 +157,7 @@ phutil_register_library_map(array( | |
'ArcanistSpellingDefaultData' => 'lint/linter/spelling/ArcanistSpellingDefaultData.php', | |
'ArcanistSpellingLinter' => 'lint/linter/ArcanistSpellingLinter.php', | |
'ArcanistSpellingLinterTestCase' => 'lint/linter/__tests__/ArcanistSpellingLinterTestCase.php', | |
+ 'ArcanistStgitAPI' => 'repository/api/ArcanistStgitAPI.php', | |
'ArcanistSubversionAPI' => 'repository/api/ArcanistSubversionAPI.php', | |
'ArcanistSubversionHookAPI' => 'repository/hookapi/ArcanistSubversionHookAPI.php', | |
'ArcanistSvnHookPreCommitWorkflow' => 'workflow/ArcanistSvnHookPreCommitWorkflow.php', | |
@@ -323,6 +324,7 @@ phutil_register_library_map(array( | |
'ArcanistSingleLintEngine' => 'ArcanistLintEngine', | |
'ArcanistSpellingLinter' => 'ArcanistLinter', | |
'ArcanistSpellingLinterTestCase' => 'ArcanistArcanistLinterTestCase', | |
+ 'ArcanistStgitAPI' => 'ArcanistGitAPI', | |
'ArcanistSubversionAPI' => 'ArcanistRepositoryAPI', | |
'ArcanistSubversionHookAPI' => 'ArcanistHookAPI', | |
'ArcanistSvnHookPreCommitWorkflow' => 'ArcanistBaseWorkflow', | |
diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php | |
index 45bae42..f2d973a 100644 | |
--- a/src/repository/api/ArcanistGitAPI.php | |
+++ b/src/repository/api/ArcanistGitAPI.php | |
@@ -5,7 +5,7 @@ | |
* | |
* @group workingcopy | |
*/ | |
-final class ArcanistGitAPI extends ArcanistRepositoryAPI { | |
+class ArcanistGitAPI extends ArcanistRepositoryAPI { | |
private $repositoryHasNoCommits = false; | |
const SEARCH_LENGTH_FOR_PARENT_REVISIONS = 16; | |
diff --git a/src/repository/api/ArcanistRepositoryAPI.php b/src/repository/api/ArcanistRepositoryAPI.php | |
index 69a89b5..191c8c4 100644 | |
--- a/src/repository/api/ArcanistRepositoryAPI.php | |
+++ b/src/repository/api/ArcanistRepositoryAPI.php | |
@@ -76,7 +76,13 @@ abstract class ArcanistRepositoryAPI { | |
$api = new ArcanistMercurialAPI($root); | |
break; | |
case 'git': | |
- $api = new ArcanistGitAPI($root); | |
+ list($code, $out, $err) = exec_manual('stg series'); | |
+ if ($code == 0) { | |
+ echo "using stg\n"; | |
+ $api = new ArcanistStgitAPI($root); | |
+ } else { | |
+ $api = new ArcanistGitAPI($root); | |
+ } | |
break; | |
default: | |
throw new Exception( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment