1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Fixed 'Create Diff'

Summary:
'Create Diff' with whitespace mode 'ignore-all' is borken, because the
line numbers get mixed up when creating a second diff for the
whitespace changes.

This should be fixed correctly at some point, but currently the
whitespace 'ignore-all' says 'Huge mess' in the comments and I didn't
want to make the mess any bigger.

Test Plan:
Tested that 'Create Diff' showed the diff correctly and a previously
created diff looked correct once the cache was disabled.

Reviewed By: epriestley
Reviewers: epriestley, jungejason
CC: aran, epriestley
Differential Revision: 473
This commit is contained in:
tuomaspelkonen 2011-06-16 12:01:41 -07:00
parent 988b038e2e
commit 6b7db27524

View file

@ -742,10 +742,16 @@ class DifferentialChangesetParser {
$changeset = $this->changeset;
// Get the diff for figuring out the creation method. Currently
// 'web' method is broken for 'ignore-all' mode, because the original
// file is not available, only the diff part.
$diff = id(new DifferentialDiff())->load($changeset->getDiffID());
if ($changeset->getFileType() == DifferentialChangeType::FILE_TEXT ||
$changeset->getFileType() == DifferentialChangeType::FILE_SYMLINK) {
if ($skip_cache || !$this->loadCache()) {
if ($this->whitespaceMode == self::WHITESPACE_IGNORE_ALL) {
if ($this->whitespaceMode == self::WHITESPACE_IGNORE_ALL &&
$diff->getCreationMethod() != 'web') {
// Huge mess. Generate a "-bw" (ignore all whitespace changes) diff,
// parse it out, and then play a shell game with the parsed format