user1226058
user1226058

Reputation: 413

Multiple svn projects in a folder

I believe the most common way to setup a project in SVN is host/svn/projectA/trunk . However if there are multiple projects that are related, can we have them under one common parent folder, or do they have to be under the svn root?

i.e.

host/svn/projectA/trunk

host/svn/projectB/trunk

host/svn/projectC/trunk

or

host/svn/parentFolder/projectA/trunk

host/svn/parentFolder/projectB/trunk

host/svn/parentFolder/projectC/trunk

Upvotes: 0

Views: 84

Answers (2)

David W.
David W.

Reputation: 107090

You can setup Subversion any darn way you please. The various directories in Subversion have no meaning to Subversion itself. The meaning is put on it by you. For example, I know many people who don't use trunk, but put a main under their branches directory. This way, everything is a branch which can make things easier to talk about and document.

The standard way (and it's only a standard because most people do it this way) is one of two methods:

/trunk/proj1
/trunk/proj2
/branches/1.2/proj1
/branches/1.2/proj2
/tags/1.2/proj1
/tags/1.2/proj2

Vs.

/proj1/trunk
/proj2/trunk
/proj1/branches/1.2
/proj2/branches/1.2
/proj1/tags/1.2
/proj2/tags/1.2

Sometimes you see it like this:

/trunk/proj1
/trunk/proj2
/branches/proj1/1.2
/branches/proj2/1.2
/tags/proj1/1.2
/tags/proj2/1.2

How should you do it? I would say it all depends how interrelated the projects are. If the projects are all under the same versioning and release schedule, I'd put trunk, branches, and tags at the beginning of the URL. If the projects are not related at all, I would put the project first, and then have each project with a separate branch, tags, and trunk.

The advantage of the second way is that you don't have a confusion which branch or tag goes with which project. It increases the namespace of your tags and branches because each has its own area under each project.

The disadvantage is that you have to create three new directories every time you create a project, and if you are doing a common release, you'll end up making separate tags for each one.

Oh, one more disadvantage: If you use svn:externals on a project (something that I usually don't recommend except under some very specific circumstances, and you use relative URLs, you'll mess up your system doing it the second way.

We have a special Ivy project that's an external for all of our packages. The Ivy package is a way to integrate Ivy into our existing projects without too much difficulty. We have the tags, trunk, and branches directories on the front of our URL. On the root of the project, you put property:

$ svn ps svn:externals ../ivy.dir ivy.dir .

Here's our layout:

/branches/1.2/ivy.dir
/branches/1.2/project
/trunk/ivy.dir
/trunk/project
/tags/1.2/ivy.dir
/tags/1.2/project

The ../ivy.dir means go up one directory, then down to the ivy.dir project. When I branch the project (and the Ivy project), the svn:externals won't have to be edited because it'll point to the same branch. When I tag, I also do the ivy.dir project at the same time. Again, the URL for the svn:externals doesn't change because they're pointing to the same tag.

So, you can setup Subversion any way you want. Using the standard means that when new developers come in, they know where things are and don't have to be trained. Less confusion. The big difference is how related are the projects to each other. If they are all branched, tagged, and released together, use a common set of branches, tags, and trunk directories. If not, you might be better off giving each project their own set of branches, tags, and truck directories.

Upvotes: 2

Robin Q
Robin Q

Reputation: 62

The way we have ours setup is in your first example

host/svn/ ..
Project A ..
project B ..
Project c ..
etc

It has been working fine for me and I have been using this method for 6+ months.

Upvotes: 0

Related Questions