HaltingState
HaltingState

Reputation: 1890

In mercurial how do I get the difference between two version numbers of a repo?

I want hg to output a diff for each file that was changed between two different version numbers.

Is this possible?

Upvotes: 2

Views: 131

Answers (2)

Taudris
Taudris

Reputation: 1443

If you're using a GUI such as TortoiseHg (my personal preference) and trying to figure out what has been changed between the two versions, you can update to the older changeset and merge the newer one to it. The directory state will then be the sum of all the changes made between the two. You could also use this technique along with some scripting to get actual diffs if that's what you really need.

Whichever you do, you don't want to commit the fake merge. Use update --clean (or your GUI's equivalent - in THG it's a checkbox in the Update dialog) to discard the local changes from the merge.

Upvotes: 0

Raghuram
Raghuram

Reputation: 52635

From hg help diff

hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...

Try hg diff -r<x> -r<y> - where <x> and <y> are your revision numbers.

Upvotes: 5

Related Questions