subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1834063 - in /subversion/trunk/subversion/svn: shelf-cmd.c svn.c
Date Thu, 21 Jun 2018 22:02:21 GMT
Author: philip
Date: Thu Jun 21 22:02:21 2018
New Revision: 1834063

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

* subversion/svn/shelf-cmd.c
  (svn_cl__shelf_log): 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=1834063&r1=1834062&r2=1834063&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelf-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelf-cmd.c Thu Jun 21 22:02:21 2018
@@ -1124,20 +1124,30 @@ svn_cl__shelf_log(apr_getopt_t *os,
                   void *baton,
                   apr_pool_t *pool)
 {
+  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,
-                            _("Too many arguments"));
-
-  SVN_ERR(svn_dirent_get_absolute(&local_abspath, "", pool));
-  SVN_ERR(shelf_log(name, local_abspath,
-                    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_log(name, target,
+                        ctx, pool));
+    }
+
+  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=1834063&r1=1834062&r2=1834063&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Thu Jun 21 22:02:21 2018
@@ -1999,9 +1999,10 @@ const svn_opt_subcommand_desc3_t svn_cl_
 
   { "x-shelf-log", svn_cl__shelf_log, {"shelf-log"}, {N_(
      "Show the versions of a shelf.\n"
-     "usage: x-shelf-log SHELF\n"
+     "usage: x-shelf-log SHELF [PATH...]\n"
      "\n"), N_(
-     "  Show all versions of SHELF.\n"
+     "  Show all versions of SHELF for each working copy containing PATH (the\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"



Mime
View raw message