neverpanic.de

Subversion Property Copy

| Comments

Although there are a couple of Subversion GUIs for Macs, I usually use the command line interface. I manage all source code I write during my studies using Subversion and usually add revision number and date of last checkin to the file using the svn:keywords-Property. However, I always forget the set of keywords I usually add: Author Date Id Revision URL. Unfortunately, there is no way to copy a property from one file to another in the standard subversion binary. There is, however, a little shortcut:

svn propset $propertyName "`svn propget $propertyName $fromFileName`" $toFileName

Typing this monster isn’t any userfriendly at all, though – a little .bashrc magic does the trick:

# add svn propcopy
function svn() {
	case "$1" in
		pc|propcopy)
			propName=$2
			fromFile=$3
			shift 3
			`which svn` propset $propName "`\`which svn\` propget $propName $fromFile`" $@
		;;
		*)
			`which svn` $@
		;;
	esac
}

Update

Thanks to Raim for the wildcard support. Using subversion auto-props is an option for files, but unfortunately, auto-props don’t work on directories yet.

University & MacBook Pro

| Comments

It’s been a while since my last update — not because there’s nothing to tell, but because I didn’t find any time to write something down.

So why’s that? I’m attending university now: I’m in my first semester of computer science at the University of Erlangen and it’s been a tough start figuring out how things work at university, finding the rooms, getting the work done, etc.