mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
102e431feb
Summary: Prevents "edited tasks, added: 1; removed: 1" Fixes T6757, using D9839 as an example Test Plan: Added and removed blockers to/from tasks, saw the expected history entries. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T6757 Differential Revision: https://secure.phabricator.com/D11045
29 lines
605 B
PHP
29 lines
605 B
PHP
<?php
|
|
|
|
echo "Migrating task dependencies to edges...\n";
|
|
$table = new ManiphestTask();
|
|
$table->openTransaction();
|
|
|
|
foreach (new LiskMigrationIterator($table) as $task) {
|
|
$id = $task->getID();
|
|
echo "Task {$id}: ";
|
|
|
|
$deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST);
|
|
if (!$deps) {
|
|
echo "-\n";
|
|
continue;
|
|
}
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
foreach ($deps as $dep) {
|
|
$editor->addEdge(
|
|
$task->getPHID(),
|
|
ManiphestTaskDependsOnTaskEdgeType::EDGECONST,
|
|
$dep);
|
|
}
|
|
$editor->save();
|
|
echo "OKAY\n";
|
|
}
|
|
|
|
$table->saveTransaction();
|
|
echo "Done.\n";
|