1. 程式人生 > >解決mac使用svn: E170000: Unrecognized URL scheme for https://xxx錯誤

解決mac使用svn: E170000: Unrecognized URL scheme for https://xxx錯誤

OS X版本:10.10.3

10.10.3自帶了svn,但是版本是1.7,如果專案是使用1.8的svn,就必須升級到1.8,才能夠正常使用。當前svn的最新版本是1.8.13。那麼首先刪除舊版本的svn,先檢視svn安裝到哪個目錄:
localhost:~ mikan$ which svn
/usr/local/bin/svn
刪除舊版本的svn:
localhost:~ mikan$ cd /usr/local/bin/
localhost:bin mikan$ rm -rf svn*
通過brew install subversion
localhost:bin mikan$ brew update subversion
檢視svn版本:
localhost:bin mikan$ svn --version
檢視svn伺服器上的某個目錄:
localhost:bin mikan$ svn list https://ip:port/xxx/trunk/
此時卻出現了:
svn: E170000: Unrecognized URL scheme for https://ip:port/xxx/trunk/

通過網上查詢,原來1.8以後需要serf軟體包來支援訪問http協議的版本庫,不然會出現上面的錯誤。而serf需要使用scons來編譯安裝,所以要成功安裝最新版本的svn,需要如下步驟:
1、安裝scons
2、安裝serf
3、安裝svn
下面是具體步驟

1、安裝scons
localhost:bin mikan$ brew install scons

2、安裝serf
serf不能通過brew安裝,只能下載原始碼來安裝,而serf託管在googlecode下,最新版本是1.3.8,但是不能在googlecode下載最新版本的,不知道是什麼原因,但找了另一個網站可下載:
http://fossies.org/linux/www/serf-1.3.8.tar.gz/

下載serf並解壓後,安裝步驟如下:
tar -xvf serf-1.3.8.tar.bz2
cd serf-1.3.8
scons PREFIX=/usr/local/serf
scons install
其中scons PREFIX=/usr/local/serf中的/usr/local/serf是serf的安裝目錄,安裝完成後,接下來安裝svn

3、安裝svn
首先去官網下載最新版本的svn原始碼包,當前最新版本是1.8.13:
https://subversion.apache.org/download/


然後解壓安裝:
tar -xvf subversion-1.8.13.tar.bz2
cd subversion-1.8.13
./configure --with-serf
make install
好了,安裝成功,來驗證一下:
localhost:subversion-1.8.13 mikan$ svn --version
svn, version 1.8.13 (r1667537)
   compiled Jun  1 2015, 21:01:09 on x86_64-apple-darwin14.3.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

通過最後兩行知道支援http和https
再通過svn list來驗證一下:
svn list https://ip:port/xxx/trunk/

Error validating server certificate for 'https://182.92.233.191:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
 - The certificate hostname does not match.
Certificate information:
 - Hostname: iZ258hknam2Z
 - Valid: from May 14 14:00:46 2015 GMT until May 11 14:00:46 2025 GMT
 - Issuer:
 - Fingerprint: 5D:5A:8E:D7:AA:95:7D:29:6A:E7:67:2E:B1:22:E6:1A:4E:B2:F4:CE
(R)eject, accept (t)emporarily or accept (p)ermanently?

這裡輸入p永久接受,然後即可顯示該svn目錄下的檔案及檔案夾了。

至此,便可正常使用svn了。