mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Fix "show raw file" showing wrong file
Summary: In a revision with multiple diffs like https://secure.phabricator.com/D3168?vs=6094&id=6095 clicking "Show Raw File (Left)" while comparing diffs 1 and 2 brings up the version from base, instead of from diff 1. This is because the hunks are stored as diffs between base and diff X, and the raw file is generated from the hunks. This introduces a hack which is probably not actually correct but seems to work for the 90% case. (The "Show Raw File (Right)" button was and remains correct.) Test Plan: Click raw file buttons while comparing different diffs. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3169
This commit is contained in:
parent
523cba5da4
commit
ef3b097a41
1 changed files with 7 additions and 0 deletions
|
@ -55,6 +55,13 @@ final class DifferentialChangesetViewController extends DifferentialController {
|
|||
case 'new':
|
||||
return $this->buildRawFileResponse($changeset, $is_new = true);
|
||||
case 'old':
|
||||
if ($vs && ($vs != -1)) {
|
||||
$vs_changeset = id(new DifferentialChangeset())->load($vs);
|
||||
if ($vs_changeset) {
|
||||
$vs_changeset->attachHunks($vs_changeset->loadHunks());
|
||||
return $this->buildRawFileResponse($vs_changeset, $is_new = true);
|
||||
}
|
||||
}
|
||||
return $this->buildRawFileResponse($changeset, $is_new = false);
|
||||
default:
|
||||
return new Aphront400Response();
|
||||
|
|
Loading…
Reference in a new issue