diff --git a/src/applications/diffusion/controller/DiffusionBlameController.php b/src/applications/diffusion/controller/DiffusionBlameController.php index 85ab393ef6..42cabbc0d9 100644 --- a/src/applications/diffusion/controller/DiffusionBlameController.php +++ b/src/applications/diffusion/controller/DiffusionBlameController.php @@ -24,6 +24,7 @@ final class DiffusionBlameController extends DiffusionController { ->setViewer($viewer) ->withRepository($repository) ->withIdentifiers($identifiers) + ->needIdentities(true) ->execute(); $commits = mpull($commits, null, 'getCommitIdentifier'); } else { @@ -68,10 +69,7 @@ final class DiffusionBlameController extends DiffusionController { $handle_phids = array(); foreach ($commits as $commit) { - $author_phid = $commit->getAuthorPHID(); - if ($author_phid) { - $handle_phids[] = $author_phid; - } + $handle_phids[] = $commit->getAuthorDisplayPHID(); } foreach ($revisions as $revision) { @@ -117,7 +115,7 @@ final class DiffusionBlameController extends DiffusionController { $author_phid = null; if ($commit) { - $author_phid = $commit->getAuthorPHID(); + $author_phid = $commit->getAuthorDisplayPHID(); } if (!$author_phid && $revision) { diff --git a/src/applications/diffusion/controller/DiffusionLastModifiedController.php b/src/applications/diffusion/controller/DiffusionLastModifiedController.php index 945f8a58b5..1a31d3a2ba 100644 --- a/src/applications/diffusion/controller/DiffusionLastModifiedController.php +++ b/src/applications/diffusion/controller/DiffusionLastModifiedController.php @@ -35,6 +35,7 @@ final class DiffusionLastModifiedController extends DiffusionController { ->withRepository($drequest->getRepository()) ->withIdentifiers(array_values($modified_map)) ->needCommitData(true) + ->needIdentities(true) ->execute(); $commit_map = mpull($commit_map, null, 'getCommitIdentifier'); } else { @@ -54,9 +55,8 @@ final class DiffusionLastModifiedController extends DiffusionController { $phids = array(); foreach ($commits as $commit) { - $data = $commit->getCommitData(); - $phids[] = $data->getCommitDetail('authorPHID'); - $phids[] = $data->getCommitDetail('committerPHID'); + $phids[] = $commit->getCommitterDisplayPHID(); + $phids[] = $commit->getAuthorDisplayPHID(); } $phids = array_filter($phids); $handles = $this->loadViewerHandles($phids); @@ -110,38 +110,21 @@ final class DiffusionLastModifiedController extends DiffusionController { $date = ''; } - $data = $commit->getCommitData(); - if ($data) { - $author_phid = $data->getCommitDetail('authorPHID'); - if ($author_phid && isset($handles[$author_phid])) { - $author = $handles[$author_phid]->renderLink(); - } else { - $author = DiffusionView::renderName($data->getAuthorName()); - } + $author = $commit->renderAuthor($viewer, $handles); + $committer = $commit->renderCommitter($viewer, $handles); - $committer = $data->getCommitDetail('committer'); - if ($committer) { - $committer_phid = $data->getCommitDetail('committerPHID'); - if ($committer_phid && isset($handles[$committer_phid])) { - $committer = $handles[$committer_phid]->renderLink(); - } else { - $committer = DiffusionView::renderName($committer); - } - if ($author != $committer) { - $author = hsprintf('%s/%s', $author, $committer); - } - } - - $details = DiffusionView::linkDetail( - $drequest->getRepository(), - $commit->getCommitIdentifier(), - $data->getSummary()); - $details = AphrontTableView::renderSingleDisplayLine($details); - } else { - $author = ''; - $details = ''; + if ($author != $committer) { + $author = hsprintf('%s/%s', $author, $committer); } + $data = $commit->getCommitData(); + $details = DiffusionView::linkDetail( + $drequest->getRepository(), + $commit->getCommitIdentifier(), + $data->getSummary()); + $details = AphrontTableView::renderSingleDisplayLine($details); + + $return = array( 'commit' => $modified, 'date' => $date, diff --git a/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php b/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php index 5bb4d5b907..5d9b06e0a3 100644 --- a/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php +++ b/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php @@ -39,6 +39,7 @@ final class PhabricatorRepositoryIdentityPHIDType $handle->setObjectName(pht('Identity %d', $id)); $handle->setName($name); $handle->setURI($identity->getURI()); + $handle->setIcon('fa-user'); } } diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php index bf3b796a76..4cb9def346 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php +++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php @@ -464,7 +464,7 @@ final class PhabricatorRepositoryCommit $data = $this->getCommitData(); $committer_name = $data->getCommitDetail('committer'); if (strlen($committer_name)) { - return $committer_name; + return DiffusionView::renderName($committer_name); } return null; @@ -479,7 +479,7 @@ final class PhabricatorRepositoryCommit $data = $this->getCommitData(); $author_name = $data->getAuthorName(); if (strlen($author_name)) { - return $author_name; + return DiffusionView::renderName($author_name); } return null;