@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+15 -7
+5 -3
src/applications/differential/parser/DifferentialChangesetParser.php
··· 972 972 $this->tryCacheStuff(); 973 973 $render_pch = $this->shouldRenderPropertyChangeHeader($this->changeset); 974 974 975 + $rows = max( 976 + count($this->old), 977 + count($this->new)); 978 + 975 979 $renderer = id(new DifferentialChangesetTwoUpRenderer()) 976 980 ->setChangeset($this->changeset) 977 981 ->setRenderPropertyChangeHeader($render_pch) 982 + ->setLineCount($rows) 978 983 ->setOldRender($this->oldRender) 979 984 ->setNewRender($this->newRender) 980 985 ->setMissingOldLines($this->missingOld) ··· 1156 1161 ->setOriginalOld($this->originalLeft) 1157 1162 ->setOriginalNew($this->originalRight); 1158 1163 1159 - $rows = max( 1160 - count($this->old), 1161 - count($this->new)); 1162 1164 if ($range_start === null) { 1163 1165 $range_start = 0; 1164 1166 }
+10 -4
src/applications/differential/render/DifferentialChangesetRenderer.php
··· 28 28 private $gaps; 29 29 private $mask; 30 30 private $depths; 31 + private $lineCount; 32 + 33 + public function setLineCount($line_count) { 34 + $this->lineCount = $line_count; 35 + return $this; 36 + } 37 + public function getLineCount() { 38 + return $this->lineCount; 39 + } 31 40 32 41 public function setDepths($depths) { 33 42 $this->depths = $depths; ··· 260 269 public function renderShield($message, $more) { 261 270 262 271 if ($more) { 263 - $end = max( 264 - count($this->getOldLines()), 265 - count($this->getNewLines()) 266 - ); 272 + $end = $this->getLineCount(); 267 273 $reference = $this->getRenderingReference(); 268 274 $more = 269 275 ' '.