#!/bin/bash export LC_ALL=C usage() { echo "Usage: $(basename $0) TAG [MESSAGE]" echo echo "Message is optional, you must run this script within a svn tree." echo exit 1 } TAG="$1" MESSAGE="$2" [[ -z ${TAG} ]] && usage [[ -z ${Message} ]] && MESSAGE="tagged '${TAG}'" URI="$(svn info | grep 'URL:' | cut -d' ' -f2)" [[ $? -ne 0 ]] && usage REPO_ROOT="$(svn info | grep 'Repository Root:' | cut -d' ' -f3)" [[ $? -ne 0 ]] && usage echo "tagging ${URI} with '${TAG}'..." svn copy -m "${MESSAGE}" "${URI}" "${REPO_ROOT}/${SUBDIR}/tags/${TAG}"