Page 1 of 1

Setting up SVN repositories

Posted: Thu Sep 21, 2006 11:26 am
by RobertGonzalez
Okay, yet another thing I get to learn as part of my new job...

When setting up a repository (or multiples) in SVN, what approach should I take? I have three main web projects that will be using SVN, but there is also a fourth use in mind for storing config files and other files not related to the web projects. Do I want to set up one repo with four directories or four separate repos?

Posted: Thu Sep 21, 2006 9:16 pm
by Ambush Commander
My current policy is to have one big incubator repository and then export out projects as the get big and need to be moved to other places/etc. The main difference is revision numbering: access control through Apache is substantially same whether you do four or one.

Posted: Thu Sep 21, 2006 10:35 pm
by RobertGonzalez
The folks I work with think it would be better to have four separate repos for each of the four projects were are versioning. What do you think? So far I have only set up one repo.

Another thing, am I supposed to create the /branch, /trunck and /?!?! directories or do those get created upon creation of the repository? I am such a total newbie at this and I have to have svn working tomorrow morning.

Posted: Fri Sep 22, 2006 12:56 am
by nickvd
Depends on how you create the repo... Some clients will create them for you, others they will not, if not, just have a Template Directory structure:

Code: Select all

projectRoot/
   branches/
   tags/
   trunk/
Set it aside somewhere, and use that for the initial import to start off from square one.

Someone more versed in svn may have a better way to automate the task (its not even needed if it's just a repo for classes/configs)...

Posted: Fri Sep 22, 2006 2:59 am
by Maugrim_The_Reaper
I'd go with separate repositories - separate repos, separate versioning, separate backups. If the projects are linked, maybe I'd fit them in just one but it just doesn't "feel" right to me.

Posted: Fri Sep 22, 2006 3:06 am
by Christopher
I agree, separate repositories for each project. It is a little more work configuring them, but the versioning works like you expect it to. And it is easier to turn them on and off as needed.

Posted: Fri Sep 22, 2006 8:04 am
by RobertGonzalez
As it looks now, we are going to have four projects that are going into svn. From an administrative/maintenance perspective, is that a low enough number of projects to justify having one project per repo?

On another note, when it comes time to push code live, how does one go about that? Is it simply a matter of copying files from the project folder to the production server?

Posted: Fri Sep 22, 2006 8:14 am
by Maugrim_The_Reaper
Depends on how you develop. Generally I'd develop the TRUNK (main development) to a point where it's stable and assessed as production ready, then copy it over to a new Branch which can be maintained separately from ongoing development. If TRUNK development and the Branch share bug fixes, then they can be added as a commit to one, and merged across to the other.

The SVN Book has a wealth of detail on branching and merging. The book is free if you look it up, you can download a PDF copy from http://svnbook.red-bean.com/ .

Posted: Fri Sep 22, 2006 8:17 am
by RobertGonzalez
I had that open all day yesterday. It was a little difficult for me to follow. Maybe its just that I am used to the wonderful PHP Manual :wink: .

Thanks Maugrim. I'll look into that in a little bit.

Posted: Fri Sep 22, 2006 8:22 am
by Maugrim_The_Reaper
Wealth of detail = difficult to follow ;)

On one of your first questions - unless I'm stuck with SF for open source development, I generally keep projects and even sub-projects separated in repos. There's a method of linking them together (if related/dependencies) during an export. Code you use will be exported mind, not checked out - exporting eliminates all those hidden .svn directories.

Good luck with the projects by the way!

Posted: Fri Sep 22, 2006 4:38 pm
by RobertGonzalez
Man, I need it. I am slightly overwhelmed with it all at the moment. I still cannot figure out how to set users up so they can check out and commit and the server knows it. And I still have no clue how to attach those headers to the code that is run through SVN, you know like:

Code: Select all

<?php
/**
 * $author: everah
 * $filetime: 2006-09-22
 */
?>

Posted: Fri Sep 22, 2006 4:54 pm
by Maugrim_The_Reaper
For the headers, it's an operation set up for individual files. The use of "propset" CLI command with svn:keywords is a starting point in the manual. If you have a GUI client it's probably setup in a file's properties tab.

I haven't setup a server in a while - not much help onn setting up users I'm afraid...

Posted: Fri Sep 22, 2006 6:16 pm
by Ambush Commander
Hey Everah, can we close one of these two topics (the other one being here)? They're starting to bleed into each other and I'm having trouble figuring out whether or not your question was answered or not. I'm quite experienced with SVN, so I can definitely help, but I'm not exactly sure what your problem is right now.

Posted: Fri Sep 22, 2006 7:27 pm
by RobertGonzalez
Tell you what, I'll close this one. Setting up the repos is done now anyhow.

The two topics were different in that this one is my ignornace as it relates to setting up repositories. The other thread is as it relates to my ignorance in setting up the server and hitting it with users that are allowed to commit changes.

But to tell you the truth, I wasn't really making sure I was in the right thread when I was posting. That is my mistake and I will be more careful.