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

前端 未结 2 1372
时光说笑
时光说笑 2021-01-30 23:05

I\'m struggling on how to correctly track nested repositories using TortoiseHg.

I have a main repository that tracks my whole project. This project contains several litt

相关标签:
2条回答
  • 2021-01-30 23:51

    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.

    0 讨论(0)
  • 2021-01-30 23:55

    You should try using:

    • The Forest extension or
    • (better choice, because officially in the Hg): the Subrepo feature

    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.

    0 讨论(0)
提交回复
热议问题