From 5b6713f3c1913c23fd91bd8512a908d827ca581b Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 15 Jun 2012 17:15:29 -0700 Subject: [PATCH] Allow revision action links using VS diff Test Plan: Created action link using VS diff, selected VS diff. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2770 --- .../DifferentialRevisionDetailRenderer.php | 12 +++++++++++- .../DifferentialRevisionViewController.php | 6 ++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/applications/differential/controller/DifferentialRevisionDetailRenderer.php b/src/applications/differential/controller/DifferentialRevisionDetailRenderer.php index 3262549364..a7d8856830 100644 --- a/src/applications/differential/controller/DifferentialRevisionDetailRenderer.php +++ b/src/applications/differential/controller/DifferentialRevisionDetailRenderer.php @@ -1,7 +1,7 @@ vsDiff = $diff; + return $this; + } + + final protected function getVSDiff() { + return $this->vsDiff; + } /** * This function must return an array of action links that will be diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index e0e9d1f8ec..0fa578f189 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -227,8 +227,10 @@ final class DifferentialRevisionViewController extends DifferentialController { // TODO: build a better version of the action links and deprecate the // whole DifferentialRevisionDetailRenderer class. - $custom_renderer = - newv($custom_renderer_class, array()); + $custom_renderer = newv($custom_renderer_class, array()); + if ($diff_vs) { + $custom_renderer->setVSDiff($diffs[$diff_vs]); + } $actions = array_merge( $actions, $custom_renderer->generateActionLinks($revision, $target_manual));