Move generateDiffusionURI() into PhabricatorRepository
Summary: Ref T4245. This further reduces the reliance on callsigns in Diffusion. Test Plan: - Pretty reasonable test coverage already exists. - Browsed repository list, browse view, history view, content view, change view, commit view, tag view, branch view of repositories. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4245 Differential Revision: https://secure.phabricator.com/D14937
This commit is contained in:
@@ -45,13 +45,13 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
|
||||
if ($best_match) {
|
||||
$repository = $repositories[$best_match];
|
||||
$redirect = DiffusionRequest::generateDiffusionURI(
|
||||
$redirect = $repository->generateURI(
|
||||
array(
|
||||
'action' => 'browse',
|
||||
'repository' => $repository,
|
||||
'branch' => $repository->getDefaultBranch(),
|
||||
'commit' => $id,
|
||||
'action' => 'browse',
|
||||
'branch' => $repository->getDefaultBranch(),
|
||||
'commit' => $id,
|
||||
));
|
||||
|
||||
return id(new AphrontRedirectResponse())->setURI($redirect);
|
||||
}
|
||||
}
|
||||
@@ -83,10 +83,9 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
} else if (count($commits) == 1) {
|
||||
$commit = head($commits);
|
||||
$repo = $repositories[$commit->getRepositoryID()];
|
||||
$redirect = DiffusionRequest::generateDiffusionURI(
|
||||
$redirect = $repo->generateURI(
|
||||
array(
|
||||
'action' => 'browse',
|
||||
'repository' => $repo,
|
||||
'branch' => $repo->getDefaultBranch(),
|
||||
'commit' => $commit->getCommitIdentifier(),
|
||||
));
|
||||
@@ -96,10 +95,9 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
$rows = array();
|
||||
foreach ($commits as $commit) {
|
||||
$repo = $repositories[$commit->getRepositoryID()];
|
||||
$href = DiffusionRequest::generateDiffusionURI(
|
||||
$href = $repo->generateURI(
|
||||
array(
|
||||
'action' => 'browse',
|
||||
'repository' => $repo,
|
||||
'branch' => $repo->getDefaultBranch(),
|
||||
'commit' => $commit->getCommitIdentifier(),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user