1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 23:40:57 +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;
}
private function loadOtherRevisions($changesets, $target, $repository) {
private function loadOtherRevisions(
array $changesets,
DifferentialDiff $target,
PhabricatorRepository $repository) {
assert_instances_of($changesets, 'DifferentialChangeset');
if (!$repository) {
return array();
}
@ -739,8 +744,8 @@ final class DifferentialRevisionViewController extends DifferentialController {
$paths = array();
foreach ($changesets as $changeset) {
$paths[] = $changeset->getAbsoluteRepositoryPath(
$target,
$repository);
$repository,
$target);
}
if (!$paths) {

View file

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

View file

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

View file

@ -196,7 +196,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
}
if ($this->diff && $this->repository) {
$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->setRenderingReferences($references);
$change_list->setRenderURI('/diffusion/'.$callsign.'/diff/');
$change_list->setRepository($repository);
$change_list->setUser($user);
$change_list->setStandaloneURI(

View file

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