mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +01:00
8cbfb49b4e
Summary: Ref T5245. These were a bad idea. We no longer need actors for edge edits either, so remove those. Generally, edges have fit into the policy model as pure/low-level infrastructure, and they do not have any policy or capability information in and of themselves. Test Plan: `grep` Reviewers: chad, btrahan, joshuaspence Reviewed By: joshuaspence Subscribers: epriestley Maniphest Tasks: T5245 Differential Revision: https://secure.phabricator.com/D9840
33 lines
839 B
PHP
33 lines
839 B
PHP
<?php
|
|
|
|
echo "Migrating differential.revisionPHID to edges...\n";
|
|
$commit_table = new PhabricatorRepositoryCommit();
|
|
$data_table = new PhabricatorRepositoryCommitData();
|
|
$editor = new PhabricatorEdgeEditor();
|
|
$commit_table->establishConnection('w');
|
|
$edges = 0;
|
|
|
|
foreach (new LiskMigrationIterator($commit_table) as $commit) {
|
|
$data = $commit->loadOneRelative($data_table, 'commitID');
|
|
if (!$data) {
|
|
continue;
|
|
}
|
|
|
|
$revision_phid = $data->getCommitDetail('differential.revisionPHID');
|
|
if (!$revision_phid) {
|
|
continue;
|
|
}
|
|
|
|
$commit_drev = PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV;
|
|
$editor->addEdge($commit->getPHID(), $commit_drev, $revision_phid);
|
|
$edges++;
|
|
if ($edges % 256 == 0) {
|
|
echo '.';
|
|
$editor->save();
|
|
$editor = new PhabricatorEdgeEditor();
|
|
}
|
|
}
|
|
|
|
echo '.';
|
|
$editor->save();
|
|
echo "\nDone.\n";
|