开发者

Get visual diff of two revisions of a file

I'd like to know the be开发者_开发技巧st/easiest way to get a visual diff of a file given two revisions in Mercurial. I.e., I'd like to visualize the difference between revision 3 and revision 12, etc.


If by 'visual' you mean a text comparison you can do:

hg diff -r 3 -r 12

If you want a GUI tools you can easily configure and use the ExtDiff extension, which comes with Mercurial, and use:

hg yourdiff -r 3 -r 12

where yourdiff was configured in your hgrc file.


In the 'better late than never' category, and in answer to epalm's comment, here is how to compare any two revisions of a file from within TortoiseHG.

From any view that displays the file of interest, right click on the file and select 'File History'. This will open a new window that only displays check-ins for that file. (If the file you want is not visible in the current change set, remember that all files are visible in the Manifest view.)

From the File History window, select the two revisions that you want to compare by doing a CTRL - Left Click on each one. Make sure exactly two revisions are selected or you won't see the context menu you need in the next step.

Right click on one of the selected file and choose the "Diff selected file revisions..." option. A file diff window will open with whatever diff tool TortoiseHG is configured to use.

Note that this answer was written based on TortoiseHG version 2.6.2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜