2012-07-19 05:42:06 +02:00
|
|
|
<?php
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('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();
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Revision %d: ', $id);
|
2012-07-19 05:42:06 +02:00
|
|
|
|
2014-07-24 00:05:46 +02:00
|
|
|
$deps = $rev->getAttachedPHIDs(DifferentialRevisionPHIDType::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(),
|
2015-01-01 04:43:26 +01:00
|
|
|
DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST,
|
2012-07-19 05:42:06 +02:00
|
|
|
$dep);
|
|
|
|
}
|
|
|
|
$editor->save();
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('OKAY')."\n";
|
2012-07-19 05:42:06 +02:00
|
|
|
}
|
|
|
|
|
2013-01-17 02:55:39 +01:00
|
|
|
$table->saveTransaction();
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|