mercurial diff+;unxutil“;“补丁”;

mercurial diff+;unxutil“;“补丁”;,mercurial,diff,patch,Mercurial,Diff,Patch,如何使mercurial“diff”命令生成与unix或unxutilpatch命令兼容的输出 我需要创建一个补丁文件,可以发送给没有安装Mercurial的同事 我尝试过使用hg diff-r 3:5>patch1.diff,但在应用它时,patch命令出错。(请稍等,我一有机会就会发布错误消息……) 好的,下面是我上传到bitbucket的一个测试用例: hg clone https://bitbucket.org/jason_s/test-patch-apply P2base hg u

如何使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

没关系,这是一个可以克服的文档化问题(错误消息非常糟糕)。发件人:

在MS Windows上,补丁文件必须是文本文件,即CR-LF必须是 用作行尾。带有LF的文件可能会给出错误:“断言 失败,hunk,文件patch.c,第343行,“除非选项--binary是 给定的


我使用了
--binary
,它工作得很好。

没关系,这是一个有文档记录的问题(错误消息非常糟糕),可以克服。发件人:

在MS Windows上,补丁文件必须是文本文件,即CR-LF必须是 用作行尾。带有LF的文件可能会给出错误:“断言 失败,hunk,文件patch.c,第343行,“除非选项--binary是 给定的

我使用了
--binary
,效果很好

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.