Page MenuHomePhabricator

D19712.diff
No OneTemporary

D19712.diff

diff --git a/src/parser/__tests__/ArcanistBaseCommitParserTestCase.php b/src/parser/__tests__/ArcanistBaseCommitParserTestCase.php
--- a/src/parser/__tests__/ArcanistBaseCommitParserTestCase.php
+++ b/src/parser/__tests__/ArcanistBaseCommitParserTestCase.php
@@ -150,13 +150,11 @@
// isolation for repository-oriented test cases.
$root = dirname(phutil_get_library_root('arcanist'));
- $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
- $configuration_manager = new ArcanistConfigurationManager();
- $configuration_manager->setWorkingCopyIdentity($working_copy);
- $repo = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
- $configuration_manager);
+ $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory($root);
- return new ArcanistBaseCommitParser($repo);
+ $api = $working_copy->newRepositoryAPI();
+
+ return new ArcanistBaseCommitParser($api);
}
}
diff --git a/src/workingcopy/ArcanistGitWorkingCopy.php b/src/workingcopy/ArcanistGitWorkingCopy.php
--- a/src/workingcopy/ArcanistGitWorkingCopy.php
+++ b/src/workingcopy/ArcanistGitWorkingCopy.php
@@ -18,5 +18,9 @@
return new self();
}
+ public function newRepositoryAPI() {
+ return new ArcanistGitAPI($this->getPath());
+ }
+
}
diff --git a/src/workingcopy/ArcanistMercurialWorkingCopy.php b/src/workingcopy/ArcanistMercurialWorkingCopy.php
--- a/src/workingcopy/ArcanistMercurialWorkingCopy.php
+++ b/src/workingcopy/ArcanistMercurialWorkingCopy.php
@@ -18,5 +18,9 @@
return new self();
}
+ public function newRepositoryAPI() {
+ return new ArcanistMercurialAPI($this->getPath());
+ }
+
}
diff --git a/src/workingcopy/ArcanistSubversionWorkingCopy.php b/src/workingcopy/ArcanistSubversionWorkingCopy.php
--- a/src/workingcopy/ArcanistSubversionWorkingCopy.php
+++ b/src/workingcopy/ArcanistSubversionWorkingCopy.php
@@ -70,5 +70,9 @@
return head($candidates);
}
+ public function newRepositoryAPI() {
+ return new ArcanistSubversionAPI($this->getPath());
+ }
+
}
diff --git a/src/workingcopy/ArcanistWorkingCopy.php b/src/workingcopy/ArcanistWorkingCopy.php
--- a/src/workingcopy/ArcanistWorkingCopy.php
+++ b/src/workingcopy/ArcanistWorkingCopy.php
@@ -110,4 +110,6 @@
return last($candidates);
}
+ abstract public function newRepositoryAPI();
+
}

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 16, 8:53 PM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719144
Default Alt Text
D19712.diff (2 KB)

Event Timeline