0

I have a distant repository called http://myrepo

I also have 3 projects with 3 distinct packages (1 in each) stored in D:/Projects/Project[ABC]/src/pack[ABC].

I would like to create a local repo in D:/Mercurial which will reference the packages pack[ABC] as subrepositories, which are to be pushed to my distant repo.

Finally, I would like to have my packages stored in my distant repo so you read http://myrepo/pack[ABC], and they should reflect the changes made in D:/Projects/Project[ABC]/src/pack[ABC].

I can't manage tu push my subrepositories to my distant one. How to set-up such a thing?

Bernard Rosset
  • 4,523
  • 6
  • 27
  • 29

1 Answers1

0

You should be able to configure your subrepos in your top repo's .hgsub as:

LocalPathA = http://server/A

LocalPathB = http://server/B

LocalPathC = http://server/C

Then, on Server, you will have to create empty repositories (with appropriate permissions) A, B, C

Your local repositories A,B,C will need their [paths] default=http://server/A, etc set up.

hgrc for the subs

[paths]
default = source repo

hgsub for the surrounding repo

protocol://servername//absolute/path/to/repo = relative/path/from/surrounding/repo/root

Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
  • I got the following message: `D:\Projects>hg commit -m "Adding subrepositories" abort: The syntax of the filename, directory or volume is incorrect: D:\Projects\http://myrepo/B` – Bernard Rosset Sep 13 '11 at 04:18
  • Ow OK... I just noticed the last part, I'll try that! – Bernard Rosset Sep 13 '11 at 18:43
  • I added `[paths] default = http://myrepo/[ABC]` in the hgrc file of my repos `D:/Projects/Project[ABC]/src/pack[ABC]`. I still get the same error – Bernard Rosset Sep 13 '11 at 18:54
  • I put `https://mydistantrepo/[ABC] = D:/Projects/Projact[ABC]/src/pack[ABC]` in my main repo .hgsub and `[paths] default = D:/Projects/Project[ABC]/src/pack[ABC]` in my projects' .hgrc, and I still have the same pb: Mercurial tries to add the distant URL to my current CMD directory. There is something I still don't get there... – Bernard Rosset Sep 14 '11 at 17:20
  • @user: you have to use paths relative to your repo root in hg sub. I really suggest you study the hg man page here. – Paul Nathan Sep 14 '11 at 17:22
  • The thing I don't get is that Mercurial tries to add the distant repos' URL to my current directory i.e. `D:\Projects\http://mydistantrepo/[ABC]`. Since my hgsub is `distant = local`, making the `local` be relative rather than absolute doesn't solve the problem. – Bernard Rosset Sep 14 '11 at 23:44
  • .hgsubs are in the form local_path = distant, by definition. – Paul Nathan Sep 15 '11 at 15:27
  • Look at your answer: You told me the exact opposite. And if it is to come back to the old local = distant, my projects are pushed to my local subdirectories and not to my distant repo..... Back to the beginning? – Bernard Rosset Sep 18 '11 at 18:24