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

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

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-11-29 23:49:15 CET

On Wed, 22 Nov 2006, Kamesh Jayachandran wrote:

> 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').

I've committed this portion of the patch to the branch in r22509.

> * 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.
...
> 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, "!))"));
> }

I think this portion of the patch needs to be accompanied by changes
to the protocol document.

  • application/pgp-signature attachment: stored
Received on Wed Nov 29 23:50:38 2006

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.