2010-02-08 112 views
2

我在本地創建我自己的SVN回購。然後使用:顛覆:從雲SVN回購遷移到本地SVN回購...失去了歷史?

svnsync init DEST SRC 
svnsync sync DEST 
svnsync checkout DEST 

結賬成功運行,我從原來的SVN回購的所有文件,並且絕對是個好東西!

但是,當我做:

svn log 

我得到的消息:

svn: Item is not readable 

是否該文件沒有任何歷史?

我有沒有遷移SVN回購不正確?

我跟着我發現是最好的,我可以在指令......


附: FWIW這裏是我在bash shell腳本的形式執行的命令:

#!/bin/bash 
#=============================================================================== 
#= Function: Script to migrate an old svn repository to a new svn repository 
#= Purpose: The process is kinda tricky... need to write it down to prevent 
#=   reinventing the wheel 
#=============================================================================== 

# User input parameters for this script 
DEFAULT_REPO_PATH = "srv/svn/repos"; 
NEW_REPO_NAME = "name"; 
SRC_REPOSITORY_URL = "https://example.googlecode.com/svn"; 

# Create the folder for all your svn repositories before creating the repository 
sudo mkdir --parents /$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME)/ 

# Create the new repository 
sudo svnadmin create /$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME)/ 

# -- The new repository is not ready for receiving the old repository. 
# -- There are a number of actions that need to be completed before you can 
# load the old repository onto the new repository. 

# 1.) Setup the pre-revprop-change hook 
cd /$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME)/hooks/ 
sudo touch pre-revprop-change 
sudo chmod +x pre-revprop-change 

# 2.) Eventually we are calling svnsync init $(SRC_URL) $(SRC_URL) but 
#  the new repository is not accessible via any URL because there is 
#  no server setup 
#  
#  Example URLS: 
#  -- svn://$(SERVER)/$(SRC_REPO_NAME) 
#  -- ssh+svn://$(SERVER)/$(SRC_REPO_NAME) 
#  -- https://$(SERVER)/$(SRC_REPO_NAME) 
# 
#  To make the new repository accesible via URL I will setup an svn 
#  server using the built in "svnserve" command. 
# 
#  Svnserve command line switches: 
#  -d, --daemon 
#   Causes svnserve to run in daemon mode. svnserve backgrounds 
#   itself and accepts and serves TCP/IP connections on the svn port 
#   (3690, by default). 
#  -r root, --root=root 
#   Sets the virtual root for repositories served by svnserve. The 
#   pathname in URLs provided by the client will be interpreted rela‐ 
#   tive to this root, and will not be allowed to escape this root. 
svnserve -d -r /$(DEFAULT_REPO_PATH)/ 

# 3.) Almost ready, the last step is to give write permission to the new repository 
#  
#  By default a new repository is read only. 
# 
# 3.1) To give write permission you have to edit both the 
# 3.2) "svnserve.conf" and 
# 3.3) "passwd" file 
#  /$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME)/conf/svnserve.conf file 
sudo vim /$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME)/conf/svnserve.conf 
# 3.4) uncomment: "anon-access = read" 
# 3.5) uncomment: "auth-access = write" 
# 3.6) uncomment: "authz-db = authz" 
sudo vim /$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME)/conf/passwd 
# 3.9) add a line for the new authorized user 
#  " 
#  $(USER1) = $(USER1_PASSWD) 
#  " 
# 3.10) add a line for the authorization permissions 
#   (groups... like anonymous or authorized get... or set up 
#   specific permissions for specific users or groups) 
#   " 
#   [/] 
#   $authenticated = rw 
#   " 
# 3.11) You have to enable the new svnserve settings by restarting the svn 
#   server. To do this you "kill" the svn server. 
sudo kill $(PID_OF_SVNSERVE) 
# 3.12) Restart the svn server by calling svnserve again 
svnserve -d -r /$(DEFAULT_REPO_PATH)/ 

# 4.) Synchronize the new repository with the old repository 
# NOTE: It took about 0.5 seconds for each revision... I only had about 
sudo svnsync init svn://$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME) $(SRC_REPOSITORY_URL) 
sudo svnsync sync svn://$(DEFAULT_REPO_PATH)/$(NEW_REPO_NAME) 

回答

1

你設置/遷移權限設置?

+0

可否給我一個鏈接到如何「設置/遷移權限設置」? – 2010-02-12 14:55:58

2

爲SVN登錄的麻煩:你有不良的配置(或Subversion有一個bug :))。

[general] 
anon-access = none 

另一種解決方案只改變「auzh」文件中的行:

[/] 
* = r 

即溶液是

反正它可以通過改變「的svnserve.conf」文件中的行被固定因爲匿名讀取您的存儲庫不好。 如果您只需要使用授權信息庫比使用第一個解決方案。 (用SVN 1.6.17測試,但認爲它不會從版本依賴)