Mercurial: add support for copy/rename handling via git-style diffs
Mercurial: add support for copy/rename handling via git-style diffs

Mercurial: add support for copy/rename handling via git-style diffs

This adds support for the git-extended diff format used by Mercurial. This
includes information about copies and renames, allowing the ReviewBoard diff
view to show content diffs even if a file has been renamed by the changeset
being reviewed.

N.B. The uploaded diff files must include the "Node ID" and "Parent" headers as
generated by "hg export". This is the only way ReviewBoard can know the
original and new changeset IDs.

Testing done: Posted a large number of git-style diffs to our production RB
server (which has this patch applied) over the course of several months.
Some of these have included renamed files, many include added and deleted files.
Verified that in all cases the renames are shown correctly (with the patch in
review request #1944 also applied) and everything else works as before.
Regular Mercurial diffs have also been tested extensively with this patch
applied (many of our developers have not updated their configuration to use
git-style diffs), with no observed change in behaviour.

Reviewed at http://reviews.reviewboard.org/r/1937/

atagar/ReviewBoard,beol/reviewboard,atagar/ReviewBoard,brennie/reviewboard,beol/reviewboard,1tush/reviewboard,Khan/reviewboard,bkochendorfer/reviewboard,chazy/reviewboard,1tush/reviewboard,chipx86/reviewboard,reviewboard/reviewboard,1tush/reviewboard,chazy/reviewboard,atagar/ReviewBoard,reviewboard/reviewboard,atagar/ReviewBoard,custode/reviewboard,davidt/reviewboard,custode/reviewboard,atagar/ReviewBoard,reviewboard/reviewboard,brennie/reviewboard,chipx86/reviewboard,brennie/reviewboard,KnowNo/reviewboard,bkochendorfer/reviewboard,chazy/reviewboard,Khan/reviewboard,1tush/reviewboard,1tush/reviewboard,KnowNo/reviewboard,chazy/reviewboard,reviewboard/reviewboard,1tush/reviewboard,chazy/reviewboard,bkochendorfer/reviewboard,atagar/ReviewBoard,bkochendorfer/reviewboard,chazy/reviewboard,chazy/reviewboard,Khan/reviewboard,Khan/reviewboard,KnowNo/reviewboard,atagar/ReviewBoard,chipx86/reviewboard,1tush/reviewboard,sgallagher/reviewboard,sgallagher/reviewboard,custode/reviewboard,1tush/reviewboard,chipx86/reviewboard,Khan/reviewboard,Khan/reviewboard,davidt/reviewboard,KnowNo/reviewboard,atagar/ReviewBoard,sgallagher/reviewboard,atagar/ReviewBoard,1tush/reviewboard,Khan/reviewboard,Khan/reviewboard,custode/reviewboard,Khan/reviewboard,beol/reviewboard,chazy/reviewboard,sgallagher/reviewboard,chazy/reviewboard,brennie/reviewboard,davidt/reviewboard,davidt/reviewboard,beol/reviewboard