Mercurial: diffs in a particular changeset?

Try hg diff -r 2580 -r 2581.


Revision 2580 isn't necessasrily the parent revision of 2581. It's easy to check if it is, of course, but easier yet is to just do:

hg log -p -r 2581

That compares 2581 to its (first) parent revision no matter what it is, and most clearly encompasses the answer to the question "what the hell did 2581 do?"


hg diff -r 2580 -r 2581

This is a wrong example. The revision 2580 can be in another branch and you get diff between two branches.

Use

hg log -p -r 2581

or hg diff -c 2581

The difference between them in the first lines. Hg log also show information about changeset (parent, author, date, ...)

I prefer second variant hg diff -c ... because it can store to patch files.

hg diff -c 2581 > revision_2581.patch

Tags:

Mercurial