2012-03-02 3 views
5

Windows에서 hg-fast-export 도구로 수많은 문제를 해결 한 후 (까다로운 python 버전 필요)hg-fast-export 오류를 해결하는 방법 : "지점 이름이 GIT 표준을 따르지 않습니다 : refs/heads/master"

master: Exporting full revision 1/98 with 142/0/0 added/changed/removed files 
fatal: Branch name doesn't conform to GIT standards: refs/heads/master 
fast-import: dumping crash report to .git/fast_import_crash_5956 
Traceback (most recent call last): 
    File "../fast-export/hg-fast-export.py", line 388, in <module> 
    options.statusfile,authors=a,sob=options.sob,force=options.force)) 
    File "../fast-export/hg-fast-export.py", line 322, in hg2git 
    c=export_commit(ui,repo,rev,old_marks,max,c,authors,sob,brmap) 
    File "../fast-export/hg-fast-export.py", line 214, in export_commit 
    export_file_contents(ctx,man,added) 
    File "../fast-export/hg-fast-export.py", line 126, in export_file_contents 
    wr(d) 
    File "../fast-export/hg-fast-export.py", line 28, in wr 
    print msg 
    File "c:\Python26\lib\site-packages\mercurial\windows.py", line 70, in write 
    raise IOError(errno.EPIPE, 'Broken pipe') 
IOError: [Errno 32] Broken pipe 
오류가 될 것으로 보인다

: 지점 이름은 GIT 표준을 준수하지 않는 : 심판/헤드/마스터 내가 해결할 수없는 오류가 우연히 발견 한) 도구를 충족하기 위해 수은 저장소를 정리하는

누구든지이 문제를 해결하는 방법에 대한 단서가 있습니까?

내 수은 저장소가 깨끗하고 정상적으로 작동하며 단 하나의 헤드 만 있으면 모두 내보낼 준비가되었습니다.

편집 :

난 HG - 자식 결합 TortoiseHG를 사용하여 문제를 해결했다. mercurial rep를 내보내는 방법을 찾는 사람에게. 또는 그 반대로, 여기에 설명 된 단계를 따르십시오 : http://www.ffuts.org/blog/accessing-a-git-repository-with-tortoisehg-on-windows/

+0

'hg branches'의 결과는 무엇입니까? – krtek

답변

8

난 혼자이 문제를 해결했습니다.

파이썬은 hg-fast-export에 의해 출력 된 모든 줄의 끝에 '\r\n'이 있어야한다는 것을 알게되었습니다. 즉, 지사 이름이 'refs/heads/master\r' 인 것으로 해석되어 유효하지 않습니다.

이 questsion에 대한 답변 ...

Make Python stop emitting a carriage return when writing newlines to sys.stdout

은 ... 바이너리 모드로 전환하기 위해, HG-빠른 내보내기 파일의 맨 위에 배치 할 수 있습니다.

편집 :
코드 추가는 다음과 같습니다

if sys.platform == "win32": 
    import os, msvcrt 
    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) 

그냥 hg-fast-export.py의 상단에 배치하고 상단에 import sys을 가지고 있는지 확인하십시오.

+0

나는 그것을 시도했지만 도움이되지 않았다. – Adabada

+0

나는 hg 내보내기 파일을 절대 건드리지는 않았지만. 저는 이것을 답으로 표시하고 있습니다 만, TortoiseHG와 hg-git 경로를 사용하려면 수은과 자식을 섞어 놓고 싶은 분을 강력히 추천합니다. 쉽고 빠르며 멋진 UI를 사용할 수도 있습니다. – Adabada

+0

그것은 나를 위해 일했다. msvcrt.setmode (sys.stdout.fileno(), os.O_BINARY) 맨 위 hg-fast-export.py는 매력처럼 작동했습니다. –

관련 문제