Move various other callsites away from callsigns
Summary: Ref T4245. These mostly relate to building URIs. Test Plan: Tried to hunt down as many of these in the UI as I could. Some are a bit tricky but they should be low-risk. Reviewers: chad Reviewed By: chad Maniphest Tasks: T4245 Differential Revision: https://secure.phabricator.com/D14933
This commit is contained in:
@@ -33,7 +33,6 @@ final class DiffusionChangeController extends DiffusionController {
|
||||
}
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
$callsign = $repository->getCallsign();
|
||||
$changesets = array(
|
||||
0 => $changeset,
|
||||
);
|
||||
@@ -59,7 +58,8 @@ final class DiffusionChangeController extends DiffusionController {
|
||||
$left_uri = $drequest->generateURI($raw_params);
|
||||
$changeset_view->setRawFileURIs($left_uri, $right_uri);
|
||||
|
||||
$changeset_view->setRenderURI('/diffusion/'.$callsign.'/diff/');
|
||||
$changeset_view->setRenderURI($repository->getPathURI('diff/'));
|
||||
|
||||
$changeset_view->setWhitespace(
|
||||
DifferentialChangesetParser::WHITESPACE_SHOW_ALL);
|
||||
$changeset_view->setUser($viewer);
|
||||
|
||||
@@ -36,7 +36,6 @@ final class DiffusionCommitController extends DiffusionController {
|
||||
}
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
$callsign = $repository->getCallsign();
|
||||
|
||||
$content = array();
|
||||
$commit = id(new DiffusionCommitQuery())
|
||||
@@ -321,19 +320,21 @@ final class DiffusionCommitController extends DiffusionController {
|
||||
$change_list->setChangesets($changesets);
|
||||
$change_list->setVisibleChangesets($visible_changesets);
|
||||
$change_list->setRenderingReferences($references);
|
||||
$change_list->setRenderURI('/diffusion/'.$callsign.'/diff/');
|
||||
$change_list->setRenderURI(
|
||||
$repository->getPathURI('diff/'));
|
||||
$change_list->setRepository($repository);
|
||||
$change_list->setUser($user);
|
||||
|
||||
// TODO: Try to setBranch() to something reasonable here?
|
||||
|
||||
$change_list->setStandaloneURI(
|
||||
'/diffusion/'.$callsign.'/diff/');
|
||||
$repository->getPathURI('diff/'));
|
||||
|
||||
$change_list->setRawFileURIs(
|
||||
// TODO: Implement this, somewhat tricky if there's an octopus merge
|
||||
// or whatever?
|
||||
null,
|
||||
'/diffusion/'.$callsign.'/diff/?view=r');
|
||||
$repository->getPathURI('diff/?view=r'));
|
||||
|
||||
$change_list->setInlineCommentControllerURI(
|
||||
'/diffusion/inline/edit/'.phutil_escape_uri($commit->getPHID()).'/');
|
||||
@@ -567,8 +568,8 @@ final class DiffusionCommitController extends DiffusionController {
|
||||
),
|
||||
pht('Unknown'));
|
||||
|
||||
$callsign = $repository->getCallsign();
|
||||
$root = '/diffusion/'.$callsign.'/commit/'.$commit->getCommitIdentifier();
|
||||
$identifier = $commit->getCommitIdentifier();
|
||||
$root = $repository->getPathURI("commit/{$identifier}");
|
||||
Javelin::initBehavior(
|
||||
'diffusion-commit-branches',
|
||||
array(
|
||||
@@ -904,8 +905,8 @@ final class DiffusionCommitController extends DiffusionController {
|
||||
$commit,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$uri = '/diffusion/'.$repository->getCallsign().'/commit/'.
|
||||
$commit->getCommitIdentifier().'/edit/';
|
||||
$identifier = $commit->getCommitIdentifier();
|
||||
$uri = $repository->getPathURI("commit/{$identifier}/edit/");
|
||||
|
||||
$action = id(new PhabricatorActionView())
|
||||
->setName(pht('Edit Commit'))
|
||||
|
||||
@@ -86,7 +86,6 @@ abstract class DiffusionController extends PhabricatorController {
|
||||
return $crumb_list;
|
||||
}
|
||||
|
||||
$callsign = $repository->getCallsign();
|
||||
$repository_name = $repository->getName();
|
||||
|
||||
if (!$spec['commit'] && !$spec['tags'] && !$spec['branches']) {
|
||||
@@ -112,17 +111,14 @@ abstract class DiffusionController extends PhabricatorController {
|
||||
$crumb_list[] = $crumb;
|
||||
|
||||
$stable_commit = $drequest->getStableCommit();
|
||||
$commit_name = $repository->formatCommitName($stable_commit);
|
||||
$commit_uri = $repository->getCommitURI($stable_commit);
|
||||
|
||||
if ($spec['tags']) {
|
||||
$crumb = new PHUICrumbView();
|
||||
if ($spec['commit']) {
|
||||
$crumb->setName(
|
||||
pht('Tags for %s', 'r'.$callsign.$stable_commit));
|
||||
$crumb->setHref($drequest->generateURI(
|
||||
array(
|
||||
'action' => 'commit',
|
||||
'commit' => $drequest->getStableCommit(),
|
||||
)));
|
||||
$crumb->setName(pht('Tags for %s', $commit_name));
|
||||
$crumb->setHref($commit_uri);
|
||||
} else {
|
||||
$crumb->setName(pht('Tags'));
|
||||
}
|
||||
@@ -139,8 +135,8 @@ abstract class DiffusionController extends PhabricatorController {
|
||||
|
||||
if ($spec['commit']) {
|
||||
$crumb = id(new PHUICrumbView())
|
||||
->setName("r{$callsign}{$stable_commit}")
|
||||
->setHref("r{$callsign}{$stable_commit}");
|
||||
->setName($commit_name)
|
||||
->setHref($commit_uri);
|
||||
$crumb_list[] = $crumb;
|
||||
return $crumb_list;
|
||||
}
|
||||
@@ -187,7 +183,7 @@ abstract class DiffusionController extends PhabricatorController {
|
||||
protected function getRepositoryControllerURI(
|
||||
PhabricatorRepository $repository,
|
||||
$path) {
|
||||
return $this->getApplicationURI($repository->getCallsign().'/'.$path);
|
||||
return $repository->getPathURI($path);
|
||||
}
|
||||
|
||||
protected function renderPathLinks(DiffusionRequest $drequest, $action) {
|
||||
|
||||
@@ -48,7 +48,7 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
$redirect = DiffusionRequest::generateDiffusionURI(
|
||||
array(
|
||||
'action' => 'browse',
|
||||
'callsign' => $repository->getCallsign(),
|
||||
'repository' => $repository,
|
||||
'branch' => $repository->getDefaultBranch(),
|
||||
'commit' => $id,
|
||||
));
|
||||
@@ -86,7 +86,7 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
$redirect = DiffusionRequest::generateDiffusionURI(
|
||||
array(
|
||||
'action' => 'browse',
|
||||
'callsign' => $repo->getCallsign(),
|
||||
'repository' => $repo,
|
||||
'branch' => $repo->getDefaultBranch(),
|
||||
'commit' => $commit->getCommitIdentifier(),
|
||||
));
|
||||
@@ -99,7 +99,7 @@ final class DiffusionExternalController extends DiffusionController {
|
||||
$href = DiffusionRequest::generateDiffusionURI(
|
||||
array(
|
||||
'action' => 'browse',
|
||||
'callsign' => $repo->getCallsign(),
|
||||
'repository' => $repo,
|
||||
'branch' => $repo->getDefaultBranch(),
|
||||
'commit' => $commit->getCommitIdentifier(),
|
||||
));
|
||||
|
||||
@@ -480,7 +480,7 @@ final class DiffusionRepositoryController extends DiffusionController {
|
||||
private function buildActionList(PhabricatorRepository $repository) {
|
||||
$viewer = $this->getRequest()->getUser();
|
||||
|
||||
$edit_uri = $this->getApplicationURI($repository->getCallsign().'/edit/');
|
||||
$edit_uri = $repository->getPathURI('edit/');
|
||||
|
||||
$view = id(new PhabricatorActionListView())
|
||||
->setUser($viewer)
|
||||
|
||||
Reference in New Issue
Block a user