Differential D20127 Diff 48137 src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/audit/management/PhabricatorAuditManagementWorkflow.php
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | if ($object instanceof PhabricatorRepository) { | ||||
->execute(); | ->execute(); | ||||
} else { | } else { | ||||
$commits = array($object); | $commits = array($object); | ||||
} | } | ||||
return $commits; | return $commits; | ||||
} | } | ||||
protected function synchronizeCommitAuditState($commit_phid) { | |||||
$viewer = $this->getViewer(); | |||||
$commit = id(new DiffusionCommitQuery()) | |||||
->setViewer($viewer) | |||||
->withPHIDs(array($commit_phid)) | |||||
->needAuditRequests(true) | |||||
->executeOne(); | |||||
if (!$commit) { | |||||
return; | |||||
} | |||||
$old_status = $commit->getAuditStatusObject(); | |||||
$commit->updateAuditStatus($commit->getAudits()); | |||||
$new_status = $commit->getAuditStatusObject(); | |||||
if ($old_status->getKey() == $new_status->getKey()) { | |||||
echo tsprintf( | |||||
"%s\n", | |||||
pht( | |||||
'No synchronization changes for "%s".', | |||||
$commit->getDisplayName())); | |||||
} else { | |||||
echo tsprintf( | |||||
"%s\n", | |||||
pht( | |||||
'Synchronizing "%s": "%s" -> "%s".', | |||||
amckinley: "Syncornizing" | |||||
$commit->getDisplayName(), | |||||
$old_status->getName(), | |||||
$new_status->getName())); | |||||
$commit->save(); | |||||
} | |||||
} | |||||
} | } |
"Syncornizing"