Changed the way the mercurial rbtools client calculates its diff to make it work better with merges.
Changed the way the mercurial rbtools client calculates its diff to make it work better with merges.

Consider the following diff tree:
* - O3/tip
|
* - O2
|\
* | - U3
| * - O1
* | - U2
|/
* - U1
|

Where revisions starting with an O are outgoing revisions and those starting
with a U are upstream revisions.

The current post-review tool will post a diff of O3:U1 including revisions U2
and U3 which are already in the repository. The following patch will change it
to use revisions O3:U3 for the diff which will include the changesets O1-3.

Testing done:
Did post-review -n with a few different mercurial trees like the one above, as
well as a couple of simple ones with one or two commits that have no merges.
Then validated that the diff included all outgoing changes and the parent of the
diff was the revision that is the most recent direct parent of our tip that is
also in the upstream repository.

Fixes bug 2311
Reviewed at http://reviews.reviewboard.org/r/2628/

beol/rbtools,bcelary/rbtools,halvorlu/rbtools,Khan/rbtools,reviewboard/rbtools,davidt/rbtools,beol/rbtools,datjwu/rbtools,halvorlu/rbtools,haosdent/rbtools,halvorlu/rbtools,reviewboard/rbtools,clach04/rbtools,datjwu/rbtools,haosdent/rbtools,1tush/rbtools,beol/rbtools,haosdent/rbtools,clach04/rbtools_0.4.1,reviewboard/rbtools,davidt/rbtools,Khan/rbtools,datjwu/rbtools,davidt/rbtools