2012-07-20 17:59:39 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
echo "Migrating task revisions to edges...\n";
|
2013-01-17 02:55:39 +01:00
|
|
|
$table = new ManiphestTask();
|
|
|
|
$table->establishConnection('w');
|
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator($table) as $task) {
|
2012-07-20 17:59:39 +02:00
|
|
|
$id = $task->getID();
|
|
|
|
echo "Task {$id}: ";
|
|
|
|
|
2013-07-21 17:11:37 +02:00
|
|
|
$revs = $task->getAttachedPHIDs(DifferentialPHIDTypeRevision::TYPECONST);
|
2012-07-20 17:59:39 +02:00
|
|
|
if (!$revs) {
|
|
|
|
echo "-\n";
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
|
|
$editor->setSuppressEvents(true);
|
|
|
|
foreach ($revs as $rev) {
|
|
|
|
$editor->addEdge(
|
|
|
|
$task->getPHID(),
|
|
|
|
PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV,
|
|
|
|
$rev);
|
|
|
|
}
|
|
|
|
$editor->save();
|
|
|
|
echo "OKAY\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "Done.\n";
|