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

[PATCH][merge-tracking] svn repos to repos copy fails with vague error over ra_svn

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-11-22 09:54:31 CET

Hi All,
Find the attached patch and log.

With regards
Kamesh Jayachandran

[[[

 svn cp svn://host/path1 svn://host/path2
 Fails with vague error message "Unknown command 'Log'".
 There are some logical errors in the 'get-merge-info' network protocol
 between 'svn' and 'svnserve'.

* subversion/libsvn_client/copy.c
  (repos_to_repos_copy):
   'svnserve' gets confused when 'readonly actions' like 'log',
   'get-merge-info' are invoked over a ra_session with a active commit_editor.
    So move the 'log' and 'get_merge_info' actions ahead of
    acquiring commit_editor.(i.e move 'calculate_target_merge_info'
    ahead of 'svn_ra_get_commit_editor2').

* subversion/svnserve/serve.c
  (get_merge_info):
   The incoming 'paths' tuple is an array of 'svn_ra_svn_item_t' and each
   item should be of kind 'SVN_RA_SVN_STRING'.
   The result is again a list of (path mergeinfo) tuple.

Patch by: Kamesh Jayachandran <kamesh@collab.net>
]]]

Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 22389)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -525,6 +525,8 @@
     message = "";
 
 
+ SVN_ERR(calculate_target_merge_info(ra_session, &(cb_baton.mergeinfo),
+ src_url, src_rel, src_revnum, pool));
   /* Fetch RA commit editor. */
   SVN_ERR(svn_client__commit_get_baton(&commit_baton, commit_info_p, pool));
   SVN_ERR(svn_ra_get_commit_editor2(ra_session, &editor, &edit_baton,
@@ -549,8 +551,6 @@
   cb_baton.is_move = is_move;
   cb_baton.src_revnum = src_revnum;
   cb_baton.resurrection = resurrection;
- SVN_ERR(calculate_target_merge_info(ra_session, &(cb_baton.mergeinfo),
- src_url, src_rel, src_revnum, pool));
 
   /* Call the path-based editor driver. */
   err = svn_delta_path_driver(editor, edit_baton, youngest, paths,
Index: subversion/svnserve/serve.c
===================================================================
--- subversion/svnserve/serve.c (revision 22389)
+++ subversion/svnserve/serve.c (working copy)
@@ -1354,8 +1354,15 @@
   SVN_ERR(svn_ra_svn_parse_tuple(params, pool, "l(?r)b", &paths, &rev,
                                  &include_parents));
   for (i = 0; i < paths->nelts; i++)
- APR_ARRAY_IDX(paths, i, const char *) =
- svn_path_canonicalize(APR_ARRAY_IDX(paths, i, const char *), pool);
+ {
+ svn_ra_svn_item_t *item = &APR_ARRAY_IDX(paths, i, svn_ra_svn_item_t);
+
+ if (item->kind != SVN_RA_SVN_STRING)
+ return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
+ _("path is not a string"));
+ APR_ARRAY_IDX(paths, i, const char *) =
+ svn_path_canonicalize(item->u.string->data, pool);
+ }
   SVN_ERR(trivial_auth_request(conn, pool, b));
   SVN_CMD_ERR(svn_repos_fs_get_merge_info(&mergeinfo, b->repos, paths, rev,
                                           include_parents,
@@ -1372,7 +1379,7 @@
           apr_hash_this(hi, &key, NULL, &value);
           path = key;
           info = value;
- SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cc", path, info));
+ SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "(cc)", path, info));
         }
       SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!))"));
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 22 09:54:51 2006

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