Add a better display for patch errors.

Review Request #8563 — Created Dec. 6, 2016 and submitted — Latest diff uploaded

Review Board

When a file fails to patch, we would show a pretty terrible error message. It
would give the location of the temp directory with the original and rejects
files, and then theoretically show the error output from the patch command
(although in the case where hunks couldn't be applied, that error output
wouldn't be shown because it's displayed to stdout instead of stderr).

This replaces that with a new display that actually shows the patch output
(with temporary directory names filtered out), and instead of forcing the
administrator to dig through that directory, allows the user to either show the
rejects inline on the page or download a .zip bundle containing the original
file, the new file, the diff, and the rejects.

Based on work by Tien Vu.

  • Uploaded a hand-modified patch that would fail to apply cleanly. Saw the new
    output. Viewed rejects inline and checked the contents of the downloaded
    error bundle.
  • Ran unit tests.