How to make local clone without pulling subrepos again?

左心房为你撑大大i 提交于 2019-12-04 07:28:11
Martin Geisler

You can use a "trivial" subrepository path in your .hgsub file like this:

foo = foo
bar = bar

This is the recommended setup. The advantage of setup a layout is that a clone has the same structure as the repository you clone from. You can thus clone your clones when on a plane.

Alternatively, you can use the [subpaths] setting to re-map the URLs to local paths. This lets you add

[subpaths]
http://server/(.*) = /clones/libs/\1

to your ~/.hgrc file and then you'll see that paths are remapped to /clones/libs when you clone.

You can achieve this by cloning the subrepositories yourself. Supposing that foo has a single subrepo called bar:

$ cd ~/Development
$ hg clone -U /clones/foo
$ hg clone -U /clones/foo/bar foo/bar
$ hg update -R foo

The update does not need to access the internet since the subrepository exists and contains the necessary changeset for the update on the master.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!