You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/02/08 15:38:23 UTC

svn commit: r907672 - /subversion/trunk/subversion/libsvn_client/ra.c

Author: julianfoad
Date: Mon Feb  8 14:38:22 2010
New Revision: 907672

URL: http://svn.apache.org/viewvc?rev=907672&view=rev
Log:
Fix an error message formatting problem, in which a URL was displayed with
its double slash reduced to a single slash.

* subversion/libsvn_client/ra.c
  (path_or_url_local_style): New function.
  (svn_client__repos_locations): Use path_or_url_local_style() to print
    paths in error messages, where the path might be a URL.

Modified:
    subversion/trunk/subversion/libsvn_client/ra.c

Modified: subversion/trunk/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/ra.c?rev=907672&r1=907671&r2=907672&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/ra.c (original)
+++ subversion/trunk/subversion/libsvn_client/ra.c Mon Feb  8 14:38:22 2010
@@ -384,6 +384,17 @@
 
 
 
+/* Convert a path or URL for display: if it is a local path, convert it to
+ * the local path style; if it is a URL, return it unchanged. */
+static const char *
+path_or_url_local_style(const char *path_or_url,
+                        apr_pool_t *pool)
+{
+  if (svn_path_is_url(path_or_url))
+    return path_or_url;
+  return svn_dirent_local_style(path_or_url, pool);
+}
+
 svn_error_t *
 svn_client__ra_session_from_path(svn_ra_session_t **ra_session_p,
                                  svn_revnum_t *rev_p,
@@ -664,7 +675,7 @@
     return svn_error_createf
       (SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
        _("Unable to find repository location for '%s' in revision %ld"),
-       svn_dirent_local_style(path, pool), start_revnum);
+       path_or_url_local_style(path, pool), start_revnum);
 
   end_path = apr_hash_get(rev_locs, &end_revnum, sizeof(svn_revnum_t));
   if (! end_path)
@@ -672,7 +683,7 @@
       (SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
        _("The location for '%s' for revision %ld does not exist in the "
          "repository or refers to an unrelated object"),
-       svn_dirent_local_style(path, pool), end_revnum);
+       path_or_url_local_style(path, pool), end_revnum);
 
   /* Repository paths might be absolute, but we want to treat them as
      relative.