You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2010/09/01 01:02:35 UTC
svn commit: r991384 - in /subversion/trunk/subversion: libsvn_client/merge.c
tests/cmdline/input_validation_tests.py
Author: pburba
Date: Tue Aug 31 23:02:35 2010
New Revision: 991384
URL: http://svn.apache.org/viewvc?rev=991384&view=rev
Log:
Return to "1.6.x-esque" behavior and prevent merges from proceeding if the
merge target doesn't exist!
* subversion/libsvn_client/merge.c
(merge_locked,
merge_reintegrate_locked,
merge_peg_locked): Raise an error if the merge target doesn't exist on
disk. With the advent of wcng we get comically far along, before we
have other problems.
* subversion/tests/cmdline/input_validation_tests.py
(invalid_merge_args): Tweak expected failure message.
Modified:
subversion/trunk/subversion/libsvn_client/merge.c
subversion/trunk/subversion/tests/cmdline/input_validation_tests.py
Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=991384&r1=991383&r2=991384&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Tue Aug 31 23:02:35 2010
@@ -8719,6 +8719,14 @@ merge_locked(const char *source1,
const char *source_repos_uuid1, *source_repos_uuid2;
svn_node_kind_t target_kind;
+ /* Make sure the target is really there. */
+ SVN_ERR(svn_io_check_path(target_abspath, &target_kind, scratch_pool));
+ if (target_kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("Path '%s' does not exist"),
+ svn_dirent_local_style(target_abspath,
+ scratch_pool));
+
/* Sanity check our input -- we require specified revisions,
* and either 2 paths or 2 URLs. */
if ((revision1->kind == svn_opt_revision_unspecified)
@@ -9994,6 +10002,15 @@ merge_reintegrate_locked(const char *sou
struct get_subtree_mergeinfo_walk_baton wb;
const char *target_url;
svn_revnum_t target_base_rev;
+ svn_node_kind_t kind;
+
+ /* Make sure the target is really there. */
+ SVN_ERR(svn_io_check_path(target_abspath, &kind, scratch_pool));
+ if (kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("Path '%s' does not exist"),
+ svn_dirent_local_style(target_abspath,
+ scratch_pool));
/* Make sure we're dealing with a real URL. */
SVN_ERR(svn_client_url_from_path2(&url2, source, ctx,
@@ -10257,6 +10274,14 @@ merge_peg_locked(const char *source,
svn_node_kind_t target_kind;
SVN_ERR_ASSERT(svn_dirent_is_absolute(target_abspath));
+
+ /* Make sure the target is really there. */
+ SVN_ERR(svn_io_check_path(target_abspath, &target_kind, scratch_pool));
+ if (target_kind == svn_node_none)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("Path '%s' does not exist"),
+ svn_dirent_local_style(target_abspath,
+ scratch_pool));
/* Make sure we're dealing with a real URL. */
SVN_ERR(svn_client_url_from_path2(&URL, source, ctx,
Modified: subversion/trunk/subversion/tests/cmdline/input_validation_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/input_validation_tests.py?rev=991384&r1=991383&r2=991384&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/input_validation_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/input_validation_tests.py Tue Aug 31 23:02:35 2010
@@ -164,8 +164,7 @@ def invalid_merge_args(sbox):
'merge', '-c42', '^/A/B', '^/A/C', 'iota')
run_and_verify_svn_in_wc(sbox, "svn: Cannot specify a revision range with" +
" two URLs", 'merge', '-c42', '^/mu', '^/')
- run_and_verify_svn_in_wc(sbox, "svn: Merge target.*does not exist in " +
- "the working copy",
+ run_and_verify_svn_in_wc(sbox, "svn: Path '.*' does not exist",
'merge', '-c42', '^/mu', 'nonexistent')