You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Richard Cavell <ri...@mail.com> on 2011/11/04 21:52:43 UTC

Virtual filesystems

Hi, everyone.

 In a URL such as:

 file:///one/two/three/four

 It may be that the repository is actually at /one/two, and the three/four are directories within the repository.

 How does subversion identify which slashes are virtual and which ones are real? Does it search each part of the path to see if it's a valid repository, and then step into it? Is there a way, or a need, to ever tell svn which part of the URL is real and which is virtual?

 Richard

Re: Virtual filesystems

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Nov 4, 2011, at 15:52, Richard Cavell wrote:

> In a URL such as:
> 
> file:///one/two/three/four
> 
> It may be that the repository is actually at /one/two, and the three/four are directories within the repository.
> 
> How does subversion identify which slashes are virtual and which ones are real?  Does it search each part of the path to see if it's a valid repository, and then step into it?

I don't know how Subversion does it. Does it matter?


> Is there a way, or a need, to ever tell svn which part of the URL is real and which is virtual?

No.

However, you can get Subversion to tell you; look in "svn info file:///one/two/three/four".



Re: Virtual filesystems

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Fri, Nov 4, 2011 at 4:52 PM, Richard Cavell <ri...@mail.com> wrote:
> Hi, everyone.
>
> In a URL such as:
>
> file:///one/two/three/four
>
> It may be that the repository is actually at /one/two, and the three/four
> are directories within the repository.
>
> How does subversion identify which slashes are virtual and which ones are
> real?  Does it search each part of the path to see if it's a valid
> repository, and then step into it?  Is there a way, or a need, to ever tell
> svn which part of the URL is real and which is virtual?

Richard, turn it around. It could also work by *ascending* the
potential directory tree, looking for a "db" directory with the
relevant components at a particular level.

I'm not sure which it does, but it's often fun to turn such analysis
questions areound and see what would happen if some confused person
set up a database directory in a top level directory and generated the
other subdirectories and stuffed another repo there. what would
happen?

Re: Virtual filesystems

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Nov 04, 2011 at 04:52:43PM -0400, Richard Cavell wrote:
> Hi, everyone.
> 
>  In a URL such as:
> 
>  file:///one/two/three/four
> 
>  It may be that the repository is actually at /one/two, and the three/four are directories within the repository.
> 
>  How does subversion identify which slashes are virtual and which ones are real? Does it search each part of the path to see if it's a valid repository, and then step into it? Is there a way, or a need, to ever tell svn which part of the URL is real and which is virtual?

It walks the path upwards (starting a 'four') and looks for a directory
which contains a file called 'format' and a directory called 'db' on
the OS filesystem (not in the versioned tree, of course).
This directory is assumed to be the repository root.

See svn_repos_find_root_path() in 
https://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_repos/repos.c