Introduce "local names" for commits

Summary: Ref T4245. Full commit display names (like `rPaaaa`) are going to be obnoxious soon in some cases (e.g., `rPaaaa` becomes `R123:aaaa`, which is much uglier) so reduce how often we show the repository in cases where it isn't really necessary to include it.

Test Plan:
  - Saw no more `rX` on repository list view for Git/Mercurial (still present for Subversion).
  - Saw no more `rX` on various repository detail views, except when referencing other commits (e.g., mentions).
  - Grepped for removed `getShortName()`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4245

Differential Revision: https://secure.phabricator.com/D14990
This commit is contained in:
epriestley
2016-01-11 02:49:04 -08:00
parent 96ebd35824
commit b848ab87b3
5 changed files with 40 additions and 12 deletions

View File

@@ -160,10 +160,16 @@ final class PhabricatorRepositorySearchEngine
$commit = $repository->getMostRecentCommit();
if ($commit) {
$commit_link = DiffusionView::linkCommit(
$repository,
$commit->getCommitIdentifier(),
$commit->getSummary());
$commit_link = phutil_tag(
'a',
array(
'href' => $commit->getURI(),
),
pht(
'%s: %s',
$commit->getLocalName(),
$commit->getSummary()));
$item->setSubhead($commit_link);
$item->setEpoch($commit->getEpoch());
}