0

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 ?

Community
  • 1
  • 1
Thalia
  • 13,637
  • 22
  • 96
  • 190
  • The question you linked to puts that `[subpaths]` info in the .hgrc, not in the .hgsub -- your question implies that you changed the .hgrc – Mike C Aug 21 '12 at 00:33
  • I changed the hgsub, and the question I linked says the same thing, unless i am reading it wrong ? – Thalia Aug 21 '12 at 00:38
  • Still, the link I attached, links to documentation that shows this has to be done in hgsub: One workaround with Mercurial 2.0 is to use [subpaths] in .hgsub to map "ideal" paths to the flat namespace used by some hosting providers. For example, a project hosted at https://bitbucket.org/kiilerix/subrepodemo/ could have a .hgsub like this: sub = sub [subpaths] https://bitbucket\.org/kiilerix/subrepodemo/sub = https://bitbucket.org/kiilerix/subrepodemo-sub – Thalia Aug 21 '12 at 00:47

1 Answers1

1

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...

Thalia
  • 13,637
  • 22
  • 96
  • 190