Author: julianfoad
Date: Wed Jul 26 13:39:49 2017
New Revision: 1803046

URL: http://svn.apache.org/viewvc?rev=1803046&view=rev
Log:
On the 'shelve-checkpoint3' branch: Construct file:// URLs in a
platform-safe manner.

Found by: Bert

* subversion/libsvn_client/checkpoint3.c
  (checkpoints_repo_dir): Rename the pool to reflect its use.
  (checkpoints_repo_url,
  (original_repos_url): Construct file:// URLs in a platform-safe manner.
    Rename the pool to reflect its use.

Modified:
    
subversion/branches/shelve-checkpoint3/subversion/libsvn_client/checkpoint3.c

Modified: 
subversion/branches/shelve-checkpoint3/subversion/libsvn_client/checkpoint3.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint3/subversion/libsvn_client/checkpoint3.c?rev=1803046&r1=1803045&r2=1803046&view=diff
==============================================================================
--- 
subversion/branches/shelve-checkpoint3/subversion/libsvn_client/checkpoint3.c 
(original)
+++ 
subversion/branches/shelve-checkpoint3/subversion/libsvn_client/checkpoint3.c 
Wed Jul 26 13:39:49 2017
@@ -60,30 +60,38 @@
  */
 static char *
 checkpoints_repo_dir(const char *wc_root_abspath,
-                     apr_pool_t *scratch_pool)
+                     apr_pool_t *result_pool)
 {
-  return svn_path_join_many(scratch_pool,
+  return svn_path_join_many(result_pool,
                             wc_root_abspath, ".svn", "checkpoints",
                             SVN_VA_NULL);
 }
 
 /* ### temp: we should not be accessing the repo via URL but directly */
-static char *
+static const char *
 checkpoints_repo_url(const char *wc_root_abspath,
-                     apr_pool_t *scratch_pool)
+                     apr_pool_t *result_pool)
 {
-  return apr_pstrcat(scratch_pool,
-                     "file://", wc_root_abspath, "/.svn/checkpoints",
-                     SVN_VA_NULL);
+  char *path = svn_path_join_many(result_pool,
+                                  wc_root_abspath,".svn", "checkpoints",
+                                  SVN_VA_NULL);
+  const char *url;
+
+  svn_error_clear(svn_uri_get_file_url_from_dirent(&url, path, result_pool));
+  return url;
 }
 
-static char *
+/* ### URL of presumed-for-testing repo at "../repo" */
+static const char *
 original_repos_url(const char *wc_root_abspath,
-                   apr_pool_t *scratch_pool)
+                   apr_pool_t *result_pool)
 {
-  return apr_pstrcat(scratch_pool,
-                     "file://", wc_root_abspath, "/../repo",
-                     SVN_VA_NULL);
+  char *path = svn_path_join_many(result_pool,
+                                  wc_root_abspath, "..", "repo", SVN_VA_NULL);
+  const char *url;
+
+  svn_error_clear(svn_uri_get_file_url_from_dirent(&url, path, result_pool));
+  return url;
 }
 
 /* Create the repo if it is not already present.


Reply via email to