Mercurial - diff multiple changesets at same time?
To diff we use:
hg diff -c <xyz>
: Show diffs for a given changesethg diff -r <xyz>
: Show all diffs since a given changeset
But let's say you have changesets 4-5-6-7-8 where changesets 4, 6, 8 were related to a particular area of the system and in one diff you wanted to see the changes made from JUST these three changesets, how would you do this? If file A was modified in changeset 4 and 8, the diff would show the difference between changeset 3 and 8.开发者_运维技巧
If changesets 4,5,6,7,8 are linear in history I don't think that even with revsets you can do that using just -r
. However, if the changes in 5 and 7 really are from a different part of the system you can likely get the output you want by adding a -X
or a -I
. Something like this:
hg diff -r 3::8 -X part/you/do/not/want/**
or
hg diff -r 3::8 -I part/you/do/want/**
If, alternately, you're a little more exact about parenting a changeset as early as possible in history you'd have a topology like this:
[3]---[4]---[6]---[8]---[9]
\ /
------[5]---[7]------
and then you'd get what you want using:
hg diff -r 3::8
(note the double colon which tells the range to follow topology not just numeric range)
精彩评论