どぅーちゅいむーにー

これ、Twitterでよくね?という日々の記録かも

Subversion リポジトリの switch (クライアント)

まぁ、調べればすぐわかる内容ですが。
SVN サーバの切り替えで、チェックアウト側でみるリポジトリを切り替えたいときに、svn switch を利用する。


たとえば
旧:https://svn.server1.com/svn-repo/projectA/
から
新:https://svn.server2.com/svn-repo/projA/
に変更したい場合(試したのがHTTPSなので・・・)。


切り換えコマンドの形式は以下。


% svn switch --relocate 旧リポジトリリポジトリ


具体的にはこんな感じ。

% svn info
Path: .
URL: https://svn.server1.com/svn-repo/projectA/
Repository Root: https://svn.server1.com/svn-repo/
Repository UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Revision: 1111
Node Kind: directory
Schedule: normal
Last Changed Author: somebody
Last Changed Rev: 1111
Last Changed Date: 2010-07-15 15:37:47 +0900 (Thu, 15 Jul 2010)

% svn switch --relocate https://svn.server1.com/svn-repo/projectA/ https://svn.server2.com/svn-repo/projA/
Error validating server certificate for 'https://svn.server2.com:443':
- The certificate is not issued by a trusted authority. Use the
・・・・
- Fingerprint: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
(R)eject, accept (t)emporarily or accept (p)ermanently? p
Authentication realm: https://svn.server2.com:443 Enter your ID and password
Password for 'ログインアカウント':
Authentication realm: https://svn.server2.com:443 Enter your ID and password
Username: SVNのアカウント
Password for 'SVNのアカウント':
% svn info
Path: .
URL: https://svn.server2.com/svn-repo/projA/
Repository Root: https://svn.server2.com/svn-repo/
Repository UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Revision: 1111
Node Kind: directory
Schedule: normal
Last Changed Author: somebody
Last Changed Rev: 1111
Last Changed Date: 2010-07-15 15:37:47 +0900 (Thu, 15 Jul 2010)

という感じで、意外にさくっと完了。
ちなみに、ちょっとした都合により、Linux ログインユーザと SVN のユーザが異なるため、最初にログインアカウントで SVN の認証を行おうとしたところでは何も入力せずにリターンし、あらためて SVN アカウント・パスワードを入力した、というログになっています。