jhourback
jhourback

Reputation: 4571

hg diff by specifying one revision and automatically using the parents of that particular revision

This this possible? Currently, I first do an hg parents to find the parents, then an hg diff using two revisions. But it would be easier if hg diff had the option to take a single revision and find the parents automatically.

Upvotes: 2

Views: 1410

Answers (2)

rds
rds

Reputation: 26984

hg diff -r 'tip~1'

because

"x~n" The nth first ancestor of x; "x~0" is x; "x~3" is "x^^^". For n < 0, the nth unambiguous descendent of x.

Upvotes: 2

Edward
Edward

Reputation: 3276

You're looking for the 'change' switch on diff:

 -c --change REV          change made by revision

you use it like this (for revision 298):

hg diff --change 298

If you use it on a merge changeset (which has two parents), only the first parent is compared. In that case you can use the p2 revset to get the second parent:

hg diff -r 298:p2(298)

Upvotes: 6

Related Questions