mac升级svn--命令行时提示版本过低

问题:在命令行下对项目进行版本管理操作,结果报这样的错:

svn: E155021: This client is too old to work with the working copy at
‘/Users/user/works/v1baobao4iphone‘ (format 31).
You need to get a newer Subversion client. For more details, see
http://subversion.apache.org/faq.html#working-copy-format-change
原因:命令行中的svn版本是1.7.x,而我用的svn客户端版本是1.8.x,在svn客户端中使用高版本的操作之后,回到命令行就歇菜了。

一、下载svn新版本

1.1通过brew更新

参见网址:http://subversion.apache.org/packages.html

$ brew options subversion
$ brew install (OPTIONS) subversion
此处更新时使用到Google的库文件,下载更新失败,建议vpn,你懂的。

安装完成之后:

@caic ➜  bin rvm:(ruby-2.2.1) git:(master) pwd
/usr/local/Cellar/subversion/1.8.13/bin
@caic ➜  bin rvm:(ruby-2.2.1) git:(master) ll svn*
-r-xr-xr-x  1 pingankeji  admin  279216 Oct  9 16:57 svn
-r-xr-xr-x  1 pingankeji  admin   87876 Oct  9 16:57 svnadmin
-r-xr-xr-x  1 pingankeji  admin   47928 Oct  9 16:57 svndumpfilter
-r-xr-xr-x  1 pingankeji  admin   85840 Oct  9 16:57 svnlook
-r-xr-xr-x  1 pingankeji  admin   56812 Oct  9 16:57 svnmucc
-r-xr-xr-x  1 pingankeji  admin   78460 Oct  9 16:57 svnrdump
-r-xr-xr-x  1 pingankeji  admin  100572 Oct  9 16:57 svnserve
-r-xr-xr-x  1 pingankeji  admin   75564 Oct  9 16:57 svnsync
-r-xr-xr-x  1 pingankeji  admin   31116 Oct  9 16:57 svnversion

1.2软件安装包更新

从网上下载得到文件:Subversion-1.8.13_1_*.pkg,安装步骤跟windows下面差不多,下一步就行了。

这种方式安装后程序会默认安装到/opt/subversion下面,设置环境变量时将会不同。

注:参考过http://blog.sina.com.cn/s/blog_a0f3ea980101c0y0.html,里面要求删除/usr/bin/svn*等文件,

再创建软链接,我这边获取root权限之后还是不行,如果那位搞定了欢迎指导。


二、设置环境变量并启用

@caic ➜  ~ rvm:(ruby-2.2.1)  vi .bash_profile
将export PATH=/usr/local/Cellar/subversion/1.8.13/bin:$PATH添加到文件末尾,保存并退出
@caic ➜  ~ rvm:(ruby-2.2.1)  source .bash_profile
然后在此查看:

@caic ➜  bin rvm:(ruby-2.2.1) git:(master) svn --version
svn, version 1.8.13 (r1667537)
   compiled Oct  9 2015, 16:56:59 on x86_64-apple-darwin15.0.0

Copyright (C) 2014 The Apache Software Foundation.
This software consists of contributions made by many people;
see the NOTICE file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository access (RA) modules are available:

* ra_svn : Module for accessing a repository using the svn network protocol.
  - with Cyrus SASL authentication
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - using serf 1.3.8
  - handles 'http' scheme
  - handles 'https' scheme


三、Xcode自带客户端

当前Xcode版本是7.0,SVN客户端位于“/Applications/Xcode.app/Contents/Developer/usr/bin”目录下

@caic ➜  bin rvm:(ruby-2.2.1)  pwd
/Applications/Xcode.app/Contents/Developer/usr/bin
@caic ➜  bin rvm:(ruby-2.2.1)  ll svn*
-rwxr-xr-x  1 root  wheel  243680 Sep 11 05:44 svn
-rwxr-xr-x  1 root  wheel   86688 Sep 11 05:44 svnadmin
-rwxr-xr-x  1 root  wheel   56624 Sep 11 05:44 svndumpfilter
-rwxr-xr-x  1 root  wheel   89136 Sep 11 05:44 svnlook
-rwxr-xr-x  1 root  wheel   80864 Sep 11 05:44 svnrdump
-rwxr-xr-x  1 root  wheel   92304 Sep 11 05:44 svnserve
-rwxr-xr-x  1 root  wheel   78080 Sep 11 05:44 svnsync
-rwxr-xr-x  1 root  wheel   36352 Sep 11 05:44 svnversion
接下来我们删除这些旧版本的SVN程序,如果你不放心,建议备份一下mv svn svn_bak。———对比1.2,此处就不存在权限不够的问题了。
@caic ➜  bin rvm:(ruby-2.2.1)  sudo rm -rf /Applications/Xcode.app/Contents/Developer/usr/bin/svn* 
创建链接
@caic ➜  bin rvm:(ruby-2.2.1)  sudo ln -s  /usr/local/Cellar/subversion/1.8.13/bin/svn*  /Applications/Xcode.app/Contents/Developer/usr/bin/ 
当然,如果你想和Xcode一样,直接把这些文件复制到Xcode下面也可以
@caic ➜  bin rvm:(ruby-2.2.1)  sudo cp /usr/local/Cellar/subversion/1.8.13/bin/svn* /Applications/Xcode.app/Contents/Developer/usr/bin/ 

参考地址:

http://www.mamicode.com/info-detail-511302.html


猜你喜欢

转载自blog.csdn.net/czc1009/article/details/49002881