You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/05/26 15:57:02 UTC

svn commit: r948428 - in /subversion/trunk/subversion/libsvn_client: checkout.c client.h externals.c

Author: hwright
Date: Wed May 26 13:57:02 2010
New Revision: 948428

URL: http://svn.apache.org/viewvc?rev=948428&view=rev
Log:
Require an absolute path for a library-internal function.

* subversion/libsvn_client/externals.c
  (switch_dir_external): Avoid double-fetching the absolute path, and use it
    for calling checkout_internal().

* subversion/libsvn_client/client.h
  (svn_client__checkout_internal): Update docstring and param name.

* subversion/libsvn_client/checkout.c
  (svn_client__checkout_internal): Require a local_abspath.
  (svn_client_checkout3): Fetch an absolute path to use in the helper.

Modified:
    subversion/trunk/subversion/libsvn_client/checkout.c
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/libsvn_client/externals.c

Modified: subversion/trunk/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/checkout.c?rev=948428&r1=948427&r2=948428&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/checkout.c (original)
+++ subversion/trunk/subversion/libsvn_client/checkout.c Wed May 26 13:57:02 2010
@@ -81,7 +81,7 @@ initialize_area(svn_revnum_t *result_rev
 svn_error_t *
 svn_client__checkout_internal(svn_revnum_t *result_rev,
                               const char *url,
-                              const char *path,
+                              const char *local_abspath,
                               const svn_opt_revision_t *peg_revision,
                               const svn_opt_revision_t *revision,
                               const svn_client__ra_session_from_path_results *ra_cache,
@@ -100,13 +100,11 @@ svn_client__checkout_internal(svn_revnum
   const char *session_url;
   svn_node_kind_t kind;
   const char *uuid, *repos_root;
-  const char *local_abspath;
 
   /* Sanity check.  Without these, the checkout is meaningless. */
-  SVN_ERR_ASSERT(path != NULL);
+  SVN_ERR_ASSERT(local_abspath != NULL);
   SVN_ERR_ASSERT(url != NULL);
-
-  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   /* Fulfill the docstring promise of svn_client_checkout: */
   if ((revision->kind != svn_opt_revision_number)
@@ -180,14 +178,14 @@ svn_client__checkout_internal(svn_revnum
       (SVN_ERR_UNSUPPORTED_FEATURE , NULL,
        _("URL '%s' refers to a file, not a directory"), session_url);
 
-  SVN_ERR(svn_io_check_path(path, &kind, pool));
+  SVN_ERR(svn_io_check_path(local_abspath, &kind, pool));
 
   if (kind == svn_node_none)
     {
       /* Bootstrap: create an incomplete working-copy root dir.  Its
          entries file should only have an entry for THIS_DIR with a
          URL, revnum, and an 'incomplete' flag.  */
-      SVN_ERR(svn_io_make_dir_recursively(path, pool));
+      SVN_ERR(svn_io_make_dir_recursively(local_abspath, pool));
       err = initialize_area(result_rev, local_abspath, revision, session_url,
                             repos_root, uuid, revnum, depth, use_sleep,
                             ignore_externals, allow_unver_obstructions,
@@ -229,27 +227,27 @@ svn_client__checkout_internal(svn_revnum
                           SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
                           _("'%s' is already a working copy for a different URL;"
                             " use 'svn update' to update it"),
-                          svn_dirent_local_style(path, pool));
+                          svn_dirent_local_style(local_abspath, pool));
         }
     }
   else
     {
       return svn_error_createf(SVN_ERR_WC_NODE_KIND_CHANGE, NULL,
                                _("'%s' already exists and is not a directory"),
-                               svn_dirent_local_style(path, pool));
+                               svn_dirent_local_style(local_abspath, pool));
     }
 
   if (err)
     {
       /* Don't rely on the error handling to handle the sleep later, do
          it now */
-      svn_io_sleep_for_timestamps(path, pool);
+      svn_io_sleep_for_timestamps(local_abspath, pool);
       return svn_error_return(err);
     }
   *use_sleep = TRUE;
 
   if (sleep_here)
-    svn_io_sleep_for_timestamps(path, pool);
+    svn_io_sleep_for_timestamps(local_abspath, pool);
 
   return SVN_NO_ERROR;
 }
@@ -266,8 +264,13 @@ svn_client_checkout3(svn_revnum_t *resul
                      svn_client_ctx_t *ctx,
                      apr_pool_t *pool)
 {
-  return svn_client__checkout_internal(result_rev, URL, path, peg_revision,
-                                       revision, NULL, depth, ignore_externals,
+  const char *local_abspath;
+
+  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
+
+  return svn_client__checkout_internal(result_rev, URL, local_abspath,
+                                       peg_revision, revision, NULL, depth,
+                                       ignore_externals,
                                        allow_unver_obstructions, FALSE, NULL,
                                        ctx, pool);
 }

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=948428&r1=948427&r2=948428&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Wed May 26 13:57:02 2010
@@ -570,15 +570,15 @@ typedef struct
   svn_node_kind_t *kind_p;
 } svn_client__ra_session_from_path_results;
 
-/* Checkout into PATH a working copy of URL at REVISION, and (if not
+/* Checkout into LOCAL_ABSPATH a working copy of URL at REVISION, and (if not
    NULL) set RESULT_REV to the checked out revision.
 
    If DEPTH is svn_depth_infinity, then check out fully recursively.
-   Else if DEPTH is svn_depth_files, checkout all files under PATH (if
+   Else if DEPTH is svn_depth_files, checkout all files under LOCAL_ABSPATH (if
    any), but not subdirectories.  Else if DEPTH is
    svn_depth_immediates, check out all files and include immediate
    subdirectories (at svn_depth_empty).  Else if DEPTH is
-   svn_depth_empty, just check out PATH, with none of its entries.
+   svn_depth_empty, just check out LOCAL_ABSPATH, with none of its entries.
 
    DEPTH must be a definite depth, not (e.g.) svn_depth_unknown.
 
@@ -592,18 +592,18 @@ typedef struct
    If TIMESTAMP_SLEEP is NULL this function will sleep before
    returning to ensure timestamp integrity.  If TIMESTAMP_SLEEP is not
    NULL then the function will not sleep but will set *TIMESTAMP_SLEEP
-   to TRUE if a sleep is required, and will not change
-   *TIMESTAMP_SLEEP if no sleep is required.  If
-   ALLOW_UNVER_OBSTRUCTIONS is TRUE, unversioned children of PATH that
-   obstruct items added from the repos are tolerated; if FALSE, these
-   obstructions cause the checkout to fail.
+   to TRUE if a sleep is required, and will not change *TIMESTAMP_SLEEP
+   if no sleep is required.  If ALLOW_UNVER_OBSTRUCTIONS is TRUE,
+   unversioned children of LOCAL_ABSPATH that obstruct items added from
+   the repos are tolerated; if FALSE, these obstructions cause the checkout
+   to fail.
 
    If INNERCHECKOUT is true, no anchor check is performed on the target.
    */
 svn_error_t *
 svn_client__checkout_internal(svn_revnum_t *result_rev,
                               const char *URL,
-                              const char *path,
+                              const char *local_abspath,
                               const svn_opt_revision_t *peg_revision,
                               const svn_opt_revision_t *revision,
                               const svn_client__ra_session_from_path_results *ra_cache,

Modified: subversion/trunk/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=948428&r1=948427&r2=948428&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Wed May 26 13:57:02 2010
@@ -268,8 +268,6 @@ switch_dir_external(const char *path,
     {
       struct relegate_dir_external_with_write_lock_baton baton;
 
-      SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
-
       baton.local_abspath = local_abspath;
       baton.wc_ctx = ctx->wc_ctx;
       baton.cancel_func = ctx->cancel_func;
@@ -289,7 +287,7 @@ switch_dir_external(const char *path,
     }
 
   /* ... Hello, new hotness. */
-  return svn_client__checkout_internal(NULL, url, path, peg_revision,
+  return svn_client__checkout_internal(NULL, url, local_abspath, peg_revision,
                                        revision, NULL, svn_depth_infinity,
                                        FALSE, FALSE, TRUE, timestamp_sleep,
                                        ctx, pool);