TortoiseSVN : Good 'patch file' viewer?

折月煮酒 提交于 2019-12-03 22:35:38

I've never found any, but the solution that I usually use is to simply apply the patch file to a pristine checkout of the tree, and then do a "regular" diff (my preferred tool is diffuse) to review the changes in context.

The problem with "raw" patch files is that they only provide a few lines of context before and after the change, which often isn't enough.

If you don't like the patch, simply revert the changes and don't commit!

SVN 1.7 I think was released since this answer was posted, and I landed here because I wanted to show my newly created patch file with syntax coloring, a la view unified diff in TortoiseSvn.

It turns out that Notepad++ automatically syntax colors my file correctly if I give it the filetype of "patch"!

Patches have been around a long time but SVN is now supporting them more fully. See for example the documentation; http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html

For how to create a patch file, see this nice document that describes various methods including mine, WinMerge; http://docs.moodle.org/dev/How_to_create_a_patch#Creating_a_patch_using_WinMerge

Beyond Compare 4 allows you to view patch files created by SVN. The top window in Beyond Compare is a tree structure, allowing you to navigate folders and files by name. Revision numbers are present in the left and right diff windows.

Create the patch

svn diff -r 5922:6116 > CodeReview.patch

Open the patch in Beyond Compare 4

If you have access to a Mac OS X machine, PatchViewer sounds like it might do what you're looking for: http://appledeveloper.com.au/products/patchviewer/

(Disclaimer: I am the author of PatchViewer.)

karolus

You can view a diff file (a patch generated by diff tool) using Kompare from KDE environment. I used it before on Linux, but today I found how to install it on Windows. Here is an installation instruction from a blog "Kompare - the only valuable diff for M$Windows":

  1. Go to gnuwin32 diffutils, download and install.
  2. Download kdewin installer and launch it.
  3. After installing kde4win - start kompare and in "Diff" section show him where your diff.exe (from gnuwin32 diffutils) is located.
  4. Restart Kompare and it's ready to use!

You can also add an association with .diff file format and now you can view any diff files. For me it works great.

I like to use KDiff3, it's packed with functions, very user friendly and available for all popular platforms. It can also integrate with TortoiseSVN.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!