1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Linking the unixname in Phabricator's blame view to the employee's profile.

Test Plan:
Visit page
http://phabricator.devXXXX.snc6.facebook.com/diffusion/E/browse/tfb/trunk/www/hphp_files.mk?view=blame
and verify that unixnames are hyperlinks leading to emplyees' profiles.

Task: T297

Reviewed By: tuomaspelkonen
Reviewers: tuomaspelkonen, epriestley
Commenters: epriestley
CC: aran, blazej0, epriestley, tuomaspelkonen
Differential Revision: 622
This commit is contained in:
Blazej Osinski 2011-07-08 17:39:33 -07:00
parent 73b0468f72
commit 3771f63441
2 changed files with 27 additions and 4 deletions

View file

@ -97,16 +97,37 @@ abstract class DiffusionFileContentQuery {
}
$repository = $this->getRequest()->getRepository();
$commits = id(new PhabricatorRepositoryCommit())->loadAllWhere(
'repositoryID = %d AND commitIdentifier IN (%Ls)', $repository->getID(),
array_unique($rev_list));
foreach ($commits as $commit) {
$commitIdentifier = $commit->getCommitIdentifier();
$epoch = $commit->getEpoch();
$blame_dict[$commitIdentifier]['epoch'] = $epoch;
$blame_dict[$commit->getCommitIdentifier()]['epoch'] =
$commit->getEpoch();
}
}
$commits_data = id(new PhabricatorRepositoryCommitData())->loadAllWhere(
'commitID IN (%Ls)',
mpull($commits, 'getID'));
$phids = array();
foreach ($commits_data as $data) {
$phids[] = $data->getCommitDetail('authorPHID');
}
$handles = id(new PhabricatorObjectHandleData(array_unique($phids)))
->loadHandles();
foreach ($commits_data as $data) {
if ($data->getCommitDetail('authorPHID')) {
$commit_identifier =
$commits[$data->getCommitID()]->getCommitIdentifier();
$blame_dict[$commit_identifier]['author'] =
$handles[$data->getCommitDetail('authorPHID')]->renderLink();
}
}
}
return array($text_list, $rev_list, $blame_dict);
}

View file

@ -6,8 +6,10 @@
phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'applications/repository/constants/repositorytype');
phutil_require_module('phabricator', 'applications/repository/storage/commit');
phutil_require_module('phabricator', 'applications/repository/storage/commitdata');
phutil_require_module('phutil', 'symbols');
phutil_require_module('phutil', 'utils');