Mercurial 저장소 A를 복제하려고합니다. 이동 된 호스트 인 하위 저장소 B를 참조합니다. A의 .hgsub를 B의 새 위치를 가리 키도록 업데이트하려고합니다. 그러나 A를 처음부터 복제 할 수 없다면 닭고기와 계란 문제입니다.수은 저장소 복제, .hgsub는 죽은 외부 서브repo를 나타냅니다.
누구든지이 문제를 해결하는 방법을 알고 있습니까?
Mercurial 저장소 A를 복제하려고합니다. 이동 된 호스트 인 하위 저장소 B를 참조합니다. A의 .hgsub를 B의 새 위치를 가리 키도록 업데이트하려고합니다. 그러나 A를 처음부터 복제 할 수 없다면 닭고기와 계란 문제입니다.수은 저장소 복제, .hgsub는 죽은 외부 서브repo를 나타냅니다.
누구든지이 문제를 해결하는 방법을 알고 있습니까?
먼저 복제본은 init + pull + update이고 서브repo 복제는 업데이트 단계의 일부인 이 아니고 끌어 오기 단계입니다. 이 업데이트 단계를 건너 뛰는 것만으로 실패 복제를 피할 수 있다는 것을 의미한다 : "어떻게이 문제 .hgsub/.hgsubstate 파일과 버전으로 업데이트하려면 어떻게해야합니까"
$ hg clone -U <url>
지금 문제가 감소
을 두 가지 가능성이 여기에있다면 : [부경] 기능을 사용다시 매핑 subrepos는
수동 업데이트 (HG 도움말 subrepo와 HG 도움말 설정 참조)
A "수동 복구 업데이트 "는 다음과 같이 수행 할 수 있습니다.
$ hg revert -a -r default -X problematic-file
[adding a bunch of files]
$ hg debugrebuildstate -r default
이제 수동으로 하위 리포지토리를 수정할 수 있습니다 .hgsub 및 커밋. 푸시하기 전에 복제본을 사용하여 수정 사항을 테스트해야합니다. http://markmail.org/thread/ktxd2rsm7avkexzr
$ hg help subrepos
...
Remapping Subrepositories Sources
---------------------------------
A subrepository source location may change during a project life,
invalidating references stored in the parent repository history. To fix
this, rewriting rules can be defined in parent repository "hgrc" file or
in Mercurial configuration. See the "[subpaths]" section in hgrc(5) for
more details.
$ man hgrc
...
subpaths
Defines subrepositories source locations rewriting rules of the form:
<pattern> = <replacement>
Where pattern is a regular expression matching the source and replacement is the replacement string used to
rewrite it. Groups can be matched in pattern and referenced in replacements. For instance:
http://server/(.*)-hg/ = http://hg.server/\1/
rewrites http://server/foo-hg/ into http://hg.server/foo/.
All patterns are applied in definition order.
...
그래서, 당신은 [subpaths]
섹션에 .hgrc
에서 그것을 할 수 있습니다.
나는이 작업을 수행하는 방법을 알고하지 않았다, 그래서 대답은 내가 그것을 발견 정확하게하는 방법을 보여줍니다
또한, 주제에이 메일 링리스트 스레드를 참조하십시오. 'hg help'와'man'은 훌륭한 유틸리티입니다. –