Subversion Repositories

Creating a Repository

Login to the control panel http://panel.dreamhost.com (User/PW Here) and go to the Goodies/Subversion section.

A full list of existing projects will be shown. When creating a new repository make sure that the Project Name and Project ID boxes are filled in.

You MUST change the domain to svn.psgpages.com.

The system will add the project ID to the end of this to give the full URL

Leave the Visibility set as Private and add some user/password pairs to the Users list.

Click the Create my new project repository now! button to create the repository.

The system will take a few minutes to actually create the repository.

Browse to http://svn.psgpages.com/ProjectID to check that it has been created

Advanced User Rights

It is possible to grant user rights on a per-folder basis, but it must be done manually.

For example if I want to grant read only rights to a user called Derek, I would add Derek DerkPassword to the Users list as above. drek will now have full access to the repository.

Visit ftp.psgpages.com/svn and look for the file NepositoryName.access

Open this file in an editor. It should have something like

[/]
user1 = rw
user2 = rw
Derek = rw

Modify this to add or restrict Dereks rights.

[/]
user1 = rw
user2 = rw
[/Directory/SubDir]
Derek = r

Derek now has read only access to files in /Directory/SubDir, but has no access to the main repository.

If any new users get added to the repository in the Dreamhost control panel, this file will be re-written by dreamhost and any changes will need to be repeated manually

Download SVN Client

  • Tortoise SVN is a great SVN cient which is integrated into the Explorer shell.
  • FIXME Karl - Please add a link to your Visual Studio SVN Client FIXME

Creating the SubFolders

On the local machine, create a new temporary folder, then two (or three) subfolders Trunk and Build (Or Trunk and Tag)

  • Temp Folder
    • Trunk - This is where the main source code collection will live
    • Build - This is where specific Build versions will be stored

These names will be case sensitive

Using TortoiseSVN Right click on the Temp Folder, and choose Tortoise/Import In the URL box, enter the repository URL, which should be http://svn.psgpages.com/ProjectID.

Checkout the Empty Repository

Make another New folder - This time in the correct place where you want to keep the source code. Right Click on this folder and choose SVN Checkout. The URL should be http://svn.psgpages.com/ProjectID/Trunk

Don't forget the /Trunk bit on the end

All being well, the folder will remain empty, but will now have SVN properties

Add the Source Files

Copy all the source files (and subfolders) into the folder, then right click the folder and choose SVN Commit. On the dialog which appears, check the Show unversioned Files box, then tick any files which should be added to the repository.

If some files/folders should not be included, right click on them and add them to the ignore list. These might be compiled .exe files, obj files and so on

Click OK to commit the files to the repository.

Everyday Use

CheckOut

Create a new folder, right click on it then choose SVN Checkout. The URL will usually be http://svn.psgpages.com/ProjectID.

The files from the repository will then be downloaded into the folder.

Update

From time to time, and especially before performing a commit it is importent to Update from the repository to make sure the latest versions of the files are available.

Right click on the folder and choose SVN Update

The system will merge any changes into the working copy, unless there are any conflicts

Conflicts

If the system cannot automatically merge changes into the files, then the conflict must be resolved manually. A twin pain dialog will be shown, highlighting the differences between the local copy and the repository copy.

Edit the local copy so that both sets of changes are combined into the one file.

Commit

When the code is stable, right click the folder and choose SVN Commit to send those changes back to the repository.

When the dialog appears, it will show any unversioned files. Either select the files to add them to the repositroy, or right lick them and add them to the ignore list.

Usually it is a good idea to add a comment.

Branching and Tagging

Tagging

Sometimes it is useful to mark the code at a specific period in time.

For example, when a new version is released it might be important to be able to return the source code to the state it was in when the version was released.

Right click on the folder and choose TortoiseSVN/Branch/tag Change the URL to http://svn.psgpages.com/ProjectID/Build/5.1.123 (Or whatever the folder was called, with the build number on the end) At some point in the future it will be able to checkout the folder from this URL.

Branching

Sometiomes it is desireable to develop along two branches of code at the same time.

For example if version 1 has just been released, it is possible to immediately branch the code to version 2 to start developing new code. When bugs are identified it is possible to switch back to the version 1 branch, fix the bug and release version 1.1. The fix can then also be applied to the version 2 branch.

Branching is performed in exactly the the same way as Tagging

 
devnews/subversion_repositories.txt · Last modified: 2009/09/09 23:25 by wynsleeman
Recent changes RSS feed Creative Commons License Driven by DokuWiki