3

I am trying to use subrepos but cannot seem to get them to work. I am very new to Hg/Kiln, so I hope I am providing the right info.

I've created two repos in Kiln, Top and Sub. Both have a few files in the root.

On my local box, I go thru these steps:

cd Top
echo Sub=Sub > .hgsub
hg add
hg commit -mAddSub

Now I see that the Sub folder is created in my Top directory, but there are no files in it.

So I do a push to Top Then I try cloning Top somewhere else locally. I get the Sub directory, but no files (well, I do get a .hg folder, but not the files that are part of the Sub dir).

I've tried replacing the echo with:

echo Sub=https://myaccount.kilnhg.com/Repo/Repositories/Group/Sub > .hgsub

But same thing, no files in Sub.

Am I completely missing the point? Doing something wrong?

flag

2 Answers

2

I think you are just missing the step of adding the files in the repositories once they are created. You've effectively "init'd" your repos but not asked them to start tracking the files there.

A subrepo is just like any other repo in Mercurial once you get past the fancy configuration bit. If you're new to Mercurial, definitely check out Joel's tutorial here:

http://hginit.com/

link|flag
Thank you. That seems to have fixed the problem – slolife Mar 22 2010 at 22:06
2

Assuming you found the tutorial at http://mercurial.selenic.com/wiki/subrepos. I discovered a few things that weren't mentioned (or, far more likely, I missed them).

  1. the subrepo name in .hgsub must match the folder name. You can't alias it. If you try that it will just create a folder path with the subrepo name. That's not what that part of the .hgsub does - it relates local and remote copies. If there is only a local copy then both sides of that equation must match.
  2. You're supposed to commit from the highest level in the repo but...
  3. unadded files in a subrepo don't seem to show up in the parent repos commit, as you would like. You have to manually add it to the subrepo first. I hope they fix that.
  4. Commits of a subrepo from a parent repo won't show you any diffs or details of which files are affected. It does show up in the repo browser when you launch it in the subrepo
  5. subrepos aren't fully baked yet.

http://kiln.stackexchange.com/questions/500/should-i-use-more-than-one-repository/1757#1757 contains some more of my stumblings and how I discovered / broke things. Try it - it's the best way to learn what the hell is going on.

link|flag
See also stackoverflow.com/questions/tagged/… – CADbloke Jul 28 2010 at 3:14
2 
Glad I'm not the only one hacking around with subrepos. Busy making some Ruby scripts to plug some of these subrepos gaps. Would do it in Python but one problem at a time :) – Pete Duncanson Aug 6 2010 at 11:02

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.