Mercurial extdiff one at a time

拥有回忆 提交于 2019-12-21 20:27:02

问题


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 thing 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?


回答1:


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 !



来源:https://stackoverflow.com/questions/7312631/mercurial-extdiff-one-at-a-time

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