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

Re: (resend) [rfc/patch] : #933,#735 import syntax, mkdir -p

From: <cmpilato_at_collab.net>
Date: 2003-06-11 08:07:39 CEST

David Kimdon <dwhedon@debian.org> writes:

> Index: subversion/libsvn_client/commit.c
> ===================================================================
> --- subversion/libsvn_client/commit.c (revision 6178)
> +++ subversion/libsvn_client/commit.c (working copy)

[...]

> @@ -550,18 +583,71 @@
> {
> svn_node_kind_t kind;
> const char *base_dir = path;
> + apr_array_header_t *dirs = NULL;
> + const char *temp;
> + const char *dir;
>
> SVN_ERR (svn_io_check_path (path, &kind, pool));
> if (kind == svn_node_file)
> svn_path_split (path, &base_dir, NULL, pool);
>
> - SVN_ERR (get_ra_editor (&ra_baton, &session, &ra_lib, NULL,
> - &editor, &edit_baton, ctx, url, base_dir,
> - NULL, log_msg, NULL, &committed_rev,
> - &committed_date, &committed_author,
> - FALSE, pool));
> + err = NULL;
> +
> + do
> + {
> + if (err)
> + {
> + /* If get_ra_editor below failed we either tried to open
> + * an invalid url, or else some other kind of error. In case
> + * the url was bad we back up a directory and try again. */
> +
> + if (err->apr_err != SVN_ERR_FS_NO_SUCH_ENTRY)
> + return err;
> +
> + if (!dirs)
> + dirs = apr_array_make (pool, 1, sizeof(const char *));
> +
> + svn_path_split (url, &temp, &dir, pool);
> + *((const char **)apr_array_push (dirs)) = dir;
> + url = temp;
> + }
> + }
> + while ((err = get_ra_editor (&ra_baton, &session, &ra_lib, NULL,
> + &editor, &edit_baton, ctx, url, base_dir,
> + NULL, log_msg, NULL, &committed_rev,
> + &committed_date, &committed_author,
> + FALSE, pool)));

Ah. Now I see why the RA->check_path() was used only once. Man, to
tell you the truth, I hate this inelegance of this -- but, I also feel
like this is the only real way to solve the problem. One thing I'd
like to see is the use of a subpool for trying out all these
connections. By clearing the subpool after each failure, you are
shutting down the defunct RA session and all the sludge associated
with it.

> Index: subversion/tests/clients/cmdline/basic_tests.py
> ===================================================================
> --- subversion/tests/clients/cmdline/basic_tests.py (revision 6178)
> +++ subversion/tests/clients/cmdline/basic_tests.py (working copy)

> # Create expected status tree for the update (disregarding props).
> # Newly imported file should be at revision 2.
> expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
> expected_status.add({
> - 'new_file' : Item(status=' ', wc_rev=2, repos_rev=2),
> + 'dirA' : Item(status=' ', wc_rev=2, repos_rev=2),
> + 'dirA/dirB' : Item(status=' ', wc_rev=2, repos_rev=2),
> + 'dirA/dirB//new_file' : Item(status=' ', wc_rev=2, repos_rev=2),

Oops. ----------^ Double-slash in there.

I haven't applied your patch for real testing. But the above comments
are based on a quick read-thru. I'd be happy to test a revised patch
once you submit one.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jun 11 08:08:45 2003

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.