On Thu, Apr 15, 2010 at 2:25 PM, C. Michael Pilato <cmpil...@collab.net> wrote: > Roderich Schupp wrote: >> On Tue, Apr 13, 2010 at 4:37 PM, C. Michael Pilato <cmpil...@collab.net> >> wrote: > Cool. I'll watch for your followup posts, and be glad to try to answer any > questions you might have about the code.
OK, here's my patch for merge_reintegrate_locked. Passes all regression tests (over local and HTTP transport). So if we try to svn merge --reintegrate SOME-URL ANOTHER-WC where ANOTHER-WC is from a different repository than SOME-URL if would previously fail with svn: URL 'SOME-URL' is not a child of repository root URL 'ANOTHER-URL' (where ANOTHER-URL is the URL of the repos root of ANOTHER-WC) and now it fails with the much clearer svn: 'SOME-URL' must be from the same repository as 'ANOTHER-WC' However, that doesn't address the fact that this is probably another case where a session is indiscriminantly opened at the repository root (the root cause of issue 3242). So perhaps a "fixme" comment should be added as well. [[[ Fix check in "merge --reintegrate" whether merge source and working copy target belong to the same repository. * subversion/libsvn_client/merge.c (merge_reintegrate_locked) Correctly compute the repos root URL for the merge source. ]]] Cheers, Roderich
Index: subversion/libsvn_client/merge.c =================================================================== --- subversion/libsvn_client/merge.c (revision 934218) +++ subversion/libsvn_client/merge.c (working copy) @@ -9560,12 +9560,10 @@ &working_revision, ctx, scratch_pool, scratch_pool)); - /* Open an RA session to our source URL, and determine its root URL. */ - SVN_ERR(svn_client__open_ra_session_internal(&ra_session, wc_repos_root, - NULL, NULL, - FALSE, FALSE, ctx, - scratch_pool)); - SVN_ERR(svn_ra_get_repos_root2(ra_session, &source_repos_root, scratch_pool)); + /* Determine the source's repository root URL. */ + SVN_ERR(svn_client__get_repos_root(&source_repos_root, url2, + peg_revision, ctx, + scratch_pool, scratch_pool)); /* source_repos_root and wc_repos_root are required to be the same, as mergeinfo doesn't come into play for cross-repository merging. */ @@ -9577,6 +9575,13 @@ svn_dirent_local_style(target_abspath, scratch_pool)); + /* Open an RA session to our (common) repository root URL */ + SVN_ERR(svn_client__open_ra_session_internal(&ra_session, wc_repos_root, + NULL, NULL, + FALSE, FALSE, ctx, + scratch_pool)); + + SVN_ERR(ensure_wc_reflects_repository_subtree(target_abspath, ctx, scratch_pool)); SVN_ERR(svn_wc__node_get_base_rev(&target_base_rev, ctx->wc_ctx,