1 /* fs.h : interface to Subversion filesystem, private to libsvn_fs
3 * ====================================================================
4 * Copyright (c) 2000-2007 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_BASE_H
19 #define SVN_LIBSVN_FS_BASE_H
24 #include <apr_pools.h>
33 #endif /* __cplusplus */
36 /*** Filesystem schema versions ***/
38 /* The format number of this filesystem. This is independent of the
39 repository format number, and independent of any other FS back
40 ends. See the SVN_FS_BASE__MIN_*_FORMAT defines to get a sense of
41 what changes and features were added in which versions of this
43 #define SVN_FS_BASE__FORMAT_NUMBER 3
45 /* Minimum format number that supports node-origins tracking */
46 #define SVN_FS_BASE__MIN_NODE_ORIGINS_FORMAT 3
48 /* Minimum format number that supports mergeinfo */
49 #define SVN_FS_BASE__MIN_MERGEINFO_FORMAT 3
51 /* Minimum format number that supports svndiff version 1. */
52 #define SVN_FS_BASE__MIN_SVNDIFF1_FORMAT 2
54 /* Return SVN_ERR_UNSUPPORTED_FEATURE if the version of filesystem FS does
55 not indicate support for FEATURE (which REQUIRES a newer version). */
57 svn_fs_base__test_required_feature_format(svn_fs_t
*fs
,
63 /*** The filesystem structure. ***/
67 /* A Berkeley DB environment for all the filesystem's databases.
68 This establishes the scope of the filesystem's transactions. */
71 /* The filesystem's various tables. See `structure' for details. */
84 /* A boolean for tracking when we have a live Berkeley DB
85 transaction trail alive. */
86 svn_boolean_t in_txn_trail
;
88 /* The filesystem UUID (or NULL if not-yet-known; see svn_fs_get_uuid). */
91 /* The format number of this FS. */
97 /*** Filesystem Revision ***/
100 /* id of the transaction that was committed to create this
107 /*** Transaction Kind ***/
110 transaction_kind_normal
= 1, /* normal, uncommitted */
111 transaction_kind_committed
, /* committed */
112 transaction_kind_dead
/* uncommitted and dead */
114 } transaction_kind_t
;
117 /*** Filesystem Transaction ***/
120 /* kind of transaction. */
121 transaction_kind_t kind
;
123 /* revision which this transaction was committed to create, or an
124 invalid revision number if this transaction was never committed. */
125 svn_revnum_t revision
;
127 /* property list (const char * name, svn_string_t * value).
128 may be NULL if there are no properties. */
129 apr_hash_t
*proplist
;
131 /* node revision id of the root node. */
132 const svn_fs_id_t
*root_id
;
134 /* node revision id of the node which is the root of the revision
135 upon which this txn is base. (unfinished only) */
136 const svn_fs_id_t
*base_id
;
138 /* copies list (const char * copy_ids), or NULL if there have been
139 no copies in this transaction. */
140 apr_array_header_t
*copies
;
145 /*** Node-Revision ***/
149 svn_node_kind_t kind
;
151 /* predecessor node revision id, or NULL if there is no predecessor
152 for this node revision */
153 const svn_fs_id_t
*predecessor_id
;
155 /* number of predecessors this node revision has (recursively), or
156 -1 if not known (for backward compatibility). */
157 int predecessor_count
;
159 /* representation key for this node's properties. may be NULL if
160 there are no properties. */
161 const char *prop_key
;
163 /* representation key for this node's text data (files) or entries
164 list (dirs). may be NULL if there are no contents. */
165 const char *data_key
;
167 /* representation key for this node's text-data-in-progess (files
168 only). NULL if no edits are currently in-progress. This field
169 is always NULL for kinds other than "file". */
170 const char *edit_key
;
172 /* path at which this node first came into existence. */
173 const char *created_path
;
175 /* does this node revision have the mergeinfo tracking property set
176 on it? (only valid for FS schema 3 and newer) */
177 svn_boolean_t has_mergeinfo
;
179 /* number of children of this node which have the mergeinfo tracking
180 property set (0 for files; valid only for FS schema 3 and newer). */
181 apr_int64_t mergeinfo_count
;
186 /*** Representation Kind ***/
189 rep_kind_fulltext
= 1, /* fulltext */
190 rep_kind_delta
/* delta */
195 /*** "Delta" Offset/Window Chunk ***/
198 /* diff format version number ### at this point, "svndiff" is the
202 /* starting offset of the data represented by this chunk */
203 svn_filesize_t offset
;
205 /* string-key to which this representation points. */
206 const char *string_key
;
208 /* size of the fulltext data represented by this delta window. */
211 /* representation-key to use when needed source data for
215 /* apr_off_t rep_offset; ### not implemented */
220 /*** Representation ***/
223 /* representation kind */
226 /* transaction ID under which representation was created (used as a
227 mutability flag when compared with a current editing
231 /* MD5 checksum for the contents produced by this representation.
232 This checksum is for the contents the rep shows to consumers,
233 regardless of how the rep stores the data under the hood. It is
234 independent of the storage (fulltext, delta, whatever).
236 If all the bytes are 0, then for compatibility behave as though
237 this checksum matches the expected checksum. */
238 unsigned char checksum
[APR_MD5_DIGESTSIZE
];
240 /* kind-specific stuff */
246 /* string-key which holds the fulltext data */
247 const char *string_key
;
254 /* an array of rep_delta_chunk_t * chunks of delta
256 apr_array_header_t
*chunks
;
266 copy_kind_real
= 1, /* real copy */
267 copy_kind_soft
/* soft copy */
275 /* What kind of copy occurred. */
278 /* Path of copy source. */
279 const char *src_path
;
281 /* Transaction id of copy source. */
282 const char *src_txn_id
;
284 /* Node-revision of copy destination. */
285 const svn_fs_id_t
*dst_noderev_id
;
293 /* Path of the change. */
296 /* Node revision ID of the change. */
297 const svn_fs_id_t
*noderev_id
;
299 /* The kind of change. */
300 svn_fs_path_change_kind_t kind
;
302 /* Text or property mods? */
303 svn_boolean_t text_mod
;
304 svn_boolean_t prop_mod
;
312 /* entries list, maps (const char *) name --> (const char *) lock-node-id */
315 /* optional lock-token, might be NULL. */
316 const char *lock_token
;
324 #endif /* __cplusplus */
326 #endif /* SVN_LIBSVN_FS_BASE_H */