1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Don't reverse downloaded raw diff

Summary:
The logic here was swapped - new file should be on the right side.
Plus we had a fatal for VS = -1 where new file should be on left.

Test Plan:
Downloaded raw diff of:

- base VS change
- change VS change
- change VS change with unmodified file

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3333
This commit is contained in:
vrana 2012-08-18 02:15:02 -07:00
parent 801a176274
commit e7796caa78

View file

@ -915,16 +915,19 @@ final class DifferentialRevisionViewController extends DifferentialController {
$generated_changesets = array();
foreach ($changesets as $changeset) {
$changeset->attachHunks($changeset->loadHunks());
$right = $changeset->makeNewFile();
$choice = $changeset;
$vs = idx($vs_map, $changeset->getID());
if ($vs) {
if ($vs == -1) {
$left = $right;
$right = $changeset->makeOldFile();
} else if ($vs) {
$choice = $vs_changeset = $vs_changesets[$vs];
$vs_changeset->attachHunks($vs_changeset->loadHunks());
$right = $vs_changeset->makeNewFile();
$left = $vs_changeset->makeNewFile();
} else {
$choice = $changeset;
$right = $changeset->makeOldFile();
$left = $changeset->makeOldFile();
}
$left = $changeset->makeNewFile();
$synthetic = $engine->generateChangesetFromFileContent(
$left,