From 67de714a2f855ea0d953df7bc81678d9680343a5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 18 Aug 2011 12:29:50 -0700 Subject: [PATCH] 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 --- ...I_differential_getcommitmessage_Method.php | 4 --- .../revision/DifferentialRevisionEditor.php | 31 ------------------- .../differential/editor/revision/__init__.php | 1 - 3 files changed, 36 deletions(-) diff --git a/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php b/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php index f2685128cb..44a552de93 100644 --- a/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php +++ b/src/applications/conduit/method/differential/getcommitmessage/ConduitAPI_differential_getcommitmessage_Method.php @@ -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."); diff --git a/src/applications/differential/editor/revision/DifferentialRevisionEditor.php b/src/applications/differential/editor/revision/DifferentialRevisionEditor.php index f9a044cee2..caa5448e6d 100644 --- a/src/applications/differential/editor/revision/DifferentialRevisionEditor.php +++ b/src/applications/differential/editor/revision/DifferentialRevisionEditor.php @@ -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) { diff --git a/src/applications/differential/editor/revision/__init__.php b/src/applications/differential/editor/revision/__init__.php index 231afd8eff..af1456b901 100644 --- a/src/applications/differential/editor/revision/__init__.php +++ b/src/applications/differential/editor/revision/__init__.php @@ -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');