Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial - diff multiple changesets at same time?

Tags:

diff

mercurial

To diff we use:

  • hg diff -c <xyz>: Show diffs for a given changeset
  • hg 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.

like image 466
Marcus Leon Avatar asked Mar 25 '11 16:03

Marcus Leon


1 Answers

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)

like image 195
Ry4an Brase Avatar answered Nov 04 '22 19:11

Ry4an Brase