从版本1.1.6开始,DiffFork的命令行程序支持选项(OPTION)"-w --wait"。该选项可以被 用来配合Bazaar、Git、Mercurial、Subversion等工具。
注意:DiffFork可比较两方目录/文件。不支持3方比较/合并。
要安装命令行程序,在“帮助”菜单中选择“安装命令行实用工具...”。
USAGE difffork file1 file2 [OPTION] DESCRIPTION -w --wait Wait for the diff window to be closed.
这里所提供的说明比较简单。更多的详细情况请参阅VCS的文档或是联络我们。
http://doc.bazaar.canonical.com/plugins/en/difftools-plugin.html
register_diff_tool(TreeDiffTool('difffork', diff_options='--wait'))
cd bzr_difftools mkdir -p $HOME/.bazaar/plugins/difftools cp *.py $HOME/.bazaar/plugins/difftools
bzr diff --using difffork
小贴士:
[ALIASES] dfdiff = diff --using difffork
#!/bin/sh difffork "$2" "$5" -w
export GIT_EXTERNAL_DIFF=FULLPATH
git diff
Mercurial有提供一个详细的介绍,指导如果使用第三方的程序来比较不同的revision,或是比较revison和 工作目录: http://mercurial.selenic.com/wiki/ExtdiffExtension
使用extdiff命令:
[extensions] hgext.extdiff =
hg extdiff -p difffork -o -w
创建自定义的extdiff命令:
[extdiff] # add new command that runs DiffFork cmd.dfdiff = difffork opts.dfdiff = -w
hg dfdiff
Subversion有一个介绍,指导如何使用外部程序: http://svnbook.red-bean.com/en/1.5/svn.advanced.externaldifftools.html
#!/usr/bin/env python import sys import os # Configure your favorite diff program here. DIFF = "FULLPATH" # Subversion provides the paths we need as the last two parameters. LEFT = sys.argv[-2] RIGHT = sys.argv[-1] # Call the diff command (change the following line to make sense for # your diff program). cmd = [DIFF, LEFT, RIGHT, '-w'] os.execv(cmd[0], cmd) # Return an errorcode of 0 if no differences were detected, 1 if some were. # Any other errorcode will be treated as fatal.
svn diff --diff-cmd svndfdiff.py