mercurialbitbucketmercurial-subrepos

Can one Mercurial repository live inside another Mercurial repository?


Can one hg repo live inside another hg repo on my local file system?

screenshot of one repo inside another

I am pulling down the bitbucket wiki for 'sandbox', and I want to know if this should be placed in repos/sandbox/wiki or repos/sandbox-wiki.

Is the former okay to do?

Edit: See Subrepository.


Solution

  • Yes and no. Depends on what you want to do. You can create repo 'sandbox/wiki' but files in this inner repos won't be commited in the outer 'sandbox' repo (@Jason is right). If you don't want to, no problem.

    Try explicitly adding files from wiki repos in sandox and you'll get the message below. If you just add path to some directory containing an inner repo the files will just be ignored.

    From sandox root directoy:

       hg add wiki/myfile
       abort: path 'wiki/myfile' is inside repo 'wiki'