1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 09:20:58 +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,6 +33,7 @@ final class PhabricatorApplicationTransactionTextDiffDetailView
$new = implode("\n", $new)."\n"; $new = implode("\n", $new)."\n";
} }
try {
$engine = new PhabricatorDifferenceEngine(); $engine = new PhabricatorDifferenceEngine();
$changeset = $engine->generateChangesetFromFileContent($old, $new); $changeset = $engine->generateChangesetFromFileContent($old, $new);
@ -47,6 +48,9 @@ final class PhabricatorApplicationTransactionTextDiffDetailView
$parser->setWhitespaceMode($whitespace_mode); $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($old_tmp, $old);
Filesystem::writeFile($new_tmp, $new); Filesystem::writeFile($new_tmp, $new);
list($err, $diff) = exec_manual( list($err, $diff) = exec_manual(
'/usr/bin/diff %Ls %s %s', 'diff %Ls %s %s',
$options, $options,
$old_tmp, $old_tmp,
$new_tmp); $new_tmp);