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

Display 'away date' in blame

Summary: I've done D3432 in the hope that it will fix also this...

Test Plan: Blamed sporadic author.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3433
This commit is contained in:
vrana 2012-09-04 19:22:03 -07:00
parent 285cb172e9
commit efd59322f2
2 changed files with 12 additions and 2 deletions

View file

@ -52,6 +52,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
$file_query = DiffusionFileContentQuery::newFromDiffusionRequest(
$this->diffusionRequest);
$file_query->setViewer($request->getUser());
$file_query->setNeedsBlame($needs_blame);
$file_query->loadFileContent();
$data = $file_query->getRawData();

View file

@ -20,6 +20,7 @@ abstract class DiffusionFileContentQuery extends DiffusionQuery {
private $needsBlame;
private $fileContent;
private $viewer;
final public static function newFromDiffusionRequest(
DiffusionRequest $request) {
@ -99,8 +100,11 @@ abstract class DiffusionFileContentQuery extends DiffusionQuery {
$phids[] = $data->getCommitDetail('authorPHID');
}
$handles = id(new PhabricatorObjectHandleData(array_unique($phids)))
->loadHandles();
$loader = new PhabricatorObjectHandleData(array_unique($phids));
if ($this->viewer) {
$loader->setViewer($this->viewer);
}
$handles = $loader->loadHandles();
foreach ($commits_data as $data) {
if ($data->getCommitDetail('authorPHID')) {
@ -126,6 +130,11 @@ abstract class DiffusionFileContentQuery extends DiffusionQuery {
return $this->needsBlame;
}
public function setViewer(PhabricatorUser $user) {
$this->viewer = $user;
return $this;
}
protected function processRevList(array $rev_list) {
return $rev_list;
}