[prev in list] [next in list] [prev in thread] [next in thread] 

List:       subversion-cvs
Subject:    
From:       kameshj () tigris ! org
Date:       2007-11-30 15:43:58
Message-ID: 200711301543.lAUFhwkp001782 () svn2 ! sjc ! collab ! net
[Download RAW message or body]

Author: kameshj
Date: Fri Nov 30 07:43:57 2007
New Revision: 28162

Log:
On the issue-2897 branch:
Make commit-revs-for-merge-ranges RA call to accept merge_target and 
merge_source relative to ra_session's url.
With this fix merge_tests-56 won't go for infinite excursion and hence PASS.

* subversion/libsvn_ra/ra_loader.c
  (svn_ra_get_commit_revs_for_merge_ranges): Assert merge_target and 
   merge_source not to be absolute.

* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__get_commit_revs_for_merge_ranges): Convert relative 
   merge_target and merge_source to absolute paths and cascade to 
   svn_repos_get_commit_revs_for_merge_ranges.

* subversion/mod_dav_svn/reports/mergeinfo.c
  (dav_svn__get_commit_revs_for_merge_ranges_report): Small stylistic tweaks.
   Output mergeinfo-item with corresponding target path in relative form and
   the each mergeinfo with path being in relative form.

* subversion/svnserve/serve.c
  (get_commit_revs_for_merge_ranges): Small stylistic tweaks.
   Convert relative merge_target and merge_source to absolute paths and
   cascade to svn_repos_get_commit_revs_for_merge_ranges.

* subversion/libsvn_client/merge.c
  (filter_reflected_revisions): Call svn_ra_get_commit_revs_for_merge_ranges
   with relative merge_source i.e mergeinfo_path + 1.


Modified:
   branches/issue-2897/subversion/libsvn_client/merge.c
   branches/issue-2897/subversion/libsvn_ra/ra_loader.c
   branches/issue-2897/subversion/libsvn_ra_local/ra_plugin.c
   branches/issue-2897/subversion/mod_dav_svn/reports/mergeinfo.c
   branches/issue-2897/subversion/svnserve/serve.c

Modified: branches/issue-2897/subversion/libsvn_client/merge.c
URL: http://svn.collab.net/viewvc/svn/branches/issue-2897/subversion/libsvn_client/merge.c?pathrev=28162&r1=28161&r2=28162
 ==============================================================================
--- branches/issue-2897/subversion/libsvn_client/merge.c	(original)
+++ branches/issue-2897/subversion/libsvn_client/merge.c	Fri Nov 30 07:43:57 2007
@@ -1270,9 +1270,15 @@
       src_rangelist_for_tgt = apr_hash_get(added_mergeinfo, mergeinfo_path,
                                            APR_HASH_KEY_STRING);
       if (src_rangelist_for_tgt && src_rangelist_for_tgt->nelts)
+        /* mergeinfo_path has leading '/' (See 
+           svn_client__path_relative_to_root is called with 
+           include_leading_slash being TRUE), for ra calls we need to give 
+           paths relative to ra_session url. So pass mergeinfo_path+1 for 
+           merge_source for 'svn_ra_get_commit_revs_for_merge_ranges' call */
         SVN_ERR(svn_ra_get_commit_revs_for_merge_ranges(ra_session,
                                                   &reflected_rangelist_for_tgt,
-                                                  max_rel_path, mergeinfo_path,
+                                                  max_rel_path, 
+                                                  mergeinfo_path + 1,
                                                   min_rev, max_rev,
                                                   src_rangelist_for_tgt,
                                                   svn_mergeinfo_inherited,

Modified: branches/issue-2897/subversion/libsvn_ra/ra_loader.c
URL: http://svn.collab.net/viewvc/svn/branches/issue-2897/subversion/libsvn_ra/ra_loader.c?pathrev=28162&r1=28161&r2=28162
 ==============================================================================
--- branches/issue-2897/subversion/libsvn_ra/ra_loader.c	(original)
+++ branches/issue-2897/subversion/libsvn_ra/ra_loader.c	Fri Nov 30 07:43:57 2007
@@ -683,6 +683,8 @@
                                      svn_mergeinfo_inheritance_t inherit,
                                      apr_pool_t *pool)
 {
+  assert(*merge_target != '/');
+  assert(*merge_source != '/');
   return session->vtable->get_commit_revs_for_merge_ranges(session,
                                             commit_rev_rangelist, merge_target,
                                             merge_source, min_commit_rev,

Modified: branches/issue-2897/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.collab.net/viewvc/svn/branches/issue-2897/subversion/libsvn_ra_local/ra_plugin.c?pathrev=28162&r1=28161&r2=28162
 ==============================================================================
--- branches/issue-2897/subversion/libsvn_ra_local/ra_plugin.c	(original)
+++ branches/issue-2897/subversion/libsvn_ra_local/ra_plugin.c	Fri Nov 30 07:43:57 \
2007 @@ -712,9 +712,14 @@
                                     apr_pool_t *pool)
 {
   svn_ra_local__session_baton_t *sess = session->priv;
+  const char *merge_target_abs_path = svn_path_join(sess->fs_path->data,
+                                                    merge_target, pool);
+  const char *merge_source_abs_path = svn_path_join(sess->fs_path->data,
+                                                    merge_source, pool);
   SVN_ERR(svn_repos_get_commit_revs_for_merge_ranges(commit_rev_range_list,
-                                                     sess->repos, merge_target,
-                                                     merge_source,
+                                                     sess->repos,
+                                                     merge_target_abs_path,
+                                                     merge_source_abs_path,
                                                      min_commit_rev,
                                                      max_commit_rev,
                                                      merge_rangelist,

Modified: branches/issue-2897/subversion/mod_dav_svn/reports/mergeinfo.c
URL: http://svn.collab.net/viewvc/svn/branches/issue-2897/subversion/mod_dav_svn/reports/mergeinfo.c?pathrev=28162&r1=28161&r2=28162
 ==============================================================================
--- branches/issue-2897/subversion/mod_dav_svn/reports/mergeinfo.c	(original)
+++ branches/issue-2897/subversion/mod_dav_svn/reports/mergeinfo.c	Fri Nov 30 \
07:43:57 2007 @@ -216,9 +216,10 @@
   /* These get determined from the request document. */
   svn_revnum_t max_commit_rev = SVN_INVALID_REVNUM;
   svn_revnum_t min_commit_rev = SVN_INVALID_REVNUM;
-  const char* merge_target = NULL;
-  const char* merge_source = NULL;
+  const char *merge_target = NULL;
+  const char *merge_source = NULL;
   const char *merge_ranges_string = NULL;
+  const char *merge_target_relative_to_repos_path;
   apr_array_header_t *merge_rangelist;
   /* By default look for explicit mergeinfo only. */
   svn_mergeinfo_inheritance_t inherit = svn_mergeinfo_explicit;
@@ -350,9 +351,8 @@
                                   resource->pool);
       goto cleanup;
     }
-
-  apr_hash_set(mergeinfo, merge_source, APR_HASH_KEY_STRING, 
-               commit_rev_range_list);
+  apr_hash_set(mergeinfo, merge_source + strlen(resource->info->repos_path), 
+               APR_HASH_KEY_STRING, commit_rev_range_list);
   serr = svn_mergeinfo_to_stringbuf(&commit_rev_mergeinfo, mergeinfo,
                                     resource->pool);
   /* ### Same error-handling code appears elsewhere.  -Karl */
@@ -363,9 +363,11 @@
       goto cleanup;
     }
 
+  merge_target_relative_to_repos_path = merge_target 
+                                          + strlen(resource->info->repos_path);
   serr = dav_svn__send_xml(bb, output, itemformat,
                            apr_xml_quote_string(resource->pool,
-                                                merge_target, 0),
+                                       merge_target_relative_to_repos_path, 0),
                            apr_xml_quote_string(resource->pool,
                                                 commit_rev_mergeinfo->data,
                                                 0));

Modified: branches/issue-2897/subversion/svnserve/serve.c
URL: http://svn.collab.net/viewvc/svn/branches/issue-2897/subversion/svnserve/serve.c?pathrev=28162&r1=28161&r2=28162
 ==============================================================================
--- branches/issue-2897/subversion/svnserve/serve.c	(original)
+++ branches/issue-2897/subversion/svnserve/serve.c	Fri Nov 30 07:43:57 2007
@@ -1536,8 +1536,10 @@
   const char *inherit_word;
   svn_revnum_t max_commit_rev = SVN_INVALID_REVNUM;
   svn_revnum_t min_commit_rev = SVN_INVALID_REVNUM;
-  const char* merge_target = NULL;
-  const char* merge_source = NULL;
+  const char *merge_target = NULL;
+  const char *merge_source = NULL;
+  const char *merge_target_abs_path = NULL;
+  const char *merge_source_abs_path = NULL;
   const char *merge_ranges_string = NULL;
   apr_array_header_t *merge_rangelist;
   svn_mergeinfo_inheritance_t inherit;
@@ -1548,11 +1550,13 @@
                                  &merge_source, &min_commit_rev,
                                  &max_commit_rev, &merge_ranges_string,
                                  &inherit_word));
-  inherit = svn_inheritance_from_word(inherit_word);
-
   /* Canonicalize the paths. */
   merge_target = svn_path_canonicalize(merge_target, pool);
   merge_source = svn_path_canonicalize(merge_source, pool);
+  merge_target_abs_path = svn_path_join(b->fs_path->data, merge_target, pool);
+  merge_source_abs_path = svn_path_join(b->fs_path->data, merge_source, pool);
+  inherit = svn_inheritance_from_word(inherit_word);
+
   {
     /* We lack svn_rangelist_parse, so creating a dummy mergeinfo 
        and parse with the help of svn_mergeinfo_parse. */
@@ -1567,14 +1571,19 @@
   SVN_ERR(trivial_auth_request(conn, pool, b));
   SVN_CMD_ERR(svn_repos_get_commit_revs_for_merge_ranges(
                                                 &commit_rev_range_list,
-                                                b->repos, merge_target,
-                                                merge_source,
+                                                b->repos, 
+                                                merge_target_abs_path,
+                                                merge_source_abs_path,
                                                 min_commit_rev,
                                                 max_commit_rev,
                                                 merge_rangelist,
                                                 inherit,
                                                 authz_check_access_cb_func(b),
                                                 b, pool));
+  /* When we hand back the stuff to client we should give back the 
+   * mergeinfo hash with path being relative to ra_session.
+   * ### TODO If at all svn_rangelist_parse exists we can remove this kludge.
+   */
   apr_hash_set(mergeinfo, merge_source, APR_HASH_KEY_STRING,
                commit_rev_range_list);
   SVN_ERR(svn_mergeinfo_to_stringbuf(&commit_rev_mergeinfo, mergeinfo, pool));

---------------------------------------------------------------------
To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
For additional commands, e-mail: svn-help@subversion.tigris.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic