2013-02-12 2 views
1

mercurial "diff"명령으로 유닉스 또는 호환되지 않는 patch 명령과 호환되는 출력을 만드는 방법은 무엇입니까?mercurial diff + unxutil "patch"

Mercurial이 설치되지 않은 동료에게 보낼 수있는 패치 파일을 만들어야합니다.


나는 hg diff -r 3:5 > patch1.diff를 사용하여 시도하고 그것을 적용 할 때 나는 patch 명령에서 오류가 발생합니다.

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 
:


확인을 (.... 나는 최대한 빨리 기회를 가지고 오류 메시지를 게시 할 예정입니다, 잠깐만), 여기에 내가의 Bitbucket에 업로드 한 테스트 케이스입니다

내 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. 

답변

1

는 신경 쓰지 ../p2base.patch 패치 <, t 그의 극복 할 수있는 문서화 된 문제입니다 (정말 오류 메시지가 있음). http://gnuwin32.sourceforge.net/packages/patch.htm에서 :

On MS-Windows, the patchfile must be a text file, i.e. CR-LF must be used as line endings. A file with LF may give the error: "Assertion failed, hunk, file patch.c, line 343," unless the option '--binary' is given.

나는 --binary을 사용하고 괜찮 았는데.

관련 문제