mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 03:12:41 +01:00
e10fdbe77e
Summary: Patches often read from slaves (possibly stale data) and use that information to write on master. It causes problems when applying more patches quickly after each other because data created in previous patch may not be replicated yet. Test Plan: $ bin/storage upgrade Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4483
30 lines
667 B
PHP
30 lines
667 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(PhabricatorPHIDConstants::PHID_TYPE_DREV);
|
|
if (!$deps) {
|
|
echo "-\n";
|
|
continue;
|
|
}
|
|
|
|
$editor = new PhabricatorEdgeEditor();
|
|
$editor->setSuppressEvents(true);
|
|
foreach ($deps as $dep) {
|
|
$editor->addEdge(
|
|
$rev->getPHID(),
|
|
PhabricatorEdgeConfig::TYPE_DREV_DEPENDS_ON_DREV,
|
|
$dep);
|
|
}
|
|
$editor->save();
|
|
echo "OKAY\n";
|
|
}
|
|
|
|
$table->saveTransaction();
|
|
echo "Done.\n";
|