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

Review Request #1937 — Created Nov. 21, 2010 and submitted — Latest diff uploaded

Information

Review Board

Reviewers

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.
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.