1
/* repos.h : interface to Subversion repository, private to libsvn_repos
3
* ====================================================================
4
* Copyright (c) 2000-2004 CollabNet. All rights reserved.
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.
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
* ====================================================================
18
#ifndef SVN_LIBSVN_REPOS_H
19
#define SVN_LIBSVN_REPOS_H
21
#include <apr_pools.h>
28
#endif /* __cplusplus */
31
/*** Repository format number. */
32
#define SVN_REPOS__FORMAT_NUMBER 3
35
/*** Repository layout. ***/
37
/* The top-level repository dir contains a README and various
39
#define SVN_REPOS__README "README.txt" /* Explanation for trespassers. */
40
#define SVN_REPOS__FORMAT "format" /* Stores the current version
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. */
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. */
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"
66
/* The extension added to the names of example hook scripts. */
67
#define SVN_REPOS__HOOK_DESC_EXT ".tmpl"
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"
74
/* The Repository object, created by svn_repos_open() and
75
svn_repos_create(), allocated in POOL. */
78
/* A Subversion filesystem object. */
81
/* The path to the repository's top-level directory. */
84
/* The path to the repository's dav directory. */
87
/* The path to the repository's conf directory. */
90
/* The path to the repository's hooks directory. */
93
/* The path to the repository's locks directory. */
96
/* The path to the Berkeley DB filesystem environment. */
99
/* The format number of this repository. */
104
/*** Hook-running Functions ***/
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.
109
USER is the authenticated name of the user starting the commit. */
111
svn_repos__hooks_start_commit (svn_repos_t *repos,
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.
118
TXN_NAME is the name of the transaction that is being committed. */
120
svn_repos__hooks_pre_commit (svn_repos_t *repos,
121
const char *txn_name,
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.
127
REV is the revision that was created as a result of the commit. */
129
svn_repos__hooks_post_commit (svn_repos_t *repos,
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.
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,
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
148
svn_repos__hooks_pre_revprop_change (svn_repos_t *repos,
152
const svn_string_t *new_value,
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.
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,
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. */
170
svn_repos__hooks_post_revprop_change (svn_repos_t *repos,
174
svn_string_t *old_value,
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.
181
PATH is the path being locked, USERNAME is the person doing it. */
183
svn_repos__hooks_pre_lock (svn_repos_t *repos,
185
const char *username,
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.
191
PATHS is an array of paths being locked, USERNAME is the person
194
svn_repos__hooks_post_lock (svn_repos_t *repos,
195
apr_array_header_t *paths,
196
const char *username,
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.
202
PATH is the path being unlocked, USERNAME is the person doing it. */
204
svn_repos__hooks_pre_unlock (svn_repos_t *repos,
206
const char *username,
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.
212
PATHS is an array of paths being unlocked, USERNAME is the person
215
svn_repos__hooks_post_unlock (svn_repos_t *repos,
216
apr_array_header_t *paths,
217
const char *username,
222
#endif /* __cplusplus */
224
#endif /* SVN_LIBSVN_REPOS_H */