Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15383485
D19580.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D19580.diff
View Options
diff --git a/src/applications/diffusion/controller/DiffusionBlameController.php b/src/applications/diffusion/controller/DiffusionBlameController.php
--- a/src/applications/diffusion/controller/DiffusionBlameController.php
+++ b/src/applications/diffusion/controller/DiffusionBlameController.php
@@ -24,6 +24,7 @@
->setViewer($viewer)
->withRepository($repository)
->withIdentifiers($identifiers)
+ ->needIdentities(true)
->execute();
$commits = mpull($commits, null, 'getCommitIdentifier');
} else {
@@ -68,10 +69,7 @@
$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 @@
$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
--- a/src/applications/diffusion/controller/DiffusionLastModifiedController.php
+++ b/src/applications/diffusion/controller/DiffusionLastModifiedController.php
@@ -35,6 +35,7 @@
->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 @@
$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 @@
$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());
- }
-
- $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);
- }
- }
+ $author = $commit->renderAuthor($viewer, $handles);
+ $committer = $commit->renderCommitter($viewer, $handles);
- $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
--- a/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php
+++ b/src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php
@@ -39,6 +39,7 @@
$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
--- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php
@@ -464,7 +464,7 @@
$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 @@
$data = $this->getCommitData();
$author_name = $data->getAuthorName();
if (strlen($author_name)) {
- return $author_name;
+ return DiffusionView::renderName($author_name);
}
return null;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 4:52 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224621
Default Alt Text
D19580.diff (5 KB)
Attached To
Mode
D19580: Update DiffusionLastModifiedController to use identities
Attached
Detach File
Event Timeline
Log In to Comment