Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / controller / DiffusionRepositoryEditUpdateController.php
blobdd95654302ddfa16370fd71dd7882ca41294ff5c
1 <?php
3 final class DiffusionRepositoryEditUpdateController
4 extends DiffusionRepositoryManageController {
6 public function handleRequest(AphrontRequest $request) {
7 $response = $this->loadDiffusionContextForEdit();
8 if ($response) {
9 return $response;
12 $viewer = $this->getViewer();
13 $drequest = $this->getDiffusionRequest();
14 $repository = $drequest->getRepository();
16 $panel_uri = id(new DiffusionRepositoryBasicsManagementPanel())
17 ->setRepository($repository)
18 ->getPanelURI();
20 if ($request->isFormPost()) {
21 $params = array(
22 'repositories' => array(
23 $repository->getPHID(),
27 id(new ConduitCall('diffusion.looksoon', $params))
28 ->setUser($viewer)
29 ->execute();
31 return id(new AphrontRedirectResponse())->setURI($panel_uri);
34 $doc_name = 'Diffusion User Guide: Repository Updates';
35 $doc_href = PhabricatorEnv::getDoclink($doc_name);
36 $doc_link = phutil_tag(
37 'a',
38 array(
39 'href' => $doc_href,
40 'target' => '_blank',
42 $doc_name);
44 return $this->newDialog()
45 ->setTitle(pht('Update Repository Now'))
46 ->appendParagraph(
47 pht(
48 'Normally, Phabricator automatically updates repositories '.
49 'based on how much time has elapsed since the last commit. '.
50 'This helps reduce load if you have a large number of mostly '.
51 'inactive repositories, which is common.'))
52 ->appendParagraph(
53 pht(
54 'You can manually schedule an update for this repository. The '.
55 'daemons will perform the update as soon as possible. This may '.
56 'be helpful if you have just made a commit to a rarely used '.
57 'repository.'))
58 ->appendParagraph(
59 pht(
60 'To learn more about how Phabricator updates repositories, '.
61 'read %s in the documentation.',
62 $doc_link))
63 ->addCancelButton($panel_uri)
64 ->addSubmitButton(pht('Schedule Update'));