diff options
Diffstat (limited to 'subversion/libsvn_client/revert.c')
-rw-r--r-- | subversion/libsvn_client/revert.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/subversion/libsvn_client/revert.c b/subversion/libsvn_client/revert.c index f8f6b1d..681e39c 100644 --- a/subversion/libsvn_client/revert.c +++ b/subversion/libsvn_client/revert.c @@ -31,6 +31,7 @@ #include "svn_wc.h" #include "svn_client.h" #include "svn_dirent_uri.h" +#include "svn_hash.h" #include "svn_pools.h" #include "svn_error.h" #include "svn_time.h" @@ -135,8 +136,9 @@ svn_client_revert2(const apr_array_header_t *paths, _("'%s' is not a local path"), path); } - cfg = ctx->config ? apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG, - APR_HASH_KEY_STRING) : NULL; + cfg = ctx->config + ? svn_hash_gets(ctx->config, SVN_CONFIG_CATEGORY_CONFIG) + : NULL; SVN_ERR(svn_config_get_bool(cfg, &use_commit_times, SVN_CONFIG_SECTION_MISCELLANY, @@ -158,7 +160,9 @@ svn_client_revert2(const apr_array_header_t *paths, && ((err = ctx->cancel_func(ctx->cancel_baton)))) goto errorful; - SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool)); + err = svn_dirent_get_absolute(&local_abspath, path, pool); + if (err) + goto errorful; baton.local_abspath = local_abspath; baton.depth = depth; @@ -166,8 +170,9 @@ svn_client_revert2(const apr_array_header_t *paths, baton.changelists = changelists; baton.ctx = ctx; - SVN_ERR(svn_wc__strictly_is_wc_root(&wc_root, ctx->wc_ctx, - local_abspath, pool)); + err = svn_wc__is_wcroot(&wc_root, ctx->wc_ctx, local_abspath, pool); + if (err) + goto errorful; lock_target = wc_root ? local_abspath : svn_dirent_dirname(local_abspath, pool); err = svn_wc__call_with_write_lock(revert, &baton, ctx->wc_ctx, @@ -178,18 +183,17 @@ svn_client_revert2(const apr_array_header_t *paths, errorful: - if (!use_commit_times) - { - /* Sleep to ensure timestamp integrity. */ - const char* sleep_path = NULL; + { + /* Sleep to ensure timestamp integrity. */ + const char *sleep_path = NULL; - /* Only specify a path if we are certain all paths are on the - same filesystem */ - if (paths->nelts == 1) - sleep_path = APR_ARRAY_IDX(paths, 0, const char *); + /* Only specify a path if we are certain all paths are on the + same filesystem */ + if (paths->nelts == 1) + sleep_path = APR_ARRAY_IDX(paths, 0, const char *); - svn_io_sleep_for_timestamps(sleep_path, subpool); - } + svn_io_sleep_for_timestamps(sleep_path, subpool); + } svn_pool_destroy(subpool); |