mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 20:10:55 +01:00
Modify whitespace default implementation
Summary: Take Tuomas's first diff. Sorry, my bad on diff feedback. Test Plan: Load D240353 without any options and make sure 'ignore-trailing' selected. Reviewed By: tuomaspelkonen Reviewers: tuomaspelkonen CC: epriestley, aran, tuomaspelkonen Differential Revision: 172
This commit is contained in:
parent
2b0b39c4e4
commit
f910c379ce
4 changed files with 17 additions and 13 deletions
|
@ -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(
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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,
|
||||
));
|
||||
|
||||
|
|
Loading…
Reference in a new issue