SVN Difference Viewing

Rather than using the built-in difference viewer of TortoiseSVN, you can set your own alternative…

This may be configured in the settings:

TortoiseSVN | Settings | External Programs | Diff Viewer

The Tortoise macros are:

  • %base : base file
  • %bname : title of base file
  • %mine : your file
  • %yname : title of your file

If you prefer WinMerge, the setting would be something like this:

"C:\Program Files\WinMerge\WinMergeU.exe" /wl /e /x /ub /dl %bname /dr %yname %base %mine

The WinMerge switches used here are:

  • /wl : left read only
  • /e : let WinMerge close with ESC
  • /x : close WinMerge if left = right
  • /ub: don’t add the paths to MRU (most recently used)
  • /dl lefttitle : description for left
  • /dr righttitle : description for right

If you prefer Beyond Compare (2) (commercial, not free), the setting would be something like (but all on one line):

"C:\Program Files\Beyond Compare 2\BC2.exe"
		/lefttitle=%bname %base /leftreadonly
		/righttitle=%yname %mine
		/solo

For Beyond Compare (3 or 3 Pro) (commercial, not free), the setting would be similar (again, all on one line):

"C:\Program Files\Beyond Compare 3\BComp.exe"
		/lefttitle=%bname %base /leftreadonly
		/righttitle=%yname %mine
		/solo

The Beyond Compare switches used here are:

  • /solo : always launch a new instance
  • /leftreadonly : left read only (obviously)
  • /lefttitle=lefttitle : description for left
  • /righttitle=righttitle : description for right

Similarly you can change the merge viewer from

TortoiseSVN | Settings | External Programs | Merge Tool

The Tortoise macros are as for diff, but also with:

  • %theirs : repository file
  • %tname : title of repository file
  • %merged : conflicted merge result file
  • %mname : title of result file

The SVN temporary filenames and TortoiseSVN macros for an update conflict are as follows:

svn update
change in
repository
%base=”file.txt.rLO
%bname
Δ
%theirs=”file.txt.rHI
%tname
local
change
Δ ↓ Δ ↓
%mine=”file.txt.mine
%yname
Δ
%merged=”file.txt”
%mname

For a merge conflict, they are as follows:

svn merge ‘branch’ change

 

(other,
merged branch)

%base=”file.txt.merge-left.rLO
%bname
Δ
%theirs=”file.txt.merge-right.rHI
%tname
‘trunk’ change
(this branch)
Δ ↓ Δ ↓
%mine=”file.text.working
%yname
Δ
%merged=”file.txt”
%mname

The merge settings for Beyond Compare 3 Pro (commercial, not free) might be (again, all on one line):

"C:\Program Files\Beyond Compare 3\BComp.exe"
		/lefttitle=%yname %mine /leftreadonly
		/righttitle=%tname %theirs /rightreadonly
		/centertitle=%bname %base /centerreadonly
		/outputtitle=%mname %merged.bc2
		/solo

Here, I’ve named the output file (of a conflicted file.txt) “file.txt.bc2” so that SVN’s own merge attempt in “file.txt” is not overwritten.

Other alternative difference and/or merge viewing tools are P4Merge.exe (Perforce merge; commercial), KDiff3, Araxis (commercial, not free), ExamDiff.

See also the relevant websites, and help files. Here are some of them:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: