diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index c48f9eb172..8d1b82e002 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -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) { diff --git a/src/applications/differential/storage/changeset/DifferentialChangeset.php b/src/applications/differential/storage/changeset/DifferentialChangeset.php index 3485e50bc1..dc7d02be0a 100644 --- a/src/applications/differential/storage/changeset/DifferentialChangeset.php +++ b/src/applications/differential/storage/changeset/DifferentialChangeset.php @@ -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(); } diff --git a/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php b/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php index 74eb6abeb6..30cc64fc6d 100644 --- a/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php +++ b/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php @@ -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(); diff --git a/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php index 39a27f4508..bd2a996fbf 100644 --- a/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php @@ -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); } } diff --git a/src/applications/diffusion/controller/commit/DiffusionCommitController.php b/src/applications/diffusion/controller/commit/DiffusionCommitController.php index b0604a5a52..2ab79be19a 100644 --- a/src/applications/diffusion/controller/commit/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/commit/DiffusionCommitController.php @@ -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( diff --git a/src/applications/herald/adapter/differential/HeraldDifferentialRevisionAdapter.php b/src/applications/herald/adapter/differential/HeraldDifferentialRevisionAdapter.php index b6ce5da89e..a5d305a0f1 100644 --- a/src/applications/herald/adapter/differential/HeraldDifferentialRevisionAdapter.php +++ b/src/applications/herald/adapter/differential/HeraldDifferentialRevisionAdapter.php @@ -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() {