~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/libsvn_delta/default_editor.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
 * default_editor.c -- provide a basic svn_delta_editor_t
 
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
#include <apr_pools.h>
 
21
#include <apr_strings.h>
 
22
 
 
23
#include "svn_types.h"
 
24
#include "svn_delta.h"
 
25
 
 
26
 
 
27
static svn_error_t *
 
28
set_target_revision (void *edit_baton, 
 
29
                     svn_revnum_t target_revision,
 
30
                     apr_pool_t *pool)
 
31
{
 
32
  return SVN_NO_ERROR;
 
33
}
 
34
static svn_error_t *
 
35
add_item (const char *path,
 
36
          void *parent_baton,
 
37
          const char *copyfrom_path,
 
38
          svn_revnum_t copyfrom_revision,
 
39
          apr_pool_t *pool,
 
40
          void **baton)
 
41
{
 
42
  *baton = NULL;
 
43
  return SVN_NO_ERROR;
 
44
}
 
45
 
 
46
 
 
47
static svn_error_t *
 
48
single_baton_func (void *baton,
 
49
                   apr_pool_t *pool)
 
50
{
 
51
  return SVN_NO_ERROR;
 
52
}
 
53
 
 
54
 
 
55
static svn_error_t *
 
56
absent_xxx_func (const char *path,
 
57
                 void *baton,
 
58
                 apr_pool_t *pool)
 
59
{
 
60
  return SVN_NO_ERROR;
 
61
}
 
62
 
 
63
 
 
64
static svn_error_t *
 
65
open_root (void *edit_baton,
 
66
           svn_revnum_t base_revision,
 
67
           apr_pool_t *dir_pool,
 
68
           void **root_baton)
 
69
{
 
70
  *root_baton = NULL;
 
71
  return SVN_NO_ERROR;
 
72
}
 
73
 
 
74
static svn_error_t *
 
75
delete_entry (const char *path,
 
76
              svn_revnum_t revision,
 
77
              void *parent_baton,
 
78
              apr_pool_t *pool)
 
79
{
 
80
  return SVN_NO_ERROR;
 
81
}
 
82
 
 
83
static svn_error_t *
 
84
open_item (const char *path,
 
85
           void *parent_baton,
 
86
           svn_revnum_t base_revision,
 
87
           apr_pool_t *pool,
 
88
           void **baton)
 
89
{
 
90
  *baton = NULL;
 
91
  return SVN_NO_ERROR;
 
92
}
 
93
 
 
94
static svn_error_t *
 
95
change_prop (void *file_baton,
 
96
             const char *name,
 
97
             const svn_string_t *value,
 
98
             apr_pool_t *pool)
 
99
{
 
100
  return SVN_NO_ERROR;
 
101
}
 
102
 
 
103
svn_error_t *svn_delta_noop_window_handler (svn_txdelta_window_t *window,
 
104
                                            void *baton)
 
105
{
 
106
  return SVN_NO_ERROR;
 
107
}
 
108
 
 
109
static svn_error_t *
 
110
apply_textdelta (void *file_baton,
 
111
                 const char *base_checksum,
 
112
                 apr_pool_t *pool,
 
113
                 svn_txdelta_window_handler_t *handler,
 
114
                 void **handler_baton)
 
115
{
 
116
  *handler = svn_delta_noop_window_handler;
 
117
  *handler_baton = NULL;
 
118
  return SVN_NO_ERROR;
 
119
}
 
120
 
 
121
 
 
122
static svn_error_t *
 
123
close_file (void *file_baton,
 
124
            const char *text_checksum,
 
125
            apr_pool_t *pool)
 
126
{
 
127
  return SVN_NO_ERROR;
 
128
}
 
129
 
 
130
 
 
131
 
 
132
static const svn_delta_editor_t default_editor =
 
133
{
 
134
  set_target_revision,  
 
135
  open_root,
 
136
  delete_entry,
 
137
  add_item,
 
138
  open_item,
 
139
  change_prop,
 
140
  single_baton_func,
 
141
  absent_xxx_func,
 
142
  add_item,
 
143
  open_item,
 
144
  apply_textdelta,
 
145
  change_prop,
 
146
  close_file,
 
147
  absent_xxx_func,
 
148
  single_baton_func,
 
149
  single_baton_func
 
150
};
 
151
 
 
152
svn_delta_editor_t *
 
153
svn_delta_default_editor (apr_pool_t *pool)
 
154
{
 
155
  return apr_pmemdup (pool, &default_editor, sizeof (default_editor));
 
156
}