summaryrefslogtreecommitdiff
path: root/subversion/libsvn_client/checkout.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_client/checkout.c')
-rw-r--r--subversion/libsvn_client/checkout.c90
1 files changed, 33 insertions, 57 deletions
diff --git a/subversion/libsvn_client/checkout.c b/subversion/libsvn_client/checkout.c
index 96e684b..41be776 100644
--- a/subversion/libsvn_client/checkout.c
+++ b/subversion/libsvn_client/checkout.c
@@ -49,10 +49,7 @@
static svn_error_t *
initialize_area(const char *local_abspath,
- const char *session_url,
- const char *repos_root,
- const char *uuid,
- svn_revnum_t revnum,
+ const svn_client__pathrev_t *pathrev,
svn_depth_t depth,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
@@ -61,8 +58,9 @@ initialize_area(const char *local_abspath,
depth = svn_depth_infinity;
/* Make the unversioned directory into a versioned one. */
- SVN_ERR(svn_wc_ensure_adm4(ctx->wc_ctx, local_abspath, session_url,
- repos_root, uuid, revnum, depth, pool));
+ SVN_ERR(svn_wc_ensure_adm4(ctx->wc_ctx, local_abspath, pathrev->url,
+ pathrev->repos_root_url, pathrev->repos_uuid,
+ pathrev->rev, depth, pool));
return SVN_NO_ERROR;
}
@@ -80,17 +78,10 @@ svn_client__checkout_internal(svn_revnum_t *result_rev,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
- svn_error_t *err = NULL;
- svn_revnum_t revnum;
- svn_boolean_t sleep_here = FALSE;
- svn_boolean_t *use_sleep = timestamp_sleep ? timestamp_sleep : &sleep_here;
- const char *session_url;
svn_node_kind_t kind;
- const char *uuid, *repos_root;
apr_pool_t *session_pool = svn_pool_create(pool);
svn_ra_session_t *ra_session;
- svn_revnum_t tmp_revnum;
- const char *tmp_session_url;
+ svn_client__pathrev_t *pathrev;
/* Sanity check. Without these, the checkout is meaningless. */
SVN_ERR_ASSERT(local_abspath != NULL);
@@ -104,26 +95,22 @@ svn_client__checkout_internal(svn_revnum_t *result_rev,
return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL, NULL);
/* Get the RA connection. */
- SVN_ERR(svn_client__ra_session_from_path(&ra_session, &tmp_revnum,
- &tmp_session_url, url, NULL,
- peg_revision, revision, ctx,
- session_pool));
+ SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &pathrev,
+ url, NULL, peg_revision, revision,
+ ctx, session_pool));
- SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root, pool));
- SVN_ERR(svn_ra_get_uuid2(ra_session, &uuid, pool));
- session_url = apr_pstrdup(pool, tmp_session_url);
- revnum = tmp_revnum;
- SVN_ERR(svn_ra_check_path(ra_session, "", revnum, &kind, pool));
+ pathrev = svn_client__pathrev_dup(pathrev, pool);
+ SVN_ERR(svn_ra_check_path(ra_session, "", pathrev->rev, &kind, pool));
svn_pool_destroy(session_pool);
if (kind == svn_node_none)
return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,
- _("URL '%s' doesn't exist"), session_url);
+ _("URL '%s' doesn't exist"), pathrev->url);
else if (kind == svn_node_file)
return svn_error_createf
(SVN_ERR_UNSUPPORTED_FEATURE , NULL,
- _("URL '%s' refers to a file, not a directory"), session_url);
+ _("URL '%s' refers to a file, not a directory"), pathrev->url);
SVN_ERR(svn_io_check_path(local_abspath, &kind, pool));
@@ -133,8 +120,7 @@ svn_client__checkout_internal(svn_revnum_t *result_rev,
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(local_abspath, pool));
- err = initialize_area(local_abspath, session_url,
- repos_root, uuid, revnum, depth, ctx, pool);
+ SVN_ERR(initialize_area(local_abspath, pathrev, depth, ctx, pool));
}
else if (kind == svn_node_dir)
{
@@ -144,8 +130,7 @@ svn_client__checkout_internal(svn_revnum_t *result_rev,
SVN_ERR(svn_wc_check_wc2(&wc_format, ctx->wc_ctx, local_abspath, pool));
if (! wc_format)
{
- err = initialize_area(local_abspath, session_url,
- repos_root, uuid, revnum, depth, ctx, pool);
+ SVN_ERR(initialize_area(local_abspath, pathrev, depth, ctx, pool));
}
else
{
@@ -156,7 +141,7 @@ svn_client__checkout_internal(svn_revnum_t *result_rev,
/* If PATH's existing URL matches the incoming one, then
just update. This allows 'svn co' to restart an
interrupted checkout. Otherwise bail out. */
- if (strcmp(entry_url, session_url) != 0)
+ if (strcmp(entry_url, pathrev->url) != 0)
return svn_error_createf(
SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
_("'%s' is already a working copy for a"
@@ -172,28 +157,13 @@ svn_client__checkout_internal(svn_revnum_t *result_rev,
}
/* Have update fix the incompleteness. */
- if (! err)
- {
- err = svn_client__update_internal(result_rev, local_abspath,
- revision, depth, TRUE,
- ignore_externals,
- allow_unver_obstructions,
- TRUE /* adds_as_modification */,
- FALSE, FALSE,
- use_sleep, ctx, pool);
- }
-
- if (err)
- {
- /* Don't rely on the error handling to handle the sleep later, do
- it now */
- svn_io_sleep_for_timestamps(local_abspath, pool);
- return svn_error_trace(err);
- }
- *use_sleep = TRUE;
-
- if (sleep_here)
- svn_io_sleep_for_timestamps(local_abspath, pool);
+ SVN_ERR(svn_client__update_internal(result_rev, local_abspath,
+ revision, depth, TRUE,
+ ignore_externals,
+ allow_unver_obstructions,
+ TRUE /* adds_as_modification */,
+ FALSE, FALSE,
+ timestamp_sleep, ctx, pool));
return SVN_NO_ERROR;
}
@@ -211,12 +181,18 @@ svn_client_checkout3(svn_revnum_t *result_rev,
apr_pool_t *pool)
{
const char *local_abspath;
+ svn_error_t *err;
+ svn_boolean_t sleep_here = FALSE;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
- return svn_client__checkout_internal(result_rev, URL, local_abspath,
- peg_revision, revision, depth,
- ignore_externals,
- allow_unver_obstructions, NULL,
- ctx, pool);
+ err = svn_client__checkout_internal(result_rev, URL, local_abspath,
+ peg_revision, revision, depth,
+ ignore_externals,
+ allow_unver_obstructions, &sleep_here,
+ ctx, pool);
+ if (sleep_here)
+ svn_io_sleep_for_timestamps(local_abspath, pool);
+
+ return svn_error_trace(err);
}