Mercurial/extdiff not changing to temp dir (as I THINK it's supposed to)

偶尔善良 提交于 2019-12-05 20:22:16
Martin Geisler

I can confirm that extdiff will change to a temporary directory before starting your diff program. You can use --debug to see this. Here I'm using true as the diff program (it just exist immediately):

$ hg extdiff -p true --debug
making snapshot of 2 files from rev 18480437f81b
  a
  b
making snapshot of 2 files from working directory
  a
  b
running "'true'  'foo.18480437f81b' 'foo'" in /tmp/extdiff.IJ9clg
cleaning up temp directory

The two arguments for the diff program are directories: a snapshot directory for the old versions and one for the new versions. They are inside the /tmp/extdiff.IJ9clg temporary directory.

One confusing point is that the arguments for the diff program are different depending on the number of modified files. With just one modified file, there is no need to create a snapshot of the working copy. So if a is the only modified file, you'll see

$ hg extdiff -p true --debug
making snapshot of 1 files from rev 18480437f81b
  a
running "'true'  '/tmp/extdiff.mUlnP_/foo.18480437f81b/a' '/home/mg/tmp/foo/a'"
in /tmp/extdiff.mUlnP_
cleaning up temp directory

Here the diff program was started with two files as arguments. As described in hg help -e extdiff, you can use some variables to build the command line. The default corresponds to $parent $child.

You say that WinMerge "cannot find the files correctly". There are other questions and answers on SO about WinMerge and they seem to have it working just fine. Maybe you can try their command line options.

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