diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index e73757d9c3..5e2253989c 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -157,6 +157,11 @@ class DifferentialRevisionViewController extends DifferentialController { $custom_renderer->generateActionLinks($revision, $target)); } + $whitespace = $request->getStr( + 'whitespace', + DifferentialChangesetParser::WHITESPACE_IGNORE_TRAILING + ); + $revision_detail->setActions($actions); $revision_detail->setUser($user); @@ -174,19 +179,20 @@ class DifferentialRevisionViewController extends DifferentialController { $changeset_view->setEditable(true); $changeset_view->setRevision($revision); $changeset_view->setVsMap($vs_map); - $changeset_view->setWhitespace($request->getStr('whitespace')); + $changeset_view->setWhitespace($whitespace); $diff_history = new DifferentialRevisionUpdateHistoryView(); $diff_history->setDiffs($diffs); $diff_history->setSelectedVersusDiffID($diff_vs); $diff_history->setSelectedDiffID($target->getID()); - $diff_history->setSelectedWhitespace($changeset_view->getWhitespace()); + $diff_history->setSelectedWhitespace($whitespace); $toc_view = new DifferentialDiffTableOfContentsView(); $toc_view->setChangesets($changesets); $toc_view->setStandaloneViewLink(empty($visible_changesets)); $toc_view->setVsMap($vs_map); $toc_view->setRevisionID($revision->getID()); + $toc_view->setWhitespace($whitespace); $draft = id(new PhabricatorDraft())->loadOneWhere( diff --git a/src/applications/differential/controller/revisionview/__init__.php b/src/applications/differential/controller/revisionview/__init__.php index 41a5ec6d22..4747da2e62 100644 --- a/src/applications/differential/controller/revisionview/__init__.php +++ b/src/applications/differential/controller/revisionview/__init__.php @@ -10,6 +10,7 @@ phutil_require_module('phabricator', 'aphront/response/404'); phutil_require_module('phabricator', 'applications/differential/constants/action'); phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus'); phutil_require_module('phabricator', 'applications/differential/controller/base'); +phutil_require_module('phabricator', 'applications/differential/parser/changeset'); phutil_require_module('phabricator', 'applications/differential/storage/changeset'); phutil_require_module('phabricator', 'applications/differential/storage/comment'); phutil_require_module('phabricator', 'applications/differential/storage/diffproperty'); diff --git a/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php b/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php index d43118e4b5..2d77947dc4 100644 --- a/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php +++ b/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php @@ -23,9 +23,7 @@ class DifferentialChangesetListView extends AphrontView { private $revision; private $renderURI = '/differential/changeset/'; private $vsMap = array(); - - // This is the Default value for whitespace mode! - private $whitespace = 'ignore-trailing'; + private $whitespace; public function setChangesets($changesets) { $this->changesets = $changesets; @@ -53,16 +51,10 @@ class DifferentialChangesetListView extends AphrontView { } public function setWhitespace($whitespace) { - if ($whitespace) { - $this->whitespace = $whitespace; - } + $this->whitespace = $whitespace; return $this; } - public function getWhitespace() { - return $this->whitespace; - } - public function render() { require_celerity_resource('differential-changeset-view-css'); diff --git a/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php index d67e6bbece..4c6508d7cb 100644 --- a/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php +++ b/src/applications/differential/view/difftableofcontents/DifferentialDiffTableOfContentsView.php @@ -22,6 +22,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { private $standaloneViewLink = null; private $renderURI = '/differential/changeset/'; private $revisionID; + private $whitespace; public function setChangesets($changesets) { $this->changesets = $changesets; @@ -43,6 +44,10 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { return $this; } + public function setWhitespace($whitespace) { + $this->whitespace = $whitespace; + return $this; + } public function render() { @@ -95,7 +100,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView { array( 'id' => $ref, 'vs' => $vs_id, - 'whitespace' => 'TODO', + 'whitespace' => $this->whitespace, 'revision_id' => $this->revisionID, ));