Subversion (svn)

Subversion is one of the interesting services at all if you want to modify your files ob different machines without the need to synchronise your work manually. Here is the Subversion manual (Quickstart)

mkdir -p /usr/local/var/my_svn/
svnadmin create /usr/local/var/my_svn/
mkdir -p ~/foo/; cd ~/foo/
svn co file:///usr/local/var/my_svn/
svn add ...
svn diff -r HEAD
svn diff -r 3:5
svn diff -r {2004-11-28 15:30}
svn update
svn commit

Mark the file FOO as binary

svn propset svn:mime-type 'application/octet-stream' FOO
svn proplist -v FOO

Set diff otions to svn diff (e.g. to ignore empty lines)

svn diff --diff-cmd diff -x -iEbBu

In order to set the option permanently just set in ~/.subversion/config a small shell-script as your diff command. Copy the current version from trunk e.g. to develop experimental functions

svn copy trunk branch/beta1
svn ci   branch/beta1
# Committed revision 123.

Merge your changes back to the trunk

cd trunk/
svn log   --stop-on-copy ../branch/beta1
svn diff  -r 123:HEAD    ../branch/beta1
svn merge -r 123:HEAD    ../branch/beta1

This is an Apache2 configuration which will make repositories at /usr/local/var/repositories/svn/NAME accessible via the URL http://HOSTNAME/repositories/svn/NAME:

<Location                     /repositories/svn/>
 DAV svn
 SVNParentPath /usr/local/var/repositories/svn/
 AuthType Basic
 AuthName "My Subversion Repository"
 AuthUserFile /usr/local/var/repositories/svn/user_passwd
 Satisfy Any
 Require valid-user
 AuthzSVNAccessFile /usr/local/var/repositories/svn/user_authorisation
</Location>;

Control the permissions of the different users: user_authorisation

## Default is NO
[/]
* =

[REPOS1:/]
usera = rw
userb = r

[REPOS1:/trunk/test]
userb   = rw

Set line feed format for a file Property:

svn:eol-style LF
svn:eol-style CRLF
svn:eol-style native

Exclude files Property:

svn:ignore *

Add a folder to a repository without its content

svn add --depth=empty foo

Do not remember password of repositories via ~/.subversion/config

[auth]
store-passwords = no
store-auth-creds = no

Winmerge and Subversion

Tell Winmerge to exclude all the .svn folders

Winmerge -> Tools -> Filters -> FileFilters -> New -> For all Users -> Install

Download this file and select it in this dialog

From now on the .svn folders will be ignored.