mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
7cab903943
Summary: Modernize Differential edges to subclass `PhabricatorEdgeType`. Largely based on D11045. Test Plan: From previous experience, these changes are fairly trivial and safe. I poked around a little to make sure things looked reasonably okay. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, Krenair, epriestley Differential Revision: https://secure.phabricator.com/D11074
29 lines
638 B
PHP
29 lines
638 B
PHP
<?php
|
|
|
|
echo "Migrating differential dependencies to edges...\n";
|
|
$table = new DifferentialRevision();
|
|
$table->openTransaction();
|
|
|
|
foreach (new LiskMigrationIterator($table) as $rev) {
|
|
$id = $rev->getID();
|
|
echo "Revision {$id}: ";
|
|
|
|
$deps = $rev->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST);
|
|
if (!$deps) {
|
|
echo "-\n";
|
|
continue;
|
|
}
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
foreach ($deps as $dep) {
|
|
$editor->addEdge(
|
|
$rev->getPHID(),
|
|
DifferentialRevisionDependsOnRevisionEdgeType::EDGECONST,
|
|
$dep);
|
|
}
|
|
$editor->save();
|
|
echo "OKAY\n";
|
|
}
|
|
|
|
$table->saveTransaction();
|
|
echo "Done.\n";
|