2012-07-19 05:42:06 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
echo "Migrating differential dependencies to edges...\n";
|
2013-01-17 02:55:39 +01:00
|
|
|
$table = new DifferentialRevision();
|
|
|
|
$table->openTransaction();
|
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator($table) as $rev) {
|
2012-07-19 05:42:06 +02:00
|
|
|
$id = $rev->getID();
|
|
|
|
echo "Revision {$id}: ";
|
|
|
|
|
2013-07-21 17:11:37 +02:00
|
|
|
$deps = $rev->getAttachedPHIDs(DifferentialPHIDTypeRevision::TYPECONST);
|
2012-07-19 05:42:06 +02:00
|
|
|
if (!$deps) {
|
|
|
|
echo "-\n";
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
|
|
foreach ($deps as $dep) {
|
|
|
|
$editor->addEdge(
|
|
|
|
$rev->getPHID(),
|
|
|
|
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV,
|
|
|
|
$dep);
|
|
|
|
}
|
|
|
|
$editor->save();
|
|
|
|
echo "OKAY\n";
|
|
|
|
}
|
|
|
|
|
2013-01-17 02:55:39 +01:00
|
|
|
$table->saveTransaction();
|
2012-07-19 05:42:06 +02:00
|
|
|
echo "Done.\n";
|