如何使用 meld 设置 svn 冲突解决?
我已在 Subversion 配置中指定 merge-tool-cmd = meld
。当我使用所提供的冲突解决选项中的选项 l 解决合并冲突时,我收到消息:
meld: error: too many arguments (wanted 0-4, got 5)
The external merge tool exited with exit code 2
任何人都可以诊断问题/提供解决方案吗?谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
首先警告!如果您犯了这个错误,很容易最终丢失您的本地编辑!测试测试测试!
我担心 pmod 链接中的脚本不适用于 svn 1.6(当前在 Ubuntu 11.04 中)。将 pmod 链接中的代码放在一起和 这里和建议在这里,我制作了这个似乎可以正常工作的脚本:
将其保存在合理的地方(例如
/usr/local/bin/svn-merge-meld.py
)并使其可执行:然后编辑
~/.subversion/config
并取消注释merge-tool-cmd =
行,并设置命令的路径。请注意,当发生冲突时,系统会提示您如何处理。您需要输入一个
l
并让 svn 运行此脚本。完成合并后,您需要键入r
来解决冲突并将合并的版本复制到工作副本。First a warning! It is very easy to end up losing your local edits if you get this wrong! Test test test!
I'm afraid the script from pmod's link does not work with svn 1.6 (current in Ubuntu 11.04). Putting together code from pmod's link and here and advice here, I made this script that seems to work ok:
Save this somewhere sensible (eg
/usr/local/bin/svn-merge-meld.py
) and make it executable:Then edit
~/.subversion/config
and uncomment the linemerge-tool-cmd =
, and set the path to your command.Note that when a conflict occurs, you will be prompted what to do with it. You need to type a single
l
and for svn to run this script. When you've finished your merge, you need to type anr
to resolve the conflict and copy the merged version to the working copy.drevicko 的答案是正确的,但需要 Python。这个答案是 bash 脚本替代方案:
复制上面的内容文件
svn-merge-meld.sh
中的脚本并提供执行权限:最后编辑您的 svn 配置:
并启用
merge-tool-cmd
:The drevicko's answer is correct but requires Python. This answer is a bash script alternative:
Copy the above script in file
svn-merge-meld.sh
and provide execution permission with:Finally edit your svn configuration:
and enable
merge-tool-cmd
:您需要使用包装器脚本来抓取并按照 diff 工具所需的顺序放置 subversion 的内容(检查 这个):
此处对此进行了很好的描述
You need to use wrapper script to grab and put things subversion is out to the order needed for your diff tool (check this):
This is very well described here
我更新了 @drevicko 答案以使用 subversion>=1.14、meld>=3.20 和 Python 3:
I updated @drevicko answer to work with subversion>=1.14, meld>=3.20 and Python 3: