diff options
Diffstat (limited to 'contrib/subversion/subversion/libsvn_client/status.c')
-rw-r--r-- | contrib/subversion/subversion/libsvn_client/status.c | 81 |
1 files changed, 45 insertions, 36 deletions
diff --git a/contrib/subversion/subversion/libsvn_client/status.c b/contrib/subversion/subversion/libsvn_client/status.c index e581d37..a701658 100644 --- a/contrib/subversion/subversion/libsvn_client/status.c +++ b/contrib/subversion/subversion/libsvn_client/status.c @@ -29,7 +29,9 @@ #include <apr_strings.h> #include <apr_pools.h> +#include "svn_private_config.h" #include "svn_pools.h" +#include "svn_sorts.h" #include "client.h" #include "svn_path.h" @@ -39,9 +41,9 @@ #include "svn_error.h" #include "svn_hash.h" -#include "svn_private_config.h" -#include "private/svn_wc_private.h" #include "private/svn_client_private.h" +#include "private/svn_sorts_private.h" +#include "private/svn_wc_private.h" /*** Getting update information ***/ @@ -195,8 +197,7 @@ reporter_finish_report(void *report_baton, apr_pool_t *pool) server doesn't support lock discovery, we'll just not do locky stuff. */ err = svn_ra_get_locks2(ras, &locks, "", rb->depth, rb->pool); - if (err && ((err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED) - || (err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE))) + if (err && err->apr_err == SVN_ERR_RA_NOT_IMPLEMENTED) { svn_error_clear(err); err = SVN_NO_ERROR; @@ -245,27 +246,32 @@ do_external_status(svn_client_ctx_t *ctx, apr_hash_t *external_map, svn_depth_t depth, svn_boolean_t get_all, - svn_boolean_t update, + svn_boolean_t check_out_of_date, + svn_boolean_t check_working_copy, svn_boolean_t no_ignore, + const apr_array_header_t *changelists, const char *anchor_abspath, const char *anchor_relpath, svn_client_status_func_t status_func, void *status_baton, apr_pool_t *scratch_pool) { - apr_hash_index_t *hi; apr_pool_t *iterpool = svn_pool_create(scratch_pool); + apr_array_header_t *externals; + int i; + + externals = svn_sort__hash(external_map, svn_sort_compare_items_lexically, + scratch_pool); /* Loop over the hash of new values (we don't care about the old ones). This is a mapping of versioned directories to property values. */ - for (hi = apr_hash_first(scratch_pool, external_map); - hi; - hi = apr_hash_next(hi)) + for (i = 0; i < externals->nelts; i++) { svn_node_kind_t external_kind; - const char *local_abspath = svn__apr_hash_index_key(hi); - const char *defining_abspath = svn__apr_hash_index_val(hi); + svn_sort__item_t item = APR_ARRAY_IDX(externals, i, svn_sort__item_t); + const char *local_abspath = item.key; + const char *defining_abspath = item.value; svn_node_kind_t kind; svn_opt_revision_t opt_rev; const char *status_path; @@ -309,9 +315,12 @@ do_external_status(svn_client_ctx_t *ctx, } /* And then do the status. */ - SVN_ERR(svn_client_status5(NULL, ctx, status_path, &opt_rev, depth, - get_all, update, no_ignore, FALSE, FALSE, - NULL, status_func, status_baton, + SVN_ERR(svn_client_status6(NULL, ctx, status_path, &opt_rev, depth, + get_all, check_out_of_date, + check_working_copy, no_ignore, + FALSE /* ignore_exernals */, + FALSE /* depth_as_sticky */, + changelists, status_func, status_baton, iterpool)); } @@ -325,13 +334,14 @@ do_external_status(svn_client_ctx_t *ctx, svn_error_t * -svn_client_status5(svn_revnum_t *result_rev, +svn_client_status6(svn_revnum_t *result_rev, svn_client_ctx_t *ctx, const char *path, const svn_opt_revision_t *revision, svn_depth_t depth, svn_boolean_t get_all, - svn_boolean_t update, + svn_boolean_t check_out_of_date, + svn_boolean_t check_working_copy, svn_boolean_t no_ignore, svn_boolean_t ignore_externals, svn_boolean_t depth_as_sticky, @@ -348,6 +358,11 @@ svn_client_status5(svn_revnum_t *result_rev, svn_error_t *err; apr_hash_t *changelist_hash = NULL; + /* Override invalid combinations of the check_out_of_date and + check_working_copy flags. */ + if (!check_out_of_date) + check_working_copy = TRUE; + if (svn_path_is_url(path)) return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL, _("'%s' is not a local path"), path); @@ -366,7 +381,7 @@ svn_client_status5(svn_revnum_t *result_rev, SVN_ERR(svn_dirent_get_absolute(&target_abspath, path, pool)); - if (update) + if (check_out_of_date) { /* The status editor only works on directories, so get the ancestor if necessary */ @@ -434,7 +449,7 @@ svn_client_status5(svn_revnum_t *result_rev, /* If we want to know about out-of-dateness, we crawl the working copy and let the RA layer drive the editor for real. Otherwise, we just close the edit. :-) */ - if (update) + if (check_out_of_date) { svn_ra_session_t *ra_session; const char *URL; @@ -464,14 +479,14 @@ svn_client_status5(svn_revnum_t *result_rev, SVN_RA_CAPABILITY_DEPTH, pool)); SVN_ERR(svn_wc__get_status_editor(&editor, &edit_baton, &set_locks_baton, - &edit_revision, ctx->wc_ctx, - dir_abspath, target_basename, - depth, get_all, - no_ignore, depth_as_sticky, - server_supports_depth, - ignores, tweak_status, &sb, - ctx->cancel_func, ctx->cancel_baton, - pool, pool)); + &edit_revision, ctx->wc_ctx, + dir_abspath, target_basename, + depth, get_all, check_working_copy, + no_ignore, depth_as_sticky, + server_supports_depth, + ignores, tweak_status, &sb, + ctx->cancel_func, ctx->cancel_baton, + pool, pool)); /* Verify that URL exists in HEAD. If it doesn't, this can save @@ -562,7 +577,7 @@ svn_client_status5(svn_revnum_t *result_rev, = svn_wc_create_notify(target_abspath, svn_wc_notify_status_completed, pool); notify->revision = edit_revision; - (ctx->notify_func2)(ctx->notify_baton2, notify, pool); + ctx->notify_func2(ctx->notify_baton2, notify, pool); } /* If the caller wants the result revision, give it to them. */ @@ -590,14 +605,7 @@ svn_client_status5(svn_revnum_t *result_rev, SVN_ERR(err); } - /* If there are svn:externals set, we don't want those to show up as - unversioned or unrecognized, so patch up the hash. If caller wants - all the statuses, we will change unversioned status items that - are interesting to an svn:externals property to - svn_wc_status_unversioned, otherwise we'll just remove the status - item altogether. - - We only descend into an external if depth is svn_depth_infinity or + /* We only descend into an external if depth is svn_depth_infinity or svn_depth_unknown. However, there are conceivable behaviors that would involve descending under other circumstances; thus, we pass depth anyway, so the code will DTRT if we change the conditional @@ -613,7 +621,8 @@ svn_client_status5(svn_revnum_t *result_rev, SVN_ERR(do_external_status(ctx, external_map, depth, get_all, - update, no_ignore, + check_out_of_date, check_working_copy, + no_ignore, changelists, sb.anchor_abspath, sb.anchor_relpath, status_func, status_baton, pool)); } |