Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionCommitController.php
| Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | if (!$commits) { | ||||
| $commit = head($commits); | $commit = head($commits); | ||||
| } | } | ||||
| $audit_requests = $commit->getAudits(); | $audit_requests = $commit->getAudits(); | ||||
| $commit_data = $commit->getCommitData(); | $commit_data = $commit->getCommitData(); | ||||
| $is_foreign = $commit_data->getCommitDetail('foreign-svn-stub'); | $is_foreign = $commit_data->getCommitDetail('foreign-svn-stub'); | ||||
| $error_panel = null; | $error_panel = null; | ||||
| $unpublished_panel = null; | |||||
| $hard_limit = 1000; | $hard_limit = 1000; | ||||
| if ($commit->isImported()) { | if ($commit->isImported()) { | ||||
| $change_query = DiffusionPathChangeQuery::newFromDiffusionRequest( | $change_query = DiffusionPathChangeQuery::newFromDiffusionRequest( | ||||
| $drequest); | $drequest); | ||||
| $change_query->setLimit($hard_limit + 1); | $change_query->setLimit($hard_limit + 1); | ||||
| $changes = $change_query->loadChanges(); | $changes = $change_query->loadChanges(); | ||||
| ▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | if ($is_foreign) { | ||||
| if (!$commit->isPermanentCommit()) { | if (!$commit->isPermanentCommit()) { | ||||
| $nonpermanent_tag = id(new PHUITagView()) | $nonpermanent_tag = id(new PHUITagView()) | ||||
| ->setType(PHUITagView::TYPE_SHADE) | ->setType(PHUITagView::TYPE_SHADE) | ||||
| ->setName(pht('Unpublished')) | ->setName(pht('Unpublished')) | ||||
| ->setColor(PHUITagView::COLOR_ORANGE); | ->setColor(PHUITagView::COLOR_ORANGE); | ||||
| $header->addTag($nonpermanent_tag); | $header->addTag($nonpermanent_tag); | ||||
| $this->commitErrors[] = pht( | $holds = $commit_data->newPublisherHoldReasons(); | ||||
| 'This commit is not reachable from any permanent branch, tag, '. | |||||
| 'or ref.'); | $reasons = array(); | ||||
| foreach ($holds as $hold) { | |||||
| $reasons[] = array( | |||||
| phutil_tag('strong', array(), pht('%s:', $hold->getName())), | |||||
| ' ', | |||||
| $hold->getSummary(), | |||||
| ); | |||||
| } | |||||
| if (!$holds) { | |||||
| $reasons[] = pht('No further details are available.'); | |||||
| } | |||||
| $doc_href = PhabricatorEnv::getDoclink( | |||||
| 'Diffusion User Guide: Permanent Refs'); | |||||
| $doc_link = phutil_tag( | |||||
| 'a', | |||||
| array( | |||||
| 'href' => $doc_href, | |||||
| 'target' => '_blank', | |||||
| ), | |||||
| pht('Learn More')); | |||||
| $title = array( | |||||
| pht('Unpublished Commit'), | |||||
| pht(" \xC2\xB7 "), | |||||
| $doc_link, | |||||
| ); | |||||
| $unpublished_panel = id(new PHUIInfoView()) | |||||
| ->setTitle($title) | |||||
| ->setErrors($reasons) | |||||
| ->setSeverity(PHUIInfoView::SEVERITY_WARNING); | |||||
| } | } | ||||
| if ($this->getCommitErrors()) { | if ($this->getCommitErrors()) { | ||||
| $error_panel = id(new PHUIInfoView()) | $error_panel = id(new PHUIInfoView()) | ||||
| ->appendChild($this->getCommitErrors()) | ->appendChild($this->getCommitErrors()) | ||||
| ->setSeverity(PHUIInfoView::SEVERITY_WARNING); | ->setSeverity(PHUIInfoView::SEVERITY_WARNING); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | if ($show_changesets && $filetree_on) { | ||||
| ->setTitle($commit->getDisplayName()) | ->setTitle($commit->getDisplayName()) | ||||
| ->setBaseURI(new PhutilURI($commit->getURI())) | ->setBaseURI(new PhutilURI($commit->getURI())) | ||||
| ->build($changesets) | ->build($changesets) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->setCollapsed((bool)$collapsed) | ->setCollapsed((bool)$collapsed) | ||||
| ->setWidth((int)$width); | ->setWidth((int)$width); | ||||
| } | } | ||||
| $description_box = id(new PHUIObjectBoxView()) | |||||
| ->setHeaderText(pht('Description')) | |||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->appendChild($detail_list); | |||||
| $detail_box = id(new PHUIObjectBoxView()) | |||||
| ->setHeaderText(pht('Details')) | |||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->appendChild($details); | |||||
| $view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
| ->setHeader($header) | ->setHeader($header) | ||||
| ->setSubheader($subheader) | ->setSubheader($subheader) | ||||
| ->setMainColumn(array( | ->setCurtain($curtain) | ||||
| ->setMainColumn( | |||||
| array( | |||||
| $unpublished_panel, | |||||
| $error_panel, | $error_panel, | ||||
| $description_box, | |||||
| $detail_box, | |||||
| $timeline, | $timeline, | ||||
| $merge_table, | $merge_table, | ||||
| $info_panel, | $info_panel, | ||||
| )) | )) | ||||
| ->setFooter(array( | ->setFooter( | ||||
| array( | |||||
| $change_table, | $change_table, | ||||
| $change_list, | $change_list, | ||||
| $add_comment, | $add_comment, | ||||
| )) | )); | ||||
| ->addPropertySection(pht('Description'), $detail_list) | |||||
| ->addPropertySection(pht('Details'), $details) | |||||
| ->setCurtain($curtain); | |||||
| $page = $this->newPage() | $page = $this->newPage() | ||||
| ->setTitle($commit->getDisplayName()) | ->setTitle($commit->getDisplayName()) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->setPageObjectPHIDS(array($commit->getPHID())) | ->setPageObjectPHIDS(array($commit->getPHID())) | ||||
| ->appendChild( | ->appendChild( | ||||
| array( | array( | ||||
| $view, | $view, | ||||
| ▲ Show 20 Lines • Show All 691 Lines • Show Last 20 Lines | |||||