如何在 Mercurial 中应用补丁并在应用失败时显示 diff 工具
我想在 Mercurial 中应用补丁:
hg import patch_name.patch
但是如果出现错误 abort: patch failed to apply
,Mercurial 会创建 *.rej
文件。
有没有办法显示 kdiff 或 vim-diif 来纠正冲突。
I want apply patch in Mercurial:
hg import patch_name.patch
But if I get the error abort: patch failed to apply
, Mercurial creates *.rej
files.
Is there a way show kdiff or vim-diif to correcting conflict.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有办法做到这一点。推荐的方法是打开文件和 .rej 文件并手动合并被拒绝的块。
There isn't a way to do this. The recommended approach is to open the file and the .rej file and manually merge in the rejected hunks.
我敢打赌 hg 返回一个错误代码。也许您可以将
hg import
包装在 shell 脚本中,捕获返回的错误代码,并在出现错误时执行您想要的操作?像这样的东西:I would bet that hg returns an error code. Perhaps you can wrap
hg import
in a shell script that catches the error code returned and does what you want if there was an error? Something like: