窑currently not support subrepos that use nested URLs on the server。这意味着,你不能有以下两个网址的工作:
http://server/kiln/somepath/project1
http://server/kiln/somepath/project1/thirdparty
所以你应该设置窑,让你在服务器上库:
http://server/kiln/somepath/project1
http://server/kiln/somepath/project2
http://server/kiln/somepath/thirdparty
http://server/kiln/somepath/common
这很简单 - 只是四个标准库。然后克隆“项目”,创建.hgsub
文件有:
thirdparty = http://server/kiln/somepath/thirdparty
common = http://server/kiln/somepath/common
当你把那回窑,它会发现,为subrepositories显示链接。但是,子目录不会最终被嵌套在服务器上。所以那里不会有任何project1/thirdparty
路径在服务器上。
这也是很不清楚,你会想要的。当你有几个合作并使用一些通用代码库的项目时,你需要“project1”和“project2”来获取对方对这个通用代码库的更改。所以这两个项目中的common
subrepo推送和从http://server/kiln/somepath/common
拉动非常有用。
在Mercurial中,我们normally recommend您在.hgsub
文件中使用common = common
格式的路径。这意味着服务器必须支持嵌套的存储库。当窑不支持嵌套回购时,您可以使用完整路径。
当您最初设置子库时,请记住您需要手动更新它们。因此,通过上述网址,您可以通过运行设置“project1”:
$ hg clone http://server/kiln/somepath/project1
$ echo "common = http://server/kiln/somepath/common" > .hgsub
$ echo "thirdparty = http://server/kiln/somepath/thirdparty" > .hgsub
$ hg commit -m "Created subrepos"
这会创建初始的空子库。他们是空的,因为你没有告诉Mercurial你需要哪些变化。这在.hgsubstate
跟踪,你会发现:
0000000000000000000000000000000000000000 common
0000000000000000000000000000000000000000 thirdparty
要填充subrepositories你做
$ cd common
$ hg pull --update
$ cd ../thirdparty
$ hg pull --update
$ cd ..
$ hg commit -m "Updated subrepos"
这将更新000...
线.hgsubstate
与两个subrepos当前提示变更标识。未来的“project1”克隆将会注意到.hgsubstate
文件,并确保将subrepos更新为此处提及的修订版。
@马丁盖斯勒 - 感谢编辑,现在阅读起来更容易! – unsynchronized 2012-01-14 08:51:57
没问题,我很高兴整理一下! :) – 2012-01-14 08:54:03