Author: julianfoad
Date: Tue Jan 23 12:34:48 2018
New Revision: 1821994

URL: http://svn.apache.org/viewvc?rev=1821994&view=rev
Log:
Shelving: let 'shelve' and 'shelf-save' accept --with-revprop.

This is for consistency with other commands that take a log message, as in
principle there is nothing ultra-special about the log message property.

At present any non-log-message revprops are saved in the shelf but there are
only private APIs to retrieve them (svn_client__shelf_revprop_get, _list).

* subversion/include/svn_client.h,
  subversion/libsvn_client/shelf.c
  (svn_client_shelf_t): Add a comment.
  (svn_client_shelf_set_log_message): Add revprops parameter.

* subversion/svn/shelf-cmd.c
  (shelve,
   shelf_shelve,
   svn_cl__shelf_shelve): Pass the revprops through.

* subversion/svn/svn.c
  (svn_cl__cmd_table): Let 'shelf-save' and 'shelve' accept the standard set
    of log-message options which includes --with-revprop.

* tools/client-side/bash_completion
  (_svn): Let 'shelf-save' and 'shelve' accept the standard set
    of log-message options which includes --with-revprop.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/shelf.c
    subversion/trunk/subversion/svn/shelf-cmd.c
    subversion/trunk/subversion/svn/svn.c
    subversion/trunk/tools/client-side/bash_completion

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1821994&r1=1821993&r2=1821994&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Tue Jan 23 12:34:48 2018
@@ -6735,7 +6735,7 @@ typedef struct svn_client_shelf_t
     /* Private fields */
     const char *wc_root_abspath;
     const char *shelves_dir;
-    apr_hash_t *revprops;
+    apr_hash_t *revprops;  /* non-null; allocated in POOL */
     svn_client_ctx_t *ctx;
     apr_pool_t *pool;
 } svn_client_shelf_t;
@@ -6900,7 +6900,7 @@ svn_client_shelf_paths_changed(apr_hash_
                                apr_pool_t *scratch_pool);
 
 /** Set the log message in @a shelf, using the log message callbacks in
- * the client context.
+ * the client context, and set other revprops to @a revprop_table.
  *
  * @since New in 1.X.
  * @warning EXPERIMENTAL.
@@ -6908,6 +6908,7 @@ svn_client_shelf_paths_changed(apr_hash_
 SVN_EXPERIMENTAL
 svn_error_t *
 svn_client_shelf_set_log_message(svn_client_shelf_t *shelf,
+                                 apr_hash_t *revprop_table,
                                  svn_boolean_t dry_run,
                                  apr_pool_t *scratch_pool);
 

Modified: subversion/trunk/subversion/libsvn_client/shelf.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/shelf.c?rev=1821994&r1=1821993&r2=1821994&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/shelf.c (original)
+++ subversion/trunk/subversion/libsvn_client/shelf.c Tue Jan 23 12:34:48 2018
@@ -35,6 +35,7 @@
 #include "svn_hash.h"
 #include "svn_utf.h"
 #include "svn_ctype.h"
+#include "svn_props.h"
 
 #include "client.h"
 #include "private/svn_client_private.h"
@@ -609,6 +610,7 @@ svn_client_shelf_get_log_message(char **
 
 svn_error_t *
 svn_client_shelf_set_log_message(svn_client_shelf_t *shelf,
+                                 apr_hash_t *revprop_table,
                                  svn_boolean_t dry_run,
                                  apr_pool_t *scratch_pool)
 {
@@ -627,6 +629,12 @@ svn_client_shelf_set_log_message(svn_cli
       if (! message)
         return SVN_NO_ERROR;
     }
+
+  if (revprop_table)
+    shelf->revprops = svn_prop_hash_dup(revprop_table, shelf->pool);
+  else
+    shelf->revprops = apr_hash_make(shelf->pool);
+
   if (message && !dry_run)
     {
       svn_string_t *propval = svn_string_create(message, shelf->pool);

Modified: subversion/trunk/subversion/svn/shelf-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/shelf-cmd.c?rev=1821994&r1=1821993&r2=1821994&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelf-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelf-cmd.c Tue Jan 23 12:34:48 2018
@@ -405,6 +405,7 @@ shelve(int *new_version_p,
        const apr_array_header_t *paths,
        svn_depth_t depth,
        const apr_array_header_t *changelists,
+       apr_hash_t *revprop_table,
        svn_boolean_t keep_local,
        svn_boolean_t dry_run,
        svn_boolean_t quiet,
@@ -477,7 +478,8 @@ shelve(int *new_version_p,
                                        dry_run, scratch_pool));
     }
 
-  SVN_ERR(svn_client_shelf_set_log_message(shelf, dry_run, scratch_pool));
+  SVN_ERR(svn_client_shelf_set_log_message(shelf, revprop_table,
+                                           dry_run, scratch_pool));
 
   if (new_version_p)
     *new_version_p = shelf->max_version;
@@ -689,6 +691,7 @@ shelf_shelve(int *new_version,
              apr_array_header_t *targets,
              svn_depth_t depth,
              apr_array_header_t *changelists,
+             apr_hash_t *revprop_table,
              svn_boolean_t keep_local,
              svn_boolean_t dry_run,
              svn_boolean_t quiet,
@@ -713,6 +716,7 @@ shelf_shelve(int *new_version,
 
   SVN_ERR(shelve(new_version, name,
                  targets, depth, changelists,
+                 revprop_table,
                  keep_local, dry_run, quiet,
                  local_abspath, ctx, scratch_pool));
 
@@ -762,6 +766,7 @@ svn_cl__shelf_shelve(apr_getopt_t *os,
                                            pool));
       err = shelf_shelve(&new_version, name,
                          targets, opt_state->depth, opt_state->changelists,
+                         opt_state->revprop_table,
                          opt_state->keep_local, opt_state->dry_run,
                          opt_state->quiet, ctx, pool);
       if (ctx->log_msg_func3)

Modified: subversion/trunk/subversion/svn/svn.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1821994&r1=1821993&r2=1821994&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Tue Jan 23 12:34:48 2018
@@ -1759,8 +1759,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
     ),
     {'q', opt_dry_run,
      opt_depth, opt_targets, opt_changelist,
-     /* almost SVN_CL__LOG_MSG_OPTIONS but not currently opt_with_revprop: */
-     'm', 'F', opt_force_log, opt_editor_cmd, opt_encoding,
+     SVN_CL__LOG_MSG_OPTIONS,
     }
   },
 
@@ -1788,8 +1787,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
     ),
     {'q', opt_dry_run, opt_keep_local,
      opt_depth, opt_targets, opt_changelist,
-     /* almost SVN_CL__LOG_MSG_OPTIONS but not currently opt_with_revprop: */
-     'm', 'F', opt_force_log, opt_editor_cmd, opt_encoding,
+     SVN_CL__LOG_MSG_OPTIONS,
     } },
 
   { "unshelve", svn_cl__shelf_unshelve, {0}, N_

Modified: subversion/trunk/tools/client-side/bash_completion
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/bash_completion?rev=1821994&r1=1821993&r2=1821994&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/bash_completion (original)
+++ subversion/trunk/tools/client-side/bash_completion Tue Jan 23 12:34:48 2018
@@ -1038,13 +1038,13 @@ _svn()
        shelf-save)
                cmdOpts="--dry-run \
                          --depth --targets $cOpts \
-                         -m --message -F --file --encoding --force-log 
--editor-cmd \
+                         $mOpts --editor-cmd \
                          $qOpts $pOpts"
                ;;
        shelve)
                cmdOpts="--keep-local --dry-run \
                          --depth --targets $cOpts \
-                         -m --message -F --file --encoding --force-log 
--editor-cmd \
+                         $mOpts --editor-cmd \
                          $qOpts $pOpts"
                ;;
        unshelve)


Reply via email to