mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 09:20:58 +01:00
1fb39a20d3
Summary: Ref T2715. Test Plan: Used `phid.lookup` and `phid.query` to load handles. Grepped for `PHID_TYPE_DREV`. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2715 Differential Revision: https://secure.phabricator.com/D6509
29 lines
629 B
PHP
29 lines
629 B
PHP
<?php
|
|
|
|
echo "Migrating task revisions to edges...\n";
|
|
$table = new ManiphestTask();
|
|
$table->establishConnection('w');
|
|
|
|
foreach (new LiskMigrationIterator($table) as $task) {
|
|
$id = $task->getID();
|
|
echo "Task {$id}: ";
|
|
|
|
$revs = $task->getAttachedPHIDs(DifferentialPHIDTypeRevision::TYPECONST);
|
|
if (!$revs) {
|
|
echo "-\n";
|
|
continue;
|
|
}
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
$editor->setSuppressEvents(true);
|
|
foreach ($revs as $rev) {
|
|
$editor->addEdge(
|
|
$task->getPHID(),
|
|
PhabricatorEdgeConfig::TYPE_TASK_HAS_RELATED_DREV,
|
|
$rev);
|
|
}
|
|
$editor->save();
|
|
echo "OKAY\n";
|
|
}
|
|
|
|
echo "Done.\n";
|