1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

Don't fatal with error in transaction diff

Test Plan: /config/edit/metamta.mail-adapter/

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5679
This commit is contained in:
Jakub Vrana 2013-04-16 08:41:36 -07:00
parent 1e4162f81b
commit ef3d1150fc
2 changed files with 15 additions and 11 deletions

View file

@ -33,20 +33,24 @@ final class PhabricatorApplicationTransactionTextDiffDetailView
$new = implode("\n", $new)."\n";
}
$engine = new PhabricatorDifferenceEngine();
$changeset = $engine->generateChangesetFromFileContent($old, $new);
try {
$engine = new PhabricatorDifferenceEngine();
$changeset = $engine->generateChangesetFromFileContent($old, $new);
$whitespace_mode = DifferentialChangesetParser::WHITESPACE_SHOW_ALL;
$whitespace_mode = DifferentialChangesetParser::WHITESPACE_SHOW_ALL;
$markup_engine = new PhabricatorMarkupEngine();
$markup_engine->setViewer($this->getUser());
$markup_engine = new PhabricatorMarkupEngine();
$markup_engine->setViewer($this->getUser());
$parser = new DifferentialChangesetParser();
$parser->setChangeset($changeset);
$parser->setMarkupEngine($markup_engine);
$parser->setWhitespaceMode($whitespace_mode);
$parser = new DifferentialChangesetParser();
$parser->setChangeset($changeset);
$parser->setMarkupEngine($markup_engine);
$parser->setWhitespaceMode($whitespace_mode);
return $parser->render(0, PHP_INT_MAX, array());
return $parser->render(0, PHP_INT_MAX, array());
} catch (Exception $ex) {
return $ex->getMessage();
}
}
}

View file

@ -94,7 +94,7 @@ final class PhabricatorDifferenceEngine {
Filesystem::writeFile($old_tmp, $old);
Filesystem::writeFile($new_tmp, $new);
list($err, $diff) = exec_manual(
'/usr/bin/diff %Ls %s %s',
'diff %Ls %s %s',
$options,
$old_tmp,
$new_tmp);