2 * wc.h : shared stuff internal to the svn_wc library.
4 * ====================================================================
5 * Copyright (c) 2000-2007 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
20 #ifndef SVN_LIBSVN_WC_H
21 #define SVN_LIBSVN_WC_H
23 #include <apr_pools.h>
26 #include "svn_types.h"
27 #include "svn_error.h"
32 #endif /* __cplusplus */
35 #define SVN_WC__TMP_EXT ".tmp"
36 #define SVN_WC__PROP_REJ_EXT ".prej"
37 #define SVN_WC__BASE_EXT ".svn-base" /* for text and prop bases */
38 #define SVN_WC__WORK_EXT ".svn-work" /* for working propfiles */
39 #define SVN_WC__REVERT_EXT ".svn-revert" /* for reverting a replaced
45 /* We can handle this format or anything lower, and we (should) error
48 * There is no format version 0; we started with 1.
50 * The change from 1 to 2 was the introduction of SVN_WC__WORK_EXT.
51 * For example, ".svn/props/foo" became ".svn/props/foo.svn-work".
53 * The change from 2 to 3 was the introduction of the entry attribute
54 * SVN_WC__ENTRY_ATTR_ABSENT.
56 * The change from 3 to 4 was the renaming of the magic "svn:this_dir"
59 * The change from 4 to 5 was the addition of support for replacing files
62 * The change from 5 to 6 was the introduction of caching of property
63 * modification state and certain properties in the entries file.
65 * The change from 6 to 7 was changing the entries file format from XML.
67 * The change from 7 to 8 was putting wcprops in one file per directory.
69 * The change from 8 to 9 was the addition of changelists, keep-local,
70 * and sticky depth (for selective/sparse checkouts).
72 * Please document any further format changes here.
74 #define SVN_WC__VERSION 9
76 /* A version <= this doesn't have property caching in the entries file. */
77 #define SVN_WC__NO_PROPCACHING_VERSION 5
79 /* A version <= this has the entries file in XML format. */
80 #define SVN_WC__XML_ENTRIES_VERSION 6
82 /* A version <= this has wcprops stored in one file per entry. */
83 #define SVN_WC__WCPROPS_MANY_FILES_VERSION 7
85 /*** Update traversals. ***/
87 struct svn_wc_traversal_info_t
89 /* The pool in which this structure and everything inside it is
93 /* The before and after values of the SVN_PROP_EXTERNALS property,
94 * for each directory on which that property changed. These have
95 * the same layout as those returned by svn_wc_edited_externals().
97 * The hashes, their keys, and their values are allocated in the
100 apr_hash_t
*externals_old
;
101 apr_hash_t
*externals_new
;
103 /* The ambient depths of the working copy directories. The keys are
104 working copy paths (as for svn_wc_edited_externals()), the values
105 are the result of svn_depth_to_word(depth_of_each_dir). */
111 /*** Timestamps. ***/
113 /* A special timestamp value which means "use the timestamp from the
114 working copy". This is sometimes used in a log entry like:
116 <modify-entry name="foo.c" revision="5" timestamp="working"/>
118 #define SVN_WC__TIMESTAMP_WC "working"
124 /* A special filesize value which means "use the filesize from the
125 working copy". This is sometimes used in a log entry like:
127 <modify-entry name="foo.c" revision="5" working-size="working"/>
129 #define SVN_WC__WORKING_SIZE_WC "working"
133 /*** Names and file/dir operations in the administrative area. ***/
135 /** The files within the administrative subdir. **/
136 #define SVN_WC__ADM_FORMAT "format"
137 #define SVN_WC__ADM_ENTRIES "entries"
138 #define SVN_WC__ADM_LOCK "lock"
139 #define SVN_WC__ADM_TMP "tmp"
140 #define SVN_WC__ADM_TEXT_BASE "text-base"
141 #define SVN_WC__ADM_PROPS "props"
142 #define SVN_WC__ADM_PROP_BASE "prop-base"
143 #define SVN_WC__ADM_DIR_PROPS "dir-props"
144 #define SVN_WC__ADM_DIR_PROP_BASE "dir-prop-base"
145 #define SVN_WC__ADM_DIR_PROP_REVERT "dir-prop-revert"
146 #define SVN_WC__ADM_WCPROPS "wcprops"
147 #define SVN_WC__ADM_DIR_WCPROPS "dir-wcprops"
148 #define SVN_WC__ADM_ALL_WCPROPS "all-wcprops"
149 #define SVN_WC__ADM_LOG "log"
150 #define SVN_WC__ADM_KILLME "KILLME"
151 #define SVN_WC__ADM_README "README.txt"
152 #define SVN_WC__ADM_EMPTY_FILE "empty-file"
154 /* The basename of the ".prej" file, if a directory ever has property
155 conflicts. This .prej file will appear *within* the conflicted
157 #define SVN_WC__THIS_DIR_PREJ "dir_conflicts"
159 /* Possible contents of the killme file. If present, signals that the
160 administrative area only should be deleted. */
161 #define SVN_WC__KILL_ADM_ONLY "adm-only"
164 /* A space separated list of properties that we cache presence/absence of.
166 * Note that each entry contains information about which properties are cached
167 * in that particular entry. This constant is only used when writing entries.
169 #define SVN_WC__CACHABLE_PROPS \
170 SVN_PROP_SPECIAL " " SVN_PROP_EXTERNALS " " SVN_PROP_NEEDS_LOCK
173 /* A few declarations for stuff in util.c.
174 * If this section gets big, move it all out into a new util.h file. */
176 /* Ensure that DIR exists. */
177 svn_error_t
*svn_wc__ensure_directory(const char *path
, apr_pool_t
*pool
);
179 /* Baton for svn_wc__compat_call_notify_func below. */
180 typedef struct svn_wc__compat_notify_baton_t
{
181 /* Wrapped func/baton. */
182 svn_wc_notify_func_t func
;
184 } svn_wc__compat_notify_baton_t
;
186 /* Implements svn_wc_notify_func2_t. Call BATON->func (BATON is of type
187 svn_wc__compat_notify_baton_t), passing BATON->baton and the appropriate
188 arguments from NOTIFY. */
189 void svn_wc__compat_call_notify_func(void *baton
,
190 const svn_wc_notify_t
*notify
,
193 /* Set *MODIFIED_P to non-zero if FILENAME's text is modified with
194 * regard to the base revision, else set *MODIFIED_P to zero.
195 * FILENAME is a path to the file, not just a basename. ADM_ACCESS
196 * must be an access baton for @a FILENAME.
198 * If FORCE_COMPARISON is true, this function will not allow early
199 * return mechanisms that avoid actual content comparison. Instead,
200 * if there is a text base, a full byte-by-byte comparison will be
201 * done, and the entry checksum verified as well. (This means that if
202 * the text base is much longer than the working file, every byte of
203 * the text base will still be examined.)
205 * If COMPARE_TEXTBASES is true, the comparison will be between a
206 * detranslated version of *FILENAME and the text base, otherwise, a
207 * translated version of the text base and *FILENAME will be compared.
209 * If FILENAME does not exist, consider it unmodified. If it exists
210 * but is not under revision control (not even scheduled for
211 * addition), return the error SVN_ERR_ENTRY_NOT_FOUND.
214 svn_wc__text_modified_internal_p(svn_boolean_t
*modified_p
,
215 const char *filename
,
216 svn_boolean_t force_comparison
,
217 svn_wc_adm_access_t
*adm_access
,
218 svn_boolean_t compare_textbases
,
223 /* Merge the difference between LEFT and RIGHT into MERGE_TARGET,
224 accumulating instructions to update the working copy into LOG_ACCUM.
226 Note that, in the case of updating, the update can have sent new
227 properties, which could affect the way the wc target is
228 detranslated and compared with LEFT and RIGHT for merging.
230 If COPYFROM_TEXT is not NULL, the "local mods" text should be taken
231 from the path named there instead of from MERGE_TARGET (but the
232 merge should still be installed into MERGE_TARGET). The merge
233 target is allowed to not be under version control in this case.
235 The merge result is stored in *MERGE_OUTCOME and merge conflicts
236 are marked in MERGE_RESULT using LEFT_LABEL, RIGHT_LABEL and
239 When DRY_RUN is true, no actual changes are made to the working copy.
241 If DIFF3_CMD is specified, the given external diff3 tool will
242 be used instead of our built in diff3 routines.
244 When MERGE_OPTIONS are specified, they are used by the internal
245 diff3 routines, or passed to the external diff3 tool.
247 If CONFLICT_FUNC is non-NULL, then call it with CONFLICT_BATON if a
248 conflict is encountered, giving the callback a chance to resolve
249 the conflict (before marking the file 'conflicted').
251 Property changes sent by the update are provided in PROP_DIFF.
253 For a complete description, see svn_wc_merge2() for which this is
254 the (loggy) implementation.
257 svn_wc__merge_internal(svn_stringbuf_t
**log_accum
,
258 enum svn_wc_merge_outcome_t
*merge_outcome
,
261 const char *merge_target
,
262 const char *copyfrom_text
,
263 svn_wc_adm_access_t
*adm_access
,
264 const char *left_label
,
265 const char *right_label
,
266 const char *target_label
,
267 svn_boolean_t dry_run
,
268 const char *diff3_cmd
,
269 const apr_array_header_t
*merge_options
,
270 const apr_array_header_t
*prop_diff
,
271 svn_wc_conflict_resolver_func_t conflict_func
,
272 void *conflict_baton
,
275 /* A default error handler for svn_wc_walk_entries3(). Returns ERR in
278 svn_wc__walker_default_error_handler(const char *path
,
283 /* Set *EDITOR and *EDIT_BATON to an ambient-depth-based filtering
284 * editor that wraps WRAPPED_EDITOR and WRAPPED_BATON. This is only
285 * required for operations where the requested depth is @c
286 * svn_depth_unknown and the server's editor driver doesn't understand
287 * depth. It is safe for *EDITOR and *EDIT_BATON to start as
288 * WRAPPED_EDITOR and WRAPPED_BATON.
290 * ANCHOR, TARGET, and ADM_ACCESS are as in svn_wc_get_update_editor3.
292 * @a requested_depth must be one of the following depth values:
293 * @c svn_depth_infinity, @c svn_depth_empty, @c svn_depth_files,
294 * @c svn_depth_immediates, or @c svn_depth_unknown.
296 * Allocations are done in POOL.
299 svn_wc__ambient_depth_filter_editor(const svn_delta_editor_t
**editor
,
301 const svn_delta_editor_t
*wrapped_editor
,
302 void *wrapped_edit_baton
,
305 svn_wc_adm_access_t
*adm_access
,
310 #endif /* __cplusplus */
312 #endif /* SVN_LIBSVN_WC_H */