1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-02 03:32:42 +01:00

Display Browse in Diffusion and Open in Editor links in commit detail

Test Plan:
/rX1
Browse in Diffusion
Open in Editor

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2180
This commit is contained in:
vrana 2012-04-09 23:42:12 -07:00
parent 488b1cf641
commit 347bc357fd
6 changed files with 16 additions and 10 deletions

View file

@ -731,7 +731,12 @@ final class DifferentialRevisionViewController extends DifferentialController {
return $symbol_indexes; return $symbol_indexes;
} }
private function loadOtherRevisions($changesets, $target, $repository) { private function loadOtherRevisions(
array $changesets,
DifferentialDiff $target,
PhabricatorRepository $repository) {
assert_instances_of($changesets, 'DifferentialChangeset');
if (!$repository) { if (!$repository) {
return array(); return array();
} }
@ -739,8 +744,8 @@ final class DifferentialRevisionViewController extends DifferentialController {
$paths = array(); $paths = array();
foreach ($changesets as $changeset) { foreach ($changesets as $changeset) {
$paths[] = $changeset->getAbsoluteRepositoryPath( $paths[] = $changeset->getAbsoluteRepositoryPath(
$target, $repository,
$repository); $target);
} }
if (!$paths) { if (!$paths) {

View file

@ -148,11 +148,11 @@ final class DifferentialChangeset extends DifferentialDAO {
} }
public function getAbsoluteRepositoryPath( public function getAbsoluteRepositoryPath(
DifferentialDiff $diff, PhabricatorRepository $repository,
PhabricatorRepository $repository) { DifferentialDiff $diff = null) {
$base = '/'; $base = '/';
if ($diff->getSourceControlPath()) { if ($diff && $diff->getSourceControlPath()) {
$base = id(new PhutilURI($diff->getSourceControlPath()))->getPath(); $base = id(new PhutilURI($diff->getSourceControlPath()))->getPath();
} }

View file

@ -228,7 +228,7 @@ final class DifferentialChangesetListView extends AphrontView {
$repository = $this->repository; $repository = $this->repository;
if ($repository) { if ($repository) {
$meta['diffusionURI'] = (string)$repository->getDiffusionBrowseURIForPath( $meta['diffusionURI'] = (string)$repository->getDiffusionBrowseURIForPath(
$changeset->getAbsoluteRepositoryPath($this->diff, $repository)); $changeset->getAbsoluteRepositoryPath($repository, $this->diff));
} }
$change = $changeset->getChangeType(); $change = $changeset->getChangeType();
@ -253,7 +253,7 @@ final class DifferentialChangesetListView extends AphrontView {
$user = $this->user; $user = $this->user;
if ($user && $repository) { if ($user && $repository) {
$path = ltrim( $path = ltrim(
$changeset->getAbsoluteRepositoryPath($this->diff, $repository), $changeset->getAbsoluteRepositoryPath($repository, $this->diff),
'/'); '/');
$line = 1; // TODO: get first changed line $line = 1; // TODO: get first changed line
$callsign = $repository->getCallsign(); $callsign = $repository->getCallsign();

View file

@ -196,7 +196,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
} }
if ($this->diff && $this->repository) { if ($this->diff && $this->repository) {
$paths[] = $paths[] =
$changeset->getAbsoluteRepositoryPath($this->diff, $this->repository); $changeset->getAbsoluteRepositoryPath($this->repository, $this->diff);
} }
} }

View file

@ -230,6 +230,7 @@ final class DiffusionCommitController extends DiffusionController {
$change_list->setChangesets($changesets); $change_list->setChangesets($changesets);
$change_list->setRenderingReferences($references); $change_list->setRenderingReferences($references);
$change_list->setRenderURI('/diffusion/'.$callsign.'/diff/'); $change_list->setRenderURI('/diffusion/'.$callsign.'/diff/');
$change_list->setRepository($repository);
$change_list->setUser($user); $change_list->setUser($user);
$change_list->setStandaloneURI( $change_list->setStandaloneURI(

View file

@ -135,7 +135,7 @@ final class HeraldDifferentialRevisionAdapter extends HeraldObjectAdapter {
$diff = $this->diff; $diff = $this->diff;
return $changeset->getAbsoluteRepositoryPath($diff, $repository); return $changeset->getAbsoluteRepositoryPath($repository, $diff);
} }
protected function loadContentDictionary() { protected function loadContentDictionary() {