LinuxSoftware

Coding and tramping in Aotearoa / New Zealand

Source control for the 21st century!

We are using Subversion as our source control system. The Subversion Book is a great reference.

Install

  • Fedora includes Subversion
  • SuSE includes Subversion
  • Subversion for Windows can be downloaded from here, or better yet use TortoiseSVN.

TortoiseSVN examples
To check out the first time:

To commit a change:

  • right click | SVN Commit
  • Enter message
  • The first time it will ask for a username and password

command-line examples
To check out the source svn checkout http://exelearning.org/svn/exe/trunk exe

To update your local source svn update

To add a file svn add filetoadd.py

To compare local source with the repository svn diff

To commit changes to the repository svn commit --message "Corrected number of cheese slices." filetocommit.py

Don't commit code to the repository without testing it first. Code commited should conform to our CodingStandards.

Revert

From http://blog.johang.se/2009/03/revert-commit-in-subversion.html

Use the svn merge command. It usually merges revisions from one repository into another. However, it can be used to do the opposite: unmerging.

svn merge -c X SOURCE merges commit X from SOURCE repository to working copy. If X is negative it will be regarded as an inverse merge and the commit removed instead of added.

So, the following command reverts revision 34 in the working copy.

svn merge -c -34 .

Don't forget to commit.

Change properties

svn propset svn:executable on Configure