2

次のような Mercurial リポジトリがあります。

SWClients/
  SWCommon
  SWB
  SWNS

... SWCommon は、他の 2 つのプロジェクトに共通のライブラリです。ここで、SWCommon を SWClients のサブリポジトリに変換したいので、こちらこちらの手順に従いました。ただし、最初のリンクの例とは対照的に、サブリポジトリには、フォルダーの最初の名前と同じ名前を付けたいと考えています。詳細には、これは私がやったことです:

次のようにファイル 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'

...確かにそうですが、なぜそれが中絶の理由になるのでしょうか? もう 1 つの奇妙な点は、上記の最後の 'mv' を実行せずに 'hg status' を実行すると、予想どおり SWCommon に多くの 'missing' ファイルが作成されることです。リンクの例はこれまでのところ成功しておらず、基本的に上記の hg update で停止していますか? 実際にどのように機能させるのですか?

4

1 に答える 1

3

現在不可能です。次のように、元のリポジトリを変換する新しいリポジトリを作成できます。

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

次のような excludemap.txt を使用します。

exclude "SWCommon"

そして、そこにサブレポを追加します。

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

この問題について議論しているメーリング リストのスレッドを参照してください。

于 2012-01-23T20:55:50.033 に答える