You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2018/06/20 19:19:52 UTC

svn commit: r1833937 - in /subversion/trunk/subversion/svn: shelf-cmd.c svn.c

Author: philip
Date: Wed Jun 20 19:19:52 2018
New Revision: 1833937

URL: http://svn.apache.org/viewvc?rev=1833937&view=rev
Log:
Allow "svn x-shelf-drop" from outside the working copy.

* subversion/svn/shelf-cmd.c
  (svn_cl__shelf_drop): Accept path arguments, supply default '.' path.

* subversion/svn/svn.c
  (svn_cl__cmd_table): Update help text.

Modified:
    subversion/trunk/subversion/svn/shelf-cmd.c
    subversion/trunk/subversion/svn/svn.c

Modified: subversion/trunk/subversion/svn/shelf-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/shelf-cmd.c?rev=1833937&r1=1833936&r2=1833937&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelf-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelf-cmd.c Wed Jun 20 19:19:52 2018
@@ -1068,18 +1068,28 @@ svn_cl__shelf_drop(apr_getopt_t *os,
   svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
   const char *name;
-  const char *local_abspath;
+  apr_array_header_t *targets = NULL;
+  apr_pool_t *iterpool = svn_pool_create(pool);
+  int i;
 
   SVN_ERR(get_next_argument(&name, os, pool, pool));
 
-  /* There should be no remaining arguments. */
-  if (os->ind < os->argc)
-    return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL);
-
-  SVN_ERR(svn_dirent_get_absolute(&local_abspath, "", pool));
-  SVN_ERR(shelf_drop(name, local_abspath,
-                     opt_state->dry_run, opt_state->quiet,
-                     ctx, pool));
+  SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
+                                                      opt_state->targets,
+                                                      ctx, FALSE, pool));
+  svn_opt_push_implicit_dot_target(targets, pool);
+
+  for (i = 0; i < targets->nelts; ++i)
+    {
+      const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+      svn_pool_clear(iterpool);
+      SVN_ERR(shelf_drop(name, target,
+                         opt_state->dry_run, opt_state->quiet,
+                         ctx, iterpool));
+    }
+
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1833937&r1=1833936&r2=1833937&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Wed Jun 20 19:19:52 2018
@@ -1962,9 +1962,10 @@ const svn_opt_subcommand_desc3_t svn_cl_
 
   { "x-shelf-drop", svn_cl__shelf_drop, {"shelf-drop"}, {N_(
      "Delete a shelf.\n"
-     "usage: x-shelf-drop SHELF\n"
+     "usage: x-shelf-drop SHELF [PATH ...]\n"
      "\n"), N_(
-     "  Delete the shelf named SHELF.\n"
+     "  Delete the shelves named SHELF from the working copies containing PATH\n"
+     "  (default PATH is '.')\n"
      "\n"), N_(
      "  The shelving feature is EXPERIMENTAL. This command is likely to change\n"
      "  in the next release, and there is no promise of backward compatibility.\n"