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

Re: [PATCH] allow local repositories on other windows drives (was: Potential issue with svn co file:// with drive letters on Windows machines)

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-05-28 00:18:24 CEST

Ulrich Winter wrote:

>Joshua,
>
>you should first check, if the path contains a drive letter.
>If not, you must not skip the leading slash.
>
>The following patch adds this check and some comments.
>
>Remark:
>As I understand RFC1738, the complete syntax for a file URL with a drive
>letter is
> file://localhost/e:/some/dir
>so if the host part is ommitted, this leads to the notation with three
>slashes:
> file:///e:/some/dir
>
>Ok - IE accepts file://e:/some/dir too, but thats the browser being wrong.
>
And anyway, this logic belongs in apr-util, which we should be using for
URI parsing.

-0 for such a change going into Subversion proper. I'd much rather see a
patch that switches to usin g the apr_uri_* functions.

>
>--
>Ulrich Winter
>
>
>
>Index: ./subversion/libsvn_ra_local/split_url.c
>===================================================================
>--- ./subversion/libsvn_ra_local/split_url.c
>+++ ./subversion/libsvn_ra_local/split_url.c Sun May 26 22:11:16 2002
>@@ -60,6 +60,35 @@
> (SVN_ERR_RA_ILLEGAL_URL, 0, NULL, pool,
> ("svn_ra_local__split_URL: URL contains unsupported hostname"));
>
>+ // Handle system specific path components:
>+ // According to RFC1738 a file URL has the general form
>+ // file://<host>/<path>
>+ // On Systems whithout a single logical file system namespace, <path> may
>+ // contain special names for drives or volumes, which may be optional,
>+ // meaning "the current drive or volume"
>+ // The interpretation of these special names is system dependent.
>+ //
>+ // Examples:
>+ // VMS:
>+ // DISK$USER:[MY.NOTES]NOTE123456.TXT becomes
>+ // file://vms.host.edu/disk$user/my/notes/note12345.txt
>+ //
>+ // Windows:
>+ // e:\some\dir becomes one of:
>+ // file://localhost/e:/some/dir (absolute path with drive letter on
>specified host)
>+ // file:///e:/some/dir (absolute path with drive letter and
>without host)
>+ // file:///some/dir (absolute path on current drive
>without host)
>+ // in order to open the repository on WIN32 systems we need the absolute
>path in
>+ // the following form:
>+ // "/some/dir" (implicitly uses the current drive)
>+ // "e:/some/dir" (includes specified drive)
>+
>+#ifdef WIN32
>+ if(strchr(path, ':'))
>+ path++;
>+
>+#endif //WIN32
>+
> /* Duplicate the URL, starting at the top of the path */
> url = svn_stringbuf_create ((const char *)path, subpool);
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: dev-help@subversion.tigris.org
>
>
>

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 28 00:19:33 2002

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