灌溉梦想,记录脚步
« »
2009年11月4日技术合集

svn库中添加、删除、提交文件的脚本

#!/bin/bash
COUNT=`svn status | grep '^?' |wc -l`
until [ $COUNT -lt "1" ]
do
CURRENT=`svn status | grep '^?' |awk {'print $2'} | head -$COUNT | tail -1`
echo "Do you want to add $CURRENT? (y/n): "
read ANS
if [ $ANS = "y" ]
then
svn add $CURRENT
echo "$CURRENT added to repository"
COUNT=`expr $COUNT – 1 `
elif [ $ANS = "n" ]
then
COUNT=`expr $COUNT – 1 `
fi
done

COUNT=`svn status | grep '^!' |wc -l`
until [ $COUNT -lt "1" ]
do
CURRENT=`svn status | grep '^!' |awk {'print $2'} | head -$COUNT | tail -1`
echo "Do you want to delete $CURRENT? (y/n): "
read ANS
if [ $ANS = "y" ]
then
svn delete $CURRENT
echo "$CURRENT added to repository"
COUNT=`expr $COUNT – 1 `
elif [ $ANS = "n" ]
then
COUNT=`expr $COUNT – 1 `
fi
done

echo "Enter a commit message: "
read MSG
svn commit -m "$MSG"

日志信息 »

该日志于2009-11-04 16:19由 kevin 发表在技术合集分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下引用到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

发表回复