You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Mauricio Culibrk <ma...@test.infohit.si> on 2006/03/25 19:42:28 UTC

Configuration tips - hierarchical repositories

Hi folks!

I'm loosing my patience experimenting and trying different setups so I 
decided to bother a little with my questions....

I would like to organize and access my repository structure in a 
hierarchical way. Besides that, I would like to have separate 
repositories per project groups. Somethink like this:

url.of.svn/repos *
             +---- group1  *
             |       +--- dir1
             |       +--- dir2
             +---- group2  *
             |       +--- dir1
             |       +--- dir2
             |       +--- dir3
             +---- group3  *
             |       +--- dir1
             |       +--- dir2
            etc

* denotes actualy repositories

So, when accessing the server with (svn/http)://url.of.svn/repos I 
practically get the list of available repositories in a user friendly 
way.
When accessing (svn/http)://url.of.svn/repos/group1/dir1/abc I 
acctually access the real repository group1.

I acctually managed to make this working with SVN / SVN+SSH protocol 
but I have abnormal troubles setting this up for http/https access via 
Apache (v2.x.x). (I explain the setup at the end)

I tried various ways with <Location>, <LocationMatch>,<Directory> 
directives helped by some RewriteRule etc with no success.

I found some hints in a message posted by Martin Lie 
(http://svn.haxx.se/users/archive-2004-07/0639.shtml) where the same 
problems with Location/Directory and regexp are mentioned.

Does anybody have some hint/idea on hof to make this working with 
Apache and dav_svn??? Please... I'm desperate...

Some explanations about the currently working svn:// setup:

I setup the "root" repository in /mnt/svn/root (svnadmin create 
/mnt/svn/root) and the "sub"repositories in /mnt/svn/root/group1, 
/mnt/root/group2... (acctually, in /mnt/svn/group1, group2... with 
links in /mnt/svn/root pointing to them)
Then I created directories (using svn - well, tortoisesvn) for each 
"subrepository" in the root repository. In this way I have identical 
structure in the root repository and file system.

This is working as expected by simply "mapping" the request url to 
real repositories....
svn://url.to.svn/ "selects" the root repository showing versioned 
"directories" while browsing (from the GUI of tortoisesvn, repo 
browser for example) to svn://url.to.svn/group1 "selects" the 
"underlaying" repository /mnt/svn/root/group1


Kind regards,
MCulibrk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Configuration tips - hierarchical repositories

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 25, 2006, at 22:46, Mauricio Culibrk wrote:

> svn ls http://url.to.svn/repos/groupX IS working...
>
> The real problem is that I would like to have the list of  
> repositories available in TortoiseSVN when issuing the svn list on  
> the "root" repository... otherwise there is no "nice" way to know  
> what repositories are available....
>
> So, yes, the SVNListParentPath on is nice in a browser - this just  
> lists the files in the "parent" folder...
>
> So, basically, the problem is the same - how to setup a FUNCTIONING  
> <Location>/<Directory> setup in Apache without having to define the  
> <Location> directive for each and every (new) repository under the  
> "virtual root" repository???

Ah yes, I had forgotten that SVNListParentPath only works in a web  
browser, not from a Subversion client like TortoiseSVN or the command  
line client. I consider that a bug, or at least a missing feature,  
but I can't find anything filed in the issue tracker (no results  
searching for SVNListParentPath). I'd like to file a bug report for  
this issue... Anyone object?


Quite frankly, my Apache crashes when I try to svn ls the root when  
using SVNListParentPath (Apache 2.2.0, Subversion 1.3.0, Mac OS X  
10.4.5 PPC) though that could be a separate problem.

$ svn ls http://www.example.com
svn: PROPFIND request failed on '/'
svn: PROPFIND of '/': Could not read status line: connection was  
closed by server. (http://www.example.com)

[Sun Mar 26 00:57:58 2006] [notice] child pid 27961 exit signal Bus  
error (10)


There's also the issue where SVNListParentPath doesn't work unless  
the path in the <Location> directive ends with a slash, though I'm  
not sure if that's really still an issue or not.

http://svn.haxx.se/dev/archive-2006-01/0421.shtml


There's also the one where the XML produced when using SVNIndexXSLT  
doesn't tell you which repository it's for, though I guess that's  
kind of this:

http://subversion.tigris.org/issues/show_bug.cgi?id=2480


> if I setup something like this
>
> <LocationMatch "^/repos$">
>    SVNPath /mnt/svn/root
> </LocationMatch>
>
> <LocationMatch "^/repos/.+">
>    SVNParentPath /mnt/svn/root   (or /mnt/svn becaouse of links)
> </LocationMatch>
>
> or anything with regular expression or any other form of  
> "wildchars" the mod_dav_svn is throwing errors as "not found"  
> because uses EXACT STRING specified in Location/LocationMatch!
> For example:
>
>  URL /repos/.+/repos/!svn/bc/20/PM: No such file or directory

I've also encountered that. Subversion doesn't like LocationMatch.  
Last month someone wrote a patch to address this somewhat:

http://subversion.tigris.org/issues/show_bug.cgi?id=2510

I'm not sure if that patch will help in your case but you could try it.

Admittedly I don't know the Subversion code, but I don't understand  
why this patch had to introduce a new configuration directive. Seems  
to me like Subversion should just be able to figure it out on its own.


> So, the Apache setup should be such that there is no "special  
> characters" in the Location directive.... ok, then I tried with  
> Rewrite and Redirect to "separate" the requests for the "root"  
> repository to get the "repository list" and access to the real  
> repositories but... again... no fun! :(

On Mar 25, 2006, at 23:01, Mauricio Culibrk wrote:

> Doing the thing with redirects (redirectmatch, rewrite...) works  
> within the web browser almost like the SVNListParentPath but NOT  
> with svn...
>
> svn list http://url/repos/   gives request failed on "/repos" - 405  
> Method not allowed but works with the repositories
>
> svn list http://url/repos/group1 shows the directories....
>
>
> Seems the svn client won't accept any redirects or such  
> "instructions"...

Yes, I've also encountered that the Subversion client doesn't obey  
redirects and even barfs at mod_rewrite attempts. I've given up on  
trying to use such tricks with Subversion.

http://subversion.tigris.org/issues/show_bug.cgi?id=660

This is perhaps a Subversion bug, but I think the Subversion team  
should first concentrate on giving us the ability to configure it the  
way we want without needing to resort to tricks like redirecting or  
rewriting.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Configuration tips - hierarchical repositories

Posted by Mauricio Culibrk <ma...@test.infohit.si>.
Hi again....

Well... after some more testing I ended up on the same problem... 
again...

As an update to my previous message...

svn ls http://url.to.svn/repos/groupX IS working...

The real problem is that I would like to have the list of repositories 
available in TortoiseSVN when issuing the svn list on the "root" 
repository... otherwise there is no "nice" way to know what 
repositories are available....

So, yes, the SVNListParentPath on is nice in a browser - this just 
lists the files in the "parent" folder...

So, basically, the problem is the same - how to setup a FUNCTIONING 
<Location>/<Directory> setup in Apache without having to define the 
<Location> directive for each and every (new) repository under the 
"virtual root" repository???

if I setup something like this

<LocationMatch "^/repos$">
    SVNPath /mnt/svn/root
</LocationMatch>

<LocationMatch "^/repos/.+">
    SVNParentPath /mnt/svn/root   (or /mnt/svn becaouse of links)
</LocationMatch>

or anything with regular expression or any other form of "wildchars" 
the mod_dav_svn is throwing errors as "not found" because uses EXACT 
STRING specified in Location/LocationMatch!
For example:

  URL /repos/.+/repos/!svn/bc/20/PM: No such file or directory


So, the Apache setup should be such that there is no "special 
characters" in the Location directive.... ok, then I tried with 
Rewrite and Redirect to "separate" the requests for the "root" 
repository to get the "repository list" and access to the real 
repositories but... again... no fun! :(

Any suggestions/ideas are *very* welcome...

Regards,
Mculibrk
On Sat, 25 Mar 2006 21:28:15 +0100
  Ryan Schmidt <su...@ryandesign.com> wrote:
> On Mar 25, 2006, at 20:42, Mauricio Culibrk wrote:
> 
>> I would like to organize and access my repository structure in a  
>> hierarchical way. Besides that, I would like to have separate  
>> repositories per project groups. Somethink like this:
>>
>> url.of.svn/repos *
>>             +---- group1  *
>>             |       +--- dir1
>>             |       +--- dir2
>>             +---- group2  *
>>             |       +--- dir1
>>             |       +--- dir2
>>             |       +--- dir3
>>             +---- group3  *
>>             |       +--- dir1
>>             |       +--- dir2
>>            etc
>>
>> * denotes actualy repositories
> 
> [snip]
> 
>> Some explanations about the currently working svn:// setup:
>>
>> I setup the "root" repository in /mnt/svn/root (svnadmin create / 
>> mnt/svn/root) and the "sub"repositories in /mnt/svn/root/group1, / 
>> mnt/root/group2... (acctually, in /mnt/svn/group1, group2... with  
>> links in /mnt/svn/root pointing to them)
>> Then I created directories (using svn - well, tortoisesvn) for each 
>> 
>> "subrepository" in the root repository. In this way I have  
>> identical structure in the root repository and file system.
>>
>> This is working as expected by simply "mapping" the request url to  
>> real repositories....
>> svn://url.to.svn/ "selects" the root repository showing versioned  
>> "directories" while browsing (from the GUI of tortoisesvn, repo  
>> browser for example) to svn://url.to.svn/group1 "selects" the  
>> "underlaying" repository /mnt/svn/root/group1
> 
> You have made this very complicated when it is really very simple.
> 
>First, do not svnadmin create /mnt/svn/root. There's no need for that 
> or the virtual directories you've put into it.
> 
> Simply create as many repositories as you like under /mnt/svn. Set 
>up  Apache this way:
> 
> <VirtualHost *:80>
> 	ServerName www.example.com
> 	DocumentRoot /wherever
> 	RedirectMatch ^/repos$ http://www.example.com/repos/
> 	<Location /repos/>
> 		DAV svn
> 		SVNParentPath /mnt/svn
> 		SVNListParentPath on
> 	</Location>
> </VirtualHost>
> 
> SVNListParentPath is available as of Subversion 1.3.0. There is no 
> equivalent for svnserve.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Configuration tips - hierarchical repositories

Posted by Mauricio Culibrk <ma...@test.infohit.si>.
Hi!

Thanks for the ultra fast response!

...I feel like an idiot... :|    almost...

the setup is working via browser access, great, but svn access IS NOT!

I'm (again) getting error 405 and 301 when try to access the 
repository by svn client (like 1000s times before... :( )

I spent quite some time (nights?) figuring how to do something similar 
wit no success...

Anyway, I first worked with svn 1.2.3 and recently upgraded to 1.3.0 
hoping this will make some difference... but it didn't!

Any more ideas??

THANKS!

MCulibrk

On Sat, 25 Mar 2006 21:28:15 +0100
  Ryan Schmidt <su...@ryandesign.com> wrote:
> On Mar 25, 2006, at 20:42, Mauricio Culibrk wrote:
> 
>> I would like to organize and access my repository structure in a  
>> hierarchical way. Besides that, I would like to have separate  
>> repositories per project groups. Somethink like this:
>>
>> url.of.svn/repos *
>>             +---- group1  *
>>             |       +--- dir1
>>             |       +--- dir2
>>             +---- group2  *
>>             |       +--- dir1
>>             |       +--- dir2
>>             |       +--- dir3
>>             +---- group3  *
>>             |       +--- dir1
>>             |       +--- dir2
>>            etc
>>
>> * denotes actualy repositories
> 
> [snip]
> 
>> Some explanations about the currently working svn:// setup:
>>
>> I setup the "root" repository in /mnt/svn/root (svnadmin create / 
>> mnt/svn/root) and the "sub"repositories in /mnt/svn/root/group1, / 
>> mnt/root/group2... (acctually, in /mnt/svn/group1, group2... with  
>> links in /mnt/svn/root pointing to them)
>> Then I created directories (using svn - well, tortoisesvn) for each 
>> 
>> "subrepository" in the root repository. In this way I have  
>> identical structure in the root repository and file system.
>>
>> This is working as expected by simply "mapping" the request url to  
>> real repositories....
>> svn://url.to.svn/ "selects" the root repository showing versioned  
>> "directories" while browsing (from the GUI of tortoisesvn, repo  
>> browser for example) to svn://url.to.svn/group1 "selects" the  
>> "underlaying" repository /mnt/svn/root/group1
> 
> You have made this very complicated when it is really very simple.
> 
>First, do not svnadmin create /mnt/svn/root. There's no need for that 
> or the virtual directories you've put into it.
> 
> Simply create as many repositories as you like under /mnt/svn. Set 
>up  Apache this way:
> 
> <VirtualHost *:80>
> 	ServerName www.example.com
> 	DocumentRoot /wherever
> 	RedirectMatch ^/repos$ http://www.example.com/repos/
> 	<Location /repos/>
> 		DAV svn
> 		SVNParentPath /mnt/svn
> 		SVNListParentPath on
> 	</Location>
> </VirtualHost>
> 
> SVNListParentPath is available as of Subversion 1.3.0. There is no 
> equivalent for svnserve.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Configuration tips - hierarchical repositories

Posted by Mauricio Culibrk <ma...@test.infohit.si>.
Again...

Doing the thing with redirects (redirectmatch, rewrite...) works 
within the web browser almost like the SVNListParentPath but NOT with 
svn...

svn list http://url/repos/   gives request failed on "/repos" - 405 
Method not allowed but works with the repositories

svn list http://url/repos/group1 shows the directories....


Seems the svn client won't accept any redirects or such 
"instructions"...

HELP....

MCulibrk


>>
>> url.of.svn/repos *
>>             +---- group1  *
>>             |       +--- dir1
>>             |       +--- dir2
>>             +---- group2  *
>>             |       +--- dir1
>>             |       +--- dir2
>>             |       +--- dir3
>>             +---- group3  *
>>             |       +--- dir1
>>             |       +--- dir2
>>            etc
>>
>> * denotes actualy repositories
> 

[snip]

> 
> <VirtualHost *:80>
> 	ServerName www.example.com
> 	DocumentRoot /wherever
> 	RedirectMatch ^/repos$ http://www.example.com/repos/
> 	<Location /repos/>
> 		DAV svn
> 		SVNParentPath /mnt/svn
> 		SVNListParentPath on
> 	</Location>
> </VirtualHost>
> 
> SVNListParentPath is available as of Subversion 1.3.0. There is no 
> equivalent for svnserve.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Configuration tips - hierarchical repositories

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 25, 2006, at 20:42, Mauricio Culibrk wrote:

> I would like to organize and access my repository structure in a  
> hierarchical way. Besides that, I would like to have separate  
> repositories per project groups. Somethink like this:
>
> url.of.svn/repos *
>             +---- group1  *
>             |       +--- dir1
>             |       +--- dir2
>             +---- group2  *
>             |       +--- dir1
>             |       +--- dir2
>             |       +--- dir3
>             +---- group3  *
>             |       +--- dir1
>             |       +--- dir2
>            etc
>
> * denotes actualy repositories

[snip]

> Some explanations about the currently working svn:// setup:
>
> I setup the "root" repository in /mnt/svn/root (svnadmin create / 
> mnt/svn/root) and the "sub"repositories in /mnt/svn/root/group1, / 
> mnt/root/group2... (acctually, in /mnt/svn/group1, group2... with  
> links in /mnt/svn/root pointing to them)
> Then I created directories (using svn - well, tortoisesvn) for each  
> "subrepository" in the root repository. In this way I have  
> identical structure in the root repository and file system.
>
> This is working as expected by simply "mapping" the request url to  
> real repositories....
> svn://url.to.svn/ "selects" the root repository showing versioned  
> "directories" while browsing (from the GUI of tortoisesvn, repo  
> browser for example) to svn://url.to.svn/group1 "selects" the  
> "underlaying" repository /mnt/svn/root/group1

You have made this very complicated when it is really very simple.

First, do not svnadmin create /mnt/svn/root. There's no need for that  
or the virtual directories you've put into it.

Simply create as many repositories as you like under /mnt/svn. Set up  
Apache this way:

<VirtualHost *:80>
	ServerName www.example.com
	DocumentRoot /wherever
	RedirectMatch ^/repos$ http://www.example.com/repos/
	<Location /repos/>
		DAV svn
		SVNParentPath /mnt/svn
		SVNListParentPath on
	</Location>
</VirtualHost>

SVNListParentPath is available as of Subversion 1.3.0. There is no  
equivalent for svnserve.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org