subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1586255 - in /subversion/trunk/subversion: libsvn_client/prop_commands.c tests/cmdline/prop_tests.py
Date Thu, 10 Apr 2014 10:14:23 GMT
Author: rhuijben
Date: Thu Apr 10 10:14:23 2014
New Revision: 1586255

URL: http://svn.apache.org/r1586255
Log:
Replace assertions triggered in svn_dirent_get_absolute() triggered by
$ svn pl -r PREV https://svn.apache.org/repos/asf
$ svn pg Q -r PREV https://svn.apache.org/repos/asf
and
$ tortoiseproc /command:properties /path:https://svn.apache.org/repos/asf
(which tries to obtain the WORKING properties)
with a proper error.

* subversion/libsvn_client/prop_commands.c
  (svn_client_propget5): Don't assert when we encounter a url.
    Avoid second conversion to absolute path.

  (get_remote_props): Don't assert when we encounter a url.

* subversion/tests/cmdline/prop_tests.py
  (wc_propop_on_url): New function.
  (test_list): Add wc_propop_on_url.

Found by: Baybora Aksoy <baksoy{_AT_}collab.net>
          CollabNet QA

Modified:
    subversion/trunk/subversion/libsvn_client/prop_commands.c
    subversion/trunk/subversion/tests/cmdline/prop_tests.py

Modified: subversion/trunk/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/prop_commands.c?rev=1586255&r1=1586254&r2=1586255&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/trunk/subversion/libsvn_client/prop_commands.c Thu Apr 10 10:14:23 2014
@@ -882,8 +882,14 @@ svn_client_propget5(apr_hash_t **props,
           const char *repos_root_url;
           const char *local_abspath;
 
-          SVN_ERR(svn_dirent_get_absolute(&local_abspath, target,
-                                          scratch_pool));
+          /* Avoid assertion on the next line when somebody accidentally asks for
+             a working copy revision on a URL */
+          if (svn_path_is_url(target))
+            return svn_error_create(SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED,
+                                    NULL, NULL);
+
+          SVN_ERR_ASSERT(svn_dirent_is_absolute(target));
+          local_abspath = target;
 
           if (SVN_CLIENT__REVKIND_NEEDS_WC(peg_revision->kind))
             {
@@ -1280,6 +1286,12 @@ get_remote_props(const char *path_or_url
       const char *local_abspath;
       svn_boolean_t is_copy;
 
+      /* Avoid assertion on the next line when somebody accidentally asks for
+         a working copy revision on a URL */
+      if (svn_path_is_url(path_or_url))
+        return svn_error_create(SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED,
+                                NULL, NULL);
+
       SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url,
                                       scratch_pool));
 

Modified: subversion/trunk/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/prop_tests.py?rev=1586255&r1=1586254&r2=1586255&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/prop_tests.py Thu Apr 10 10:14:23 2014
@@ -2746,6 +2746,20 @@ def iprops_list_abspath(sbox):
                                      '--show-inherited-props', '-v',
                                      os.path.abspath(sbox.ospath('')))
 
+def wc_propop_on_url(sbox):
+  "perform wc specific operations on url"
+
+  sbox.build(create_wc = False)
+
+  svntest.actions.run_and_verify_svn(None, None, '.*E195000:.*path',
+                                     'pl', '-r', 'PREV',
+                                     sbox.repo_url)
+
+  svntest.actions.run_and_verify_svn(None, None, '.*E195000:.*path',
+                                     'pg', 'my:Q', '-r', 'PREV',
+                                     sbox.repo_url)
+
+
 ########################################################################
 # Run the tests
 
@@ -2794,6 +2808,7 @@ test_list = [ None,
               xml_unsafe_author,
               dir_prop_conflict_details,
               iprops_list_abspath,
+              wc_propop_on_url,
              ]
 
 if __name__ == '__main__':



Mime
View raw message