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

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

From: Daniel Patterson <danpat_at_danpat.net>
Date: 2005-02-19 00:19:17 CET

Rowell, Geoff wrote:
> Really could have used this feature recently when developing packaging
> scripts.
>
>
>
> I'd like to be able to export a single directory, without any
> housekeeping information or lower-level directories.

   And here's a patch against trunk to do just that.

[[[
Add a --non-recursive option to "svn export"

* subversion/libsvn_client/export.c:
   (svn_client_export3): deprecate and call svn_client_export4,
   defaulting to old recursive behaviour.
   (svn_client_export4): add a "recursive" flag which gets passed
   through to svn_ra_do_update.

* subversion/clients/cmdlind/export-cmd.c:
   (svn_cl__export): use new svn_client_export4 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/libsvn_client/export.c
===================================================================
--- subversion/libsvn_client/export.c (revision 13057)
+++ subversion/libsvn_client/export.c (working copy)
@@ -737,13 +737,14 @@
 /*** Public Interfaces ***/
 
 svn_error_t *
-svn_client_export3 (svn_revnum_t *result_rev,
+svn_client_export4 (svn_revnum_t *result_rev,
                     const char *from,
                     const char *to,
                     const svn_opt_revision_t *peg_revision,
                     const svn_opt_revision_t *revision,
                     svn_boolean_t force,
                     svn_boolean_t ignore_externals,
+ svn_boolean_t recursive,
                     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 */
+ recursive, /* recurse */
                                       export_editor, edit_baton, pool));
 
           SVN_ERR (reporter->set_path (report_baton, "", revnum,
@@ -913,6 +914,22 @@
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_client_export3 (svn_revnum_t *result_rev,
+ const char *from,
+ const char *to,
+ const svn_opt_revision_t *peg_revision,
+ const svn_opt_revision_t *revision,
+ svn_boolean_t force,
+ svn_boolean_t ignore_externals,
+ const char *native_eol,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ return svn_client_export4 (result_rev, from, to, peg_revision,
+ revision, force, ignore_externals, TRUE,
+ native_eol, ctx, pool);
+}
 
 svn_error_t *
 svn_client_export2 (svn_revnum_t *result_rev,
Index: subversion/clients/cmdline/export-cmd.c
===================================================================
--- subversion/clients/cmdline/export-cmd.c (revision 13057)
+++ subversion/clients/cmdline/export-cmd.c (working copy)
@@ -71,9 +71,10 @@
                           FALSE, pool);
 
   /* Do the export. */
- err = svn_client_export3 (NULL, truefrom, to, &peg_revision,
+ err = svn_client_export4 (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 13057)
+++ 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 Sat Feb 19 00:21:18 2005

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