Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6F3110C2D for ; Fri, 23 Aug 2013 10:41:38 +0000 (UTC) Received: (qmail 93667 invoked by uid 500); 23 Aug 2013 10:41:38 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 93580 invoked by uid 500); 23 Aug 2013 10:41:37 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 93573 invoked by uid 99); 23 Aug 2013 10:41:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 10:41:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 10:41:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B8DDF238890D; Fri, 23 Aug 2013 10:41:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1516816 - in /subversion/trunk/subversion/libsvn_client: add.c client.h Date: Fri, 23 Aug 2013 10:41:15 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130823104115.B8DDF238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhuijben Date: Fri Aug 23 10:41:15 2013 New Revision: 1516816 URL: http://svn.apache.org/r1516816 Log: Make some 'svn mkdir' code use absolute paths internally, to avoid path length limits on Windows. * subversion/libsvn_client/add.c (svn_client__make_local_parents): Document as taking absolute paths, and don't hide errors. (svn_client_mkdir4): Make dirents absolute before passing them to svn_client__make_local_parents. * subversion/libsvn_client/client.h (svn_client__make_local_parents): Tweak prototype. Found by: schabi Modified: subversion/trunk/subversion/libsvn_client/add.c subversion/trunk/subversion/libsvn_client/client.h Modified: subversion/trunk/subversion/libsvn_client/add.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/add.c?rev=1516816&r1=1516815&r2=1516816&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/add.c (original) +++ subversion/trunk/subversion/libsvn_client/add.c Fri Aug 23 10:41:15 2013 @@ -1243,35 +1243,34 @@ mkdir_urls(const apr_array_header_t *url svn_error_t * -svn_client__make_local_parents(const char *path, +svn_client__make_local_parents(const char *local_abspath, svn_boolean_t make_parents, svn_client_ctx_t *ctx, - apr_pool_t *pool) + apr_pool_t *scratch_pool) { svn_error_t *err; svn_node_kind_t orig_kind; - SVN_ERR(svn_io_check_path(path, &orig_kind, pool)); + SVN_ERR(svn_io_check_path(local_abspath, &orig_kind, scratch_pool)); if (make_parents) - SVN_ERR(svn_io_make_dir_recursively(path, pool)); + SVN_ERR(svn_io_make_dir_recursively(local_abspath, scratch_pool)); else - SVN_ERR(svn_io_dir_make(path, APR_OS_DEFAULT, pool)); + SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool)); /* Should no longer use svn_depth_empty to indicate that only the directory itself is added, since it not only constraints the operation depth, but also defines the depth of the target directory now. Moreover, the new directory will have no children at all.*/ - err = svn_client_add5(path, svn_depth_infinity, FALSE, FALSE, FALSE, - make_parents, ctx, pool); + err = svn_client_add5(local_abspath, svn_depth_infinity, FALSE, FALSE, FALSE, + make_parents, ctx, scratch_pool); /* If we created a new directory, but couldn't add it to version control, then delete it. */ if (err && (orig_kind == svn_node_none)) { - /* ### If this returns an error, should we link it onto - err instead, so that the user is warned that we just - created an unversioned directory? */ - - svn_error_clear(svn_io_remove_dir2(path, FALSE, NULL, NULL, pool)); + err = svn_error_compose_create(err, + svn_io_remove_dir2(local_abspath, FALSE, + NULL, NULL, + scratch_pool)); } return svn_error_trace(err); @@ -1300,23 +1299,25 @@ svn_client_mkdir4(const apr_array_header else { /* This is a regular "mkdir" + "svn add" */ - apr_pool_t *subpool = svn_pool_create(pool); + apr_pool_t *iterpool = svn_pool_create(pool); int i; for (i = 0; i < paths->nelts; i++) { const char *path = APR_ARRAY_IDX(paths, i, const char *); - svn_pool_clear(subpool); + svn_pool_clear(iterpool); /* See if the user wants us to stop. */ if (ctx->cancel_func) SVN_ERR(ctx->cancel_func(ctx->cancel_baton)); + SVN_ERR(svn_dirent_get_absolute(&path, path, iterpool)); + SVN_ERR(svn_client__make_local_parents(path, make_parents, ctx, - subpool)); + iterpool)); } - svn_pool_destroy(subpool); + svn_pool_destroy(iterpool); } return SVN_NO_ERROR; Modified: subversion/trunk/subversion/libsvn_client/client.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1516816&r1=1516815&r2=1516816&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/client.h (original) +++ subversion/trunk/subversion/libsvn_client/client.h Fri Aug 23 10:41:15 2013 @@ -466,10 +466,10 @@ svn_client__wc_delete_many(const apr_arr apr_pool_t *pool); -/* Make PATH and add it to the working copy, optionally making all the - intermediate parent directories if MAKE_PARENTS is TRUE. */ +/* Make LOCAL_ABSPATH and add it to the working copy, optionally making all + the intermediate parent directories if MAKE_PARENTS is TRUE. */ svn_error_t * -svn_client__make_local_parents(const char *path, +svn_client__make_local_parents(const char *local_abspath, svn_boolean_t make_parents, svn_client_ctx_t *ctx, apr_pool_t *pool);