Page MenuHomePhabricator

find-unaccepted-revisions.php

Authored By
epriestley
Dec 1 2015, 10:54 PM
Size
953 B
Referenced Files
None
Subscribers
None

find-unaccepted-revisions.php

<?php
require_once 'scripts/__init_script__.php';
$viewer = PhabricatorUser::getOmnipotentUser();
$table = new DifferentialRevision();
foreach (new LiskMigrationIterator($table) as $rev) {
if ($rev->getStatus() != ArcanistDifferentialRevisionStatus::CLOSED) {
continue;
}
$rev = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs(array($rev->getID()))
->needReviewerStatus(true)
->executeOne();
if (!$rev) {
continue;
}
$reviewers = $rev->getReviewerStatus();
$any_accept = false;
foreach ($reviewers as $reviewer) {
$status = $reviewer->getStatus();
if (($status == DifferentialReviewerStatus::STATUS_ACCEPTED) ||
($status == DifferentialReviewerStatus::STATUS_ACCEPTED_OLDER)) {
$any_accept = true;
break;
}
}
if ($any_accept) {
continue;
}
$id = $rev->getID();
echo "D{$id} is closed without any accepting reviewers.\n";
}
echo "Done.\n";

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/oh/b4/flecaa6wngegn5qd
Default Alt Text
find-unaccepted-revisions.php (953 B)

Event Timeline