【发布时间】:2013-02-12 17:08:15
【问题描述】:
如何让 mercurial “diff”命令产生与 unix 或 unxutil patch 命令兼容的输出?
我需要创建一个补丁文件,我可以将其发送给没有安装 Mercurial 的同事。
我已尝试使用hg diff -r 3:5 > patch1.diff,但在应用它时,patch 命令出现错误。 (稍等,我会尽快发布错误消息......)
好的,这是我上传到 bitbucket 的一个测试用例:
hg clone https://bitbucket.org/jason_s/test-patch-apply P2base
hg update -r 2 -R P2base
hg diff -r 2:4 -R P2base > p2base.patch
rm -r P2base/.hg
cd P2base
patch < ../p2base.patch
我在我的 Windows PC 上得到了这个:
C:\tmp\hg\P2base>补丁
patching file bar.txt
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
【问题讨论】: