tags:

views:

185

answers:

2

I'm a beginner in svn. I know basic things like creating a repository, checking, updating, creating branches and such, but I have some difficulty in defining a structure for my repository when working with various cms.

Let's suppose I'm creating a lot of components and templates for a cms, like Joomla!. These components are going to be used in a lot of different portals, may be related or not to each other and the templates may be adapted to other projects as well on the run.

What's the best approach - create a single repository, called "Joomla Projects", and all components inside it (since some modules are really simple, 4 php files inside a folder), or a repository for each component?

I dont know if I'm making myself clear, it's my first time here. Thanks in advance!

A: 

I would map repositories with projects. So I'd keep everything in the same repository and I'd do something like this:

vendor/
tags/
branches/
trunk/ 
      component1/
      component2/
      singleFileComponent1

Maybe have a common directory for related components.

apphacker
+2  A: 

You can decide yourself after reading the topic "Planning Your Repository Organization" in the SVN Book.

It really depends on your needs. Since you said there'll be a lot of small components shared by many projects (i.e. they are tightly related) I think you'd better have a single repository with separate branches/tags/trunk folders:

components/
  component_1/
    trunk/
    tags/
    branches/
  component_2/
    trunk/
    tags/
    branches/
  ...
project_1/
  trunk/
  tags/
  branches/
project_2/
  trunk/
  tags/
  branches/
...

That leaves open the possibility for each component to have different branches for different projects (if required).

SVN externals may also be useful in your case.

Romulo A. Ceccon