Differential D17193 Diff 41346 src/applications/maniphest/controller/ManiphestTaskDetailController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/maniphest/controller/ManiphestTaskDetailController.php
Show First 20 Lines • Show All 391 Lines • ▼ Show 20 Lines | if ($commit_phids) { | ||||
$commit_drev = DiffusionCommitHasRevisionEdgeType::EDGECONST; | $commit_drev = DiffusionCommitHasRevisionEdgeType::EDGECONST; | ||||
$drev_edges = id(new PhabricatorEdgeQuery()) | $drev_edges = id(new PhabricatorEdgeQuery()) | ||||
->withSourcePHIDs($commit_phids) | ->withSourcePHIDs($commit_phids) | ||||
->withEdgeTypes(array($commit_drev)) | ->withEdgeTypes(array($commit_drev)) | ||||
->execute(); | ->execute(); | ||||
foreach ($commit_phids as $phid) { | foreach ($commit_phids as $phid) { | ||||
$revisions_commits[$phid] = $handles->renderHandle($phid) | $revisions_commits[$phid] = $handles->renderHandle($phid) | ||||
->setShowHovercard(true); | ->setShowHovercard(true) | ||||
->setShowStateIcon(true); | |||||
$revision_phid = key($drev_edges[$phid][$commit_drev]); | $revision_phid = key($drev_edges[$phid][$commit_drev]); | ||||
$revision_handle = $handles->getHandleIfExists($revision_phid); | $revision_handle = $handles->getHandleIfExists($revision_phid); | ||||
if ($revision_handle) { | if ($revision_handle) { | ||||
$task_drev = ManiphestTaskHasRevisionEdgeType::EDGECONST; | $task_drev = ManiphestTaskHasRevisionEdgeType::EDGECONST; | ||||
unset($edges[$task_drev][$revision_phid]); | unset($edges[$task_drev][$revision_phid]); | ||||
$revisions_commits[$phid] = hsprintf( | $revisions_commits[$phid] = hsprintf( | ||||
'%s / %s', | '%s / %s', | ||||
$revision_handle->renderHovercardLink($revision_handle->getName()), | $revision_handle->renderHovercardLink($revision_handle->getName()), | ||||
$revisions_commits[$phid]); | $revisions_commits[$phid]); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
foreach ($edge_types as $edge_type => $edge_name) { | foreach ($edge_types as $edge_type => $edge_name) { | ||||
if ($edges[$edge_type]) { | if (!$edges[$edge_type]) { | ||||
$edge_handles = $viewer->loadHandles(array_keys($edges[$edge_type])); | continue; | ||||
$view->addProperty( | |||||
$edge_name, | |||||
$edge_handles->renderList()); | |||||
} | } | ||||
$edge_handles = $viewer->loadHandles(array_keys($edges[$edge_type])); | |||||
$edge_list = $edge_handles->renderList() | |||||
->setShowStateIcons(true); | |||||
$view->addProperty($edge_name, $edge_list); | |||||
} | } | ||||
if ($revisions_commits) { | if ($revisions_commits) { | ||||
$view->addProperty( | $view->addProperty( | ||||
pht('Commits'), | pht('Commits'), | ||||
phutil_implode_html(phutil_tag('br'), $revisions_commits)); | phutil_implode_html(phutil_tag('br'), $revisions_commits)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |