4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
25 #ifndef SVN_LIBSVN_WC_PROPS_H
26 #define SVN_LIBSVN_WC_PROPS_H
28 #include <apr_pools.h>
30 #include "svn_types.h"
31 #include "svn_string.h"
32 #include "svn_props.h"
38 #endif /* __cplusplus */
40 /* Internal function for diffing props. See svn_wc_get_prop_diffs2(). */
42 svn_wc__internal_propdiff(apr_array_header_t **propchanges,
43 apr_hash_t **original_props,
45 const char *local_abspath,
46 apr_pool_t *result_pool,
47 apr_pool_t *scratch_pool);
50 /* Internal function for fetching a property. See svn_wc_prop_get2(). */
52 svn_wc__internal_propget(const svn_string_t **value,
54 const char *local_abspath,
56 apr_pool_t *result_pool,
57 apr_pool_t *scratch_pool);
59 /* Validate and canonicalize the PROPS like svn_wc_prop_set4() does;
60 * see that function for details of the SKIP_SOME_CHECKS option.
62 * The properties are checked against the node at LOCAL_ABSPATH (which
63 * need not be under version control) of kind KIND. This text of this
64 * node may be read (if it is a file) in order to validate the
65 * svn:eol-style property.
67 * Only regular props are accepted; WC props and entry props raise an error
68 * (unlike svn_wc_prop_set4() which accepts WC props).
70 * Set *PREPARED_PROPS to the resulting canonicalized properties,
71 * allocating any new data in RESULT_POOL but making shallow copies of
72 * keys and unchanged values from PROPS.
75 svn_wc__canonicalize_props(apr_hash_t **prepared_props,
76 const char *local_abspath,
77 svn_node_kind_t node_kind,
78 const apr_hash_t *props,
79 svn_boolean_t skip_some_checks,
80 apr_pool_t *result_pool,
81 apr_pool_t *scratch_pool);
84 /* Given LOCAL_ABSPATH/DB and an array of PROPCHANGES based on
85 SERVER_BASEPROPS, calculate what changes should be applied to the working
88 We return the new property collections to the caller, so the caller
89 can combine the property update with other operations.
91 If SERVER_BASEPROPS is NULL then use the pristine props as PROPCHANGES
94 Return the new set of actual properties in *NEW_ACTUAL_PROPS.
96 Append any conflicts of the actual props to *CONFLICT_SKEL. (First
97 allocate *CONFLICT_SKEL from RESULT_POOL if it is initially NULL.
98 CONFLICT_SKEL itself must not be NULL.)
100 If STATE is non-null, set *STATE to the state of the local properties
101 after the merge, one of:
103 svn_wc_notify_state_unchanged
104 svn_wc_notify_state_changed
105 svn_wc_notify_state_merged
106 svn_wc_notify_state_conflicted
109 svn_wc__merge_props(svn_skel_t **conflict_skel,
110 svn_wc_notify_state_t *state,
111 apr_hash_t **new_actual_props,
113 const char *local_abspath,
114 /*const*/ apr_hash_t *server_baseprops,
115 /*const*/ apr_hash_t *pristine_props,
116 /*const*/ apr_hash_t *actual_props,
117 const apr_array_header_t *propchanges,
118 apr_pool_t *result_pool,
119 apr_pool_t *scratch_pool);
122 /* Given PROPERTIES is array of @c svn_prop_t structures. Returns TRUE if any
123 of the PROPERTIES are the known "magic" ones that might require
124 changing the working file. */
125 svn_boolean_t svn_wc__has_magic_property(const apr_array_header_t *properties);
127 /* Set *MODIFIED_P TRUE if the props for LOCAL_ABSPATH have been modified. */
129 svn_wc__props_modified(svn_boolean_t *modified_p,
131 const char *local_abspath,
132 apr_pool_t *scratch_pool);
134 /* Internal version of svn_wc_prop_list2(). */
136 svn_wc__get_actual_props(apr_hash_t **props,
138 const char *local_abspath,
139 apr_pool_t *result_pool,
140 apr_pool_t *scratch_pool);
142 /* Creates a property reject file at *TMP_PREJFILE_ABSPATH, with
143 either the property conflict data from DB (when PROP_CONFLICT_DATA
144 is NULL) or the information in PROP_CONFLICT_DATA if it isn't.
147 svn_wc__create_prejfile(const char **tmp_prejfile_abspath,
149 const char *local_abspath,
150 const svn_skel_t *prop_conflict_data,
151 svn_cancel_func_t cancel_func,
153 apr_pool_t *result_pool,
154 apr_pool_t *scratch_pool);
158 #endif /* __cplusplus */
160 #endif /* SVN_LIBSVN_WC_PROPS_H */