1
/* fs.h : interface to Subversion filesystem, private to libsvn_fs
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_FS_FS_H
19
#define SVN_LIBSVN_FS_FS_H
21
#include <apr_pools.h>
24
#include <apr_thread_mutex.h>
29
#endif /* __cplusplus */
32
/*** The filesystem structure. ***/
34
/* The format number of this filesystem.
35
This is independent of the repository format number, and
36
independent of any other FS back ends. */
37
#define SVN_FS_FS__FORMAT_NUMBER 1
41
/* A cache of the last directory opened within the filesystem. */
42
svn_fs_id_t *dir_cache_id;
43
apr_hash_t *dir_cache;
44
apr_pool_t *dir_cache_pool;
46
/* The format number of this FS. */
49
/* The uuid of this FS. */
53
/* A lock for intra-process synchronization when grabbing the
54
repository write lock. Common to all repositories with the same
55
uuid; discovered using the serialized_init function. */
56
apr_thread_mutex_t *lock;
61
/* Return a canonicalized version of a filesystem PATH, allocated in
62
POOL. While the filesystem API is pretty flexible about the
63
incoming paths (they must be UTF-8 with '/' as separators, but they
64
don't have to begin with '/', and multiple contiguous '/'s are
65
ignored) we want any paths that are physically stored in the
66
underlying database to look consistent. Specifically, absolute
67
filesystem paths should begin with '/', and all redundant and trailing '/'
68
characters be removed. */
70
svn_fs_fs__canonicalize_abspath (const char *path, apr_pool_t *pool);
73
/*** Filesystem Revision ***/
76
/* id of the transaction that was committed to create this
83
/*** Transaction Kind ***/
86
transaction_kind_normal = 1, /* normal, uncommitted */
87
transaction_kind_committed, /* committed */
88
transaction_kind_dead /* uncommitted and dead */
93
/*** Filesystem Transaction ***/
96
/* kind of transaction. */
97
transaction_kind_t kind;
99
/* property list (const char * name, svn_string_t * value).
100
may be NULL if there are no properties. */
101
apr_hash_t *proplist;
103
/* node revision id of the root node. */
104
const svn_fs_id_t *root_id;
106
/* node revision id of the node which is the root of the revision
107
upon which this txn is base. (unfinished only) */
108
const svn_fs_id_t *base_id;
110
/* copies list (const char * copy_ids), or NULL if there have been
111
no copies in this transaction. */
112
apr_array_header_t *copies;
119
copy_kind_real = 1, /* real copy */
120
copy_kind_soft /* soft copy */
125
/*** Representation ***/
128
/* MD5 checksum for the contents produced by this representation.
129
This checksum is for the contents the rep shows to consumers,
130
regardless of how the rep stores the data under the hood. It is
131
independent of the storage (fulltext, delta, whatever).
133
If all the bytes are 0, then for compatibility behave as though
134
this checksum matches the expected checksum. */
135
unsigned char checksum[APR_MD5_DIGESTSIZE];
137
/* Revision where this representation is located. */
138
svn_revnum_t revision;
140
/* Offset into the revision file where it is located. */
143
/* The size of the representation in bytes as seen in the revision
147
/* The size of the fulltext of the representation. */
148
svn_filesize_t expanded_size;
150
/* Is this representation a transaction? */
156
/*** Node-Revision ***/
160
svn_node_kind_t kind;
162
/* The node-id for this node-rev. */
163
const svn_fs_id_t *id;
165
/* predecessor node revision id, or NULL if there is no predecessor
166
for this node revision */
167
const svn_fs_id_t *predecessor_id;
169
/* If this node-rev is a copy, where was it copied from? */
170
const char *copyfrom_path;
171
svn_revnum_t copyfrom_rev;
173
/* Helper for history tracing, root of the parent tree from whence
174
this node-rev was copied. */
175
svn_revnum_t copyroot_rev;
176
const char *copyroot_path;
178
/* number of predecessors this node revision has (recursively), or
179
-1 if not known (for backward compatibility). */
180
int predecessor_count;
182
/* representation key for this node's properties. may be NULL if
183
there are no properties. */
184
representation_t *prop_rep;
186
/* representation for this node's data. may be NULL if there is
188
representation_t *data_rep;
190
/* path at which this node first came into existence. */
191
const char *created_path;
196
/*** Representation Kind ***/
199
rep_kind_fulltext = 1, /* fulltext */
200
rep_kind_delta /* delta */
205
/*** "Delta" Offset/Window Chunk ***/
208
/* diff format version number ### at this point, "svndiff" is the
212
/* starting offset of the data represented by this chunk */
213
svn_filesize_t offset;
215
/* string-key to which this representation points. */
216
const char *string_key;
218
/* size of the fulltext data represented by this delta window. */
221
/* represenatation-key to use when needed source data for
225
/* apr_off_t rep_offset; ### not implemented */
235
/* What kind of copy occurred. */
238
/* Path of copy source. */
239
const char *src_path;
241
/* Transaction id of copy source. */
242
const char *src_txn_id;
244
/* Node-revision of copy destination. */
245
const svn_fs_id_t *dst_noderev_id;
253
/* Path of the change. */
256
/* Node revision ID of the change. */
257
const svn_fs_id_t *noderev_id;
259
/* The kind of change. */
260
svn_fs_path_change_kind_t kind;
262
/* Text or property mods? */
263
svn_boolean_t text_mod;
264
svn_boolean_t prop_mod;
266
/* Copyfrom revision and path. */
267
svn_revnum_t copyfrom_rev;
268
const char * copyfrom_path;
275
#endif /* __cplusplus */
277
#endif /* SVN_LIBSVN_FS_FS_H */