mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +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();
|
||||
$render_pch = $this->shouldRenderPropertyChangeHeader($this->changeset);
|
||||
|
||||
$rows = max(
|
||||
count($this->old),
|
||||
count($this->new));
|
||||
|
||||
$renderer = id(new DifferentialChangesetTwoUpRenderer())
|
||||
->setChangeset($this->changeset)
|
||||
->setRenderPropertyChangeHeader($render_pch)
|
||||
->setLineCount($rows)
|
||||
->setOldRender($this->oldRender)
|
||||
->setNewRender($this->newRender)
|
||||
->setMissingOldLines($this->missingOld)
|
||||
|
@ -1156,9 +1161,6 @@ final class DifferentialChangesetParser {
|
|||
->setOriginalOld($this->originalLeft)
|
||||
->setOriginalNew($this->originalRight);
|
||||
|
||||
$rows = max(
|
||||
count($this->old),
|
||||
count($this->new));
|
||||
if ($range_start === null) {
|
||||
$range_start = 0;
|
||||
}
|
||||
|
|
|
@ -28,6 +28,15 @@ abstract class DifferentialChangesetRenderer {
|
|||
private $gaps;
|
||||
private $mask;
|
||||
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) {
|
||||
$this->depths = $depths;
|
||||
|
@ -260,10 +269,7 @@ abstract class DifferentialChangesetRenderer {
|
|||
public function renderShield($message, $more) {
|
||||
|
||||
if ($more) {
|
||||
$end = max(
|
||||
count($this->getOldLines()),
|
||||
count($this->getNewLines())
|
||||
);
|
||||
$end = $this->getLineCount();
|
||||
$reference = $this->getRenderingReference();
|
||||
$more =
|
||||
' '.
|
||||
|
|
Loading…
Reference in a new issue