@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 "left"/"right" changeset ID selection for synthetic deletions

Summary:
Fixes T8323. See that task for a description.

We were using `nonempty()`, but that rule doesn't cover synthetic deletions (file present in an earlier diff, but no longer present in the later diff).

Test Plan: Followed the steps in T8323, got a clean comment.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8323

Differential Revision: https://secure.phabricator.com/D17929

+20 -4
+20 -4
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 150 150 $renderer = DifferentialChangesetHTMLRenderer::getHTMLRendererByKey( 151 151 $this->getRenderer()); 152 152 153 + $changeset_id = $this->changeset->getID(); 154 + 155 + $vs_id = $this->getVsChangesetID(); 156 + if (!$vs_id) { 157 + // Showing a changeset normally. 158 + $left_id = $changeset_id; 159 + $right_id = $changeset_id; 160 + } else if ($vs_id == -1) { 161 + // Showing a synthetic "deleted" changeset for a file which was 162 + // removed between changes. 163 + $left_id = $changeset_id; 164 + $right_id = null; 165 + } else { 166 + // Showing a diff-of-diffs. 167 + $left_id = $vs_id; 168 + $right_id = $changeset_id; 169 + } 170 + 153 171 return javelin_tag( 154 172 'div', 155 173 array( 156 174 'sigil' => 'differential-changeset', 157 175 'meta' => array( 158 - 'left' => nonempty( 159 - $this->getVsChangesetID(), 160 - $this->changeset->getID()), 161 - 'right' => $this->changeset->getID(), 176 + 'left' => $left_id, 177 + 'right' => $right_id, 162 178 'renderURI' => $this->getRenderURI(), 163 179 'whitespace' => $this->getWhitespace(), 164 180 'highlight' => null,