HG Clone repository with subrepos without pulling

1.5k views Asked by At

I am trying to figure out how to clone a repository with subrepositories without pulling from the source. I'm afraid that, while I have read tutorials and examples, my Mercurial knowledge is tentative.

Right now, the .hgsub structure is a list of type:

subrepo = ssh://address/subrepo

Reading the answer to the post How to make local clone without pulling subrepos again? I tried to change it to a list

subrepo = subrepo
[subpaths]
subrepo = ssh://address/subrepo

hg clone c:\path\repo

hg update -R rev

No matter what I do, I always end up pulling from the source (ssh) not the local subrepository contents.

Note: As I tried to update my original repository, I got an error about duplicate paths, which only went away when I reverted my change in the .hgsub file.

What else have I tried:

An idea: making a duplicate copy of the repository, like copy and paste, and use hard links. Would that be a good idea ? Will I not end up making changes to the original files, when I change the copy ?

Another idea: clone the .hg folders using hard links, and simply copy the rest of the contents ?

Does anybody have a solution for this problem ?

1

There are 1 answers

0
Thalia On BEST ANSWER

I ended up giving up on the idea - copy and paste the repo folder. And just for fun, I made a script to copy all the files and hard-link the .hg folders. At least, I did learn a bit about Mercurial in the process...