mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-04 12:42:43 +01:00
8c8e7f07b5
Summary: Ref T13110. Installs have various reasons for sending unreviewable changes (changes where the text of the change will never be reviewed by a human) through Differential anyway. Prepare for accommodating this more gracefully by building a standalone changeset list page which paginates the changesets. Test Plan: Clicked the new "Changeset List" button on a revision, was taken to a separate page. Maniphest Tasks: T13110 Differential Revision: https://secure.phabricator.com/D19295
51 lines
1 KiB
PHP
51 lines
1 KiB
PHP
<?php
|
|
|
|
final class DifferentialChangesetListController
|
|
extends DifferentialController {
|
|
|
|
private $diff;
|
|
|
|
public function shouldAllowPublic() {
|
|
return true;
|
|
}
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
$viewer = $this->getViewer();
|
|
|
|
$diff = id(new DifferentialDiffQuery())
|
|
->setViewer($viewer)
|
|
->withIDs(array($request->getURIData('id')))
|
|
->executeOne();
|
|
if (!$diff) {
|
|
return new Aphront404Response();
|
|
}
|
|
$this->diff = $diff;
|
|
|
|
return id(new DifferentialChangesetSearchEngine())
|
|
->setController($this)
|
|
->setDiff($diff)
|
|
->buildResponse();
|
|
}
|
|
|
|
protected function buildApplicationCrumbs() {
|
|
$crumbs = parent::buildApplicationCrumbs();
|
|
|
|
$diff = $this->diff;
|
|
if ($diff) {
|
|
$revision = $diff->getRevision();
|
|
if ($revision) {
|
|
$crumbs->addTextCrumb(
|
|
$revision->getMonogram(),
|
|
$revision->getURI());
|
|
}
|
|
|
|
$crumbs->addTextCrumb(
|
|
pht('Diff %d', $diff->getID()),
|
|
$diff->getURI());
|
|
}
|
|
|
|
return $crumbs;
|
|
}
|
|
|
|
|
|
}
|