开发者

Mercurial extdiff one at a time

I am using winmerge as my extdiff tool, like this:

[extdiff]
cmd.winmerge = C:\Program Files\WinMerge\WinMergeU.exe
opts.winmerge = /e /x /ub /wl

The th开发者_如何学编程ing is, when I run hg winmerge it seems that it sends all of the files at once, while for example in Git, when I do a diff it calls the difftool with one modified file at a time. Can I get the same behaviour in Mercurial?


Like explained in Mercurial: The Definitive Guide, extdiff creates two snapshot of the source tree and call the diff tool on them. You're tool has to support directory diff for it to work, but like explained, you can use scripting to workaround this.

This example script is given in the book. It basically takes the two directories and call the interdiff utility on every files.

In your case, you can easily adapt the script to call winmerge instead. Just modify the line 41 :

if os.system('winmerge /e /x /ub /wl "%s" "%s"' % (name(sys.argv[1], f),

Say you create an hg-winmerge script , you can then configure extdiff like this :

 [extdiff]
 cmd.winmerge = C:\Path\To\My\Script\hg-winmerge

Hope this helps !

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜