#!/bin/sh # # Distributed under the terms of GNU GPL version 2 # # An addition to the SVN scripts at http://marius.scurtescu.com/?p=102 # # Stuart Langridge, http://www.kryogenix.org/ LOGFILE=`mktemp -t svn_commit.XXXXXX` ICONPATH="`dirname $0`/svn.xpm" # check this is a working copy svn info || (zenity --error --text="Not a working copy" && exit) SUGGESTTAG=$(echo "scale=9;$(svn ls $(dirname "$(svn info | grep '^URL:' | cut -c6-)")/tags/ | sort -n | tail -1 | sed 'sX/XX') + 0.01" | bc) TAGNAME=`zenity --entry --title="Subversion: Tag this working copy" --text="Enter tag name:" --entry-text="$SUGGESTTAG" --width=400 --window-icon="$ICONPATH" 2>/dev/null` if [ $? -eq 0 ] ; then NEWURL=$(dirname "$(svn info | grep '^URL:' | cut -c6-)")/tags/$TAGNAME echo $NEWURL svn copy . $NEWURL -m "Tag as $TAGNAME" > $LOGFILE # And now create a LATEST tag LATEST=$(dirname "$(svn info | grep '^URL:' | cut -c6-)")/tags/LATEST svn delete $LATEST -m "Removing LATEST to retag" >> $LOGFILE svn copy $NEWURL $LATEST -m "Tagging $TAGNAME as LATEST" >> $LOGFILE zenity --text-info --title="Subversion: Tagged as $TAGNAME" --filename=$LOGFILE --width=600 --height=400 --window-icon="`dirname $0`/svn.xpm" rm -f $LOGFILE fi