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."
Or, slightly more formally (thanks to Steve Losh):
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.
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:
@ changeset: 3 |\ summary: Merged. | | | o changeset: 2 | | summary: Changing b | | o | changeset: 1 |/ summary: Changing a | o changeset: 0 summary: Adding a and b
But if I ask to see the changes introduced by revision 3, hg di -c 3
, Mercurial will show me the same thing as if I asked to see the changes introduced in revision 1, hg di -c 1
:
$ 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
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:
$ hg di -c 3 $
So, how can I do this?
ps: I know that I can reduce the number of merges in my repository using rebase
… But that's not my problem - my problem is figuring out what was changed with a merge.