mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
fix differential + diffusion for showing generated files
Summary: in the re-factor quest this got broken. Turns out NewLines (aka $this->new in the parser) gets updated right up until the very end for showing text changes so instead pass over the total line count to the renderer to get this codepath right. Test Plan: showed content of some generated files in diffusion and all was well Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2204 Differential Revision: https://secure.phabricator.com/D4237
This commit is contained in:
parent
b8d372c4bc
commit
fcc5366eff
2 changed files with 15 additions and 7 deletions
|
@ -972,9 +972,14 @@ final class DifferentialChangesetParser {
|
||||||
$this->tryCacheStuff();
|
$this->tryCacheStuff();
|
||||||
$render_pch = $this->shouldRenderPropertyChangeHeader($this->changeset);
|
$render_pch = $this->shouldRenderPropertyChangeHeader($this->changeset);
|
||||||
|
|
||||||
|
$rows = max(
|
||||||
|
count($this->old),
|
||||||
|
count($this->new));
|
||||||
|
|
||||||
$renderer = id(new DifferentialChangesetTwoUpRenderer())
|
$renderer = id(new DifferentialChangesetTwoUpRenderer())
|
||||||
->setChangeset($this->changeset)
|
->setChangeset($this->changeset)
|
||||||
->setRenderPropertyChangeHeader($render_pch)
|
->setRenderPropertyChangeHeader($render_pch)
|
||||||
|
->setLineCount($rows)
|
||||||
->setOldRender($this->oldRender)
|
->setOldRender($this->oldRender)
|
||||||
->setNewRender($this->newRender)
|
->setNewRender($this->newRender)
|
||||||
->setMissingOldLines($this->missingOld)
|
->setMissingOldLines($this->missingOld)
|
||||||
|
@ -1156,9 +1161,6 @@ final class DifferentialChangesetParser {
|
||||||
->setOriginalOld($this->originalLeft)
|
->setOriginalOld($this->originalLeft)
|
||||||
->setOriginalNew($this->originalRight);
|
->setOriginalNew($this->originalRight);
|
||||||
|
|
||||||
$rows = max(
|
|
||||||
count($this->old),
|
|
||||||
count($this->new));
|
|
||||||
if ($range_start === null) {
|
if ($range_start === null) {
|
||||||
$range_start = 0;
|
$range_start = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,15 @@ abstract class DifferentialChangesetRenderer {
|
||||||
private $gaps;
|
private $gaps;
|
||||||
private $mask;
|
private $mask;
|
||||||
private $depths;
|
private $depths;
|
||||||
|
private $lineCount;
|
||||||
|
|
||||||
|
public function setLineCount($line_count) {
|
||||||
|
$this->lineCount = $line_count;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
public function getLineCount() {
|
||||||
|
return $this->lineCount;
|
||||||
|
}
|
||||||
|
|
||||||
public function setDepths($depths) {
|
public function setDepths($depths) {
|
||||||
$this->depths = $depths;
|
$this->depths = $depths;
|
||||||
|
@ -260,10 +269,7 @@ abstract class DifferentialChangesetRenderer {
|
||||||
public function renderShield($message, $more) {
|
public function renderShield($message, $more) {
|
||||||
|
|
||||||
if ($more) {
|
if ($more) {
|
||||||
$end = max(
|
$end = $this->getLineCount();
|
||||||
count($this->getOldLines()),
|
|
||||||
count($this->getNewLines())
|
|
||||||
);
|
|
||||||
$reference = $this->getRenderingReference();
|
$reference = $this->getRenderingReference();
|
||||||
$more =
|
$more =
|
||||||
' '.
|
' '.
|
||||||
|
|
Loading…
Reference in a new issue