Author: svn-role
Date: Thu May 30 04:00:36 2013
New Revision: 1487719

URL: http://svn.apache.org/r1487719
Log:
Merge r1485127 from trunk:

 * r1485127
   Revert 1.8 behavior change that breaks some url forms when passed to
   ra_local. Without this some existing working copies using non standard
   urls to access the repository might be broken.
   Justification:
     Restores functionality that was lost in 1.8 compared to 1.7.
   Votes:
     +1: rhuijben (for 1.8.1 or soak restart), danielsh, cmpilato

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_ra_local/split_url.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1485127

Modified: subversion/branches/1.8.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1487719&r1=1487718&r2=1487719&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Thu May 30 04:00:36 2013
@@ -63,12 +63,3 @@ Approved changes:
 # that would restart the soak should not be added unless they are resolving
 # blocking issues.  If in doubt see this link for details:
 # 
http://subversion.apache.org/docs/community-guide/releasing.html#release-stabilization
-
- * r1485127
-   Revert 1.8 behavior change that breaks some url forms when passed to
-   ra_local. Without this some existing working copies using non standard
-   urls to access the repository might be broken.
-   Justification:
-     Restores functionality that was lost in 1.8 compared to 1.7.
-   Votes:
-     +1: rhuijben (for 1.8.1 or soak restart), danielsh, cmpilato

Modified: subversion/branches/1.8.x/subversion/libsvn_ra_local/split_url.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_ra_local/split_url.c?rev=1487719&r1=1487718&r2=1487719&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_ra_local/split_url.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_ra_local/split_url.c Thu May 30 
04:00:36 2013
@@ -23,13 +23,14 @@
 
 #include "ra_local.h"
 #include <string.h>
+#include "svn_path.h"
 #include "svn_dirent_uri.h"
 #include "svn_private_config.h"
 
 
 svn_error_t *
 svn_ra_local__split_URL(svn_repos_t **repos,
-                        const char **repos_root_url,
+                        const char **repos_url,
                         const char **fs_path,
                         const char *URL,
                         apr_pool_t *pool)
@@ -37,6 +38,7 @@ svn_ra_local__split_URL(svn_repos_t **re
   svn_error_t *err = SVN_NO_ERROR;
   const char *repos_dirent;
   const char *repos_root_dirent;
+  svn_stringbuf_t *urlbuf;
 
   SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dirent, URL, pool));
 
@@ -62,15 +64,31 @@ svn_ra_local__split_URL(svn_repos_t **re
   /* = apr_pstrcat(pool,
                    "/",
                    svn_dirent_skip_ancestor(repos_root_dirent, repos_dirent),
-                   (const char *)NULL */
+                   (const char *)NULL); */
   *fs_path = &repos_dirent[strlen(repos_root_dirent)];
 
   if (**fs_path == '\0')
     *fs_path = "/";
 
-  /* Create a url to the repository root. */
-  SVN_ERR(svn_uri_get_file_url_from_dirent(repos_root_url, repos_root_dirent,
-                                           pool));
+  /* Remove the path components after the root dirent from the original URL,
+     to get a URL to the repository root.
+
+     We don't use svn_uri_get_file_url_from_dirent() here as that would
+     transform several uris to form a differently formed url than
+     svn_uri_canonicalize would.
+
+     E.g. file://localhost/C:/dir -> file:///C:/dir
+          (a transform that was originally supported directly by this function,
+           before the implementation moved)
+
+          On on Windows:
+          file:///dir -> file:///E:/dir  (When E: is the current disk)
+     */
+  urlbuf = svn_stringbuf_create(URL, pool);
+  svn_path_remove_components(urlbuf,
+                             svn_path_component_count(repos_dirent)
+                             - svn_path_component_count(repos_root_dirent));
+  *repos_url = urlbuf->data;
 
   /* Configure hook script environment variables. */
   SVN_ERR(svn_repos_hooks_setenv(*repos, NULL, pool));


Reply via email to