Skip to content

Instantly share code, notes, and snippets.

@masakih
Created June 8, 2009 06:27
Show Gist options
  • Select an option

  • Save masakih/125667 to your computer and use it in GitHub Desktop.

Select an option

Save masakih/125667 to your computer and use it in GitHub Desktop.
# 作業コピー内でRepository Rootを表示
alias svnroot="LC_ALL=C svn info | awk '/Root:/{print \$3}'"
# 作業コピー内でRepositoryの内容をRepository Rootを起点に表示。svnroot必須。
function svnls {
svn ls `svnroot`/$1
}
# 作業コピー内でコピーを作成する。svnroot必須。
function svncp {
if [ $# -eq 0 ]; then
echo usage:
echo " svncp dest"
echo " svncp src dest"
return
fi
if [ $# -eq 1 ]; then
svnURL="LC_ALL=C svn info | awk '/URL:/{print \$2}'"
src=`basename svnURL`
dest=$1
fi
if [ $# -eq 2 ]; then
src=$1
dest=$2
fi
svn copy `svnroot`/${src} `svnroot`/${dest}
}
# 作業コピー内でsvn switchを実行
svnswitch ()
{
if [ ! $# -eq 1 ]; then
echo chose directory;
return;
fi;
svn switch `svnroot`/$1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment