[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Auto-selection of merge source URL

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-11-30 19:28:30 CET

Mike, sorry if I'm being dense here, but I don't really follow this
change. svn_client_suggest_merge_sources() is intended to (when
possible) automatically select the correct merge source URL for a
target. Removing its usage means that the user will either have to
manually enter a URL.

However, your commit log suggests that you've made the merge source
the same as the target, which makes no sense to me.

Thanks, Dan

On Thu, 29 Nov 2007, cmpilato@tigris.org wrote:

> Author: cmpilato
> Date: Thu Nov 29 09:28:45 2007
> New Revision: 28143
>
> Log:
> Make the default merge source in the command-line client be the same
> as the target.
>
> * subversion/svn/merge-cmd.c
> (svn_cl__merge): Default the merge source to the same thing as the target.
>
> * subversion/svn/main.c
> (svn_cl__cmd_table): Update usage information for merge subcommand.
>
> * subversion/tests/cmdline/merge_tests.py
> (mergeinfo_inheritance_and_discontinuous_ranges): Update in light of
> merge command-line syntax changes.
> (detect_copy_src_for_target_with_multiple_ancestors): Remove.
> (test_list): Remove reference to obnoxiously-lengthy function name,
> detect_copy_src_for_target_with_multiple_ancestors()
>
> * TODO-1.5-branch
> Remove associated TODO item.
>
>
> Modified:
> trunk/TODO-1.5-branch
> trunk/subversion/svn/main.c
> trunk/subversion/svn/merge-cmd.c
> trunk/subversion/tests/cmdline/merge_tests.py
>
> Modified: trunk/TODO-1.5-branch
> URL: http://svn.collab.net/viewvc/svn/trunk/TODO-1.5-branch?pathrev=28143&r1=28142&r2=28143
> ==============================================================================
> --- trunk/TODO-1.5-branch (original)
> +++ trunk/TODO-1.5-branch Thu Nov 29 09:28:45 2007
> @@ -9,10 +9,6 @@
> * Improving the default revisions chosen for a revision-less merge.
> [cmpilato, estimate: 4 hours]
>
> - * Changing the default path for a source-less copy to be "myself", which
> - is the only value with is both consistent and reasonably explainable
> - to the average user. [cmpilato, estimate: 1 hour]
> -
> * Improving the svn_client_merge() API to actually do source-relatedness
> checks instead of just assuming the sources aren't related. (And if
> they *are* related, I'll probably just have it call
>
> Modified: trunk/subversion/svn/main.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svn/main.c?pathrev=28143&r1=28142&r2=28143
> ==============================================================================
> --- trunk/subversion/svn/main.c (original)
> +++ trunk/subversion/svn/main.c Thu Nov 29 09:28:45 2007
> @@ -544,9 +544,8 @@
> "\n"
> " 3. In the third form, SOURCE can be a URL, or working copy item\n"
> " in which case the corresponding URL is used. If not specified,\n"
> - " the copy source URL of SOURCE is used. If the WCPATH cannot be\n"
> - " determined automatically, an error is displayed asking for an\n"
> - " explicit SOURCE. This URL in revision REV is compared as it\n"
> + " SOURCE will be the same as WCPATH (see below regarding the way\n"
> + " WCPATH is determined). SOURCE in revision REV is compared as it\n"
> " existed between revisions N and M. If REV is not specified, HEAD\n"
> " is assumed. '-c M' is equivalent to '-r <M-1>:M', and '-c -M'\n"
> " does the reverse: '-r M:<M-1>'. If neither N nor M is specified,\n"
>
> Modified: trunk/subversion/svn/merge-cmd.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svn/merge-cmd.c?pathrev=28143&r1=28142&r2=28143
> ==============================================================================
> --- trunk/subversion/svn/merge-cmd.c (original)
> +++ trunk/subversion/svn/merge-cmd.c Thu Nov 29 09:28:45 2007
> @@ -208,24 +208,7 @@
> if (using_rev_range_syntax)
> {
> if (! sourcepath1)
> - {
> - /* If a merge source was not specified, try to derive it. */
> - apr_array_header_t *suggested_sources;
> - svn_opt_revision_t working_rev;
> - working_rev.kind = svn_opt_revision_working;
> -
> - SVN_ERR(svn_client_suggest_merge_sources(&suggested_sources,
> - targetpath, &working_rev,
> - ctx, pool));
> - if (! suggested_sources->nelts)
> - return svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
> - _("Unable to determine merge source for "
> - "'%s' -- please provide an explicit "
> - "source"),
> - svn_path_local_style(targetpath, pool));
> - sourcepath1 = APR_ARRAY_IDX(suggested_sources, 0, const char *);
> - }
> -
> + sourcepath1 = targetpath;
> err = svn_client_merge_peg3(sourcepath1,
> opt_state->revision_ranges,
> &peg_revision1,
>
> Modified: trunk/subversion/tests/cmdline/merge_tests.py
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/tests/cmdline/merge_tests.py?pathrev=28143&r1=28142&r2=28143
> ==============================================================================
> --- trunk/subversion/tests/cmdline/merge_tests.py (original)
> +++ trunk/subversion/tests/cmdline/merge_tests.py Thu Nov 29 09:28:45 2007
> @@ -5358,6 +5358,7 @@
> wc_dir = sbox.wc_dir
>
> # Some paths we'll care about
> + A_url = sbox.repo_url + '/A'
> A_COPY_path = os.path.join(wc_dir, "A_COPY")
> D_COPY_path = os.path.join(wc_dir, "A_COPY", "D")
> A_COPY_rho_path = os.path.join(wc_dir, "A_COPY", "D", "G", "rho")
> @@ -5368,12 +5369,10 @@
> saved_cwd = os.getcwd()
>
> os.chdir(A_COPY_path)
> - # Use run_and_verify_svn rather than run_and_verify_merge so we
> - # can test the implied merge source functionality.
> svntest.actions.run_and_verify_svn(None,
> expected_merge_output([[4]], 'U ' +
> os.path.join("D", "G", "rho") + '\n'),
> - [], 'merge', '-c4')
> + [], 'merge', '-c4', A_url)
> os.chdir(saved_cwd)
>
> # Check the results of the merge.
> @@ -6640,59 +6639,6 @@
> '/A_COPY/D/H/omega:3\n'], [],
> 'pl', '-vR', other_omega_path)
>
> -def detect_copy_src_for_target_with_multiple_ancestors(sbox):
> - "detect copy src for target with multiple ancestors"
> -
> - # This tests that copy source detection is correct in the case where
> - # many ancestors of a target exist in the same commit as a copy of target.
> -
> - # Copy A/B as A/copy-of-B
> - # Copy A/C as A/copy-of-B/C
> - # Commit results in r2.
> - # From A/copy-of-B/C do merge. This merge should implicitly detect the
> - # merge source to be A/C.
> -
> - sbox.build()
> - wc_dir = sbox.wc_dir
> - A_path = os.path.join(wc_dir, 'A')
> - A_B_path = os.path.join(A_path, 'B')
> - A_C_path = os.path.join(A_path, 'C')
> - A_copy_of_B_path = os.path.join(A_path, 'copy-of-B')
> - A_copy_of_B_C_path = os.path.join(A_copy_of_B_path, 'C')
> - svntest.main.run_svn(None, 'cp', A_B_path, A_copy_of_B_path)
> - svntest.main.run_svn(None, 'cp', A_C_path, A_copy_of_B_path)
> - expected_output = wc.State(wc_dir, {
> - 'A/copy-of-B' : Item(verb='Adding'),
> - 'A/copy-of-B/C' : Item(verb='Adding')
> - })
> - expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
> - expected_status.add({
> - 'A/copy-of-B' : Item(status=' ', wc_rev=2),
> - 'A/copy-of-B/lambda' : Item(status=' ', wc_rev=2),
> - 'A/copy-of-B/E' : Item(status=' ', wc_rev=2),
> - 'A/copy-of-B/E/alpha' : Item(status=' ', wc_rev=2),
> - 'A/copy-of-B/E/beta' : Item(status=' ', wc_rev=2),
> - 'A/copy-of-B/F' : Item(status=' ', wc_rev=2),
> - 'A/copy-of-B/C' : Item(status=' ', wc_rev=2),
> - })
> -
> - svntest.actions.run_and_verify_commit(wc_dir, expected_output,
> - expected_status, None,
> - None, None, None, None, wc_dir)
> - saved_cwd = os.getcwd()
> - os.chdir(A_copy_of_B_C_path)
> - # Use --record-only to force the setting of mergeinfo since this is
> - # a no-op merge.
> - svntest.actions.run_and_verify_svn(None, [],
> - [], 'merge', '--record-only')
> - os.chdir(saved_cwd)
> -
> - expected_status.tweak('A/copy-of-B/C', status=' M')
> - svntest.actions.run_and_verify_status(wc_dir, expected_status)
> - svntest.actions.run_and_verify_svn(None, ["/A/C:2\n"], [],
> - 'propget', SVN_PROP_MERGE_INFO,
> - A_copy_of_B_C_path)
> -
> def prop_add_to_child_with_mergeinfo(sbox):
> "merge adding prop to child of merge target works"
>
> @@ -9748,7 +9694,6 @@
> merge_with_implicit_target_file,
> SkipUnless(empty_rev_range_mergeinfo,
> server_has_mergeinfo),
> - detect_copy_src_for_target_with_multiple_ancestors,
> prop_add_to_child_with_mergeinfo,
> diff_repos_does_not_update_mergeinfo,
> XFail(avoid_reflected_revs),

  • application/pgp-signature attachment: stored
Received on Fri Nov 30 19:28:43 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.