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 * @file svn_repos_private.h
24 * @brief Subversion-internal repos APIs.
27 #ifndef SVN_REPOS_PRIVATE_H
28 #define SVN_REPOS_PRIVATE_H
30 #include <apr_pools.h>
32 #include "svn_types.h"
33 #include "svn_repos.h"
34 #include "svn_editor.h"
38 #endif /* __cplusplus */
41 /** Validate that property @a name is valid for use in a Subversion
42 * repository; return @c SVN_ERR_REPOS_BAD_ARGS if it isn't. For some
43 * "svn:" properties, also validate the @a value, and return
44 * @c SVN_ERR_BAD_PROPERTY_VALUE if it is not valid.
46 * Use @a pool for temporary allocations.
48 * @note This function is used to implement server-side validation.
49 * Consequently, if you make this function stricter in what it accepts, you
50 * (a) break svnsync'ing of existing repositories that contain now-invalid
51 * properties, (b) do not preclude such invalid values from entering the
52 * repository via tools that use the svn_fs_* API directly (possibly
53 * including svnadmin and svnlook). This has happened before and there
54 * are known (documented, but unsupported) upgrade paths in some cases.
59 svn_repos__validate_prop(const char *name,
60 const svn_string_t *value,
64 * Given the error @a err from svn_repos_fs_commit_txn(), return an
65 * string containing either or both of the svn_fs_commit_txn() error
66 * and the SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error from
67 * the post-commit hook. Any error tracing placeholders in the error
68 * chain are skipped over.
70 * This function does not modify @a err.
72 * ### This method should not be necessary, but there are a few
73 * ### places, e.g. mod_dav_svn, where only a single error message
74 * ### string is returned to the caller and it is useful to have both
75 * ### error messages included in the message.
77 * Use @a pool to do any allocations in.
82 svn_repos__post_commit_error_str(svn_error_t *err,
85 /* A repos version of svn_fs_type */
87 svn_repos__fs_type(const char **fs_type,
88 const char *repos_path,
92 /* Create a commit editor for REPOS, based on REVISION. */
94 svn_repos__get_commit_ev2(svn_editor_t **editor,
97 const char *authz_repos_name,
98 const char *authz_user,
100 svn_commit_callback2_t commit_cb,
102 svn_cancel_func_t cancel_func,
104 apr_pool_t *result_pool,
105 apr_pool_t *scratch_pool);
108 svn_repos__replay_ev2(svn_fs_root_t *root,
109 const char *base_dir,
110 svn_revnum_t low_water_mark,
111 svn_editor_t *editor,
112 svn_repos_authz_func_t authz_read_func,
113 void *authz_read_baton,
114 apr_pool_t *scratch_pool);
116 /* A private addition to svn_repos_notify_warning_t. */
117 #define svn_repos__notify_warning_invalid_mergeinfo \
118 ((svn_repos_notify_warning_t)(-1))
123 #endif /* __cplusplus */
125 #endif /* SVN_REPOS_PRIVATE_H */