From d63f3d479ccfb26c7618b7cd28399413a522217c Mon Sep 17 00:00:00 2001 From: tuomaspelkonen Date: Mon, 9 May 2011 16:42:39 -0700 Subject: [PATCH] Fixed 'Modified' link in Diffusion History View. Summary: 'Modified' link always pointed to the latest change. Fixed the link. Test Plan: Tested that clicking 'Modified' took me to the correct place. Made sure that Diffusion commit view was still working correctly. Reviewed By: epriestley Reviewers: epriestley CC: jungejason, aran, epriestley Differential Revision: 255 --- src/applications/diffusion/view/base/DiffusionView.php | 7 +++++-- .../view/historytable/DiffusionHistoryTableView.php | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/applications/diffusion/view/base/DiffusionView.php b/src/applications/diffusion/view/base/DiffusionView.php index ff1856345a..3cb5c8bc35 100644 --- a/src/applications/diffusion/view/base/DiffusionView.php +++ b/src/applications/diffusion/view/base/DiffusionView.php @@ -29,7 +29,8 @@ abstract class DiffusionView extends AphrontView { return $this->diffusionRequest; } - final public function linkChange($change_type, $file_type, $path = null) { + final public function linkChange($change_type, $file_type, $path = null, + $commit_identifier = null) { $text = DifferentialChangeType::getFullNameForChangeType($change_type); if ($change_type == DifferentialChangeType::TYPE_CHILD) { @@ -42,7 +43,9 @@ abstract class DiffusionView extends AphrontView { $drequest = $this->getDiffusionRequest(); - if ($drequest->getRawCommit()) { + if ($commit_identifier) { + $commit = ';'.$commit_identifier; + } else if ($drequest->getRawCommit()) { $commit = ';'.$drequest->getCommitURIComponent($drequest->getRawCommit()); } else { $commit = null; diff --git a/src/applications/diffusion/view/historytable/DiffusionHistoryTableView.php b/src/applications/diffusion/view/historytable/DiffusionHistoryTableView.php index dddb708669..283cf99828 100644 --- a/src/applications/diffusion/view/historytable/DiffusionHistoryTableView.php +++ b/src/applications/diffusion/view/historytable/DiffusionHistoryTableView.php @@ -71,7 +71,9 @@ final class DiffusionHistoryTableView extends DiffusionView { $history->getCommitIdentifier()), $this->linkChange( $history->getChangeType(), - $history->getFileType()), + $history->getFileType(), + null, + $history->getCommitIdentifier()), $date, $time, $author,