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

Re: [PATCH] Add "--non-recursive" flag for export

From: <kfogel_at_collab.net>
Date: 2005-02-20 01:40:47 CET

Thanks for the new patch.

There's a bug, though: when you do an export from a working copy
(instead of from a URL), the new -N flag is just ignored. It should
have the same effect when the source is a working copy as when the
source is a URL.

-Karl

Daniel Patterson <danpat@danpat.net> writes:
> kfogel@collab.net wrote:
> Ah, I hadn't noticed that it was new for 1.2. I've re-done the change
> adding a parameter to svn_client_export3 (and updated svn_client.h)
> instead of a new function. Patch attached.
>
> I'm out of time today, but when I get a chance, I'll submit a patch
> for the regression tests (when I figure out how they fit together).
>
> [[[
> Add --non-recursive parameter to "svn export"
>
> * subversion/libsvn_client/export.c:
> (svn_client_export3): add new "recursive" parameter that
> gets passed through to svn_ra_do_update
> (svn_client_export2): default to passing TRUE for new
> "recurse" parameter
>
> * subversion/include/svn_client.h:
> (svn_client_export3): update public API to include new
> "recursive" parameter"
>
> * subversion/libsvn_client/externals.c:
> (handle_external_item_change): update call to
> svn_client_export3 to pass TRUE as the recursive value.
> When traversing externals, if we're doing a nonrecursive
> export, we should never get to this point, so TRUE should
> always be the case.
>
> * subversion/clients/cmdlind/export-cmd.c:
> (svn_cl__export): use updated svn_client_export3 function and pass
> inverse of --non-recursive command line through. Still defaults
> to the original behaviour of a recursive export.
>
> * subversion/clients/cmdline/main.c:
> (svn_cl__cmd_table[]): add "N" option to "export" command
> ]]]
> Index: subversion/include/svn_client.h
> ===================================================================
> --- subversion/include/svn_client.h (revision 13058)
> +++ subversion/include/svn_client.h (working copy)
> @@ -1568,6 +1568,9 @@
> * will use the standard eol marker. Any other value will cause the
> * SVN_ERR_IO_UNKNOWN_EOL error to be returned.
> *
> + * @a recurse passes through to svn_ra_do_update to make exports of
> + * directories recursive if TRUE.
> + *
> * All allocations are done in @a pool.
> */
> svn_error_t *
> @@ -1578,6 +1581,7 @@
> const svn_opt_revision_t *revision,
> svn_boolean_t force,
> svn_boolean_t ignore_externals,
> + svn_boolean_t recurse,
> const char *native_eol,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool);
> Index: subversion/libsvn_client/externals.c
> ===================================================================
> --- subversion/libsvn_client/externals.c (revision 13058)
> +++ subversion/libsvn_client/externals.c (working copy)
> @@ -244,7 +244,8 @@
> SVN_ERR (svn_client_export3 (NULL, new_item->url, path,
> &(new_item->revision),
> &(new_item->revision),
> - TRUE, FALSE, NULL, ib->ctx, ib->pool));
> + TRUE, FALSE, TRUE, NULL,
> + ib->ctx, ib->pool));
> else
> SVN_ERR (svn_client__checkout_internal (NULL, new_item->url, path,
> &(new_item->revision),
> Index: subversion/libsvn_client/export.c
> ===================================================================
> --- subversion/libsvn_client/export.c (revision 13058)
> +++ subversion/libsvn_client/export.c (working copy)
> @@ -744,6 +744,7 @@
> const svn_opt_revision_t *revision,
> svn_boolean_t force,
> svn_boolean_t ignore_externals,
> + svn_boolean_t recurse,
> const char *native_eol,
> svn_client_ctx_t *ctx,
> apr_pool_t *pool)
> @@ -851,7 +852,7 @@
> &reporter, &report_baton,
> revnum,
> "", /* no sub-target */
> - TRUE, /* recurse */
> + recurse, /* recurse */
> export_editor, edit_baton, pool));
>
> SVN_ERR (reporter->set_path (report_baton, "", revnum,
> @@ -929,7 +930,8 @@
> peg_revision.kind = svn_opt_revision_unspecified;
>
> return svn_client_export3 (result_rev, from, to, &peg_revision,
> - revision, force, FALSE, native_eol, ctx, pool);
> + revision, force, FALSE, TRUE,
> + native_eol, ctx, pool);
> }
>
>
> Index: subversion/clients/cmdline/export-cmd.c
> ===================================================================
> --- subversion/clients/cmdline/export-cmd.c (revision 13058)
> +++ subversion/clients/cmdline/export-cmd.c (working copy)
> @@ -74,6 +74,7 @@
> err = svn_client_export3 (NULL, truefrom, to, &peg_revision,
> &(opt_state->start_revision),
> opt_state->force, opt_state->ignore_externals,
> + opt_state->nonrecursive ? FALSE : TRUE,
> opt_state->native_eol, ctx,
> pool);
> if (err && err->apr_err == SVN_ERR_WC_OBSTRUCTED_UPDATE && !opt_state->force)
> Index: subversion/clients/cmdline/main.c
> ===================================================================
> --- subversion/clients/cmdline/main.c (revision 13058)
> +++ subversion/clients/cmdline/main.c (working copy)
> @@ -322,7 +322,7 @@
> " If specified, PEGREV determines in which revision the target is "
> "first\n"
> " looked up.\n"),
> - {'r', 'q', svn_cl__force_opt, SVN_CL__AUTH_OPTIONS,
> + {'r', 'q', 'N', svn_cl__force_opt, SVN_CL__AUTH_OPTIONS,
> svn_cl__config_dir_opt, svn_cl__native_eol_opt,
> svn_cl__ignore_externals_opt} },
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 20 01:58:09 2005

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.