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(),
|
2014-07-18 00:41:08 +02:00
|
|
|
ManiphestTaskHasRevisionEdgeType::EDGECONST,
|
2012-07-20 17:59:39 +02:00
|
|
|
$rev);
|
|
|
|
}
|
|
|
|
$editor->save();
|
|
|
|
echo "OKAY\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "Done.\n";
|