~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to subversion/libsvn_repos/repos.h

  • 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
/* repos.h : interface to Subversion repository, private to libsvn_repos
 
2
 *
 
3
 * ====================================================================
 
4
 * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
 
5
 *
 
6
 * This software is licensed as described in the file COPYING, which
 
7
 * you should have received as part of this distribution.  The terms
 
8
 * are also available at http://subversion.tigris.org/license-1.html.
 
9
 * If newer versions of this license are posted there, you may use a
 
10
 * newer version instead, at your option.
 
11
 *
 
12
 * This software consists of voluntary contributions made by many
 
13
 * individuals.  For exact contribution history, see the revision
 
14
 * history and logs, available at http://subversion.tigris.org/.
 
15
 * ====================================================================
 
16
 */
 
17
 
 
18
#ifndef SVN_LIBSVN_REPOS_H
 
19
#define SVN_LIBSVN_REPOS_H
 
20
 
 
21
#include <apr_pools.h>
 
22
#include <apr_hash.h>
 
23
 
 
24
#include "svn_fs.h"
 
25
 
 
26
#ifdef __cplusplus
 
27
extern "C" {
 
28
#endif /* __cplusplus */
 
29
 
 
30
 
 
31
/*** Repository format number. */
 
32
#define SVN_REPOS__FORMAT_NUMBER     3
 
33
 
 
34
 
 
35
/*** Repository layout. ***/
 
36
 
 
37
/* The top-level repository dir contains a README and various
 
38
   subdirectories.  */
 
39
#define SVN_REPOS__README      "README.txt" /* Explanation for trespassers. */
 
40
#define SVN_REPOS__FORMAT      "format"     /* Stores the current version
 
41
                                               of the repository. */
 
42
#define SVN_REPOS__DB_DIR      "db"         /* Where Berkeley lives. */
 
43
#define SVN_REPOS__DAV_DIR     "dav"        /* DAV sandbox. */
 
44
#define SVN_REPOS__LOCK_DIR    "locks"      /* Lock files live here. */
 
45
#define SVN_REPOS__HOOK_DIR    "hooks"      /* Hook programs. */
 
46
#define SVN_REPOS__CONF_DIR    "conf"       /* Configuration files. */
 
47
 
 
48
/* Things for which we keep lockfiles. */
 
49
#define SVN_REPOS__DB_LOCKFILE "db.lock" /* Our Berkeley lockfile. */
 
50
#define SVN_REPOS__DB_LOGS_LOCKFILE "db-logs.lock" /* BDB logs lockfile. */
 
51
 
 
52
/* In the repository hooks directory, look for these files. */
 
53
#define SVN_REPOS__HOOK_START_COMMIT    "start-commit"
 
54
#define SVN_REPOS__HOOK_PRE_COMMIT      "pre-commit"
 
55
#define SVN_REPOS__HOOK_POST_COMMIT     "post-commit"
 
56
#define SVN_REPOS__HOOK_READ_SENTINEL   "read-sentinels"
 
57
#define SVN_REPOS__HOOK_WRITE_SENTINEL  "write-sentinels"
 
58
#define SVN_REPOS__HOOK_PRE_REVPROP_CHANGE  "pre-revprop-change"
 
59
#define SVN_REPOS__HOOK_POST_REVPROP_CHANGE "post-revprop-change"
 
60
#define SVN_REPOS__HOOK_PRE_LOCK        "pre-lock"
 
61
#define SVN_REPOS__HOOK_POST_LOCK       "post-lock"
 
62
#define SVN_REPOS__HOOK_PRE_UNLOCK      "pre-unlock"
 
63
#define SVN_REPOS__HOOK_POST_UNLOCK     "post-unlock"
 
64
 
 
65
 
 
66
/* The extension added to the names of example hook scripts. */
 
67
#define SVN_REPOS__HOOK_DESC_EXT        ".tmpl"
 
68
 
 
69
 
 
70
/* In the repository conf directory, look for these files. */
 
71
#define SVN_REPOS__CONF_SVNSERVE_CONF "svnserve.conf"
 
72
#define SVN_REPOS__CONF_PASSWD "passwd"
 
73
 
 
74
/* The Repository object, created by svn_repos_open() and
 
75
   svn_repos_create(), allocated in POOL. */
 
76
struct svn_repos_t
 
77
{
 
78
  /* A Subversion filesystem object. */
 
79
  svn_fs_t *fs;
 
80
 
 
81
  /* The path to the repository's top-level directory. */
 
82
  char *path;
 
83
 
 
84
  /* The path to the repository's dav directory. */
 
85
  char *dav_path;
 
86
 
 
87
  /* The path to the repository's conf directory. */
 
88
  char *conf_path;
 
89
 
 
90
  /* The path to the repository's hooks directory. */
 
91
  char *hook_path;
 
92
 
 
93
  /* The path to the repository's locks directory. */
 
94
  char *lock_path;
 
95
 
 
96
  /* The path to the Berkeley DB filesystem environment. */
 
97
  char *db_path;
 
98
 
 
99
  /* The format number of this repository. */
 
100
  int format;
 
101
};
 
102
 
 
103
 
 
104
/*** Hook-running Functions ***/
 
105
 
 
106
/* Run the start-commit hook for REPOS.  Use POOL for any temporary
 
107
   allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.
 
108
 
 
109
   USER is the authenticated name of the user starting the commit.  */
 
110
svn_error_t *
 
111
svn_repos__hooks_start_commit (svn_repos_t *repos,
 
112
                               const char *user,
 
113
                               apr_pool_t *pool);
 
114
 
 
115
/* Run the pre-commit hook for REPOS.  Use POOL for any temporary
 
116
   allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.  
 
117
 
 
118
   TXN_NAME is the name of the transaction that is being committed.  */
 
119
svn_error_t *
 
120
svn_repos__hooks_pre_commit (svn_repos_t *repos,
 
121
                             const char *txn_name,
 
122
                             apr_pool_t *pool);
 
123
 
 
124
/* Run the post-commit hook for REPOS.  Use POOL for any temporary
 
125
   allocations.  If the hook fails, run SVN_ERR_REPOS_HOOK_FAILURE.
 
126
 
 
127
   REV is the revision that was created as a result of the commit.  */
 
128
svn_error_t *
 
129
svn_repos__hooks_post_commit (svn_repos_t *repos,
 
130
                              svn_revnum_t rev,
 
131
                              apr_pool_t *pool);
 
132
 
 
133
/* Run the pre-revprop-change hook for REPOS.  Use POOL for any
 
134
   temporary allocations.  If the hook fails, return
 
135
   SVN_ERR_REPOS_HOOK_FAILURE.  
 
136
 
 
137
   REV is the revision whose property is being changed.
 
138
   AUTHOR is the authenticated name of the user changing the prop.
 
139
   NAME is the name of the property being changed.  
 
140
   NEW_VALUE is the new value of the property.
 
141
   ACTION is indicates if the property is being 'A'dded, 'M'odified,
 
142
   or 'D'eleted.
 
143
 
 
144
   The pre-revprop-change hook will have the new property value
 
145
   written to its stdin.  If the property is being deleted, no data
 
146
   will be written. */
 
147
svn_error_t *
 
148
svn_repos__hooks_pre_revprop_change (svn_repos_t *repos,
 
149
                                     svn_revnum_t rev,
 
150
                                     const char *author,
 
151
                                     const char *name,
 
152
                                     const svn_string_t *new_value,
 
153
                                     char action,
 
154
                                     apr_pool_t *pool);
 
155
 
 
156
/* Run the pre-revprop-change hook for REPOS.  Use POOL for any
 
157
   temporary allocations.  If the hook fails, return
 
158
   SVN_ERR_REPOS_HOOK_FAILURE. 
 
159
 
 
160
   REV is the revision whose property was changed.
 
161
   AUTHOR is the authenticated name of the user who changed the prop.
 
162
   NAME is the name of the property that was changed, and OLD_VALUE is
 
163
   that property's value immediately before the change, or null if
 
164
   none.  ACTION indicates if the property was 'A'dded, 'M'odified,
 
165
   or 'D'eleted.
 
166
 
 
167
   The old value will be passed to the post-revprop hook on stdin.  If
 
168
   the property is being created, no data will be written. */
 
169
svn_error_t *
 
170
svn_repos__hooks_post_revprop_change (svn_repos_t *repos,
 
171
                                      svn_revnum_t rev,
 
172
                                      const char *author,
 
173
                                      const char *name,
 
174
                                      svn_string_t *old_value,
 
175
                                      char action,
 
176
                                      apr_pool_t *pool);
 
177
 
 
178
/* Run the pre-lock hook for REPOS.  Use POOL for any temporary
 
179
   allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.  
 
180
 
 
181
   PATH is the path being locked, USERNAME is the person doing it.  */
 
182
svn_error_t *
 
183
svn_repos__hooks_pre_lock (svn_repos_t *repos,
 
184
                           const char *path,
 
185
                           const char *username,
 
186
                           apr_pool_t *pool);
 
187
 
 
188
/* Run the post-lock hook for REPOS.  Use POOL for any temporary
 
189
   allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.  
 
190
 
 
191
   PATHS is an array of paths being locked, USERNAME is the person
 
192
   who did it.  */
 
193
svn_error_t *
 
194
svn_repos__hooks_post_lock (svn_repos_t *repos,
 
195
                            apr_array_header_t *paths,
 
196
                            const char *username,
 
197
                            apr_pool_t *pool);
 
198
 
 
199
/* Run the pre-unlock hook for REPOS.  Use POOL for any temporary
 
200
   allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.  
 
201
   
 
202
   PATH is the path being unlocked, USERNAME is the person doing it.  */
 
203
svn_error_t *
 
204
svn_repos__hooks_pre_unlock (svn_repos_t *repos,
 
205
                             const char *path,
 
206
                             const char *username,
 
207
                             apr_pool_t *pool);
 
208
 
 
209
/* Run the post-unlock hook for REPOS.  Use POOL for any temporary
 
210
   allocations.  If the hook fails, return SVN_ERR_REPOS_HOOK_FAILURE.  
 
211
   
 
212
   PATHS is an array of paths being unlocked, USERNAME is the person
 
213
   who did it.  */
 
214
svn_error_t *
 
215
svn_repos__hooks_post_unlock (svn_repos_t *repos,
 
216
                              apr_array_header_t *paths,
 
217
                              const char *username,
 
218
                              apr_pool_t *pool);
 
219
 
 
220
#ifdef __cplusplus
 
221
}
 
222
#endif /* __cplusplus */
 
223
 
 
224
#endif /* SVN_LIBSVN_REPOS_H */