@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update DiffusionLastModifiedController to use identities

Summary: Ref T12164. Updates another controller to use identities.

Test Plan:
Pretty ad-hoc, but loaded the main pages of several different repos with and without repo identities. I'm not totally convinced the `author` from this data structure is actually being used:
```
$return = array(
'commit' => $modified,
'date' => $date,
'author' => $author,
'details' => $details,
);
```

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12164

Differential Revision: https://secure.phabricator.com/D19580

+21 -39
+3 -5
src/applications/diffusion/controller/DiffusionBlameController.php
··· 24 24 ->setViewer($viewer) 25 25 ->withRepository($repository) 26 26 ->withIdentifiers($identifiers) 27 + ->needIdentities(true) 27 28 ->execute(); 28 29 $commits = mpull($commits, null, 'getCommitIdentifier'); 29 30 } else { ··· 68 69 69 70 $handle_phids = array(); 70 71 foreach ($commits as $commit) { 71 - $author_phid = $commit->getAuthorPHID(); 72 - if ($author_phid) { 73 - $handle_phids[] = $author_phid; 74 - } 72 + $handle_phids[] = $commit->getAuthorDisplayPHID(); 75 73 } 76 74 77 75 foreach ($revisions as $revision) { ··· 117 115 $author_phid = null; 118 116 119 117 if ($commit) { 120 - $author_phid = $commit->getAuthorPHID(); 118 + $author_phid = $commit->getAuthorDisplayPHID(); 121 119 } 122 120 123 121 if (!$author_phid && $revision) {
+15 -32
src/applications/diffusion/controller/DiffusionLastModifiedController.php
··· 35 35 ->withRepository($drequest->getRepository()) 36 36 ->withIdentifiers(array_values($modified_map)) 37 37 ->needCommitData(true) 38 + ->needIdentities(true) 38 39 ->execute(); 39 40 $commit_map = mpull($commit_map, null, 'getCommitIdentifier'); 40 41 } else { ··· 54 55 55 56 $phids = array(); 56 57 foreach ($commits as $commit) { 57 - $data = $commit->getCommitData(); 58 - $phids[] = $data->getCommitDetail('authorPHID'); 59 - $phids[] = $data->getCommitDetail('committerPHID'); 58 + $phids[] = $commit->getCommitterDisplayPHID(); 59 + $phids[] = $commit->getAuthorDisplayPHID(); 60 60 } 61 61 $phids = array_filter($phids); 62 62 $handles = $this->loadViewerHandles($phids); ··· 110 110 $date = ''; 111 111 } 112 112 113 + $author = $commit->renderAuthor($viewer, $handles); 114 + $committer = $commit->renderCommitter($viewer, $handles); 115 + 116 + if ($author != $committer) { 117 + $author = hsprintf('%s/%s', $author, $committer); 118 + } 119 + 113 120 $data = $commit->getCommitData(); 114 - if ($data) { 115 - $author_phid = $data->getCommitDetail('authorPHID'); 116 - if ($author_phid && isset($handles[$author_phid])) { 117 - $author = $handles[$author_phid]->renderLink(); 118 - } else { 119 - $author = DiffusionView::renderName($data->getAuthorName()); 120 - } 121 + $details = DiffusionView::linkDetail( 122 + $drequest->getRepository(), 123 + $commit->getCommitIdentifier(), 124 + $data->getSummary()); 125 + $details = AphrontTableView::renderSingleDisplayLine($details); 121 126 122 - $committer = $data->getCommitDetail('committer'); 123 - if ($committer) { 124 - $committer_phid = $data->getCommitDetail('committerPHID'); 125 - if ($committer_phid && isset($handles[$committer_phid])) { 126 - $committer = $handles[$committer_phid]->renderLink(); 127 - } else { 128 - $committer = DiffusionView::renderName($committer); 129 - } 130 - if ($author != $committer) { 131 - $author = hsprintf('%s/%s', $author, $committer); 132 - } 133 - } 134 - 135 - $details = DiffusionView::linkDetail( 136 - $drequest->getRepository(), 137 - $commit->getCommitIdentifier(), 138 - $data->getSummary()); 139 - $details = AphrontTableView::renderSingleDisplayLine($details); 140 - } else { 141 - $author = ''; 142 - $details = ''; 143 - } 144 127 145 128 $return = array( 146 129 'commit' => $modified,
+1
src/applications/repository/phid/PhabricatorRepositoryIdentityPHIDType.php
··· 39 39 $handle->setObjectName(pht('Identity %d', $id)); 40 40 $handle->setName($name); 41 41 $handle->setURI($identity->getURI()); 42 + $handle->setIcon('fa-user'); 42 43 } 43 44 } 44 45
+2 -2
src/applications/repository/storage/PhabricatorRepositoryCommit.php
··· 464 464 $data = $this->getCommitData(); 465 465 $committer_name = $data->getCommitDetail('committer'); 466 466 if (strlen($committer_name)) { 467 - return $committer_name; 467 + return DiffusionView::renderName($committer_name); 468 468 } 469 469 470 470 return null; ··· 479 479 $data = $this->getCommitData(); 480 480 $author_name = $data->getAuthorName(); 481 481 if (strlen($author_name)) { 482 - return $author_name; 482 + return DiffusionView::renderName($author_name); 483 483 } 484 484 485 485 return null;