On the 'showing-merge-info' branch: fix a WC locking issue after r1213635.
Don't take out a WC write lock in 'svn' because we call svn_client_merge4()
which does, and we can't nest the locks.
* subversion/svn/merge-cmd.c
(get_target_and_lock_abspath): Delete.
(merge_reintegrate_locked, merge_reintegrate): Combine as one function.
git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/showing-merge-info@1213637 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/svn/merge-cmd.c b/subversion/svn/merge-cmd.c
index c52f0aa..601677f 100644
--- a/subversion/svn/merge-cmd.c
+++ b/subversion/svn/merge-cmd.c
@@ -34,7 +34,6 @@
#include "svn_types.h"
#include "cl.h"
-#include "private/svn_wc_private.h"
#include "svn_private_config.h"
@@ -95,39 +94,16 @@
return SVN_NO_ERROR;
}
-/* Set *TARGET_ABSPATH to the absolute path of, and *LOCK_ABSPATH to
- the absolute path to lock for, TARGET_WCPATH. */
-static svn_error_t *
-get_target_and_lock_abspath(const char **target_abspath,
- const char **lock_abspath,
- const char *target_wcpath,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool)
-{
- svn_node_kind_t kind;
- SVN_ERR(svn_dirent_get_absolute(target_abspath, target_wcpath,
- scratch_pool));
- SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, *target_abspath, FALSE,
- scratch_pool));
- if (kind == svn_node_dir)
- *lock_abspath = *target_abspath;
- else
- *lock_abspath = svn_dirent_dirname(*target_abspath, scratch_pool);
-
- return SVN_NO_ERROR;
-}
-
/* */
static svn_error_t *
-merge_reintegrate_locked(const char *source_path_or_url,
- const svn_opt_revision_t *source_peg_revision,
- const char *target_wcpath,
- const char *target_wc_abspath,
- svn_boolean_t dry_run,
- svn_boolean_t quiet,
- const apr_array_header_t *merge_options,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool)
+merge_reintegrate(const char *source_path_or_url,
+ const svn_opt_revision_t *source_peg_revision,
+ const char *target_wcpath,
+ svn_boolean_t dry_run,
+ svn_boolean_t quiet,
+ const apr_array_header_t *merge_options,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
{
const char *url1, *url2;
svn_revnum_t rev1, rev2;
@@ -170,36 +146,6 @@
return SVN_NO_ERROR;
}
-/* */
-static svn_error_t *
-merge_reintegrate(const char *source,
- const svn_opt_revision_t *peg_revision,
- const char *target_wcpath,
- svn_boolean_t dry_run,
- svn_boolean_t quiet,
- const apr_array_header_t *merge_options,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- const char *target_wc_abspath, *lock_abspath;
-
- SVN_ERR(get_target_and_lock_abspath(&target_wc_abspath, &lock_abspath,
- target_wcpath, ctx, pool));
-
- if (!dry_run)
- SVN_WC__CALL_WITH_WRITE_LOCK(
- merge_reintegrate_locked(source, peg_revision,
- target_wcpath, target_wc_abspath,
- dry_run, quiet, merge_options, ctx, pool),
- ctx->wc_ctx, lock_abspath, FALSE /* lock_anchor */, pool);
- else
- SVN_ERR(merge_reintegrate_locked(source, peg_revision,
- target_wcpath, target_wc_abspath,
- dry_run, quiet, merge_options, ctx, pool));
-
- return SVN_NO_ERROR;
-}
-
/* This implements the `svn_opt_subcommand_t' interface. */
svn_error_t *
svn_cl__merge(apr_getopt_t *os,