Svn partial replication of multiple directories?

I am trying to create a read-only mirror of an SVN repository where I am only interested in the two top-level branches and all their subdirectories. i.e. / trunk / * / Branches / reviews / *

There are several other branches under branches that I want to ignore.

I already have svnsync working to mirror the entire repository between sites. I'm just wondering if I can use svnrdump pipe in svndumpfilter using -drop-emtpy-revs to either include two branch patterns or exclude other branch patterns. When I have only trunk / * and review / * dump, I will upload it, svnsync will run it and start syncing.

Am I on the right track or is there another method anyone can suggest?

Thanks, Brent

+3


source to share


1 answer


If you really want to replicate the repository and not the rare ones as suggested above, I have some suggestions.

First, --drop-empty-revs and svnsync won't play well; svnsync depends on version numbers which will be exactly the same, if not, you will get an error:

svnsync: E000022: Revision being currently copied (2018), last merged
revision (2017), and destination HEAD (1234) are inconsistent; have
you committed to the destination without using svnsync?

      

Second, splitting some directories from the repository can be problematic, usually due to copying files from branches outside of the set you choose, as is the case in this question . A detailed description of this issue can be found here .



Another way to make a partial copy that avoids the previous problem is briefly mentioned in the SVN FAQ . This solution worked great for me. So what you need to do is restrict access to your repository using authz, something like this (note that you need to deny access to things that you don't want to replicate):

[/]
myuser = r
[/trunk]
myuser = r
[/branches/reviews]
myuser = r
[/tags]
myuser =
[/branches/other]
myuser =

      

Then set up and run svnsync and anything outside of the directories you have allowed to read will not be present, which means you will have a lot of empty revisions, but as I said earlier, this is necessary to keep svnsync happy.

Hope this helps!

0


source







All Articles