2

We have 2 projects which include the same three sub repos (containing shared images/css/javascript).

When checking in between the two projects we keep finding that we get this error:

"RepoLookupError: unknown revision '50f5d68c6114b416c072b80d899b658fb385646d+'"

Now we know quick hack for this seems to be to remove the "+" from the end and do another update. However it keeps happeneing which is getting just a touch annoying. I know that I'm always trying to commit from the root folder but I can't say the same for the rest of my team yet as we are still all new to Kiln. Could it be that someone is commiting on the subrepos itself which could be causing this on other machines?

Additionally we keep seeing that our subrepos's are not pulling in changes when we do an update on the root folder, however if you click on sub repos's and check incoming you can see all the files that we are expecting to be sucked in when pulling from root. Again could this be caused by incorrect commits on the subrepos themselves rather than on the root.

Its been on going now for a few weeks and is becoming a pain in ass to sort out as often as it keeps happening. Looking for a solution, I guess it is just something we are doing wrong with the way we commit and our mental model than problems with Kiln itself.

Any tips? :)

flag
We are transitioning to Kiln/Hg from a central system. In our orig system we had many repos that were pulled together by the main application's makefiles, based on a version # string in each repo and a "master" list of desired version #s. I also tried out subrepos to replace the above system. But it was confusing, error prone and subrepos are not 100% ready according to Mercurial (I think). So, today, I modified our make files to do the same acts using hg. Worked great and the confusion is greatly lessoned, and now with hg, we can now rapidly change versions compared to the prev system. – M. Esh Oct 15 2010 at 22:55

2 Answers

2

After spending the weekend playing with Subrepos on my laptop I think I've found some of the issues with them and our use of them.

The problem comes down to sloppy commits and not knowing the best/correct way to commit changes in subrepos. So for anyone else here is what we will now be doing to stop the above error.

Adding/Removing files: When you have subrepos you will have to manually add/remove files for that subrepos from within that subrepos (ie right click and select "Add" for each of your added files). Adding a file does not need a commit on the subrepos, see below.

Commiting: you should only ever commit from the parent/root repository. NEVER commit from the subrepos. This will get your repositories out of sync with each other and lead to the unknown revision error above amoung others.

Pulling: always get everything locally committed and then do a PULL from the Kiln repos. Again do this only from the parent/root repos for this project. NEVER pull from your subrepos.

Pushing: always do a pull before you even think about doing a push! Merge everything in and commit it (again only from the parent/root repos). Then you can go for a PUSH if you are happy.

If you follow those simple rules (which can be summed up with simply "do everything" in the parent/root except adding/removing files) then you should be ok and safe.

Hope that helps someone. I had trouble find any docs on this stuff and trail and error seemed to be the best way to feel out what we where doing wrong and what works.

link|flag
0

I have been working with subrepos for a month now and I agree with your advice, except for the part about NEVER commit from the subrepo.

I commit locally to my subrepos all the time. Yes, eventually you must commit at the parent repo level. This updates the .hgsubstate file with the correct hexidecimal changesetID for each subrepo. Without this step, the parent repo will be unaware of any changes committed at the subrepo level. But to say you can never commit at the subrepo level is not true.

I have even made multiple commits at the subrepo level, then used Mqueue to fold all the commits into a single changeset. This made the subrepo history cleaner, before I committed at the parent repo level.

link|flag
Hey Dan, yes you are quite right, of course you can commit direct from the sub-repos. However you sound like an advance user (happy to play with Mqueue for instance) and my advice above it aimed at the whole team (design, sys admin, testers, even clients) and not just developers. For safety sake the above works just fine and avoids any slip ups. If however you are comfy enough to be committing locally and manage it well enough then you can of course stretch my guide lines, they are after all just that, guide lines. – Pete Duncanson Oct 23 2010 at 16:52

Your Answer

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