Mercurial `hg clone` but ignoring all subrepos?

后端 未结 4 1695
無奈伤痛
無奈伤痛 2021-02-04 00:37

Is there a way to clone a repo that comes with subrepos, but without having Mercurial pull all the subrepos?

It appears that while hg clone -U can be used t

4条回答
  •  萌比男神i
    2021-02-04 01:02

    If you have a subrepo, a working directory must include some version of that subrepo. That version may be a fixed older revision if specified, or the tip if not.

    You cannot update your repo without getting the subrepos; if you had a complete working dir without them, you shouldn't be using subrepos - use truly external repos instead.

    If your subrepos are pegged against a certain remote version, then updates after the first will not trigger a subrepo update - they're already up-to-date. But for the initial creation of the working directory, you will have to do a remote pull.

    You can trick Mercurial by munging the hgsubstate file. But really, your model and the conceptual model differ, so you're probably not a good match for subrepos if this is a concern.

    edit: If you find yourself cloning and then updating to the tip many times, try using local branches or mq instead. That way you only have to do the initial clone once.

提交回复
热议问题