svn怎么检出两个地址项目_svn 检出项目报错

可能是svn 版本问题 升级自己svn.

brew update svn

svn 好难用,但是老项目都是svn 我是自己把svn命令封装了

#!/bin/bash

#

# @function SVN 提交工具

# @uses /bin/bash

# @version 1.0

# @author Pu ShaoWei

#

# ---------------------------------------------------------------------------------------- #

#

# ├── Patch 配置

# │

# ├── Common

# │

# ├── Fcuntion

# │

# └── Init

# ---------------------------------------------------------------------------------------- #

PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin;export PATH

SVN=/usr/bin/svn;

DEPLOY_TOOLS_DIR=`pwd`

# ---------------------------------------- Common ---------------------------------------- #

function validate(){

if [[ $1 == "" ]]; then

echo "Param Fail"

exit 1;

fi

for var in $*

do

# if [[ $var == $1 ]]; then

# continue;

# fi

if [[ ! -d $DEPLOY_TOOLS_DIR"/"$var ]];then

if [[ ! -f $DEPLOY_TOOLS_DIR"/"$var ]];then

continue;

fi

fi

file_path=$file_path" "$var

done

if [[ $file_path == "" ]]; then

echo "not File"

return 1;

fi

echo $file_path;

}

# ---------------------------------------- Function ---------------------------------------- #

function addCommand(){

file=$(validate $*);

if [[ $? == "1" ]]; then

echo $file

exit $?;

fi

$SVN add $file;

}

function ciCommand()

{

if [[ $1 != "-m" ]]; then

echo "svn commit -m '' path "

exit $?;

fi

msg=$2;

if [[ $msg == "" ]]; then

echo "Msg Empty!!"

exit 0;

fi

file=$(validate $3);

if [[ $? == "1" ]]; then

echo $file

exit $?;

fi

$SVN up;

$SVN commit -m $msg $file ; # --force-log

}

function revCommand()

{

file=$(validate $*);

if [[ $? == "1" ]]; then

echo $file

exit $?;

fi

$SVN revert $file;

}

function logCommand()

{

if [[ $2 != "" ]]; then

$SVN log -v --search $2 | less;

exit;

fi

$SVN log -v | less;

}

function vgCommand()

{

echo '=========================================================================='

echo

echo ' [添加文件] svn add '

echo ' [提交文件] svn commit '

echo ' [详细信息] svn info '

echo ' [更新信息] svn up '

echo ' [删除文件] svn delete '

echo ' [查看日志] svn log '

echo ' [对比文件] svn diff '

echo ' [撤销命令] svn revert '

echo ' [更新冲突]

Select: (p) postpone, (df) diff-full, (e) edit,

(mc) mine-conflict, (tc) theirs-conflict,

(s) show all options:

解析:

(p) postpone 把服务器代码和自己的代码都显示出来,供我们解决

(df) diff-full 命令行显示冲突内容,不好看

(e) edit 修改,不要这么做

(mc) mine-conflict 只使用自己的代码,删除服务器的

(tc) theirs-conflict 只使用服务器的,删除自己的代码

(s) show all options 再重新打印一下这个选择日志

'

echo '=========================================================================='

}

# ----------------------------------- Init ---------------------------------------- #

case $1 in

add)

addCommand $*

exit $?;

;;

commit)

m=`echo $2`

commit=`echo $3`

path=`echo ${@:4}`

ciCommand "$m" "$commit" "$path"

exit $?;

;;

status)

$SVN status;

exit $?;

;;

info)

$SVN info;

exit $?;

;;

checkout)

$SVN checkout $2;

exit $?;

;;

log)

logCommand $*

exit $?;

;;

cat)

$SVN $*

exit $?;

;;

up)

$SVN up

exit $?;

;;

delete)

$SVN delete $2

exit $?;

;;

diff)

$SVN diff $2

exit $?;

;;

revert)

revCommand $*

exit $?;

;;

vg)

vgCommand $*

exit $?;

;;

*)

vgCommand $*;

exit 1;

esac

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值