Author: julianfoad
Date: Thu Mar 22 11:15:54 2018
New Revision: 1827477

URL: http://svn.apache.org/viewvc?rev=1827477&view=rev
Log:
Shelving: unshelve --force will bypass the check for local modifications.

* subversion/svn/shelf-cmd.c
  (shelf_restore): Don't check for mods if so requested.
  (svn_cl__shelf_unshelve): Pass through the option.

* subversion/svn/svn.c
  (svn_cl__cmd_table): Add and document 'unshelve --force' option.

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=1827477&r1=1827476&r2=1827477&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelf-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelf-cmd.c Thu Mar 22 11:15:54 2018
@@ -648,6 +648,7 @@ shelf_restore(const char *name,
               const char *arg,
               svn_boolean_t dry_run,
               svn_boolean_t quiet,
+              svn_boolean_t force_already_modified,
               const char *local_abspath,
               svn_client_ctx_t *ctx,
               apr_pool_t *scratch_pool)
@@ -684,8 +685,11 @@ shelf_restore(const char *name,
       SVN_ERR(stats(shelf, version, shelf_version, time_now,
                     TRUE /*with_logmsg*/, scratch_pool));
     }
-  SVN_ERR(check_no_modified_paths(shelf->wc_root_abspath,
-                                  shelf_version, quiet, ctx, scratch_pool));
+  if (! force_already_modified)
+    {
+      SVN_ERR(check_no_modified_paths(shelf->wc_root_abspath,
+                                      shelf_version, quiet, ctx, 
scratch_pool));
+    }
 
   b.rejects = FALSE;
   b.notify_func = ctx->notify_func2;
@@ -931,6 +935,7 @@ svn_cl__shelf_unshelve(apr_getopt_t *os,
 
   SVN_ERR(shelf_restore(name, arg,
                         opt_state->dry_run, opt_state->quiet,
+                        opt_state->force /*force_already_modified*/,
                         local_abspath, ctx, scratch_pool));
 
   if (opt_state->drop)

Modified: subversion/trunk/subversion/svn/svn.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1827477&r1=1827476&r2=1827477&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Thu Mar 22 11:15:54 2018
@@ -2060,7 +2060,9 @@ const svn_opt_subcommand_desc3_t svn_cl_
      "  Apply the shelf named NAME to the working copy.\n"
      "  NAME defaults to the newest shelf.\n"
      "\n"), N_(
-     "  Any conflict between the change being unshelved and a change\n"
+     "  Unshelve normally refuses to run if any of the files are already\n"
+     "  modified in the WC. With --force, it does not check. In that case,\n"
+     "  any conflict between the change being unshelved and a change\n"
      "  already in the WC is handled the same way as by 'svn patch',\n"
      "  creating a 'reject' file.\n"
      "\n"), N_(
@@ -2070,7 +2072,7 @@ const svn_opt_subcommand_desc3_t svn_cl_
      "  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"
     )},
-    {opt_drop, 'q', opt_dry_run} },
+    {opt_drop, 'q', opt_dry_run, opt_force} },
 
   { NULL, NULL, {0}, {NULL}, {0} }
 };


Reply via email to