1 /* revs-txns.h : internal interface to revision and transactions operations
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
20 * ====================================================================
23 #ifndef SVN_LIBSVN_FS_REVS_TXNS_H
24 #define SVN_LIBSVN_FS_REVS_TXNS_H
27 #include "svn_private_config.h"
36 #endif /* __cplusplus */
42 /* Set *ROOT_ID_P to the ID of the root directory of revision REV in FS,
43 as part of TRAIL. Allocate the ID in POOL. */
44 svn_error_t *svn_fs_base__rev_get_root(const svn_fs_id_t **root_id_p,
51 /* Set *TXN_ID_P to the ID of the transaction that was committed to
52 create REV in FS, as part of TRAIL. Allocate the ID in POOL. */
53 svn_error_t *svn_fs_base__rev_get_txn_id(const char **txn_id_p,
60 /* Set property NAME to VALUE on REV in FS, as part of TRAIL. */
61 svn_error_t *svn_fs_base__set_rev_prop(svn_fs_t *fs,
64 const svn_string_t *const *old_value_p,
65 const svn_string_t *value,
71 /*** Transactions ***/
73 /* Convert the unfinished transaction in FS named TXN_NAME to a
74 committed transaction that refers to REVISION as part of TRAIL.
76 Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
77 transaction that has already been committed. */
78 svn_error_t *svn_fs_base__txn_make_committed(svn_fs_t *fs,
80 svn_revnum_t revision,
85 /* Set *REVISION to the revision which was created when FS transaction
86 TXN_NAME was committed, or to SVN_INVALID_REVNUM if the transaction
87 has not been committed. Do all of this as part of TRAIL. */
88 svn_error_t *svn_fs_base__txn_get_revision(svn_revnum_t *revision,
95 /* Retrieve information about the Subversion transaction TXN_NAME from
96 the `transactions' table of FS, as part of TRAIL.
97 Set *ROOT_ID_P to the ID of the transaction's root directory.
98 Set *BASE_ROOT_ID_P to the ID of the root directory of the
99 transaction's base revision.
101 If there is no such transaction, SVN_ERR_FS_NO_SUCH_TRANSACTION is
104 Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
105 transaction that has already been committed.
107 Allocate *ROOT_ID_P and *BASE_ROOT_ID_P in POOL. */
108 svn_error_t *svn_fs_base__get_txn_ids(const svn_fs_id_t **root_id_p,
109 const svn_fs_id_t **base_root_id_p,
111 const char *txn_name,
116 /* Set the root directory of the Subversion transaction TXN_NAME in FS
117 to ROOT_ID, as part of TRAIL. Do any necessary temporary
120 Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
121 transaction that has already been committed. */
122 svn_error_t *svn_fs_base__set_txn_root(svn_fs_t *fs,
123 const char *txn_name,
124 const svn_fs_id_t *root_id,
129 /* Add COPY_ID to the list of copies made under the Subversion
130 transaction TXN_NAME in FS as part of TRAIL.
132 Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
133 transaction that has already been committed. */
134 svn_error_t *svn_fs_base__add_txn_copy(svn_fs_t *fs,
135 const char *txn_name,
141 /* Set the base root directory of TXN_NAME in FS to NEW_ID, as part of
142 TRAIL. Do any necessary temporary allocation in POOL.
144 Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
145 transaction that has already been committed. */
146 svn_error_t *svn_fs_base__set_txn_base(svn_fs_t *fs,
147 const char *txn_name,
148 const svn_fs_id_t *new_id,
153 /* Set a property NAME to VALUE on transaction TXN_NAME in FS as part
154 of TRAIL. Use POOL for any necessary allocations.
156 Returns SVN_ERR_FS_TRANSACTION_NOT_MUTABLE if TXN_NAME refers to a
157 transaction that has already been committed. */
158 svn_error_t *svn_fs_base__set_txn_prop(svn_fs_t *fs,
159 const char *txn_name,
161 const svn_string_t *value,
166 /* These functions implement some of the calls in the FS loader
167 library's fs and txn vtables. */
169 svn_error_t *svn_fs_base__youngest_rev(svn_revnum_t *youngest_p, svn_fs_t *fs,
172 svn_error_t *svn_fs_base__revision_prop(svn_string_t **value_p, svn_fs_t *fs,
174 const char *propname,
177 svn_error_t *svn_fs_base__revision_proplist(apr_hash_t **table_p,
182 svn_error_t *svn_fs_base__change_rev_prop(svn_fs_t *fs, svn_revnum_t rev,
184 const svn_string_t *const *old_value_p,
185 const svn_string_t *value,
188 svn_error_t *svn_fs_base__begin_txn(svn_fs_txn_t **txn_p, svn_fs_t *fs,
189 svn_revnum_t rev, apr_uint32_t flags,
192 svn_error_t *svn_fs_base__open_txn(svn_fs_txn_t **txn, svn_fs_t *fs,
193 const char *name, apr_pool_t *pool);
195 svn_error_t *svn_fs_base__purge_txn(svn_fs_t *fs, const char *txn_id,
198 svn_error_t *svn_fs_base__list_transactions(apr_array_header_t **names_p,
199 svn_fs_t *fs, apr_pool_t *pool);
201 svn_error_t *svn_fs_base__abort_txn(svn_fs_txn_t *txn, apr_pool_t *pool);
203 svn_error_t *svn_fs_base__txn_prop(svn_string_t **value_p, svn_fs_txn_t *txn,
204 const char *propname, apr_pool_t *pool);
206 svn_error_t *svn_fs_base__txn_proplist(apr_hash_t **table_p,
210 /* Helper func: variant of __txn_proplist that uses an existing TRAIL.
211 * TXN_ID identifies the transaction.
212 * *TABLE_P will be non-null upon success.
214 svn_error_t *svn_fs_base__txn_proplist_in_trail(apr_hash_t **table_p,
218 svn_error_t *svn_fs_base__change_txn_prop(svn_fs_txn_t *txn, const char *name,
219 const svn_string_t *value,
222 svn_error_t *svn_fs_base__change_txn_props(svn_fs_txn_t *txn,
223 const apr_array_header_t *props,
229 #endif /* __cplusplus */
231 #endif /* SVN_LIBSVN_FS_REVS_TXNS_H */