Notes - Subversion Tips

.plan
[Last 5] [Last 10] [Index] [RSS Feed]
[Full .plan (over 1MB)]
Contact Me

Notes

Notes
SubVersion
Vim
C and C++
FreeBSD
more...

RMITCS

C Helpdesk Resources
Customising Your CS Account
more...

Software

Codepile
Assorted little scripts and apps.
dumps.pl - FreeBSD Backup script
rastodo.py - Python Console todo/reminder
more...
Android
NumLock
Lost Emulators

Game Mods

LethalMod
A Max Payne 2 mod - more realistic and deadly.
more...

Image Gallery

Image Gallery
Photos
Screenshots
more...

Roleplaying Games

Shadowrun Notes(4th ed)
Heavy Gear Notes(2nd ed)
GURPS Notes
GameMastering Notes

Miscellaneous

links
Taglines
crazy
Trombone slide position chart [PDF]
[Back to home page]
[Back to Index]

[Raw XML]
Subversion version control tips.

Contents:


Checking out from a machine you have SSH access to

Construct the URL from protocol "svn+ssh", the hostname and the full path to the repository and tree:

dleigh@:~> svn co svn+ssh://yallara/home/d/dleigh/repository/PP2B/ 
dleigh@yallara.cs.rmit.edu.au's password:
A  project/AUTHORS
A  project/code
A  project/README
A  project/style.txt
Checked out revision 4.
dleigh@:~>

You can commit, update and so on as normal - subversion will remember the URL you used to access the repository.

Keyword expansion

By default keyword expansion is disabled in subversion - you can explicitly enable it per-file as follows:

svn propset svn:keywords "Id LastChangedDate Author" file1.c file2.java...

You can enable it by default when adding certain filetypes by setting the following in your config file. In Unix, this is "~/.subversion/config"; in Windows, this is "C:\Documents and Settings\[username]\Application Data\Subversion\config", assuming user profiles are located in C:\Documents and Settings.

In [miscellany] section:

enable-auto-props = yes

In [auto-props] section:


*.c = svn:keywords=Id LastChangedDate Author
*.cpp = svn:keywords=Id LastChangedDate Author
*.java = svn:keywords=Id LastChangedDate Author
(etc...)

Automatic commit email

In the hooks/ subdirectory of your repository create a file called post-commit (no extension) which should look similar to:


#!/bin/sh

REPOS="$1"
REV="$2"

/full/path/commit-email.pl "$REPOS" "$REV" -s SVN:project-name user1@.abc.net user2@.abc.net...

This requires the commit-email.pl script that comes with subversion is properly set up on your system. You can find it in /usr/local/share/subversion/hook-scripts/commit-email.pl on FreeBSD 5.x.

Generated Wed, 08 Feb 2012 06:28:33 +1100
Copyright © 2002-2011 Dylan Leigh.
[HTML 4.01 Transitional]