views:

387

answers:

6
+4  Q: 

SVN Versioning

Hi guys,

Just a small SVN "problem" here.

I setup my own SVN server http://www.codinghorror.com/blog/archives/001093.html

Now I made a rep in which all my projects will go.

Now, I checked the rep out in a folder called "Projects".

Now If I make a project and check it in, that project is revision 1. If I make a second project, and check it in, that Project is at revision 2. Thus, if I make a change to Project 1, that project will then be at Revision 3.

What I would really want is for each project to have its own revision scheme. How do I do this?

+14  A: 

The only way is to have each project in a completely separate repository. Items within the same repository will always exhibit the behavior you mentioned in your question.

From Here

Unlike those of many other version control systems, Subversion's revision numbers apply to entire trees, not individual files. Each revision number selects an entire tree, a particular state of the repository after some committed change.

Mark Biek
+1  A: 

You have to create a separate repository for each project. This is in general a good idea anyways so no downside there :)

Armin Ronacher
I disagree with the no downsides. From http://svnbook.red-bean.com/en/1.0/ch05s04.html, you have duplicated (or more) maintenance to do and any "shared" code is difficult to maintain. Some thought should be made before choosing one way or the other.
Richard Morgan
+1  A: 

You need to create repositories inside your "Projects" folder, and when you do the initial checkout, checkout "???/projects/repo1"... this will keep the working copies separate on your machine, and you will check in/out completely separately of each other.

Steve Paulo
This is not really correct, the question was about keeping the revisions for the different projects separate, your example will not do this
Palmin
How so? Separate repositories == separate projects == separate revisions...
Steve Paulo
Well, the initial poster said that he'd checked out the repository inside a "Projects" folder. You can not "create repositories" within a checked-out folder, since this is client-side only. As such, the answer could be misunderstood.
Palmin
I can see what you mean... i'll try to be more explicit in the future.
Steve Paulo
A: 

So I don't need to start a seperate Windows Service for each rep right? (That would be insane)

IceHeat
The Server can have multiple repos. If you're on windows, google visualsvn server. It has a nice console snap-in to do the basic administrative work
Ben Robbins
A: 

They discuss it a little better here: http://www.nabble.com/Multiple-Repositories-in-a-Windows-Server-td15014106.html

Basically you can do:

svnserve -r /path/to/repository  

svn://hostname/

or

svnserve -r /path/to/directory/containing/many/repositories  

svn://hostname/repositoryname/

Alternately, you could go server'less and just host the individual repositories on a local or networked drive.

CodeSlave
+1  A: 

Can you describe why having a single subversion revision number across multiple projects is a problem for you?

There are some legitimate advantages to using a single repository for all of your projects. The biggest one being that you're probably better able to control changes between common code in multiple projects.

If you have a problem with the concept of a single incrementing subversion revision number across multiple projects now, have you considered the situation where you branch one of your projects? (remembering that a normal branch will also have a globally incrementing subversion revision number)

It sounds like you're trying to use the repository revision number as part of the build or release number? If that's the case perhaps you could consider implementing a different build numbering scheme for your project/s that can then be associated with the subversion revision number.

Such an association can be made by using a convention of creating branches with the release number and putting the subversion revision in the comment for the branch.

Some schemes were discussed in this question

Andrew Edgecombe