由于 svn 服务器地址变更,本地仓库需要更新新的地址,可以用命令行或客户端来更新仓库地址。

使用 svn relocate 命令更新仓库地址

  • 使用 svn relocate --help 来查看 svn relocate 的用法:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Kilig:~ wy$ svn relocate --help
relocate: Relocate the working copy to point to a different repository root URL.
usage: 1. relocate FROM-PREFIX TO-PREFIX [PATH...]
2. relocate TO-URL [PATH]

Rewrite working copy URL metadata to reflect a syntactic change only.
This is used when a repository's root URL changes (such as a scheme
or hostname change) but your working copy still reflects the same
directory within the same repository.

1. FROM-PREFIX and TO-PREFIX are initial substrings of the working
copy's current and new URLs, respectively. (You may specify the
complete old and new URLs if you wish.) Use 'svn info' to determine
the current working copy URL.

2. TO-URL is the (complete) new repository URL to use for PATH.

Examples:
svn relocate http:// svn:// project1 project2
svn relocate http://www.example.com/repo/project \
svn://svn.example.com/repo/project

Valid options:
--ignore-externals : ignore externals definitions

Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG (caution: on many operating
systems, other users will be able to see this)
--no-auth-cache : do not cache authentication tokens
--non-interactive : do no interactive prompting (default is to prompt
only if standard input is a terminal device)
--force-interactive : do interactive prompting even if standard input
is not a terminal device
--trust-server-cert : deprecated; same as
--trust-server-cert-failures=unknown-ca
--trust-server-cert-failures ARG : with --non-interactive, accept SSL server
certificates with failures; ARG is comma-separated
list of 'unknown-ca' (Unknown Authority),
'cn-mismatch' (Hostname mismatch), 'expired'
(Expired certificate), 'not-yet-valid' (Not yet
valid certificate) and 'other' (all other not
separately classified certificate errors).
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
servers:global:http-library=serf

Kilig:~ wy$
  • 使用 svn info 来查看仓库信息
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Kilig:Demo wy$ svn info
Path: .
Working Copy Root Path: /Users/wy/Develop/Demo
URL: http://192.168.5.27/svn/Demo/iOS/Demo_proj/branches/Develop
Relative URL: ^/iOS/Demo_proj/branches/Develop
Repository Root: http://192.168.5.27/svn/Demo
Repository UUID: eb6cf98c-3463-4050-b78e-425bec7bf9b3
Revision: 31421
Node Kind: directory
Schedule: normal
Last Changed Author: wy
Last Changed Rev: 31421
Last Changed Date: 2018-03-05 10:24:16 +0800 (Wed, 07 Mar 2018)

Kilig:Demo wy$
  • 更新仓库地址

注意 FROM-URL 和 TO-URL 是 Repository Root 的地址,命令如下:

1
2
3
4
$ svn relocate http://192.168.5.27/svn/Demo \
http://10.127.33.27/svn/Demo \
--username wy \
--password 123456

使用 svn 客户端更新仓库地址

以 SmartSVN 为例,只要在菜单栏上点击 Modify -> Relocate,然后输入新地址,确定,再输入账号密码即可。其他客户端雷同,右键或菜单栏找到 Relocate 选项,输入新的地址。