~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/clients/cmdline/revert-cmd.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * revert-cmd.c -- Subversion revert command
 
3
 *
 
4
 * ====================================================================
 
5
 * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
 
6
 *
 
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.
 
12
 *
 
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/.
 
16
 * ====================================================================
 
17
 */
 
18
 
 
19
/* ==================================================================== */
 
20
 
 
21
 
 
22
 
 
23
/*** Includes. ***/
 
24
 
 
25
#include "svn_client.h"
 
26
#include "svn_error.h"
 
27
#include "cl.h"
 
28
 
 
29
#include "svn_private_config.h"
 
30
 
 
31
 
 
32
/*** Code. ***/
 
33
 
 
34
/* This implements the `svn_opt_subcommand_t' interface. */
 
35
svn_error_t *
 
36
svn_cl__revert (apr_getopt_t *os,
 
37
                void *baton,
 
38
                apr_pool_t *pool)
 
39
{
 
40
  svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
 
41
  svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
 
42
  apr_array_header_t *targets;
 
43
  svn_error_t *err;
 
44
 
 
45
  SVN_ERR (svn_opt_args_to_target_array2 (&targets, os, 
 
46
                                          opt_state->targets, pool));
 
47
 
 
48
  /* Revert has no implicit dot-target `.', so don't you put that code here! */
 
49
  if (! targets->nelts)
 
50
    return svn_error_create (SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL);
 
51
 
 
52
  if (! opt_state->quiet)
 
53
    svn_cl__get_notifier (&ctx->notify_func2, &ctx->notify_baton2, FALSE,
 
54
                          FALSE, FALSE, pool);
 
55
 
 
56
  err = svn_client_revert (targets, opt_state->recursive, ctx, pool);
 
57
 
 
58
  if (err && (err->apr_err == SVN_ERR_WC_NOT_LOCKED))
 
59
    {
 
60
      err = svn_error_quick_wrap
 
61
        (err, _("Try 'svn revert --recursive' instead?"));
 
62
    }
 
63
 
 
64
  return err;
 
65
}