@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+45 -36
+2 -2
src/applications/diffusion/controller/DiffusionChangeController.php
··· 33 33 } 34 34 35 35 $repository = $drequest->getRepository(); 36 - $callsign = $repository->getCallsign(); 37 36 $changesets = array( 38 37 0 => $changeset, 39 38 ); ··· 59 58 $left_uri = $drequest->generateURI($raw_params); 60 59 $changeset_view->setRawFileURIs($left_uri, $right_uri); 61 60 62 - $changeset_view->setRenderURI('/diffusion/'.$callsign.'/diff/'); 61 + $changeset_view->setRenderURI($repository->getPathURI('diff/')); 62 + 63 63 $changeset_view->setWhitespace( 64 64 DifferentialChangesetParser::WHITESPACE_SHOW_ALL); 65 65 $changeset_view->setUser($viewer);
+9 -8
src/applications/diffusion/controller/DiffusionCommitController.php
··· 36 36 } 37 37 38 38 $repository = $drequest->getRepository(); 39 - $callsign = $repository->getCallsign(); 40 39 41 40 $content = array(); 42 41 $commit = id(new DiffusionCommitQuery()) ··· 321 320 $change_list->setChangesets($changesets); 322 321 $change_list->setVisibleChangesets($visible_changesets); 323 322 $change_list->setRenderingReferences($references); 324 - $change_list->setRenderURI('/diffusion/'.$callsign.'/diff/'); 323 + $change_list->setRenderURI( 324 + $repository->getPathURI('diff/')); 325 325 $change_list->setRepository($repository); 326 326 $change_list->setUser($user); 327 327 328 328 // TODO: Try to setBranch() to something reasonable here? 329 329 330 330 $change_list->setStandaloneURI( 331 - '/diffusion/'.$callsign.'/diff/'); 331 + $repository->getPathURI('diff/')); 332 + 332 333 $change_list->setRawFileURIs( 333 334 // TODO: Implement this, somewhat tricky if there's an octopus merge 334 335 // or whatever? 335 336 null, 336 - '/diffusion/'.$callsign.'/diff/?view=r'); 337 + $repository->getPathURI('diff/?view=r')); 337 338 338 339 $change_list->setInlineCommentControllerURI( 339 340 '/diffusion/inline/edit/'.phutil_escape_uri($commit->getPHID()).'/'); ··· 567 568 ), 568 569 pht('Unknown')); 569 570 570 - $callsign = $repository->getCallsign(); 571 - $root = '/diffusion/'.$callsign.'/commit/'.$commit->getCommitIdentifier(); 571 + $identifier = $commit->getCommitIdentifier(); 572 + $root = $repository->getPathURI("commit/{$identifier}"); 572 573 Javelin::initBehavior( 573 574 'diffusion-commit-branches', 574 575 array( ··· 904 905 $commit, 905 906 PhabricatorPolicyCapability::CAN_EDIT); 906 907 907 - $uri = '/diffusion/'.$repository->getCallsign().'/commit/'. 908 - $commit->getCommitIdentifier().'/edit/'; 908 + $identifier = $commit->getCommitIdentifier(); 909 + $uri = $repository->getPathURI("commit/{$identifier}/edit/"); 909 910 910 911 $action = id(new PhabricatorActionView()) 911 912 ->setName(pht('Edit Commit'))
+7 -11
src/applications/diffusion/controller/DiffusionController.php
··· 86 86 return $crumb_list; 87 87 } 88 88 89 - $callsign = $repository->getCallsign(); 90 89 $repository_name = $repository->getName(); 91 90 92 91 if (!$spec['commit'] && !$spec['tags'] && !$spec['branches']) { ··· 112 111 $crumb_list[] = $crumb; 113 112 114 113 $stable_commit = $drequest->getStableCommit(); 114 + $commit_name = $repository->formatCommitName($stable_commit); 115 + $commit_uri = $repository->getCommitURI($stable_commit); 115 116 116 117 if ($spec['tags']) { 117 118 $crumb = new PHUICrumbView(); 118 119 if ($spec['commit']) { 119 - $crumb->setName( 120 - pht('Tags for %s', 'r'.$callsign.$stable_commit)); 121 - $crumb->setHref($drequest->generateURI( 122 - array( 123 - 'action' => 'commit', 124 - 'commit' => $drequest->getStableCommit(), 125 - ))); 120 + $crumb->setName(pht('Tags for %s', $commit_name)); 121 + $crumb->setHref($commit_uri); 126 122 } else { 127 123 $crumb->setName(pht('Tags')); 128 124 } ··· 139 135 140 136 if ($spec['commit']) { 141 137 $crumb = id(new PHUICrumbView()) 142 - ->setName("r{$callsign}{$stable_commit}") 143 - ->setHref("r{$callsign}{$stable_commit}"); 138 + ->setName($commit_name) 139 + ->setHref($commit_uri); 144 140 $crumb_list[] = $crumb; 145 141 return $crumb_list; 146 142 } ··· 187 183 protected function getRepositoryControllerURI( 188 184 PhabricatorRepository $repository, 189 185 $path) { 190 - return $this->getApplicationURI($repository->getCallsign().'/'.$path); 186 + return $repository->getPathURI($path); 191 187 } 192 188 193 189 protected function renderPathLinks(DiffusionRequest $drequest, $action) {
+3 -3
src/applications/diffusion/controller/DiffusionExternalController.php
··· 48 48 $redirect = DiffusionRequest::generateDiffusionURI( 49 49 array( 50 50 'action' => 'browse', 51 - 'callsign' => $repository->getCallsign(), 51 + 'repository' => $repository, 52 52 'branch' => $repository->getDefaultBranch(), 53 53 'commit' => $id, 54 54 )); ··· 86 86 $redirect = DiffusionRequest::generateDiffusionURI( 87 87 array( 88 88 'action' => 'browse', 89 - 'callsign' => $repo->getCallsign(), 89 + 'repository' => $repo, 90 90 'branch' => $repo->getDefaultBranch(), 91 91 'commit' => $commit->getCommitIdentifier(), 92 92 )); ··· 99 99 $href = DiffusionRequest::generateDiffusionURI( 100 100 array( 101 101 'action' => 'browse', 102 - 'callsign' => $repo->getCallsign(), 102 + 'repository' => $repo, 103 103 'branch' => $repo->getDefaultBranch(), 104 104 'commit' => $commit->getCommitIdentifier(), 105 105 ));
+1 -1
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 480 480 private function buildActionList(PhabricatorRepository $repository) { 481 481 $viewer = $this->getRequest()->getUser(); 482 482 483 - $edit_uri = $this->getApplicationURI($repository->getCallsign().'/edit/'); 483 + $edit_uri = $repository->getPathURI('edit/'); 484 484 485 485 $view = id(new PhabricatorActionListView()) 486 486 ->setUser($viewer)
+1 -1
src/applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php
··· 14 14 $repository = $object->getRepository(); 15 15 16 16 $params = array( 17 - 'callsign' => $repository->getCallsign(), 17 + 'repository' => $repository->getPHID(), 18 18 'contains' => $commit->getCommitIdentifier(), 19 19 ); 20 20
+1 -1
src/applications/diffusion/query/DiffusionQuery.php
··· 53 53 $repository = $drequest->getRepository(); 54 54 55 55 $core_params = array( 56 - 'callsign' => $repository->getCallsign(), 56 + 'repository' => $repository->getPHID(), 57 57 ); 58 58 59 59 if ($drequest->getBranch() !== null) {
+10 -2
src/applications/diffusion/request/DiffusionRequest.php
··· 465 465 } 466 466 467 467 $defaults = array( 468 - 'callsign' => $this->getCallsign(), 468 + 'repository' => $this->getRepository(), 469 469 'path' => $this->getPath(), 470 470 'branch' => $this->getBranch(), 471 471 'commit' => $default_commit, ··· 487 487 * - `action` One of `history`, `browse`, `change`, `lastmodified`, 488 488 * `branch`, `tags`, `branches`, or `revision-ref`. The action specified 489 489 * by the URI. 490 + * - `repository` Repository. 490 491 * - `callsign` Repository callsign. 491 492 * - `branch` Optional if action is not `branch`, branch name. 492 493 * - `path` Optional, path to file. ··· 504 505 public static function generateDiffusionURI(array $params) { 505 506 $action = idx($params, 'action'); 506 507 507 - $callsign = idx($params, 'callsign'); 508 + $repository = idx($params, 'repository'); 509 + 510 + if ($repository) { 511 + $callsign = $repository->getCallsign(); 512 + } else { 513 + $callsign = idx($params, 'callsign'); 514 + } 515 + 508 516 $path = idx($params, 'path'); 509 517 $branch = idx($params, 'branch'); 510 518 $commit = idx($params, 'commit');
+2 -2
src/applications/harbormaster/step/HarbormasterWaitForPreviousBuildStepImplementation.php
··· 63 63 $call = new ConduitCall( 64 64 'diffusion.commitparentsquery', 65 65 array( 66 - 'commit' => $commit->getCommitIdentifier(), 67 - 'callsign' => $commit->getRepository()->getCallsign(), 66 + 'commit' => $commit->getCommitIdentifier(), 67 + 'repository' => $commit->getRepository()->getPHID(), 68 68 )); 69 69 $call->setUser(PhabricatorUser::getOmnipotentUser()); 70 70 $parents = $call->execute();
+1 -1
src/applications/owners/controller/PhabricatorOwnersDetailController.php
··· 270 270 } 271 271 $href = DiffusionRequest::generateDiffusionURI( 272 272 array( 273 - 'callsign' => $repo->getCallsign(), 273 + 'repository' => $repo, 274 274 'branch' => $repo->getDefaultBranch(), 275 275 'path' => $path->getPath(), 276 276 'action' => 'browse',
+1 -1
src/applications/repository/customfield/PhabricatorCommitBranchesField.php
··· 26 26 27 27 $params = array( 28 28 'contains' => $this->getObject()->getCommitIdentifier(), 29 - 'callsign' => $this->getObject()->getRepository()->getCallsign(), 29 + 'repository' => $this->getObject()->getRepository()->getPHID(), 30 30 ); 31 31 32 32 try {
+1 -1
src/applications/repository/customfield/PhabricatorCommitMergedCommitsField.php
··· 39 39 id(new ConduitCall('diffusion.mergedcommitsquery', array( 40 40 'commit' => $commit->getCommitIdentifier(), 41 41 'limit' => $limit + 1, 42 - 'callsign' => $commit->getRepository()->getCallsign(), 42 + 'repository' => $commit->getRepository()->getPHID(), 43 43 ))) 44 44 ->setUser($this->getViewer()) 45 45 ->execute());
+1 -1
src/applications/repository/customfield/PhabricatorCommitTagsField.php
··· 26 26 27 27 $params = array( 28 28 'commit' => $this->getObject()->getCommitIdentifier(), 29 - 'callsign' => $this->getObject()->getRepository()->getCallsign(), 29 + 'repository' => $this->getObject()->getRepository()->getPHID(), 30 30 ); 31 31 32 32 try {
+1 -1
src/applications/repository/query/PhabricatorRepositorySearchEngine.php
··· 177 177 if ($size) { 178 178 $history_uri = DiffusionRequest::generateDiffusionURI( 179 179 array( 180 - 'callsign' => $repository->getCallsign(), 180 + 'repository' => $repository, 181 181 'action' => 'history', 182 182 )); 183 183
+4
src/applications/repository/storage/PhabricatorRepository.php
··· 601 601 return '/diffusion/'.$this->getCallsign().'/'; 602 602 } 603 603 604 + public function getPathURI($path) { 605 + return $this->getURI().$path; 606 + } 607 + 604 608 public function getCommitURI($identifier) { 605 609 $callsign = $this->getCallsign(); 606 610 return "/r{$callsign}{$identifier}";