2012-07-18 20:41:42 -07:00
|
|
|
<?php
|
|
|
|
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Migrating task dependencies to edges...')."\n";
|
2013-01-16 17:55:39 -08:00
|
|
|
$table = new ManiphestTask();
|
|
|
|
$table->openTransaction();
|
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator($table) as $task) {
|
2012-07-18 20:41:42 -07:00
|
|
|
$id = $task->getID();
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Task %d: ', $id);
|
2012-07-18 20:41:42 -07:00
|
|
|
|
2014-07-24 08:05:46 +10:00
|
|
|
$deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST);
|
2012-07-18 20:41:42 -07:00
|
|
|
if (!$deps) {
|
|
|
|
echo "-\n";
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
|
|
foreach ($deps as $dep) {
|
|
|
|
$editor->addEdge(
|
|
|
|
$task->getPHID(),
|
2014-12-28 06:10:49 -08:00
|
|
|
ManiphestTaskDependsOnTaskEdgeType::EDGECONST,
|
2012-07-18 20:41:42 -07:00
|
|
|
$dep);
|
|
|
|
}
|
|
|
|
$editor->save();
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('OKAY')."\n";
|
2012-07-18 20:41:42 -07:00
|
|
|
}
|
|
|
|
|
2013-01-16 17:55:39 -08:00
|
|
|
$table->saveTransaction();
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Done.')."\n";
|