Page MenuHomePhabricator

D11586.id.diff
No OneTemporary

D11586.id.diff

diff --git a/src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php b/src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php
--- a/src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php
+++ b/src/applications/arcanist/conduit/ArcanistProjectInfoConduitAPIMethod.php
@@ -38,7 +38,13 @@
throw new ConduitException('ERR-BAD-ARCANIST-PROJECT');
}
- $repository = $project->loadRepository();
+ $repository = null;
+ if ($project->getRepositoryID()) {
+ $repository = id(new PhabricatorRepositoryQuery())
+ ->setViewer($request->getUser())
+ ->withRepositoryIDs(array($project->getRepositoryID()))
+ ->executeOne();
+ }
$repository_phid = null;
$tracked = false;
diff --git a/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php b/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php
--- a/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php
+++ b/src/applications/releeph/controller/branch/ReleephBranchNamePreviewController.php
@@ -15,7 +15,9 @@
$arc_project_id = $request->getInt('arcProjectID');
$fake_commit_handle =
- ReleephBranchTemplate::getFakeCommitHandleFor($arc_project_id);
+ ReleephBranchTemplate::getFakeCommitHandleFor(
+ $arc_project_id,
+ $request->getUser());
list($name, $errors) = id(new ReleephBranchTemplate())
->setCommitHandle($fake_commit_handle)
diff --git a/src/applications/releeph/controller/product/ReleephProductCreateController.php b/src/applications/releeph/controller/product/ReleephProductCreateController.php
--- a/src/applications/releeph/controller/product/ReleephProductCreateController.php
+++ b/src/applications/releeph/controller/product/ReleephProductCreateController.php
@@ -28,7 +28,14 @@
}
$arc_project = $arc_projects[$arc_pr_id];
- $pr_repository = $arc_project->loadRepository();
+ $pr_repository = null;
+ if ($arc_project->getRepositoryID()) {
+ $pr_repository = id(new PhabricatorRepositoryQuery())
+ ->setViewer($request->getUser())
+ ->withRepositoryIDs(array($arc_project->getRepositoryID()))
+ ->executeOne();
+ }
+
if (!$errors) {
$releeph_product = id(new ReleephProject())
diff --git a/src/applications/releeph/controller/product/ReleephProductEditController.php b/src/applications/releeph/controller/product/ReleephProductEditController.php
--- a/src/applications/releeph/controller/product/ReleephProductEditController.php
+++ b/src/applications/releeph/controller/product/ReleephProductEditController.php
@@ -93,7 +93,7 @@
->setDetail('testPaths', $test_paths);
$fake_commit_handle =
- ReleephBranchTemplate::getFakeCommitHandleFor($arc_project_id);
+ ReleephBranchTemplate::getFakeCommitHandleFor($arc_project_id, $viewer);
if ($branch_template) {
list($branch_name, $template_errors) = id(new ReleephBranchTemplate())
diff --git a/src/applications/releeph/view/branch/ReleephBranchTemplate.php b/src/applications/releeph/view/branch/ReleephBranchTemplate.php
--- a/src/applications/releeph/view/branch/ReleephBranchTemplate.php
+++ b/src/applications/releeph/view/branch/ReleephBranchTemplate.php
@@ -19,7 +19,10 @@
return $template;
}
- public static function getFakeCommitHandleFor($arc_project_id) {
+ public static function getFakeCommitHandleFor(
+ $arc_project_id,
+ PhabricatorUser $viewer) {
+
$arc_project = id(new PhabricatorRepositoryArcanistProject())
->load($arc_project_id);
if (!$arc_project) {
@@ -27,9 +30,19 @@
"No Arc project found with id '{$arc_project_id}'!");
}
- $repository = $arc_project->loadRepository();
- return id(new PhabricatorObjectHandle())
- ->setName($repository->formatCommitName('100000000000'));
+ $repository = null;
+ if ($arc_project->getRepositoryID()) {
+ $repository = id(new PhabricatorRepositoryQuery())
+ ->setViewer($viewer)
+ ->withRepositoryIDs(array($arc_project->getRepositoryID()))
+ ->executeOne();
+ }
+ $fake_handle = 'SOFAKE';
+ if ($repository) {
+ $fake_handle = id(new PhabricatorObjectHandle())
+ ->setName($repository->formatCommitName('100000000000'));
+ }
+ return $fake_handle;
}
private $commitHandle;
diff --git a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php b/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
--- a/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryArcanistProject.php
@@ -45,14 +45,6 @@
PhabricatorRepositoryArcanistProjectPHIDType::TYPECONST);
}
- // TODO: Remove. Also, T603.
- public function loadRepository() {
- if (!$this->getRepositoryID()) {
- return null;
- }
- return id(new PhabricatorRepository())->load($this->getRepositoryID());
- }
-
public function delete() {
$this->openTransaction();

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 25, 7:40 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6711442
Default Alt Text
D11586.id.diff (5 KB)

Event Timeline