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

[PATCH] Avoid treating urls as paths

From: D.J. Heap <dj_at_shadyvale.net>
Date: 2004-03-19 20:39:28 CET

This passes all ra_local tests and manual testing. If it passes the
other test suites and there's no objections, I'll commit it in a day or two.

Log:
Avoid calling svn_cmdline_path_local_style_from_utf8 on urls
which turns forward slashes into backslashes on Windows.

* subversion/clients/cmdline/propget-cmd.c
   (svn_cl__propget): Call svn_utf_cstring_from_utf8 if it's a url.
* subversion/clients/cmdline/proplist-cmd.c
   (svn_cl__proplist): Call svn_utf_cstring_from_utf8 if it's a url.

Index: subversion/clients/cmdline/propget-cmd.c
===================================================================
--- subversion/clients/cmdline/propget-cmd.c (revision 9147)
+++ subversion/clients/cmdline/propget-cmd.c (working copy)
@@ -141,6 +141,7 @@
           apr_hash_t *props;
           apr_hash_index_t *hi;
           svn_boolean_t print_filenames = FALSE;
+ svn_boolean_t is_url = svn_path_is_url (target);
 
           svn_pool_clear (subpool);
           SVN_ERR (svn_cl__check_cancel (ctx->cancel_baton));
@@ -176,8 +177,12 @@
               if (print_filenames)
                 {
                   const char *filename_stdout;
- SVN_ERR (svn_cmdline_path_local_style_from_utf8
- (&filename_stdout, filename, subpool));
+ if (! is_url)
+ SVN_ERR (svn_cmdline_path_local_style_from_utf8
+ (&filename_stdout, filename, subpool));
+ else
+ SVN_ERR (svn_utf_cstring_from_utf8
+ (&filename_stdout, filename, subpool));
                   SVN_ERR (stream_write (out, filename_stdout,
                                          strlen (filename_stdout)));
                   SVN_ERR (stream_write (out, " - ", 3));
Index: subversion/clients/cmdline/proplist-cmd.c
===================================================================
--- subversion/clients/cmdline/proplist-cmd.c (revision 9147)
+++ subversion/clients/cmdline/proplist-cmd.c (working copy)
@@ -100,6 +100,7 @@
           apr_array_header_t *props;
           int j;
           svn_error_t *err;
+ svn_boolean_t is_url = svn_path_is_url (target);
 
           svn_pool_clear (subpool);
           SVN_ERR (svn_cl__check_cancel (ctx->cancel_baton));
@@ -126,8 +127,12 @@
               svn_client_proplist_item_t *item
                 = ((svn_client_proplist_item_t **)props->elts)[j];
               const char *node_name_stdout;
- SVN_ERR (svn_cmdline_path_local_style_from_utf8
- (&node_name_stdout, item->node_name->data, subpool));
+ if (! is_url)
+ SVN_ERR (svn_cmdline_path_local_style_from_utf8
+ (&node_name_stdout, item->node_name->data, subpool));
+ else
+ SVN_ERR (svn_utf_cstring_from_utf8
+ (&node_name_stdout, item->node_name->data, subpool));
               printf("Properties on '%s':\n", node_name_stdout);
               SVN_ERR (svn_cl__print_prop_hash
                        (item->prop_hash, (! opt_state->verbose), subpool));

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 19 20:39:44 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.