You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/04/19 17:46:35 UTC

svn commit: r935631 - /subversion/trunk/subversion/libsvn_client/merge.c

Author: cmpilato
Date: Mon Apr 19 15:46:35 2010
New Revision: 935631

URL: http://svn.apache.org/viewvc?rev=935631&view=rev
Log:
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.  Add FIXME comment regarding possible
    unnecessary opening of an RA session at the repos root.

Patch by: Roderich Schupp <roderich.schupp{_AT_}googlemail.com>

Modified:
    subversion/trunk/subversion/libsvn_client/merge.c

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=935631&r1=935630&r2=935631&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Mon Apr 19 15:46:35 2010
@@ -9545,12 +9545,10 @@ merge_reintegrate_locked(const char *sou
                                      &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. */
@@ -9562,6 +9560,16 @@ merge_reintegrate_locked(const char *sou
                              svn_dirent_local_style(target_abspath,
                                                     scratch_pool));
 
+  /* Open an RA session to our (common) repository root URL */
+
+  /* ### FIXME: Oops!  Can we open this session to a more conservative
+     ### location, in case the user lacks read access at the
+     ### repository root? */
+  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,