2
2
* move-cmd.c -- Subversion move command
4
4
* ====================================================================
5
* Copyright (c) 2000-2006 CollabNet. All rights reserved.
7
* This software is licensed as described in the file COPYING, which
8
* you should have received as part of this distribution. The terms
9
* are also available at http://subversion.tigris.org/license-1.html.
10
* If newer versions of this license are posted there, you may use a
11
* newer version instead, at your option.
13
* This software consists of voluntary contributions made by many
14
* individuals. For exact contribution history, see the revision
15
* history and logs, available at http://subversion.tigris.org/.
5
* Licensed to the Apache Software Foundation (ASF) under one
6
* or more contributor license agreements. See the NOTICE file
7
* distributed with this work for additional information
8
* regarding copyright ownership. The ASF licenses this file
9
* to you under the Apache License, Version 2.0 (the
10
* "License"); you may not use this file except in compliance
11
* with the License. You may obtain a copy of the License at
13
* http://www.apache.org/licenses/LICENSE-2.0
15
* Unless required by applicable law or agreed to in writing,
16
* software distributed under the License is distributed on an
17
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18
* KIND, either express or implied. See the License for the
19
* specific language governing permissions and limitations
16
21
* ====================================================================
27
32
#include "svn_path.h"
30
/* We shouldn't be including a private header here, but it is
31
* necessary for fixing issue #3416 */
32
#include "private/svn_opt_private.h"
34
35
#include "svn_private_config.h"
47
48
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
48
49
apr_array_header_t *targets;
49
50
const char *dst_path;
50
svn_commit_info_t *commit_info = NULL;
53
53
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
54
54
opt_state->targets,
57
57
if (targets->nelts < 2)
58
58
return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
65
65
_("Cannot specify revisions (except HEAD) with move operations"));
68
if (! opt_state->quiet)
69
svn_cl__get_notifier(&ctx->notify_func2, &ctx->notify_baton2, FALSE,
72
68
dst_path = APR_ARRAY_IDX(targets, targets->nelts - 1, const char *);
73
69
apr_array_pop(targets);
86
82
SVN_ERR(svn_cl__make_log_msg_baton(&(ctx->log_msg_baton3), opt_state,
87
83
NULL, ctx->config, pool));
89
SVN_ERR(svn_opt__eat_peg_revisions(&targets, targets, pool));
85
SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
91
err = svn_client_move5(&commit_info, targets, dst_path, opt_state->force,
87
err = svn_client_move6(targets, dst_path,
92
88
TRUE, opt_state->parents, opt_state->revprop_table,
89
(opt_state->quiet ? NULL : svn_cl__print_commit_info),
96
93
err = svn_cl__may_need_force(err);
98
95
if (ctx->log_msg_func3)
99
96
SVN_ERR(svn_cl__cleanup_log_msg(ctx->log_msg_baton3, err, pool));
103
if (commit_info && ! opt_state->quiet)
104
SVN_ERR(svn_cl__print_commit_info(commit_info, pool));
98
return svn_error_trace(err);
106
100
return SVN_NO_ERROR;