#!/bin/sh myname="abelcheung" usage() { cat << _EOF_ Usage: $(basename $0) branch release Example: $(basename $0) 2.0 2.0.10 _EOF_ exit 1 } if [ -z "$2" ]; then usage fi if [ ! -d "./branches" -a ! -d "./tags" -a ! -d "./trunk" ]; then echo "This script should be executed under the folder of your language" exit 2 fi branch="$1" release="$2" lang="$(basename $(pwd))" prefix="http://${myname}@svn.automattic.com/wordpress-i18n/$lang" if [ ! -d ./branches/"$branch" ]; then echo "The branch '$branch' does not exist" exit 3 fi if [ ! -d ./tags ]; then echo "The 'tags' dir does not exist" exit 3 fi echo -n "Checking for existing tag ... " taglist="$(svn ls ./tags 2>/dev/null)" if $(echo -n "$taglist" | grep -q "^${release}/$"); then echo "already tagged for this release version" exit 4 else echo "done." fi svn copy -m "Tagged $lang for $release release." "$prefix"/branches/"$branch" "$prefix"/tags/"$release"