Any comments on this patch to remove the unwanted "revision" argument from "svn move" and "svn_client_move"?
- Julian
Remove the unwanted "revision" argument from "svn move" and "svn_client_move".
* doc/book/book/ch09.xml (svn-ch-9-sect-1.2-re-move)
* tools/client-side/bash_completion (_svn)
* subversion/clients/cmdline/main.c (svn_cl__cmd_table)
Remove "-r" from the options of "svn move".
* subversion/clients/cmdline/move-cmd.c
(svn_cl__move): Call svn_client_move2 instead of svn_client_move.
* subversion/include/svn_client.h
(svn_client_move): Deprecated.
(svn_client_move2): New function, as svn_client_move without src_revision.
* subversion/libsvn_client/copy.c
(setup_copy): Don't check the "revision" for a move here.
(svn_client_move): Check the "revision" for a move here instead.
(svn_client_move2): New function, as svn_client_move without src_revision.
Index: doc/book/book/ch09.xml
===================================================================
--- doc/book/book/ch09.xml (revision 11328)
+++ doc/book/book/ch09.xml (working copy)
@@ -2515,7 +2515,6 @@
<screen>
--message (-m) TEXT
--file (-F) FILE
---revision (-r) REV
--quiet (-q)
--force
--username USER
Index: tools/client-side/bash_completion
===================================================================
--- tools/client-side/bash_completion (revision 11328)
+++ tools/client-side/bash_completion (working copy)
@@ -114,7 +114,7 @@
cmdOpts="$mOpts $qOpts --editor-cmd $pOpts"
;;
move|mv|rename|ren)
- cmdOpts="$mOpts $rOpts $qOpts --force --editor-cmd $pOpts"
+ cmdOpts="$mOpts $qOpts --force --editor-cmd $pOpts"
;;
propdel|pdel|pd)
cmdOpts="$qOpts -R --recursive $rOpts --revprop $pOpts"
Index: subversion/include/svn_client.h
===================================================================
--- subversion/include/svn_client.h (revision 11328)
+++ subversion/include/svn_client.h (working copy)
@@ -1072,9 +1072,6 @@
*
* - @a dst_path must also be a repository URL (existent or not).
*
- * - @a src_revision is used to choose the revision from which to copy
- * the @a src_path.
- *
* - the authentication baton in @a ctx and @a ctx->log_msg_func/@a
* ctx->log_msg_baton are used to commit the move.
*
@@ -1085,8 +1082,7 @@
*
* - @a dst_path must also be a working copy path (existent or not).
*
- * - @a src_revision, and @a ctx->log_msg_func/@a ctx->log_msg_baton are
- * ignored.
+ * - @a ctx->log_msg_func and @a ctx->log_msg_baton are ignored.
*
* - This is a scheduling operation. No changes will happen to the
* repository until a commit occurs. This scheduling can be removed
@@ -1110,6 +1106,22 @@
* ### Is this really true? What about @c svn_wc_notify_commit_replaced? ###
*/
svn_error_t *
+svn_client_move2 (svn_client_commit_info_t **commit_info,
+ const char *src_path,
+ const char *dst_path,
+ svn_boolean_t force,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool);
+
+/**
+ * @deprecated Provided for backward compatibility with the 1.1.0 API.
+ *
+ * Similar to @c svn_client_move2, but an extra argument @a src_revision
+ * must be passed. This has no effect, but must be of kind
+ * @c svn_opt_revision_unspecified or @c svn_opt_revision_head,
+ * otherwise error @c SVN_ERR_UNSUPPORTED_FEATURE is returned.
+ */
+svn_error_t *
svn_client_move (svn_client_commit_info_t **commit_info,
const char *src_path,
const svn_opt_revision_t *src_revision,
Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c (revision 11328)
+++ subversion/libsvn_client/copy.c (working copy)
@@ -1039,21 +1039,6 @@
(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("No support for repos <--> working copy moves"));
}
-
- /* It doesn't make sense to specify revisions in a move. */
-
- /* ### todo: this check could fail wrongly. For example,
- someone could pass in an svn_opt_revision_number that just
- happens to be the HEAD. It's fair enough to punt then, IMHO,
- and just demand that the user not specify a revision at all;
- beats mucking up this function with RA calls and such. */
- if (src_revision->kind != svn_opt_revision_unspecified
- && src_revision->kind != svn_opt_revision_head)
- {
- return svn_error_create
- (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("Cannot specify revisions with move operations"));
- }
}
else
{
@@ -1140,6 +1125,25 @@
svn_error_t *
+svn_client_move2 (svn_client_commit_info_t **commit_info,
+ const char *src_path,
+ const char *dst_path,
+ svn_boolean_t force,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *pool)
+{
+ const svn_opt_revision_t src_revision
+ = { svn_opt_revision_unspecified, { 0 } };
+
+ return setup_copy (commit_info,
+ src_path, &src_revision, dst_path,
+ TRUE /* is_move */,
+ force,
+ ctx,
+ pool);
+}
+
+svn_error_t *
svn_client_move (svn_client_commit_info_t **commit_info,
const char *src_path,
const svn_opt_revision_t *src_revision,
@@ -1148,6 +1152,21 @@
svn_client_ctx_t *ctx,
apr_pool_t *pool)
{
+ /* It doesn't make sense to specify revisions in a move. */
+
+ /* ### todo: this check could fail wrongly. For example,
+ someone could pass in an svn_opt_revision_number that just
+ happens to be the HEAD. It's fair enough to punt then, IMHO,
+ and just demand that the user not specify a revision at all;
+ beats mucking up this function with RA calls and such. */
+ if (src_revision->kind != svn_opt_revision_unspecified
+ && src_revision->kind != svn_opt_revision_head)
+ {
+ return svn_error_create
+ (SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("Cannot specify revisions with move operations"));
+ }
+
return setup_copy (commit_info,
src_path, src_revision, dst_path,
TRUE /* is_move */,
Index: subversion/clients/cmdline/move-cmd.c
===================================================================
--- subversion/clients/cmdline/move-cmd.c (revision 11328)
+++ subversion/clients/cmdline/move-cmd.c (working copy)
@@ -65,9 +65,9 @@
SVN_ERR (svn_cl__make_log_msg_baton (&(ctx->log_msg_baton), opt_state,
NULL, ctx->config, pool));
- err = svn_client_move
+ err = svn_client_move2
(&commit_info,
- src_path, &(opt_state->start_revision), dst_path,
+ src_path, dst_path,
opt_state->force,
ctx,
pool);
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c (revision 11328)
+++ subversion/clients/cmdline/main.c (working copy)
@@ -449,7 +449,7 @@
" SRC and DST can both be working copy (WC) paths or URLs:\n"
" WC -> WC: move and schedule for addition (with history)\n"
" URL -> URL: complete server-side rename.\n"),
- {'r', 'q', svn_cl__force_opt,
+ {'q', svn_cl__force_opt,
SVN_CL__LOG_MSG_OPTIONS, SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} },
{ "propdel", svn_cl__propdel, {"pdel", "pd"},
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 12 17:33:00 2004