mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
Remove (most) support for 'differential.attach-task-class'
Summary: After D814 and D829, you should be able to implement this logic in the didWriteRevision() method of the field. Note that the attacher is still referenced in ConduitAPI_differential_updatetaskrevisionassoc_Method. This method should probably be moved to facebook/ since it's pretty Facebook-specific. No rush on any of this, it's not hurting anything. Test Plan: - Hit differential.getcommitmessage - Ran 'arc diff' Reviewers: jungejason, tuomaspelkonen, aran Reviewed By: jungejason CC: aran, jungejason Differential Revision: 830
This commit is contained in:
parent
ed33e59c5a
commit
67de714a2f
3 changed files with 0 additions and 36 deletions
|
@ -76,10 +76,6 @@ class ConduitAPI_differential_getcommitmessage_Method extends ConduitAPIMethod {
|
|||
|
||||
$aux_field = idx($aux_fields, $field);
|
||||
if (!$aux_field) {
|
||||
if ($field == 'tasks') {
|
||||
// TODO: Remove, backcompat for Facebook.
|
||||
continue;
|
||||
}
|
||||
throw new Exception(
|
||||
"Commit message includes field '{$field}' which does not ".
|
||||
"correspond to any configured field.");
|
||||
|
|
|
@ -31,7 +31,6 @@ class DifferentialRevisionEditor {
|
|||
protected $diff;
|
||||
protected $comments;
|
||||
protected $silentUpdate;
|
||||
protected $tasks = null;
|
||||
|
||||
private $auxiliaryFields = array();
|
||||
|
||||
|
@ -58,11 +57,6 @@ class DifferentialRevisionEditor {
|
|||
$editor->addDiff($diff, null);
|
||||
$editor->save();
|
||||
|
||||
// Tasks can only be updated after revision has been saved to the
|
||||
// database. Currently tasks are updated only when a revision is created.
|
||||
// UI must be used to modify tasks after creating one.
|
||||
$editor->updateTasks();
|
||||
|
||||
return $revision;
|
||||
}
|
||||
|
||||
|
@ -85,12 +79,6 @@ class DifferentialRevisionEditor {
|
|||
|
||||
foreach ($fields as $field => $value) {
|
||||
if (empty($aux_fields[$field])) {
|
||||
if ($field == 'tasks') {
|
||||
// TODO: Deprecate once this can be fully supported with custom
|
||||
// fields. This is just to prevent a backcompat break for Facebook.
|
||||
$this->setTasks($value);
|
||||
continue;
|
||||
}
|
||||
throw new Exception(
|
||||
"Parsed commit message contains unrecognized field '{$field}'.");
|
||||
}
|
||||
|
@ -120,10 +108,6 @@ class DifferentialRevisionEditor {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setTasks(array $tasks) {
|
||||
$this->tasks = $tasks;
|
||||
}
|
||||
|
||||
public function addDiff(DifferentialDiff $diff, $comments) {
|
||||
if ($diff->getRevisionID() &&
|
||||
$diff->getRevisionID() != $this->getRevision()->getID()) {
|
||||
|
@ -673,21 +657,6 @@ class DifferentialRevisionEditor {
|
|||
return $comment;
|
||||
}
|
||||
|
||||
private function updateTasks() {
|
||||
if ($this->tasks) {
|
||||
$task_class = PhabricatorEnv::getEnvConfig(
|
||||
'differential.attach-task-class');
|
||||
if ($task_class) {
|
||||
PhutilSymbolLoader::loadClass($task_class);
|
||||
$task_attacher = newv($task_class, array());
|
||||
$ret = $task_attacher->attachTasksToRevision(
|
||||
$this->actorPHID,
|
||||
$this->revision,
|
||||
$this->tasks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function updateAuxiliaryFields() {
|
||||
$aux_map = array();
|
||||
foreach ($this->auxiliaryFields as $aux_field) {
|
||||
|
|
|
@ -26,7 +26,6 @@ phutil_require_module('phabricator', 'infrastructure/env');
|
|||
phutil_require_module('phabricator', 'storage/qsprintf');
|
||||
phutil_require_module('phabricator', 'storage/queryfx');
|
||||
|
||||
phutil_require_module('phutil', 'symbols');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue