[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: WIN32 compability in svn_ra_local__split_URL?

From: Magnus Sirwi� <sirwio_at_hotmail.com>
Date: 2001-04-26 22:45:18 CEST

cmpilato wrote:
>
>"Magnus Sirwi�" <sirwio@hotmail.com> writes:
>
> > Lets say I have created a repo in C:\svnroot with
> > c:\>svnadmin create C:\svnroot
> >
> > Next I switch to my svn sandbox to import my HelloWorld sources:
> > c:\svnbox>svn import file://localhost/D:\svnroot . HelloWorld
>
>First of all, unless your C: and D: drives somehow magically map to
>the same location, I can't see how this is beneficial. So. I'm going
>to assume that what you typed was an accident, and pretend that I read
>"...svn import file://localhost/C:\svnroot..." :-)

Yepp. That was a typo.

>
>Now, with that in mind, let's move on. First of all, my spidey sense
>tells me that something is inherently wrong with a URL that looks like
>that. First of all, if your working copy and repositories are both on
>your C: drive, perhaps the command should have been:
>
> svn import file://localhost/svnroot . HelloWorld
>
>However, this makes me wonder what would happen had you created your
>repository in a deeper tree. What happens if you do:
>
> C:\> svnadmin create C:\svn\repositories\magnus
> C:\> svn import file:///svn/repositories/magnus . Helloworld
>
>Does it work?

No.
A file URL given as above suggests that the win32 path to the repository
would be repositories\magnus or pherhaps \repositories\magnus more on that
later.

The path \ is the root folder of the current drive on M$ systems. So one
must give the drive in the path mapping in repository path. Actually one
could also use UNC paths but let leave that until ordinary win32 paths work!

Dived into the RFC 1738 Dec 1994 spec. to read more about about URL's. This
is from the spec:

   A file URL takes the form:

       file://<host>/<path>

And later in the spec:

   Some URL schemes (such as the ftp, http, and file schemes) contain
   names that can be considered hierarchical; the components of the
   hierarchy are separated by "/".

So Branko is right that directories shall be separated by "/" as he
suggested in another posting.
More from the spec:

    url-path
        The rest of the locator consists of data specific to the
        scheme, and is known as the "url-path". It supplies the
        details of how the specified resource can be accessed. Note
        that the "/" between the host (or port) and the url-path is
        NOT part of the url-path.

This is kind of strange. This would mean that on a unix host the file URL
file://localhost/home/magnus/svnroot would give the url-path or "file to be
opened" by subversion to be home/magnus/svnroot and not
/home/magnus/svnroot.

Where does this leave us in the patching of the svn_ra_local__split_URL
function. One way is to leave it as is for unix filesystems and remove the
heading / from the url-path on win32 OR to do it as the spec says and add a
heading / when opening the berkley db on unix filesystems.

I might have misinterpreted the spec but I think it is as I suggest above.
Please be nice if I'm wrong!

How did/does CVS handle filepath/delimiter platform issues? Do we have
something to learn from CVS?

>Does APR (or even Windows) let us open the path
>'/svn/repositories/magnus' despite the fact that Windows paths are
>backspace-delimited? Does this mean that local repos access on
>Windows only works if the repository is on the same drive as your
>working copy?

One would have to give the drive as well or the UNC path I guess! Opening
the berkley DB is no problem with "/" as delimiters in the url-path. I
haven't explored if some conversion is done to substiture "/" -> "\". This
would of course be the safest thing to do for win32 filesystem calls.

> Is this more fuel for GregS's belief that ra_local
>should not exist at all (since presumably if we were using real http:
>URLs for these operations, Apache itself could translate between
>public paths and physical drive/path mappings)?! If I arrange my
>living room in such a way that my sofa is not centered with the window
>behind it, am I a bad person??! I gotta know!!!
>

\Magnus - Bad, bad boy.

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Received on Sat Oct 21 14:36:29 2006

This is an archived mail posted to the Subversion Dev mailing list.