公司的项目用的SVN, 也还好, 虽然慢点. 但是它的diff和merge实在是human-unreadable.

还好, SVN可以使用外部的diff工具, 例如vimdiff, 只要写个下面那样的脚本, 然后将svn的config中diff-cmd指向它就好.

另外关于diff3, 我的理解刚开始和svn的merge不同, svn实际上是将两个版本的差异变化实施到当前版本. 我想用vimdiff来实现, 最后cat合并后的本地版本以满足svn的要求, 但是一直有问题, 还差点在生产中出状况, 而且这个用的也不多, 所以暂时放下. 有那位大侠实现了vimdiff作为svn的diff3-cmd, 请一定告诉我, 联系方式见About.

#!/bin/sh

# Configure your favorite diff program here.
DIFF="vimdiff"

if [ -z $2 ]
then
	echo ERROR: This script expects to be called by subversion
	exit 1
fi

# Subversion provides the paths we need as the sixth and seventh
# parameters.
LEFT=${6}
RIGHT=${7}

# Call the diff command (change the following line to make sense for
# your merge program).
#$DIFF --left $LEFT --right $RIGHT
$DIFF $LEFT $RIGHT

# Return an errorcode of 0 if no differences were detected, 1 if some were.
# Any other errorcode will be treated as fatal.
exit 0