Please add to the contrib directory w/ executable bit set for the
pleasure of anyone that requires a script to move the .svn directories
for a working copy.
You may rename this as needed or appropriate.
=================================mvadminfrom=========================
Moves wc admin path from one standard to another
Shamim Islam (c) 2003, relicenced under Subversion license as listed
in COPYING.
mvadminfrom [OPTIONS]
-n - no execution
-o unix|win32 - to OS
-f from admin path override, defaults to .svn on unix, _svn on win32
-t to admin path override, defaults to _svn on unix, .svn on win32
-p root path override - location of wc root to start conversion, defaults
to .
=====================================================================
#!/bin/bash
function MoveAdminFrom()
{
# No info, exit
if [ "$1" == "" ] ; then
exit;
fi
# Test mode - no execution
if [ "$1" == "-n" ] || [ "$1" == "-N" ] ; then
TEST=1
shift
else
TEST=0
fi
# Default output format -o win32 or -o unix etc
if [ "$1" == "-o" ] || [ "$1" == "-O" ] ; then
shift
if [ "$1" == "win32" ] ; then
SVNFROM=_svn
SVNTO=.svn
else
SVNFROM=.svn
SVNTO=_svn
fi
shift
fi
# Override FROM path
if [ "$1" == "-f" ] || [ "$1" == "-F" ] ; then
shift
SVNFROM="$1"
shift
fi
if [ "$1" == "-t" ] || [ "$1" == "-T" ] ; then
shift
SVNTO="$1"
shift
fi
# Path override
if [ "$1" == "-p" ] || [ "$1" == "-P" ] ; then
shift
ROOTPATH="$1"
shift
fi
if [ "$ROOTPATH" == "" ] ; then
ROOTPATH='.'
fi
find "$ROOTPATH" | grep "\\$SVNFROM$" | while read FROMPATH ; do
SVNTOP=`dirname $FROMPATH`
if [ $TEST -eq 1 ] ; then
echo "$FROMPATH" "$SVNTOP/$SVNTO"
else
mv "$FROMPATH" "$SVNTOP/$SVNTO"
fi
done
}
MoveAdminFrom "$@"
============================end==mvadminfrom=========================
Shamim Islam
BA BS
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 25 20:22:32 2003