2

I'm not sure if this is possible, and if it's not any alternative solutions would be welcomed!

I have a number of solutions using Orchard - which mandates that any modules be in a certain directory inside it's folder structure. I have some modules, and based on the power of DVCS I'd like to be able to reproduce a new project using just suprepos. And also update Orchard with just Mercurial.

My folder structure looks like:

Project
    - Orchard
        - Modules
            - Orchard module 1
            - Orchard module 2
    - My other code

I've just copied the orchard files to my repo, and then added my modules as subrepos.

What I'd like to be able to do is to also have the rest of the Orchard structure a subrepo. But I can't find a way to have a suprepo inside another subrepo. It won't be a nested subrepo, as the 'base' repo will be mine in both cases (orchard and the modules).

ie Project/.hgsub would look like:

Orchard = http://path/to/orchard
Orchard/Modules/Module1 = http://path/to/module1
Orchard/Modules/Module2 = http://path/to/module2

But this doesn't seem to work and I can't find documentation to say if/how I can do it.

Any help appreciated!

Edit: In case it wasn't clear I don't have write access to the Orchard repo, and I can't move the modules.

Carl
  • 1,782
  • 17
  • 24
  • I actually answered a very similar question before: http://stackoverflow.com/a/11324635/705048 – hcarver Jul 10 '12 at 08:04
  • I think I know what you are saying. Are there any other solutions? – Carl Jul 10 '12 at 10:12
  • No, no other solution. Your top-most folder can't place sub-repos within other of its sub-repos. Your only options are to rearrange the folder layout, have Orchard *not* be a sub-repo or make Module1 and Module2 be sub-repos of Orchard (but not of Project). – hcarver Jul 10 '12 at 10:18
  • All well... pity that, as I can't do either easily. Will look at some build shenanigans to see if I can move the modules and then copy them to their location on successful build. – Carl Jul 10 '12 at 13:15

1 Answers1

0

Just tested this scenario.

Here is what you need to do.

Add a folder to Orchard repository with 'modules' as folder (place atleast one file inside that). Do a commit with .hgsub (subrepos), now the subrepos should be added, do a pull on the subrepos and update their references in .hgsubstate.

Please share if you have any questions.

Kannaiyan
  • 12,554
  • 3
  • 44
  • 83
  • Can you explain what you are doing? I'm not sure that it will help in this situation – Carl Oct 29 '12 at 21:15
  • Make the Module directory committed to Orchard repository before adding them as subrepos. Then add them, it should work. – Kannaiyan Oct 30 '12 at 03:14