title: Mercurial: how can I see only the changes introduced by a merge?
body: <p>I'm trying to get in the habit of doing code reviews, but merges have been making the process difficult because I don't know how to ask Mercurial to "show only changes introduced by the merge which were not present in either of its parents."</p>
  
  <p>Or, slightly more formally (thanks to Steve Losh):</p>
  
  <blockquote>
    <p>Show me every hunk in the merge that wasn't present in either of its parents, and show me every hunk present in either of its parents that isn't also present in 3.</p>
  </blockquote>
  
  <p>For example, assume I have a repository with two files, a and b. If "a" is changed in revision 1, "b" is changed in revision 2 (which is on a separate branch) and these two changes are merged in revision 3, I'll get a history which looks like this:</p>
  
  <pre>    @    changeset:   3
      |\   summary:     Merged.
      | |
      | o  changeset:   2
      | |  summary:     Changing b
      | |
      o |  changeset:   1
      |/   summary:     Changing a
      |
      o  changeset:   0
         summary:     Adding a and b</pre>
  
  <p>But if I ask to see the changes introduced by revision 3, <code>hg di -c 3</code>, Mercurial will show me the same thing as if I asked to see the changes introduced in revision 1, <code>hg di -c 1</code>:</p>
  
  <pre>    $ hg di -c 3
      --- a/a     
      +++ b/a     
      @@ -1,1 +1,1 @@ 
      -a 
      +Change to a
      $ hg di -c 1
      --- a/a     
      +++ b/a     
      @@ -1,1 +1,1 @@ 
      -a 
      +Change to a</pre>
  
  <p>But, obviously, this isn't very helpful - instead, I would like to be told that no new changes were introduced by revision 3 (or, if there was a conflict during the merge, I would like to see only the resolution to that conflict). Something like:</p>
  
  <pre>    $ hg di -c 3
      $</pre>
  
  <p>So, how can I do this?</p>
  
  <p><strong>ps</strong>: I know that I can reduce the number of merges in my repository using <code>rebase</code>… But that's not my problem - my problem is figuring out what was changed with a merge.</p>