svn_repos_private.h revision 289166
1/** 2 * @copyright 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 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 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 19 * under the License. 20 * ==================================================================== 21 * @endcopyright 22 * 23 * @file svn_repos_private.h 24 * @brief Subversion-internal repos APIs. 25 */ 26 27#ifndef SVN_REPOS_PRIVATE_H 28#define SVN_REPOS_PRIVATE_H 29 30#include <apr_pools.h> 31 32#include "svn_types.h" 33#include "svn_repos.h" 34#include "svn_editor.h" 35 36#ifdef __cplusplus 37extern "C" { 38#endif /* __cplusplus */ 39 40 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. 45 * 46 * Use @a pool for temporary allocations. 47 * 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. 55 * 56 * @since New in 1.7. 57 */ 58svn_error_t * 59svn_repos__validate_prop(const char *name, 60 const svn_string_t *value, 61 apr_pool_t *pool); 62 63/** 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. 69 * 70 * This function does not modify @a err. 71 * 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. 76 * 77 * Use @a pool to do any allocations in. 78 * 79 * @since New in 1.7. 80 */ 81const char * 82svn_repos__post_commit_error_str(svn_error_t *err, 83 apr_pool_t *pool); 84 85/* A repos version of svn_fs_type */ 86svn_error_t * 87svn_repos__fs_type(const char **fs_type, 88 const char *repos_path, 89 apr_pool_t *pool); 90 91 92/* Create a commit editor for REPOS, based on REVISION. */ 93svn_error_t * 94svn_repos__get_commit_ev2(svn_editor_t **editor, 95 svn_repos_t *repos, 96 svn_authz_t *authz, 97 const char *authz_repos_name, 98 const char *authz_user, 99 apr_hash_t *revprops, 100 svn_commit_callback2_t commit_cb, 101 void *commit_baton, 102 svn_cancel_func_t cancel_func, 103 void *cancel_baton, 104 apr_pool_t *result_pool, 105 apr_pool_t *scratch_pool); 106 107svn_error_t * 108svn_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); 115 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)) 119 120 121#ifdef __cplusplus 122} 123#endif /* __cplusplus */ 124 125#endif /* SVN_REPOS_PRIVATE_H */ 126