2

I have a repository in which I have three subfolders.
A, B and a core folder.

I need the files of the core folder in A and in B. So every file of the core folder should be inside another folder in A and B and every update to the files should be commited to "core" and vice versa.
So I tried to make the core folder to a subrepository and add this to A and B.

So in folder B for example there is following line in the .hgsub www = ../core
In the main repository is in the .hgsub core = core

I assume there is something I do wrong, but maybe you have a hint how to achieve what I want :)

(Update)
To clarify:
The repository contains different "projects" for an app.
A is Android and B is iOS. The "core" contains HTML+JS files which are later used in the Android and iOS projects to build apps with phonegap.

hering
  • 1,956
  • 4
  • 28
  • 43

1 Answers1

8

If I understand you right, you have this:

repo
  |
  +-- core         <--+
  +-- A               |
      +-- core     ---+ \A\core and \B\core should be equal to \core
  +-- B               |
      +-- core     ---+

There is nothing in Mercurial that will help you with this.

What you can do is this:

core-repo
  +-- (content)

repo
  +-- A
      +-- core        --- sub-repo pointing to core-repo
  +-- B
      +-- core        --- sub-repo pointing to core-repo

This will allow you to commit changes to the sub-repo inside A, push, and then pull and update into the sub-repo inside B, keeping them in sync.

Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
  • Thanks a lot. In my build script I copy the content of the core folder into the corresponding sub folders of A and B. The challenge now is to get the development environment to work :) – hering Jul 26 '11 at 11:38
  • 2
    I am not familiar with Jenkins at all. In any case, sub-repos are linked to a specific revision of that repository. In other words, if you change something under A\core, commit, then push, even if you pull into B\core, you still need to update and commit the repo to record the new changeset link. – Lasse V. Karlsen Jul 26 '11 at 11:41