Correctly store base revision for Mercurial diffs with parent diffs.

Mercurial diffs with parent diffs do not work at all in RB 1.7.7.1 if there is
no overlap between the files in the diff and those in the parent diff.

This change fixes the issue and improves the method of dealing with Mercurial
diffs that was introduced changeset 6b1f537b4cf9. The old method was somewhat
fragile and was broken by changeset 562a8b4a21a9.

Testing done:
Tested using a local repo on which the problem was originally seen.
Added a unit test that tests this scenario.

Fixes bug 2971.
Reviewed at https://reviews.reviewboard.org/r/4121/