2012-07-20 08:59:39 -07:00
|
|
|
<?php
|
|
|
|
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Migrating task revisions to edges...')."\n";
|
2013-01-16 17:55:39 -08:00
|
|
|
$table = new ManiphestTask();
|
|
|
|
$table->establishConnection('w');
|
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator($table) as $task) {
|
2012-07-20 08:59:39 -07:00
|
|
|
$id = $task->getID();
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Task %d: ', $id);
|
2012-07-20 08:59:39 -07:00
|
|
|
|
2014-07-24 08:05:46 +10:00
|
|
|
$revs = $task->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST);
|
2012-07-20 08:59:39 -07:00
|
|
|
if (!$revs) {
|
|
|
|
echo "-\n";
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
|
|
foreach ($revs as $rev) {
|
|
|
|
$editor->addEdge(
|
|
|
|
$task->getPHID(),
|
2014-07-17 15:41:08 -07:00
|
|
|
ManiphestTaskHasRevisionEdgeType::EDGECONST,
|
2012-07-20 08:59:39 -07:00
|
|
|
$rev);
|
|
|
|
}
|
|
|
|
$editor->save();
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('OKAY')."\n";
|
2012-07-20 08:59:39 -07:00
|
|
|
}
|
|
|
|
|
2015-05-22 17:27:56 +10:00
|
|
|
echo pht('Done.')."\n";
|