@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.

make "browse in diffusion" action work for commits in branches other than master

Summary: we do this by passing the "seenOnBranches" commit data detail through the stack

Test Plan: browse in diffusion link worked for non-master checkins under git

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1949

Differential Revision: https://secure.phabricator.com/D3853

+19 -2
+11 -1
src/applications/differential/view/DifferentialChangesetListView.php
··· 32 32 private $user; 33 33 private $symbolIndexes = array(); 34 34 private $repository; 35 + private $branch; 35 36 private $diff; 36 37 private $vsMap = array(); 38 + 39 + public function setBranch($branch) { 40 + $this->branch = $branch; 41 + return $this; 42 + } 43 + private function getBranch() { 44 + return $this->branch; 45 + } 37 46 38 47 public function setChangesets($changesets) { 39 48 $this->changesets = $changesets; ··· 257 266 if ($repository) { 258 267 $meta['diffusionURI'] = (string)$repository->getDiffusionBrowseURIForPath( 259 268 $changeset->getAbsoluteRepositoryPath($repository, $this->diff), 260 - idx($changeset->getMetadata(), 'line:first')); 269 + idx($changeset->getMetadata(), 'line:first'), 270 + $this->getBranch()); 261 271 } 262 272 263 273 $change = $changeset->getChangeType();
+4
src/applications/diffusion/controller/DiffusionCommitController.php
··· 269 269 $change_list->setRenderURI('/diffusion/'.$callsign.'/diff/'); 270 270 $change_list->setRepository($repository); 271 271 $change_list->setUser($user); 272 + // pick the first branch for "Browse in Diffusion" View Option 273 + $branches = $commit_data->getCommitDetail('seenOnBranches'); 274 + $first_branch = reset($branches); 275 + $change_list->setBranch($first_branch); 272 276 273 277 $change_list->setStandaloneURI( 274 278 '/diffusion/'.$callsign.'/diff/');
+4 -1
src/applications/repository/storage/PhabricatorRepository.php
··· 60 60 return $this; 61 61 } 62 62 63 - public function getDiffusionBrowseURIForPath($path, $line = null) { 63 + public function getDiffusionBrowseURIForPath($path, 64 + $line = null, 65 + $branch = null) { 64 66 $drequest = DiffusionRequest::newFromDictionary( 65 67 array( 66 68 'repository' => $this, 67 69 'path' => $path, 70 + 'branch' => $branch, 68 71 )); 69 72 70 73 return $drequest->generateURI(