Marcus Leon
Marcus Leon

Reputation: 56659

Mercurial - diff multiple changesets at same time?

To diff we use:

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.

Upvotes: 10

Views: 4292

Answers (1)

Ry4an Brase
Ry4an Brase

Reputation: 78330

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)

Upvotes: 9

Related Questions