You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2011/04/23 18:19:58 UTC

svn commit: r1096175 - /subversion/trunk/subversion/libsvn_client/cmdline.c

Author: danielsh
Date: Sat Apr 23 16:19:58 2011
New Revision: 1096175

URL: http://svn.apache.org/viewvc?rev=1096175&view=rev
Log:
Fix an assertion triggered by 'svn sw ^/trunk' in a non-working-copy directory.

Since the API in question (svn_client_args_to_target_array) has existed since
1.5, I'm assuming its current semantics are also its historical ones and
therefore fix the caller rather than have the API return an error in addition
to returning NULL.

* subversion/libsvn_client/cmdline.c
  (svn_client_args_to_target_array):
    Re-check ROOT_URL for NULLness after (re)attempting to compute it.

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

Modified: subversion/trunk/subversion/libsvn_client/cmdline.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/cmdline.c?rev=1096175&r1=1096174&r2=1096175&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/cmdline.c (original)
+++ subversion/trunk/subversion/libsvn_client/cmdline.c Sat Apr 23 16:19:58 2011
@@ -291,9 +291,16 @@ svn_client_args_to_target_array(apr_arra
        * arguments.
        */
       if (root_url == NULL)
-        SVN_ERR_W(svn_client_root_url_from_path(&root_url, "", ctx, pool),
-                  "Resolving '^/': no repository root found in the "
-                  "target arguments or in the current directory");
+        {
+          svn_error_t *err2;
+          err2 = svn_client_root_url_from_path(&root_url, "", ctx, pool);
+
+          if (err2 || root_url == NULL)
+            return svn_error_create(SVN_ERR_WC_NOT_WORKING_COPY, err2,
+                                    _("Resolving '^/': no repository root "
+                                      "found in the target arguments or "
+                                      "in the current directory"));
+        }
 
       *targets_p = apr_array_make(pool, output_targets->nelts,
                                   sizeof(const char *));