Subrepositories

Bryan Murdock bmurdock at gmail.com
Wed Aug 31 15:29:26 UTC 2016


On Wed, Aug 31, 2016 at 9:10 AM, Nicolas Pinault <nicolasp at aaton.com> wrote:
> Le 31/08/2016 à 16:57, Kevin Bullock a écrit :
>
> On Aug 31, 2016, at 02:28, Nicolas Pinault <nicolasp at aaton.com> wrote:
>
> Hi,
>
> I'm starting to use subrepositories.
> My first question : Do I have to add .hgsubstate to the repository ?
>
> No, you just create the .hgsub file and Mercurial maintains the .hgsubstate
> for you.
>
> What are you using them for? Subrepos are generally considered a feature of
> last resort—a feature that is fully supported, but has significant tradeoffs
> in its use vs. normal Mercurial usage. You'll want to read the
> recommendations and caveats on the wiki:
> <https://www.mercurial-scm.org/wiki/Subrepository#Recommendations>
>
> I hoped the answer is "yes".
> I'm quite sure TortoiseHg adds it automatically. If it is not in the main
> repo, I don't understand how hg knows which revision of the sub-repos have
> to be used when pulling/updating.

You have to go into each subrepo and run hg update <revision> to get
them to the revision that you want recorded in .hgsubstate.  Then when
you run hg commit those revision automatically get recorded in
.hgsubstate.  It's a little awkward, and one of the reasons (IMHO) why
subrepos is a "feature of last resort."

Bryan



More information about the Mercurial mailing list