View the differences between two sets of changes in one file

I have a file that is being tracked in Mercurial. I see his story with hg log . How can I see the differences between its latest version and the latest updated set of changes?

+51
mercurial
Nov 11 2018-10-11
source share
3 answers

hg diff -r <first_revision_number>:<other_revision_number> filename

who will do it

eg hg diff -r 0:1 default.aspx

hope this helps

+58
Nov 11 2018-10-11
source share
— -

If you know the revision numbers, what PaulStack says.

If you clearly want to know the difference between the current end of the branch and the previous one, you can use shortcuts. Of course, if the file has not changed, diff will not show anything useful.

hg diff -r -1:. filename

-1 indicates the previous set of changes in this thread. " . " means the current set of changes. You can use -2 , -3 , etc., but as soon as you click the merge point, it will become a little more interesting. (link: http://hgtip.com/tips/beginner/2009-10-05-shortcuts-for-specifying-revisions/ )

If you want outstanding changes in your workspace, then it's just hg diff filename.

A few useful places for beginners HG http://hgtip.com .

The Ultimate HG Handbook at http://hgbook.red-bean.com/ .

An overflow stackoverflow such as a site for which more HG is a Kiln support site. http://kiln.stackexchange.com . Kiln is built on top of HG and uses the modified TortoiseHG client, so most of the questions and answers there are informative. They will also answer questions, even if you are not a user.

+37
Nov 11 '10 at 12:50
source share

there is also de ^ syntax for parent revision, which is in addition to . (the parent directory of the working directory) makes a useful combination:

show the difference between the current checked revision and its parent version (this works around tip and -1 constraints)

 hg diff -r .^:. 
0
Oct 24 '17 at 3:19 on
source share



All Articles