1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Fix two diff rendering bugs

Summary:
  - The order of operations for file changes is wrong. We need to wrap them in a table, then render the changeset talbe around that table.
  - Line data was being set to late, so renderShield() got the wrong line count and rendered empty diffs behind, e.g., generated changes.

Test Plan: Looked at an image change with property changes. Clicked "show file contents" on a generated file.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D4432
This commit is contained in:
epriestley 2013-01-15 08:07:40 -08:00
parent 894666f975
commit 4566b86376
2 changed files with 8 additions and 6 deletions

View file

@ -704,7 +704,9 @@ final class DifferentialChangesetParser {
->setCodeCoverage($this->getCoverage())
->setRenderingReference($this->getRenderingReference())
->setMarkupEngine($this->markupEngine)
->setHandles($this->handles);
->setHandles($this->handles)
->setOldLines($this->old)
->setNewLines($this->new);
if ($this->user) {
$renderer->setUser($this->user);
@ -894,8 +896,6 @@ final class DifferentialChangesetParser {
);
$renderer
->setOldLines($this->old)
->setNewLines($this->new)
->setGaps($gaps)
->setMask($mask)
->setDepths($depths);

View file

@ -406,7 +406,7 @@ final class DifferentialChangesetTwoUpRenderer
$th_new = '<th id="C'.$id.'NL1">1</th>';
}
$output = $this->renderChangesetTable(
$output =
'<tr class="differential-image-diff">'.
$th_old.
'<td class="left differential-old-image">'.$old.'</td>'.
@ -416,9 +416,11 @@ final class DifferentialChangesetTwoUpRenderer
'</td>'.
'</tr>'.
implode('', $html_old).
implode('', $html_new));
implode('', $html_new);
return $this->wrapChangeInTable($output);
$output = $this->wrapChangeInTable($output);
return $this->renderChangesetTable($output);
}
}