What is the correct way to handle nested Hg repositories with Mercurial/TortoiseHg?

こ雲淡風輕ζ 提交于 2019-12-02 16:19:20

I've finally managed to make it work the way I'd love. I'm using TortoiseHg on winXP, so I won't be able to tell you what hg calls were internally made, but I don't think anything fancy is used here.

I started with an existing repo, inside which I had a plugins/ directory filled with plugin1/, plugin/2 directories (not repositories, just simple directories). I also had those plugins online, hosted on BitBucket.

  • I first went to my plugins/ directory, right click on plugin1/, TortoiseHg => Remove Files.
  • I get back to the root of my repo, right click and Hg Commit
  • Then I went back to my plugins/ directory, right click, TortoiseHg => Clone..., I selected the http address of the plugin on bit bucket (http://bitbucket.org/username/plugin1/ and clicked Done
  • The back again to the root of the main repo. I created (or edited if the file already existed) a .hgsub file and add the plugins/plugin1 = plugins/plugin1 line inside it.
  • I was then able to either commit the main root repo, or the plugin1 repo independently

Note that the extra remove and commit steps are only required if the newly cloned repo has the same name of an already tracked directory.

You should try using:

Subrepositories is a feature that allows you to treat a collection of repositories as a group.
This will allow you to clone, commit to, push, and pull projects and their associated libraries as a group.

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