2011-09-26 1 views
2

다음과 같은 Mercurial 저장소가 있습니다.Mercurial : 기존 폴더를 sub-repos로 변환

SWClients/ 
    SWCommon 
    SWB 
    SWNS 

... 여기서 SWCommon은 다른 두 프로젝트에 공통적 인 라이브러리입니다. 이제는 SWCommon을 SWClients의 하위 저장소로 변환하려고합니다. 따라서 herehere 지침을 따랐습니다. 그러나 첫 번째 링크의 예와 달리 하위 저장소는 처음에 폴더와 동일한 이름을 갖기를 원합니다. 이것은 다음과 같습니다.

다음과 같이 map.txt 파일을 만듭니다.

include SWCommon 
rename SWCommon . 

다음과 같이 .hgsub 파일을 만듭니다.

SWCommon = SWCommon 

그런 다음

$ hg --config extensions.hgext.convert= convert --filemap map.txt . SWCommon-temp 
...lots of stuff happens... 

그런 다음

$ cd SWCommon-temp 
$ hg update 
101 files updated, 0 files merged, 0 files removed, 0 files unresolved 
$ cd .. 
$ mv SWCommon SWCommon-old 
$ mv SWCommon-temp SWCommon 
$ hg status 
abort: path 'SWCommon/SWCommon.xcodeproj/xcuserdata/malte.xcuserdatad/xcschemes/SWCommon.xcscheme' is inside nested repo 'SWCommon' 

... 실제로 그렇습니다. 그러나 왜 그 이유가 중단됩니까? 다른 이상한 점은 위의 마지막 'mv'를 수행하지 않고 'hg status'를 실행하면 SWCommon에서 많은 '누락 된'파일이 예상된다는 것입니다. 링크의 예제는 결코 그것을 멀리 만들지 않으며 기본적으로 위의 hg 업데이트에서 멈 춥니 다. 실제로 어떻게 작동 시키나요?

답변

3

현재 가능하지 않습니다. 같은 excludemap.txt으로

$ hg --filemap excludemap.txt SWClients SWClients-without-SWCommon 

: 당신은 같은 원래의 변환 새로운 REPO를 만들 수

exclude "SWCommon" 

그리고 거기 subrepo를 추가합니다.

$ hg --filemap map.txt SWCommon SWClients-without-SWCommon/SWCommon 
$ cd SWClients-without-SWCommon 
$ hg add SWCommon 
$ hg ci -m "Created subrepo" 

이 문제를 설명하는 mailing list thread을 참조하십시오.