4

I'm trying to make a partial mirror of an external svn repository. According to http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.reposadmin.maint.replication.svnsync-partial, this should be possible as of svn 1.5.

I followed all the steps described in http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.reposadmin.maint.replication.svnsync, except that I did not use a 'svnsync' user. Instead, all commands were executed as the local user 'svn' and the local repository is accessed using the file:// protocol.

So, here's what I did:

$ svnadmin create /var/svn/mirrors/foreign-mirror

$ cat > /var/svn/mirrors/foreign-mirror/hooks/pre-revprop-change <<EOF
#!/bin/sh
USER="$3"
if [ "$USER" = "svn" ]; then exit 0; fi
echo "Only the svn user may change revision properties" >&2
exit 1
EOF

$ chmod +x /var/svn/mirrors/foreign-mirror/hooks/pre-revprop-change

$ cat > /var/svn/mirrors/foreign-mirror/hooks/start-commit <<EOF
#!/bin/sh
USER="$2"
if [ "$USER" = "svn" ]; then exit 0; fi
echo "Only the svn user may commit new revisions" >&2
exit 1
EOF

$ chmod +x /var/svn/mirrors/foreign-mirror/hooks/start-commit

$ svnsync initialize \
file:///var/svn/mirrors/foreign-mirror \
https://svn.foreign.com/svn/Projects/X/Y \
--source-username #### --source-password ####

$ svnsync synchronize \
file:///var/svn/mirrors/foreign-mirror \
--non-interactive --source-username #### --source-password ####
Committed revision 1.
Copied properties for revision 1.
Committed revision 2.
Copied properties for revision 2.
...
Committed revision 80089.
Copied properties for revision 80089.
Committed revision 80090.
Copied properties for revision 80090.
svnsync: Path 'Projects' not present

Looking at the svn log:

$ svn log https://svn.foreign.com/svn/Projects/X/Y -v -r80091
------------------------------------------------------------------------
r80091 | John.Doe | 2011-09-27 06:42:21 +0200 (Tue, 27 Sep 2011) | 1 line
Changed paths:
   A /Projects/X/Y

If I understand this correctly, replaying commit #80091 fails because it can't find /Projects. This confuses me. Isn't the point of partial replication to skip over non-existing paths?

I'm running svn 1.6.6 on ubuntu linux (destination repository) and have full control over that. I have no control over the source repository and the username and password only have access to /Projects/X/Y and below. No access to /Projects or /Projects/X.

Is there a way to overcome this, maybe to start the replication at a specific revision? Any suggestion greatly appreciated.

Pat
  • 1,726
  • 11
  • 18

1 Answers1

2

I do not have any advice for svnsync problem but you are trying to do

"I'm trying to make a partial mirror of an external svn repository.". 

Did you try svk. Even though it is discontinued project. It is a very good tool to make partial mirrors of subversion repositories. I used it occasionally to get partial history of sub project. Lets say you have following subversion directory structure.

trunk
  MainProject
  HelperTools
    ImportantToolAsSubProject
branches
tags

svk can create subversion history of only /trunk/HelperTools/ImportantToolAsSubProject. If this directory has only 100 commits. Created subversion repository will have 100 commits only.

Atilla Ozgur
  • 14,339
  • 3
  • 49
  • 69