views:

206

answers:

1

I created my own SVN repo locally. Then used:

svnsync init DEST SRC
svnsync sync DEST
svnsync checkout DEST

The checkout worked successfully and I got all the files from the original SVN repo and that is definitely a good thing!

But when I did:

svn log

All I get is the message:

svn: Item is not readable

Does the file not have any history?

Did I migrate the SVN repo incorrectly?

I followed the instructions I found as best as I could...


p.s. FWIW here is the commands I executed in the form of a bash shell script:

#!/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  A: 

Did you set up/migrate the permission settings?

Sander Rijken
Could I get a link to how to "set up/migrate the permission settings"?
Trevor Boyd Smith