Page MenuHomePhabricator

repo_phid.php

Authored By
epriestley
Mar 24 2014, 11:42 PM
Size
805 B
Referenced Files
None
Subscribers
None

repo_phid.php

<?php
require_once 'scripts/__init_script__.php';
$conn_w = id(new DifferentialRevision())->establishConnection('w');
foreach (new LiskMigrationIterator(new DifferentialRevision()) as $rev) {
$id = $rev->getID();
echo "Checking D{$id}...\n";
if ($rev->getRepositoryPHID()) {
// Already has a repository PHID, skip it.
continue;
}
$diff = $rev->loadActiveDiff();
if (!$diff) {
// Oldschool broken no-diff rev, skip it.
continue;
}
if (!$diff->getRepositoryPHID()) {
// Diff doesn't have a repository PHID either, skip it.
continue;
}
echo "Updating D{$id}...\n";
queryfx(
$conn_w,
'UPDATE %T SET repositoryPHID = %s WHERE id = %d',
id(new DifferentialRevision())->getTableName(),
$diff->getRepositoryPHID(),
$id);
}
echo "Done.\n";

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/q4/7s/pnutwhjd43auxsc7
Default Alt Text
repo_phid.php (805 B)

Event Timeline