I'm not sure how mercurial looks to launch an external diff tool though ? Hopefully it's as simple as adjusting 2 & 5 in the above line to being the index of the arguments for 'checked in' and 'current working copy'.
I found Ry4an's answer to be a good solution, except for a minor problem, which left p4merge (under mac os) mixing up the command inputs. Do everything described in his answer and add the following line in the [merge-tools] section:
p4.args=$base $local $other $output
This line tells mercurial in which order p4merge takes its arguments.
Basically, you need to know the calling expectations of the CLI tool that loads up the diff tool. IE, how to make it load data from a particular file, and how to make it wait for exit. There should be enough info on the post to give you some ideas.
发布评论
评论(6)
我使用以下 Python 代码来启动 p4merge 并将其与 git 一起使用:
我不确定 Mercurial 启动外部 diff 工具的效果如何? 希望它像调整 2 & 一样简单。 上一行中的 5 是“签入”和“当前工作副本”参数的索引。
I use the following bit of Python to launch p4merge and use it with git :
I'm not sure how mercurial looks to launch an external diff tool though ? Hopefully it's as simple as adjusting 2 & 5 in the above line to being the index of the arguments for 'checked in' and 'current working copy'.
这将适用于合并:
将其放入您的
~/.hgrc
(或者,Windows 上的Mercurial.ini
):需要 Mercurial 1.0 或更高版本。 显然,您需要更新该可执行文件的路径以反映 p4merge 的安装位置。
您无法更改
hg diff
使用的内容; 但是您可以使用extdiff
扩展来创建使用您想要的显示的新diff命令。所以
hg pdiff
可以运行 p4 merge 等。This will work for merging:
Place this into your
~/.hgrc
(or, optionally, yourMercurial.ini
on Windows):Requires Mercurial 1.0 or newer. Clearly you'll need to update the path to that executable to reflect where you'd got p4merge installed.
You can't change what
hg diff
uses; but you can use theextdiff
extension to create new diff commands that use the display you want.So
hg pdiff
could run p4 merge, etc.我发现 Ry4an 的答案是这是一个很好的解决方案,除了一个小问题,它使 p4merge(在 mac os 下)混淆了命令输入。 执行他的答案中描述的所有操作< /a> 并在 [merge-tools] 部分添加以下行:
此行告诉 Mercurial p4merge 采用其参数的顺序。
I found Ry4an's answer to be a good solution, except for a minor problem, which left p4merge (under mac os) mixing up the command inputs. Do everything described in his answer and add the following line in the [merge-tools] section:
This line tells mercurial in which order p4merge takes its arguments.
也许是因为我在 Windows 上工作,但建议的解决方案对我不起作用。 相反,以下内容确实有效。
在您的
~/.hgrc/
/Mercurial.ini
中,我应用了以下更改:启用“ExtDiff”扩展:
添加了 P4 extdiff 命令:
将其配置为默认视觉差异工具:
Maybe because I'm working on Windows, but the proposed solution didn't work for me. Instead, the following does work.
In your
~/.hgrc/
/Mercurial.ini
, I applied the following changes:Enabled "ExtDiff" extension:
Added P4 extdiff command:
Configured it as the default visual diff tool:
我猜有一个用于 p4merge 的 CLI 工具(我对此一无所知)。
我写了一篇关于使用 Changes.app 和 Mercurial 的其他一些 GUI 工具的博客文章:将 Mercurial 与 GUI 工具结合使用。
基本上,您需要了解加载 diff 工具的 CLI 工具的调用期望。 IE,如何使其从特定文件加载数据,以及如何使其等待退出。 帖子上应该有足够的信息来给你一些想法。
I'm guessing there's a CLI tool for p4merge (which I know nothing about).
I wrote a blog post about using Changes.app, and some other GUI tools with Mercurial: Using Mercurial with GUI Tools.
Basically, you need to know the calling expectations of the CLI tool that loads up the diff tool. IE, how to make it load data from a particular file, and how to make it wait for exit. There should be enough info on the post to give you some ideas.
我使用的是 TortoiseHg 1.0.1 版本,p4merge 开箱即用。
只需进入全局设置 -> TortoiseHg 并选择以下选项:
I am using version 1.0.1 of TortoiseHg and p4merge works out of the box.
Just go to Global Settings -> TortoiseHg and select the following options: