Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14851006
D12894.id31018.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
22 KB
Referenced Files
None
Subscribers
None
D12894.id31018.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -296,7 +296,6 @@
'DifferentialAdjustmentMapTestCase' => 'applications/differential/storage/__tests__/DifferentialAdjustmentMapTestCase.php',
'DifferentialAffectedPath' => 'applications/differential/storage/DifferentialAffectedPath.php',
'DifferentialApplyPatchField' => 'applications/differential/customfield/DifferentialApplyPatchField.php',
- 'DifferentialArcanistProjectField' => 'applications/differential/customfield/DifferentialArcanistProjectField.php',
'DifferentialAsanaRepresentationField' => 'applications/differential/customfield/DifferentialAsanaRepresentationField.php',
'DifferentialAuditorsField' => 'applications/differential/customfield/DifferentialAuditorsField.php',
'DifferentialAuthorField' => 'applications/differential/customfield/DifferentialAuthorField.php',
@@ -368,10 +367,8 @@
'DifferentialGetAllDiffsConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php',
'DifferentialGetCommitMessageConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php',
'DifferentialGetCommitPathsConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php',
- 'DifferentialGetDiffConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php',
'DifferentialGetRawDiffConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetRawDiffConduitAPIMethod.php',
'DifferentialGetRevisionCommentsConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetRevisionCommentsConduitAPIMethod.php',
- 'DifferentialGetRevisionConduitAPIMethod' => 'applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php',
'DifferentialGetWorkingCopy' => 'applications/differential/DifferentialGetWorkingCopy.php',
'DifferentialGitHubLandingStrategy' => 'applications/differential/landing/DifferentialGitHubLandingStrategy.php',
'DifferentialGitSVNIDField' => 'applications/differential/customfield/DifferentialGitSVNIDField.php',
@@ -3542,7 +3539,6 @@
'DifferentialAdjustmentMapTestCase' => 'ArcanistPhutilTestCase',
'DifferentialAffectedPath' => 'DifferentialDAO',
'DifferentialApplyPatchField' => 'DifferentialCustomField',
- 'DifferentialArcanistProjectField' => 'DifferentialCustomField',
'DifferentialAsanaRepresentationField' => 'DifferentialCustomField',
'DifferentialAuditorsField' => 'DifferentialStoredCustomField',
'DifferentialAuthorField' => 'DifferentialCustomField',
@@ -3618,10 +3614,8 @@
'DifferentialGetAllDiffsConduitAPIMethod' => 'DifferentialConduitAPIMethod',
'DifferentialGetCommitMessageConduitAPIMethod' => 'DifferentialConduitAPIMethod',
'DifferentialGetCommitPathsConduitAPIMethod' => 'DifferentialConduitAPIMethod',
- 'DifferentialGetDiffConduitAPIMethod' => 'DifferentialConduitAPIMethod',
'DifferentialGetRawDiffConduitAPIMethod' => 'DifferentialConduitAPIMethod',
'DifferentialGetRevisionCommentsConduitAPIMethod' => 'DifferentialConduitAPIMethod',
- 'DifferentialGetRevisionConduitAPIMethod' => 'DifferentialConduitAPIMethod',
'DifferentialGitHubLandingStrategy' => 'DifferentialLandingStrategy',
'DifferentialGitSVNIDField' => 'DifferentialCustomField',
'DifferentialHostField' => 'DifferentialCustomField',
diff --git a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
@@ -12,7 +12,6 @@
}
protected function defineParamTypes() {
-
$vcs_const = $this->formatStringConstants(
array(
'svn',
@@ -40,7 +39,7 @@
'sourceControlPath' => 'required string',
'sourceControlBaseRevision' => 'required string',
'creationMethod' => 'optional string',
- 'arcanistProject' => 'optional string',
+ 'arcanistProject' => 'deprecated',
'lintStatus' => 'required '.$status_const,
'unitStatus' => 'required '.$status_const,
'repositoryPHID' => 'optional phid',
@@ -84,21 +83,6 @@
}
}
- $project_name = $request->getValue('arcanistProject');
- $project_phid = null;
- if ($project_name) {
- $arcanist_project = id(new PhabricatorRepositoryArcanistProject())
- ->loadOneWhere(
- 'name = %s',
- $project_name);
- if (!$arcanist_project) {
- $arcanist_project = new PhabricatorRepositoryArcanistProject();
- $arcanist_project->setName($project_name);
- $arcanist_project->save();
- }
- $project_phid = $arcanist_project->getPHID();
- }
-
switch ($request->getValue('lintStatus')) {
case 'skip':
$lint_status = DifferentialLintStatus::LINT_SKIP;
@@ -156,7 +140,6 @@
'sourceControlPath' => $request->getValue('sourceControlPath'),
'sourceControlBaseRevision' =>
$request->getValue('sourceControlBaseRevision'),
- 'arcanistProjectPHID' => $project_phid,
'lintStatus' => $lint_status,
'unitStatus' => $unit_status,
);
diff --git a/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php
deleted file mode 100644
--- a/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-
-final class DifferentialGetDiffConduitAPIMethod
- extends DifferentialConduitAPIMethod {
-
- public function getAPIMethodName() {
- return 'differential.getdiff';
- }
-
- public function shouldAllowPublic() {
- return true;
- }
-
- public function getMethodStatus() {
- return self::METHOD_STATUS_DEPRECATED;
- }
-
- public function getMethodStatusDescription() {
- return pht(
- 'This method has been deprecated in favor of differential.querydiffs.');
- }
-
-
- public function getMethodDescription() {
- return pht('Load the content of a diff from Differential by revision id '.
- 'or diff id.');
- }
-
- protected function defineParamTypes() {
- return array(
- 'revision_id' => 'optional id',
- 'diff_id' => 'optional id',
- );
- }
-
- protected function defineReturnType() {
- return 'nonempty dict';
- }
-
- protected function defineErrorTypes() {
- return array(
- 'ERR_BAD_DIFF' => 'No such diff exists.',
- );
- }
-
- protected function execute(ConduitAPIRequest $request) {
- $diff_id = $request->getValue('diff_id');
-
- // If we have a revision ID, we need the most recent diff. Figure that out
- // without loading all the attached data.
- $revision_id = $request->getValue('revision_id');
- if ($revision_id) {
- $diffs = id(new DifferentialDiffQuery())
- ->setViewer($request->getUser())
- ->withRevisionIDs(array($revision_id))
- ->execute();
- if ($diffs) {
- $diff_id = head($diffs)->getID();
- } else {
- throw new ConduitException('ERR_BAD_DIFF');
- }
- }
-
- $diff = null;
- if ($diff_id) {
- $diff = id(new DifferentialDiffQuery())
- ->setViewer($request->getUser())
- ->withIDs(array($diff_id))
- ->needChangesets(true)
- ->needArcanistProjects(true)
- ->executeOne();
- }
-
- if (!$diff) {
- throw new ConduitException('ERR_BAD_DIFF');
- }
-
- return $diff->getDiffDict();
- }
-
-}
diff --git a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php
deleted file mode 100644
--- a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-
-final class DifferentialGetRevisionConduitAPIMethod
- extends DifferentialConduitAPIMethod {
-
- public function getAPIMethodName() {
- return 'differential.getrevision';
- }
-
- public function getMethodStatus() {
- return self::METHOD_STATUS_DEPRECATED;
- }
-
- public function getMethodStatusDescription() {
- return "Replaced by 'differential.query'.";
- }
-
- public function getMethodDescription() {
- return 'Load the content of a revision from Differential.';
- }
-
- protected function defineParamTypes() {
- return array(
- 'revision_id' => 'required id',
- );
- }
-
- protected function defineReturnType() {
- return 'nonempty dict';
- }
-
- protected function defineErrorTypes() {
- return array(
- 'ERR_BAD_REVISION' => 'No such revision exists.',
- );
- }
-
- protected function execute(ConduitAPIRequest $request) {
- $diff = null;
-
- $revision_id = $request->getValue('revision_id');
- $revision = id(new DifferentialRevisionQuery())
- ->withIDs(array($revision_id))
- ->setViewer($request->getUser())
- ->needRelationships(true)
- ->needReviewerStatus(true)
- ->executeOne();
-
- if (!$revision) {
- throw new ConduitException('ERR_BAD_REVISION');
- }
-
- $reviewer_phids = array_values($revision->getReviewers());
-
- $diffs = id(new DifferentialDiffQuery())
- ->setViewer($request->getUser())
- ->withRevisionIDs(array($revision_id))
- ->needChangesets(true)
- ->needArcanistProjects(true)
- ->execute();
- $diff_dicts = mpull($diffs, 'getDiffDict');
-
- $commit_dicts = array();
- $commit_phids = $revision->loadCommitPHIDs();
- $handles = id(new PhabricatorHandleQuery())
- ->setViewer($request->getUser())
- ->withPHIDs($commit_phids)
- ->execute();
-
- foreach ($commit_phids as $commit_phid) {
- $commit_dicts[] = array(
- 'fullname' => $handles[$commit_phid]->getFullName(),
- 'dateCommitted' => $handles[$commit_phid]->getTimestamp(),
- );
- }
-
- $field_data = $this->loadCustomFieldsForRevisions(
- $request->getUser(),
- array($revision));
-
- $dict = array(
- 'id' => $revision->getID(),
- 'phid' => $revision->getPHID(),
- 'authorPHID' => $revision->getAuthorPHID(),
- 'uri' => PhabricatorEnv::getURI('/D'.$revision->getID()),
- 'title' => $revision->getTitle(),
- 'status' => $revision->getStatus(),
- 'statusName' =>
- ArcanistDifferentialRevisionStatus::getNameForRevisionStatus(
- $revision->getStatus()),
- 'summary' => $revision->getSummary(),
- 'testPlan' => $revision->getTestPlan(),
- 'lineCount' => $revision->getLineCount(),
- 'reviewerPHIDs' => $reviewer_phids,
- 'diffs' => $diff_dicts,
- 'commits' => $commit_dicts,
- 'auxiliary' => idx($field_data, $revision->getPHID(), array()),
- );
-
- return $dict;
- }
-
-}
diff --git a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
@@ -44,7 +44,6 @@
'subscribers' => 'optional list<phid>',
'responsibleUsers' => 'optional list<phid>',
'branches' => 'optional list<string>',
- 'arcanistProjects' => 'optional list<string>',
);
}
@@ -73,7 +72,6 @@
$subscribers = $request->getValue('subscribers');
$responsible_users = $request->getValue('responsibleUsers');
$branches = $request->getValue('branches');
- $arc_projects = $request->getValue('arcanistProjects');
$query = id(new DifferentialRevisionQuery())
->setViewer($request->getUser());
@@ -169,19 +167,6 @@
if ($branches) {
$query->withBranches($branches);
}
- if ($arc_projects) {
- // This is sort of special-cased, but don't make arc do an extra round
- // trip.
- $projects = id(new PhabricatorRepositoryArcanistProject())
- ->loadAllWhere(
- 'name in (%Ls)',
- $arc_projects);
- if (!$projects) {
- return array();
- }
-
- $query->withArcanistProjectPHIDs(mpull($projects, 'getPHID'));
- }
$query->needRelationships(true);
$query->needCommitPHIDs(true);
@@ -228,7 +213,6 @@
'ccs' => array_values($revision->getCCPHIDs()),
'hashes' => $revision->getHashes(),
'auxiliary' => idx($field_data, $phid, array()),
- 'arcanistProjectPHID' => $diff->getArcanistProjectPHID(),
'repositoryPHID' => $diff->getRepositoryPHID(),
);
diff --git a/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialQueryDiffsConduitAPIMethod.php
@@ -33,7 +33,6 @@
->withIDs($ids)
->withRevisionIDs($revision_ids)
->needChangesets(true)
- ->needArcanistProjects(true)
->execute();
}
diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -33,7 +33,6 @@
$diffs = id(new DifferentialDiffQuery())
->setViewer($request->getUser())
->withRevisionIDs(array($this->revisionID))
- ->needArcanistProjects(true)
->execute();
$diffs = array_reverse($diffs, $preserve_keys = true);
diff --git a/src/applications/differential/customfield/DifferentialArcanistProjectField.php b/src/applications/differential/customfield/DifferentialArcanistProjectField.php
deleted file mode 100644
--- a/src/applications/differential/customfield/DifferentialArcanistProjectField.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-final class DifferentialArcanistProjectField
- extends DifferentialCustomField {
-
- public function getFieldKey() {
- return 'differential:arcanist-project';
- }
-
- public function getFieldName() {
- return pht('Arcanist Project');
- }
-
- public function getFieldDescription() {
- return pht('Shows arcanist project name.');
- }
-
- public function shouldAppearInPropertyView() {
- return true;
- }
-
- public function renderPropertyViewLabel() {
- return $this->getFieldName();
- }
-
- public function getRequiredHandlePHIDsForPropertyView() {
- $phid = $this->getArcanistProjectPHID();
- if ($phid) {
- return array($phid);
- }
- return array();
- }
-
- public function renderPropertyViewValue(array $handles) {
- return $this->renderHandleList($handles);
- }
-
- private function getArcanistProjectPHID() {
- return $this->getObject()->getActiveDiff()->getArcanistProjectPHID();
- }
-
-}
diff --git a/src/applications/differential/editor/DifferentialDiffEditor.php b/src/applications/differential/editor/DifferentialDiffEditor.php
--- a/src/applications/differential/editor/DifferentialDiffEditor.php
+++ b/src/applications/differential/editor/DifferentialDiffEditor.php
@@ -234,8 +234,7 @@
->setSourceControlPath(idx($dict, 'sourceControlPath'))
->setSourceControlBaseRevision(idx($dict, 'sourceControlBaseRevision'))
->setLintStatus(idx($dict, 'lintStatus'))
- ->setUnitStatus(idx($dict, 'unitStatus'))
- ->setArcanistProjectPHID(idx($dict, 'arcanistProjectPHID'));
+ ->setUnitStatus(idx($dict, 'unitStatus'));
return $diff;
}
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -220,7 +220,6 @@
} else {
$object->setRepositoryPHID($diff->getRepositoryPHID());
}
- $object->setArcanistProjectPHID($diff->getArcanistProjectPHID());
$object->attachActiveDiff($diff);
// TODO: Update the `diffPHID` once we add that.
diff --git a/src/applications/differential/query/DifferentialDiffQuery.php b/src/applications/differential/query/DifferentialDiffQuery.php
--- a/src/applications/differential/query/DifferentialDiffQuery.php
+++ b/src/applications/differential/query/DifferentialDiffQuery.php
@@ -7,7 +7,6 @@
private $phids;
private $revisionIDs;
private $needChangesets = false;
- private $needArcanistProjects = false;
public function withIDs(array $ids) {
$this->ids = $ids;
@@ -29,11 +28,6 @@
return $this;
}
- public function needArcanistProjects($bool) {
- $this->needArcanistProjects = $bool;
- return $this;
- }
-
protected function loadPage() {
$table = new DifferentialDiff();
$conn_r = $table->establishConnection('r');
@@ -79,10 +73,6 @@
$diffs = $this->loadChangesets($diffs);
}
- if ($diffs && $this->needArcanistProjects) {
- $diffs = $this->loadArcanistProjects($diffs);
- }
-
return $diffs;
}
@@ -98,29 +88,6 @@
return $diffs;
}
- private function loadArcanistProjects(array $diffs) {
- $phids = array_filter(mpull($diffs, 'getArcanistProjectPHID'));
- $projects = array();
- $project_map = array();
- if ($phids) {
- $projects = id(new PhabricatorRepositoryArcanistProject())
- ->loadAllWhere(
- 'phid IN (%Ls)',
- $phids);
- $project_map = mpull($projects, null, 'getPHID');
- }
-
- foreach ($diffs as $diff) {
- $project = null;
- if ($diff->getArcanistProjectPHID()) {
- $project = idx($project_map, $diff->getArcanistProjectPHID());
- }
- $diff->attachArcanistProject($project);
- }
-
- return $diffs;
- }
-
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
$where = array();
diff --git a/src/applications/differential/query/DifferentialRepositoryLookup.php b/src/applications/differential/query/DifferentialRepositoryLookup.php
--- a/src/applications/differential/query/DifferentialRepositoryLookup.php
+++ b/src/applications/differential/query/DifferentialRepositoryLookup.php
@@ -22,22 +22,6 @@
$viewer = $this->viewer;
$diff = $this->diff;
- // Look for an explicit Arcanist project.
- if ($diff->getArcanistProjectPHID()) {
- $project = id(new PhabricatorRepositoryArcanistProject())->loadOneWhere(
- 'phid = %s',
- $diff->getArcanistProjectPHID());
- if ($project && $project->getRepositoryID()) {
- $repositories = id(new PhabricatorRepositoryQuery())
- ->setViewer($viewer)
- ->withIDs(array($project->getRepositoryID()))
- ->execute();
- if ($repositories) {
- return head($repositories);
- }
- }
- }
-
// Look for a repository UUID.
if ($diff->getRepositoryUUID()) {
$repositories = id(new PhabricatorRepositoryQuery())
diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php
--- a/src/applications/differential/query/DifferentialRevisionQuery.php
+++ b/src/applications/differential/query/DifferentialRevisionQuery.php
@@ -36,7 +36,6 @@
private $phids = array();
private $responsibles = array();
private $branches = array();
- private $arcanistProjectPHIDs = array();
private $repositoryPHIDs;
private $updatedEpochMin;
private $updatedEpochMax;
@@ -228,19 +227,6 @@
}
- /**
- * Filter results to only return revisions with a given set of arcanist
- * projects.
- *
- * @param array List of project PHIDs.
- * @return this
- * @task config
- */
- public function withArcanistProjectPHIDs(array $arc_project_phids) {
- $this->arcanistProjectPHIDs = $arc_project_phids;
- return $this;
- }
-
public function withRepositoryPHIDs(array $repository_phids) {
$this->repositoryPHIDs = $repository_phids;
return $this;
@@ -771,13 +757,6 @@
$this->branches);
}
- if ($this->arcanistProjectPHIDs) {
- $where[] = qsprintf(
- $conn_r,
- 'r.arcanistProjectPHID in (%Ls)',
- $this->arcanistProjectPHIDs);
- }
-
if ($this->updatedEpochMin !== null) {
$where[] = qsprintf(
$conn_r,
diff --git a/src/applications/differential/storage/DifferentialDiff.php b/src/applications/differential/storage/DifferentialDiff.php
--- a/src/applications/differential/storage/DifferentialDiff.php
+++ b/src/applications/differential/storage/DifferentialDiff.php
@@ -262,7 +262,6 @@
'lintStatus' => $this->getLintStatus(),
'changes' => array(),
'properties' => array(),
- 'projectName' => $this->getArcanistProjectName(),
);
$dict['changes'] = $this->buildChangesList();
diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
--- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
+++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php
@@ -321,14 +321,6 @@
$this->repository->getCallsign().
$this->commit->getCommitIdentifier());
- // TODO: This is not correct in SVN where one repository can have multiple
- // Arcanist projects.
- $arcanist_project = id(new PhabricatorRepositoryArcanistProject())
- ->loadOneWhere('repositoryID = %d LIMIT 1', $this->repository->getID());
- if ($arcanist_project) {
- $diff->setArcanistProjectPHID($arcanist_project->getPHID());
- }
-
$parents = DiffusionQuery::callConduitWithDiffusionRequest(
$viewer,
$drequest,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 12:02 PM (15 h, 57 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7092184
Default Alt Text
D12894.id31018.diff (22 KB)
Attached To
Mode
D12894: Remove arcanist projects from differential
Attached
Detach File
Event Timeline
Log In to Comment