Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /data/sites/web/remonpelnl/www/wp-content/plugins/rmp_bitly/rmp_bitly.php on line 20
So, you’re developing with SVN and you want to use branches? Creating a branch is easy, but switching between them by manually typing those URLs can be annoying. Use this script :)
SVN Branch Switcher (download file)
#!/bin/sh
[ ! -d ".svn" ] && echo Use only inside the main project directory under SVN control && exit
S=` svn info | grep URL: | cut -d " " -f 2 `
echo Currently on $S
#echo $S
#exit;
BSE=` echo $S | sed 's/\/trunk/ /' | sed 's/\/branches/ /' | sed 's/\/tags/ /' | cut -d " " -f 1 `
BASEBRANCHES=$BSE/branches
TARGET=$BASEBRANCHES/$1
[ "$1" == "" ] && TARGET=$BSE/trunk
[ "$TARGET" != "$BSE/trunk" ] && [ "` svn ls $BASEBRANCHES | egrep \"^$1/$\" | wc -l | egrep -o \"[0-9]+\"`" == "0" ] && echo Branch $1 does not exist && exit;
echo Switching to $TARGET
[ "$TARGET" == "$S" ] && echo Nothing to do, already there && exit;
svn switch $TARGET
use it with a branchname as parameter and it will switch to the branch, without a parameter switches back to the trunk.
Enjoy!