|
svn commit: r13121 - in trunk/subversion: clients/cmdline include libsvn_cl: msg#00290version-control.subversion.svn
Author: kfogel Date: Tue Feb 22 16:35:08 2005 New Revision: 13121 Modified: trunk/subversion/clients/cmdline/export-cmd.c trunk/subversion/clients/cmdline/main.c trunk/subversion/include/svn_client.h trunk/subversion/libsvn_client/export.c trunk/subversion/libsvn_client/externals.c Log: Add --non-recursive/-N option to "svn export". Patch by Daniel Patterson <danpat-YD1psRxBmw2sTnJN9+BGXg@xxxxxxxxxxxxxxxx>, from issue #2228. * subversion/libsvn_client/export.c: (svn_client_export3): Add new "recursive" parameter that gets passed through to svn_ra_do_update. Also, if exporting from a working copy, pass the recursive flag through to copy_versioned_files (which has been updated), see below. Also also, if recurse is FALSE, we do not follow externals (i.e. the behaviour is the same as setting ignore_externals to TRUE). (svn_client_export2): Default to passing TRUE for new "recurse" parameter (copy_versioned_files): Add a "recurse" parameter and only do a recursive copy if it's TRUE. * subversion/include/svn_client.h: (svn_client_export3): Update public API to include new "recurse" 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/-N 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 Modified: trunk/subversion/clients/cmdline/export-cmd.c Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/clients/cmdline/export-cmd.c?view=diff&rev=13121&p1=trunk/subversion/clients/cmdline/export-cmd.c&r1=13120&p2=trunk/subversion/clients/cmdline/export-cmd.c&r2=13121 ============================================================================== --- trunk/subversion/clients/cmdline/export-cmd.c (original) +++ trunk/subversion/clients/cmdline/export-cmd.c Tue Feb 22 16:35:08 2005 @@ -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) Modified: trunk/subversion/clients/cmdline/main.c Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/clients/cmdline/main.c?view=diff&rev=13121&p1=trunk/subversion/clients/cmdline/main.c&r1=13120&p2=trunk/subversion/clients/cmdline/main.c&r2=13121 ============================================================================== --- trunk/subversion/clients/cmdline/main.c (original) +++ trunk/subversion/clients/cmdline/main.c Tue Feb 22 16:35:08 2005 @@ -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} }, Modified: trunk/subversion/include/svn_client.h Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/include/svn_client.h?view=diff&rev=13121&p1=trunk/subversion/include/svn_client.h&r1=13120&p2=trunk/subversion/include/svn_client.h&r2=13121 ============================================================================== --- trunk/subversion/include/svn_client.h (original) +++ trunk/subversion/include/svn_client.h Tue Feb 22 16:35:08 2005 @@ -1588,6 +1588,12 @@ * will use the standard eol marker. Any other value will cause the * SVN_ERR_IO_UNKNOWN_EOL error to be returned. * + * If @a recurse is TRUE, export recursively. Otherwise, export + * just the directory represented by @a from and its immediate + * non-directory children, but none of its child directories (if any). + * Also, if @a recurse is FALSE, the export will behave as if + * @a ignore_externals is TRUE. + * * All allocations are done in @a pool. */ svn_error_t * @@ -1598,6 +1604,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); Modified: trunk/subversion/libsvn_client/export.c Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_client/export.c?view=diff&rev=13121&p1=trunk/subversion/libsvn_client/export.c&r1=13120&p2=trunk/subversion/libsvn_client/export.c&r2=13121 ============================================================================== --- trunk/subversion/libsvn_client/export.c (original) +++ trunk/subversion/libsvn_client/export.c Tue Feb 22 16:35:08 2005 @@ -214,6 +214,7 @@ const char *to, svn_opt_revision_t *revision, svn_boolean_t force, + svn_boolean_t recurse, const char *native_eol, svn_client_ctx_t *ctx, apr_pool_t *pool) @@ -301,12 +302,17 @@ } else { - const char *new_from = svn_path_join (from, item, iterpool); - const char *new_to = svn_path_join (to, item, iterpool); + if (recurse) + { + const char *new_from = svn_path_join (from, item, + iterpool); + const char *new_to = svn_path_join (to, item, iterpool); - SVN_ERR (copy_versioned_files (new_from, new_to, revision, - force, native_eol, ctx, - iterpool)); + SVN_ERR (copy_versioned_files (new_from, new_to, + revision, force, recurse, + native_eol, ctx, + iterpool)); + } } } else if (*type == svn_node_file) @@ -745,6 +751,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) @@ -852,7 +859,7 @@ &reporter, &report_baton, revnum, "", /* no sub-target */ - TRUE, /* recurse */ + recurse, export_editor, edit_baton, pool)); SVN_ERR (reporter->set_path (report_baton, "", revnum, @@ -876,7 +883,7 @@ SVN_ERR (open_root_internal (to, force, ctx->notify_func, ctx->notify_baton, pool)); - if (! ignore_externals) + if (! ignore_externals && recurse) SVN_ERR (svn_client__fetch_externals (eb->externals, TRUE, &use_sleep, ctx, pool)); } @@ -894,7 +901,7 @@ /* just copy the contents of the working copy into the target path. */ SVN_ERR (copy_versioned_files (from, to, &working_revision, force, - native_eol, ctx, pool)); + recurse, native_eol, ctx, pool)); } @@ -930,7 +937,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); } Modified: trunk/subversion/libsvn_client/externals.c Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_client/externals.c?view=diff&rev=13121&p1=trunk/subversion/libsvn_client/externals.c&r1=13120&p2=trunk/subversion/libsvn_client/externals.c&r2=13121 ============================================================================== --- trunk/subversion/libsvn_client/externals.c (original) +++ trunk/subversion/libsvn_client/externals.c Tue Feb 22 16:35:08 2005 @@ -245,7 +245,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), |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r13120 - trunk: 00290, kfogel-jqHnx1hy4Dsdnm+yROfE0A |
|---|---|
| Next by Date: | svn commit: r13122 - trunk/notes: 00290, breser-jqHnx1hy4Dsdnm+yROfE0A |
| Previous by Thread: | svn commit: r13120 - trunki: 00290, kfogel-jqHnx1hy4Dsdnm+yROfE0A |
| Next by Thread: | svn commit: r13122 - trunk/notes: 00290, breser-jqHnx1hy4Dsdnm+yROfE0A |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |