I want something like this
hg vdiff filename.txt -lastRevision -secondLastRevision
I don't know what vdiff is, but how about:
hg diff -r rev1 -r rev2 filename.txt
Edit: to get the last 2 revisions, that would be:
hg diff -r -2 -r -1 filename.txt
Type hg help revisions
for information about specifying revisions.
As of this writing, the top answers refer to -1
, -2
and -3
. The negative integers are historical artifacts and should not be used with modern Mercurial workflows.
Typically, the "last version" means "the currently checked out revision". In that case, to see the changes to file
in the currently checked out commit, you can use
hg diff --change . filename.txt
If you'd like to see the last time filename.txt
was changed, you can use
hg log --follow --patch --limit 1 filename.txt
The --follow
argument causes hg log
to follow history, so it'll only output the current revision or its ancestors.
Use
hg diff -r -3 -r -2 file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With