Hi,

Currently it is possible to compare arbitrary versioned or unversioned files or
directories using the 'svn diff --old A --new B' command [1].  Running this
command may produce errors and on my Windows machine the
corresponding error messages contain paths with incorrect separators.

- For example, running 'svn diff --old doc --new win-tests.py' on a fresh
subversion/trunk checkout produces the following message:

[[[
svn: E145001: 'C:/Projects/Subversion/doc' is not the same node kind as
'C:/Projects/Subversion/win-tests.py'
]]]

- Running 'svn diff --old DOES-NOT-EXIST --new DOES-NOT-EXIST' in the same case
produces the following message:

[[[
svn: E145001: 'C:/Projects/Subversion/DOES-NOT-EXIST' is not a file or directory
]]]

I've attached a patch that fixes the described problems (we should use
'svn_dirent_local_style' for path formatting in the error messages produced by
the 'svn_client__arbitrary_nodes_diff' function).

[1] http://svn.apache.org/viewvc?view=revision&revision=1310291


Thanks and regards,
Evgeny Kotkov
Index: subversion/libsvn_client/diff_local.c
===================================================================
--- subversion/libsvn_client/diff_local.c       (revision 1500633)
+++ subversion/libsvn_client/diff_local.c       (working copy)
@@ -607,7 +607,10 @@ svn_client__arbitrary_nodes_diff(const char *local
   if (kind1 != kind2)
     return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                              _("'%s' is not the same node kind as '%s'"),
-                             local_abspath1, local_abspath2);
+                             svn_dirent_local_style(local_abspath1,
+                                                    scratch_pool),
+                             svn_dirent_local_style(local_abspath2,
+                                                    scratch_pool));
 
   if (depth == svn_depth_unknown)
     depth = svn_depth_infinity;
@@ -627,7 +630,10 @@ svn_client__arbitrary_nodes_diff(const char *local
   else
     return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
                              _("'%s' is not a file or directory"),
-                             kind1 == svn_node_none ?
-                              local_abspath1 : local_abspath2);
+                             kind1 == svn_node_none
+                               ? svn_dirent_local_style(local_abspath1,
+                                                        scratch_pool)
+                               : svn_dirent_local_style(local_abspath2,
+                                                        scratch_pool));
   return SVN_NO_ERROR;
 }
Use local style for paths when formatting error messages from the
'svn diff --old A --new B' commands.  Follow-up to r1310291.

* subversion/libsvn_client/diff_local.c
  (svn_client__arbitrary_nodes_diff): Use local style for paths when formatting
    the "not the same node kind" and "not a file or directory" messages.

Patch by: Evgeny Kotkov <evgeny.kotkov{_AT_}visualsvn.com>

Reply via email to