Author: julianfoad
Date: Fri Aug 25 12:57:39 2017
New Revision: 1806168
URL: http://svn.apache.org/viewvc?rev=1806168&view=rev
Log:
On the 'shelve' branch: Implement 'svn shelve --keep-local'.
* subversion/svn/svn.c
(svn_cl__cmd_table): Add the '--keep-local' option to 'shelve'.
* subversion/svn/shelve-cmd.c
(svn_cl__shelve): Pass the 'keep local' option on down.
* subversion/include/svn_client.h,
subversion/libsvn_client/shelve.c
(svn_client_shelve): Accept and obey a 'keep local' option.
Modified:
subversion/branches/shelve/subversion/include/svn_client.h
subversion/branches/shelve/subversion/libsvn_client/shelve.c
subversion/branches/shelve/subversion/svn/shelve-cmd.c
subversion/branches/shelve/subversion/svn/svn.c
Modified: subversion/branches/shelve/subversion/include/svn_client.h
URL:
http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/include/svn_client.h?rev=1806168&r1=1806167&r2=1806168&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/include/svn_client.h (original)
+++ subversion/branches/shelve/subversion/include/svn_client.h Fri Aug 25
12:57:39 2017
@@ -6730,6 +6730,7 @@ svn_client_shelve(const char *shelf_name
const apr_array_header_t *paths,
svn_depth_t depth,
const apr_array_header_t *changelists,
+ svn_boolean_t keep_local,
svn_boolean_t dry_run,
svn_client_ctx_t *ctx,
apr_pool_t *pool);
Modified: subversion/branches/shelve/subversion/libsvn_client/shelve.c
URL:
http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/libsvn_client/shelve.c?rev=1806168&r1=1806167&r2=1806168&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/libsvn_client/shelve.c (original)
+++ subversion/branches/shelve/subversion/libsvn_client/shelve.c Fri Aug 25
12:57:39 2017
@@ -197,6 +197,7 @@ svn_client_shelve(const char *shelf_name
const apr_array_header_t *paths,
svn_depth_t depth,
const apr_array_header_t *changelists,
+ svn_boolean_t keep_local,
svn_boolean_t dry_run,
svn_client_ctx_t *ctx,
apr_pool_t *pool)
@@ -239,11 +240,14 @@ svn_client_shelve(const char *shelf_name
else
SVN_ERR(err);
- /* Reverse-apply the patch. This should be a safer way to remove those
- changes from the WC than running a 'revert' operation. */
- SVN_ERR(svn_client_shelf_apply_patch(shelf_name, wc_root_abspath,
- TRUE /*reverse*/, dry_run,
- ctx, pool));
+ if (!keep_local)
+ {
+ /* Reverse-apply the patch. This should be a safer way to remove those
+ changes from the WC than running a 'revert' operation. */
+ SVN_ERR(svn_client_shelf_apply_patch(shelf_name, wc_root_abspath,
+ TRUE /*reverse*/, dry_run,
+ ctx, pool));
+ }
if (dry_run)
{
Modified: subversion/branches/shelve/subversion/svn/shelve-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/shelve-cmd.c?rev=1806168&r1=1806167&r2=1806168&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/shelve-cmd.c (original)
+++ subversion/branches/shelve/subversion/svn/shelve-cmd.c Fri Aug 25 12:57:39
2017
@@ -188,7 +188,7 @@ svn_cl__shelve(apr_getopt_t *os,
pool));
err = svn_client_shelve(shelf_name,
targets, depth, opt_state->changelists,
- opt_state->dry_run,
+ opt_state->keep_local, opt_state->dry_run,
ctx, pool);
if (ctx->log_msg_func3)
SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3,
Modified: subversion/branches/shelve/subversion/svn/svn.c
URL:
http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/svn.c?rev=1806168&r1=1806167&r2=1806168&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/svn.c (original)
+++ subversion/branches/shelve/subversion/svn/svn.c Fri Aug 25 12:57:39 2017
@@ -1651,13 +1651,14 @@ const svn_opt_subcommand_desc2_t svn_cl_
{ "shelve", svn_cl__shelve, {0}, N_
("Shelve changes.\n"
- "usage: 1. shelve NAME PATH...\n"
+ "usage: 1. shelve [--keep-local] NAME PATH...\n"
" 2. shelve --delete NAME\n"
" 3. shelve --list\n"
"\n"
" 1. Save the local changes in the given PATHs to a patch file, and\n"
- " revert those changes from the WC. If a log message is given with\n"
- " '-m' or '-F', include it at the beginning of the patch file.\n"
+ " revert those changes from the WC unless '--keep-local' is given.\n"
+ " If a log message is given with '-m' or '-F', include it at the\n"
+ " beginning of the patch file.\n"
"\n"
" 2. Delete the shelved patch NAME.\n"
"\n"
@@ -1666,7 +1667,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" given.\n"
"\n"
" Patch files are named .svn/shelves/NAME.patch\n"),
- {opt_delete, opt_list, 'q', opt_dry_run,
+ {opt_delete, opt_list, 'q', opt_dry_run, opt_keep_local,
'N', 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,