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_wc_private.h
24 * @brief The Subversion Working Copy Library - Internal routines
30 * - Ability to manipulate working copy's versioned data.
31 * - Ability to manipulate working copy's administrative files.
37 #ifndef SVN_WC_PRIVATE_H
38 #define SVN_WC_PRIVATE_H
40 #include "svn_types.h"
42 #include "private/svn_diff_tree.h"
46 #endif /* __cplusplus */
49 /* Return TRUE iff CLHASH (a hash whose keys are const char *
50 changelist names) is NULL or if LOCAL_ABSPATH is part of a changelist in
53 svn_wc__changelist_match(svn_wc_context_t *wc_ctx,
54 const char *local_abspath,
55 const apr_hash_t *clhash,
56 apr_pool_t *scratch_pool);
58 /* Like svn_wc_get_update_editorX and svn_wc_get_status_editorX, but only
59 allows updating a file external LOCAL_ABSPATH.
61 Since this only deals with files, the WCROOT_IPROPS argument in
62 svn_wc_get_update_editorX and svn_wc_get_status_editorX (hashes mapping
63 const char * absolute working copy paths, which are working copy roots, to
64 depth-first ordered arrays of svn_prop_inherited_item_t * structures) is
65 simply IPROPS here, a depth-first ordered arrays of
66 svn_prop_inherited_item_t * structs. */
68 svn_wc__get_file_external_editor(const svn_delta_editor_t **editor,
70 svn_revnum_t *target_revision,
71 svn_wc_context_t *wc_ctx,
72 const char *local_abspath,
73 const char *wri_abspath,
75 const char *repos_root_url,
76 const char *repos_uuid,
77 apr_array_header_t *iprops,
78 svn_boolean_t use_commit_times,
79 const char *diff3_cmd,
80 const apr_array_header_t *preserved_exts,
81 const char *record_ancestor_abspath,
82 const char *recorded_url,
83 const svn_opt_revision_t *recorded_peg_rev,
84 const svn_opt_revision_t *recorded_rev,
85 svn_wc_conflict_resolver_func2_t conflict_func,
87 svn_cancel_func_t cancel_func,
89 svn_wc_notify_func2_t notify_func,
91 apr_pool_t *result_pool,
92 apr_pool_t *scratch_pool);
94 /* Like svn_wc_crawl_revisionsX, but only supports updating a file external
95 LOCAL_ABSPATH which may or may not exist yet. */
97 svn_wc__crawl_file_external(svn_wc_context_t *wc_ctx,
98 const char *local_abspath,
99 const svn_ra_reporter3_t *reporter,
101 svn_boolean_t restore_files,
102 svn_boolean_t use_commit_times,
103 svn_cancel_func_t cancel_func,
105 svn_wc_notify_func2_t notify_func,
107 apr_pool_t *scratch_pool);
109 /* Check if LOCAL_ABSPATH is an external in the working copy identified
110 by WRI_ABSPATH. If not return SVN_ERR_WC_PATH_NOT_FOUND.
112 If it is an external return more information on this external.
114 If IGNORE_ENOENT, then set *external_kind to svn_node_none, when
115 LOCAL_ABSPATH is not an external instead of returning an error.
117 Here is an overview of how DEFINING_REVISION and
118 DEFINING_OPERATIONAL_REVISION would be set for which kinds of externals
121 svn:externals line DEFINING_REV. DEFINING_OP._REV.
125 -r1 ^/foo bar 1 SVN_INVALID_REVNUM
126 ^/foo bar SVN_INVALID_REVNUM SVN_INVALID_REVNUM
127 ^/foo@HEAD bar SVN_INVALID_REVNUM SVN_INVALID_REVNUM
128 -rHEAD ^/foo bar -- not a valid externals definition --
131 svn_wc__read_external_info(svn_node_kind_t *external_kind,
132 const char **defining_abspath,
133 const char **defining_url,
134 svn_revnum_t *defining_operational_revision,
135 svn_revnum_t *defining_revision,
136 svn_wc_context_t *wc_ctx,
137 const char *wri_abspath,
138 const char *local_abspath,
139 svn_boolean_t ignore_enoent,
140 apr_pool_t *result_pool,
141 apr_pool_t *scratch_pool);
143 /** See svn_wc__committable_externals_below(). */
144 typedef struct svn_wc__committable_external_info_t {
146 /* The local absolute path where the external should be checked out. */
147 const char *local_abspath;
149 /* The relpath part of the source URL the external should be checked out
151 const char *repos_relpath;
153 /* The root URL part of the source URL the external should be checked out
155 const char *repos_root_url;
157 /* Set to either svn_node_file or svn_node_dir. */
158 svn_node_kind_t kind;
160 } svn_wc__committable_external_info_t;
162 /* Add svn_wc__committable_external_info_t* items to *EXTERNALS, describing
163 * 'committable' externals checked out below LOCAL_ABSPATH. Recursively find
164 * all nested externals (externals defined inside externals).
166 * In this context, a 'committable' external belongs to the same repository as
167 * LOCAL_ABSPATH, is not revision-pegged and is currently checked out in the
168 * WC. (Local modifications are not tested for.)
170 * *EXTERNALS must be initialized either to NULL or to a pointer created with
171 * apr_array_make(..., sizeof(svn_wc__committable_external_info_t *)). If
172 * *EXTERNALS is initialized to NULL, an array will be allocated from
173 * RESULT_POOL as necessary. If no committable externals are found,
174 * *EXTERNALS is left unchanged.
176 * DEPTH limits the recursion below LOCAL_ABSPATH.
178 * This function will not find externals defined in some parent WC above
179 * LOCAL_ABSPATH's WC-root.
181 * ###TODO: Add a WRI_ABSPATH (wc root indicator) separate from LOCAL_ABSPATH,
182 * to allow searching any wc-root for externals under LOCAL_ABSPATH, not only
183 * LOCAL_ABSPATH's most immediate wc-root. */
185 svn_wc__committable_externals_below(apr_array_header_t **externals,
186 svn_wc_context_t *wc_ctx,
187 const char *local_abspath,
189 apr_pool_t *result_pool,
190 apr_pool_t *scratch_pool);
192 /* Gets a mapping from const char * local abspaths of externals to the const
193 char * local abspath of where they are defined for all externals defined
194 at or below LOCAL_ABSPATH.
196 ### Returns NULL in *EXTERNALS until we bumped to format 29.
198 Allocate the result in RESULT_POOL and perform temporary allocations in
201 svn_wc__externals_defined_below(apr_hash_t **externals,
202 svn_wc_context_t *wc_ctx,
203 const char *local_abspath,
204 apr_pool_t *result_pool,
205 apr_pool_t *scratch_pool);
208 /* Registers a new external at LOCAL_ABSPATH in the working copy containing
211 The node is registered as defined on DEFINING_ABSPATH (must be an ancestor
212 of LOCAL_ABSPATH) of kind KIND.
214 The external is registered as from repository REPOS_ROOT_URL with uuid
215 REPOS_UUID and the defining relative path REPOS_RELPATH.
217 If the revision of the node is locked OPERATIONAL_REVISION and REVISION
218 are the peg and normal revision; otherwise their value is
221 ### Only KIND svn_node_dir is supported.
223 Perform temporary allocations in SCRATCH_POOL.
226 svn_wc__external_register(svn_wc_context_t *wc_ctx,
227 const char *defining_abspath,
228 const char *local_abspath,
229 svn_node_kind_t kind,
230 const char *repos_root_url,
231 const char *repos_uuid,
232 const char *repos_relpath,
233 svn_revnum_t operational_revision,
234 svn_revnum_t revision,
235 apr_pool_t *scratch_pool);
237 /* Remove the external at LOCAL_ABSPATH from the working copy identified by
238 WRI_ABSPATH using WC_CTX.
240 If DECLARATION_ONLY is TRUE, only remove the registration and leave the
241 on-disk structure untouched.
243 If not NULL, call CANCEL_FUNC with CANCEL_BATON to allow canceling while
244 removing the working copy files.
246 ### This function wraps svn_wc_remove_from_revision_control2().
249 svn_wc__external_remove(svn_wc_context_t *wc_ctx,
250 const char *wri_abspath,
251 const char *local_abspath,
252 svn_boolean_t declaration_only,
253 svn_cancel_func_t cancel_func,
255 apr_pool_t *scratch_pool);
257 /* Gather all svn:externals property values from the actual properties on
258 directories below LOCAL_ABSPATH as a mapping of const char *local_abspath
259 to const char * values.
261 Use DEPTH as how it would be used to limit the externals property results
262 on update. (So any depth < infinity will only read svn:externals on
263 LOCAL_ABSPATH itself)
265 If DEPTHS is not NULL, set *depths to an apr_hash_t* mapping the same
266 local_abspaths to the const char * ambient depth of the node.
268 Allocate the result in RESULT_POOL and perform temporary allocations in
271 svn_wc__externals_gather_definitions(apr_hash_t **externals,
272 apr_hash_t **ambient_depths,
273 svn_wc_context_t *wc_ctx,
274 const char *local_abspath,
276 apr_pool_t *result_pool,
277 apr_pool_t *scratch_pool);
279 /* Close the DB for LOCAL_ABSPATH. Perform temporary allocations in
282 Wraps svn_wc__db_drop_root(). */
284 svn_wc__close_db(const char *external_abspath,
285 svn_wc_context_t *wc_ctx,
286 apr_pool_t *scratch_pool);
288 /** Set @a *tree_conflict to a newly allocated @c
289 * svn_wc_conflict_description_t structure describing the tree
290 * conflict state of @a victim_abspath, or to @c NULL if @a victim_abspath
291 * is not in a state of tree conflict. @a wc_ctx is a working copy context
292 * used to access @a victim_path. Allocate @a *tree_conflict in @a result_pool,
293 * use @a scratch_pool for temporary allocations.
296 svn_wc__get_tree_conflict(const svn_wc_conflict_description2_t **tree_conflict,
297 svn_wc_context_t *wc_ctx,
298 const char *victim_abspath,
299 apr_pool_t *result_pool,
300 apr_pool_t *scratch_pool);
302 /** Record the tree conflict described by @a conflict in the WC for
303 * @a conflict->local_abspath. Use @a scratch_pool for all temporary
306 * Returns an SVN_ERR_WC_PATH_UNEXPECTED_STATUS error when
307 * CONFLICT->LOCAL_ABSPATH is already tree conflicted.
309 * ### This function can't set moved_away, moved_here conflicts for
310 * any operation, except merges.
313 svn_wc__add_tree_conflict(svn_wc_context_t *wc_ctx,
314 const svn_wc_conflict_description2_t *conflict,
315 apr_pool_t *scratch_pool);
317 /* Remove any tree conflict on victim @a victim_abspath using @a wc_ctx.
318 * (If there is no such conflict recorded, do nothing and return success.)
320 * Do all temporary allocations in @a scratch_pool.
323 svn_wc__del_tree_conflict(svn_wc_context_t *wc_ctx,
324 const char *victim_abspath,
325 apr_pool_t *scratch_pool);
327 /** Check whether LOCAL_ABSPATH has a parent directory that knows about its
328 * existence. Set *IS_WCROOT to FALSE if a parent is found, and to TRUE
329 * if there is no such parent.
331 * Like svn_wc_is_wc_root2(), but doesn't consider switched subdirs or
332 * deleted entries as working copy roots.
335 svn_wc__is_wcroot(svn_boolean_t *is_wcroot,
336 svn_wc_context_t *wc_ctx,
337 const char *local_abspath,
338 apr_pool_t *scratch_pool);
341 /** Set @a *wcroot_abspath to the local abspath of the root of the
342 * working copy in which @a local_abspath resides.
345 svn_wc__get_wcroot(const char **wcroot_abspath,
346 svn_wc_context_t *wc_ctx,
347 const char *local_abspath,
348 apr_pool_t *result_pool,
349 apr_pool_t *scratch_pool);
351 /** Set @a *dir to the abspath of the directory in which administrative
352 * data for experimental features may be stored. This directory is inside
353 * the WC's administrative directory. Ensure the directory exists.
355 * @a local_abspath is any path in the WC, and is used to find the WC root.
357 * @warning EXPERIMENTAL.
361 svn_wc__get_experimental_dir(char **dir,
362 svn_wc_context_t *wc_ctx,
363 const char *local_abspath,
364 apr_pool_t *result_pool,
365 apr_pool_t *scratch_pool);
368 * The following are temporary APIs to aid in the transition from wc-1 to
369 * wc-ng. Use them for new development now, but they may be disappearing
370 * before the 1.7 release.
374 * Convert from svn_wc_conflict_description2_t to
375 * svn_wc_conflict_description_t. This is needed by some backwards-compat
376 * code in libsvn_client/ctx.c
378 * Allocate the result in RESULT_POOL.
380 svn_wc_conflict_description_t *
381 svn_wc__cd2_to_cd(const svn_wc_conflict_description2_t *conflict,
382 apr_pool_t *result_pool);
386 * Convert from svn_wc_status3_t to svn_wc_status2_t.
387 * Allocate the result in RESULT_POOL.
389 * Deprecated because svn_wc_status2_t is deprecated and the only
390 * calls are from other deprecated functions.
394 svn_wc__status2_from_3(svn_wc_status2_t **status,
395 const svn_wc_status3_t *old_status,
396 svn_wc_context_t *wc_ctx,
397 const char *local_abspath,
398 apr_pool_t *result_pool,
399 apr_pool_t *scratch_pool);
402 * Set @a *children to a new array of the immediate children of the working
403 * node at @a dir_abspath. The elements of @a *children are (const char *)
406 * Include children that are scheduled for deletion, but not those that
407 * are excluded, server-excluded or not-present.
409 * Return every path that refers to a child of the working node at
410 * @a dir_abspath. Do not include a path just because it was a child of a
411 * deleted directory that existed at @a dir_abspath if that directory is now
412 * sheduled to be replaced by the working node at @a dir_abspath.
414 * Allocate @a *children in @a result_pool. Use @a wc_ctx to access the
415 * working copy, and @a scratch_pool for all temporary allocations.
418 svn_wc__node_get_children_of_working_node(const apr_array_header_t **children,
419 svn_wc_context_t *wc_ctx,
420 const char *dir_abspath,
421 apr_pool_t *result_pool,
422 apr_pool_t *scratch_pool);
425 * Gets the immediate 'not-present' children of a node.
427 * #### Needed during 'svn cp WC URL' to handle mixed revision cases
430 svn_wc__node_get_not_present_children(const apr_array_header_t **children,
431 svn_wc_context_t *wc_ctx,
432 const char *dir_abspath,
433 apr_pool_t *result_pool,
434 apr_pool_t *scratch_pool);
437 * Fetch the repository information for the working version
438 * of the node at @a local_abspath into @a *revision, @a *repos_relpath,
439 * @a *repos_root_url and @a *repos_uuid. Use @a wc_ctx to access the working
440 * copy. Allocate results in @a result_pool.
442 * @a *revision will be set to SVN_INVALID_REVNUM for any shadowed node (including
443 * added and deleted nodes). All other output values will be set to the current
444 * values or those they would have after a commit.
446 * All output argument may be NULL, indicating no interest.
449 svn_wc__node_get_repos_info(svn_revnum_t *revision,
450 const char **repos_relpath,
451 const char **repos_root_url,
452 const char **repos_uuid,
453 svn_wc_context_t *wc_ctx,
454 const char *local_abspath,
455 apr_pool_t *result_pool,
456 apr_pool_t *scratch_pool);
459 * Get the changed revision, date and author for @a local_abspath using @a
460 * wc_ctx. Allocate the return values in @a result_pool; use @a scratch_pool
461 * for temporary allocations. Any of the return pointers may be @c NULL, in
462 * which case they are not set.
464 * If @a local_abspath is not in the working copy, return
465 * @c SVN_ERR_WC_PATH_NOT_FOUND.
468 svn_wc__node_get_changed_info(svn_revnum_t *changed_rev,
469 apr_time_t *changed_date,
470 const char **changed_author,
471 svn_wc_context_t *wc_ctx,
472 const char *local_abspath,
473 apr_pool_t *result_pool,
474 apr_pool_t *scratch_pool);
478 * Set @a *url to the corresponding url for @a local_abspath, using @a wc_ctx.
479 * If the node is added, return the url it will have in the repository.
481 * If @a local_abspath is not in the working copy, return
482 * @c SVN_ERR_WC_PATH_NOT_FOUND.
485 svn_wc__node_get_url(const char **url,
486 svn_wc_context_t *wc_ctx,
487 const char *local_abspath,
488 apr_pool_t *result_pool,
489 apr_pool_t *scratch_pool);
492 * Retrieves the origin of the node as it is known in the repository. For
493 * a copied node this retrieves where the node is copied from, for an added
494 * node this returns NULL/INVALID outputs, and for any other node this
495 * retrieves the repository location.
497 * All output arguments may be NULL.
499 * If @a is_copy is not NULL, sets @a *is_copy to TRUE if the origin is a copy
500 * of the original node.
502 * If not NULL, sets @a revision, @a repos_relpath, @a repos_root_url and
503 * @a repos_uuid to the original (if a copy) or their current values.
505 * If not NULL, set @a depth, to the recorded depth on @a local_abspath.
507 * If @a copy_root_abspath is not NULL, and @a *is_copy indicates that the
508 * node was copied, set @a *copy_root_abspath to the local absolute path of
509 * the root of the copied subtree containing the node. If the copied node is
510 * a root by itself, @a *copy_root_abspath will match @a local_abspath (but
511 * won't necessarily point to the same string in memory).
513 * If @a scan_deleted is TRUE, determine the origin of the deleted node. If
514 * @a scan_deleted is FALSE, return NULL, SVN_INVALID_REVNUM or FALSE for
517 * Allocate the result in @a result_pool. Perform temporary allocations in
520 svn_wc__node_get_origin(svn_boolean_t *is_copy,
521 svn_revnum_t *revision,
522 const char **repos_relpath,
523 const char **repos_root_url,
524 const char **repos_uuid,
526 const char **copy_root_abspath,
527 svn_wc_context_t *wc_ctx,
528 const char *local_abspath,
529 svn_boolean_t scan_deleted,
530 apr_pool_t *result_pool,
531 apr_pool_t *scratch_pool);
534 * Set @a *not_present to TRUE when @a local_abspath has status
535 * svn_wc__db_status_not_present. Set @a *user_excluded to TRUE when
536 * @a local_abspath has status svn_wc__db_status_excluded. Set
537 * @a *server_excluded to TRUE when @a local_abspath has status
538 * svn_wc__db_status_server_excluded. Otherwise set these values to FALSE.
539 * If @a base_only is TRUE then only the base node will be examined,
540 * otherwise the current base or working node will be examined.
542 * If a value is not interesting you can pass NULL.
544 * If @a local_abspath is not in the working copy, return
545 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
549 svn_wc__node_is_not_present(svn_boolean_t *not_present,
550 svn_boolean_t *user_excluded,
551 svn_boolean_t *server_excluded,
552 svn_wc_context_t *wc_ctx,
553 const char *local_abspath,
554 svn_boolean_t base_only,
555 apr_pool_t *scratch_pool);
558 * Set @a *is_added to whether @a local_abspath is added, using
559 * @a wc_ctx. If @a local_abspath is not in the working copy, return
560 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
563 * NOTE: "added" in this sense, means it was added, copied-here, or
564 * moved-here. This function provides NO information on whether this
565 * addition has replaced another node.
567 * To be clear, this does NOT correspond to svn_wc_schedule_add.
570 svn_wc__node_is_added(svn_boolean_t *is_added,
571 svn_wc_context_t *wc_ctx,
572 const char *local_abspath,
573 apr_pool_t *scratch_pool);
576 * Set @a *has_working to whether @a local_abspath has a working node (which
577 * might shadow BASE nodes)
579 * This is a check similar to status = added or status = deleted.
582 svn_wc__node_has_working(svn_boolean_t *has_working,
583 svn_wc_context_t *wc_ctx,
584 const char *local_abspath,
585 apr_pool_t *scratch_pool);
589 * Get the repository location of the base node at @a local_abspath.
591 * Set *REVISION, *REPOS_RELPATH, *REPOS_ROOT_URL *REPOS_UUID and *LOCK_TOKEN
592 * to the location that this node was checked out at or last updated/switched
593 * to, regardless of any uncommitted changes (delete, replace and/or copy-here/
596 * If there is no BASE node at @a local_abspath or if @a show_hidden is FALSE,
597 * no status 'normal' or 'incomplete' BASE node report
598 * SVN_ERR_WC_PATH_NOT_FOUND, or if @a ignore_enoent is TRUE, @a kind
599 * svn_node_unknown, @a revision SVN_INVALID_REVNUM and all other values NULL.
601 * All output arguments may be NULL.
603 * Allocate the results in @a result_pool. Perform temporary allocations in
607 svn_wc__node_get_base(svn_node_kind_t *kind,
608 svn_revnum_t *revision,
609 const char **repos_relpath,
610 const char **repos_root_url,
611 const char **repos_uuid,
612 const char **lock_token,
613 svn_wc_context_t *wc_ctx,
614 const char *local_abspath,
615 svn_boolean_t ignore_enoent,
616 apr_pool_t *result_pool,
617 apr_pool_t *scratch_pool);
620 /* Return an array of const char * elements, which represent local absolute
621 * paths for nodes, within the working copy indicated by WRI_ABSPATH, which
622 * have a basename matching BASENAME and have node kind KIND.
623 * If no such nodes exist, return an empty array.
625 * This function returns only paths to nodes which are present in the highest
626 * layer of the WC. In other words, paths to deleted and/or excluded nodes are
630 svn_wc__find_working_nodes_with_basename(apr_array_header_t **abspaths,
631 const char *wri_abspath,
632 const char *basename,
633 svn_node_kind_t kind,
634 svn_wc_context_t *wc_ctx,
635 apr_pool_t *result_pool,
636 apr_pool_t *scratch_pool);
638 /* Return an array of const char * elements, which represent local absolute
639 * paths for nodes, within the working copy indicated by WRI_ABSPATH, which
640 * are copies of REPOS_RELPATH and have node kind KIND.
641 * If no such nodes exist, return an empty array.
643 * This function returns only paths to nodes which are present in the highest
644 * layer of the WC. In other words, paths to deleted and/or excluded nodes are
648 svn_wc__find_copies_of_repos_path(apr_array_header_t **abspaths,
649 const char *wri_abspath,
650 const char *repos_relpath,
651 svn_node_kind_t kind,
652 svn_wc_context_t *wc_ctx,
653 apr_pool_t *result_pool,
654 apr_pool_t *scratch_pool);
656 /* Get the working revision of @a local_abspath using @a wc_ctx. If @a
657 * local_abspath is not in the working copy, return @c
658 * SVN_ERR_WC_PATH_NOT_FOUND.
660 * This function is meant as a temporary solution for using the old-style
661 * semantics of entries. It will handle any uncommitted changes (delete,
662 * replace and/or copy-here/move-here).
664 * For a delete the @a revision is the BASE node of the operation root, e.g
665 * the path that was deleted. But if the delete is below an add, the
666 * revision is set to SVN_INVALID_REVNUM. For an add, copy or move we return
667 * SVN_INVALID_REVNUM. In case of a replacement, we return the BASE
670 * The @a changed_rev is set to the latest committed change to @a
671 * local_abspath before or equal to @a revision, unless the node is
672 * copied-here or moved-here. Then it is the revision of the latest committed
673 * change before or equal to the copyfrom_rev. NOTE, that we use
674 * SVN_INVALID_REVNUM for a scheduled copy or move.
676 * The @a changed_date and @a changed_author are the ones associated with @a
680 svn_wc__node_get_pre_ng_status_data(svn_revnum_t *revision,
681 svn_revnum_t *changed_rev,
682 apr_time_t *changed_date,
683 const char **changed_author,
684 svn_wc_context_t *wc_ctx,
685 const char *local_abspath,
686 apr_pool_t *result_pool,
687 apr_pool_t *scratch_pool);
690 * Acquire a recursive write lock for @a local_abspath. If @a lock_anchor
691 * is true, determine if @a local_abspath has an anchor that should be locked
692 * instead; otherwise, @a local_abspath must be a versioned directory.
693 * Store the obtained lock in @a wc_ctx.
695 * If @a lock_root_abspath is not NULL, store the root of the lock in
696 * @a *lock_root_abspath. If @a lock_root_abspath is NULL, then @a
697 * lock_anchor must be FALSE.
699 * Returns @c SVN_ERR_WC_LOCKED if an existing lock is encountered, in
700 * which case any locks acquired will have been released.
702 * If @a lock_anchor is TRUE and @a lock_root_abspath is not NULL, @a
703 * lock_root_abspath will be set even when SVN_ERR_WC_LOCKED is returned.
706 svn_wc__acquire_write_lock(const char **lock_root_abspath,
707 svn_wc_context_t *wc_ctx,
708 const char *local_abspath,
709 svn_boolean_t lock_anchor,
710 apr_pool_t *result_pool,
711 apr_pool_t *scratch_pool);
715 * Recursively release write locks for @a local_abspath, using @a wc_ctx
716 * for working copy access. Only locks held by @a wc_ctx are released.
717 * Locks are not removed if work queue items are present.
719 * If @a local_abspath is not the root of an owned SVN_ERR_WC_NOT_LOCKED
723 svn_wc__release_write_lock(svn_wc_context_t *wc_ctx,
724 const char *local_abspath,
725 apr_pool_t *scratch_pool);
727 /** A callback invoked by the svn_wc__call_with_write_lock() function. */
728 typedef svn_error_t *(*svn_wc__with_write_lock_func_t)(void *baton,
729 apr_pool_t *result_pool,
730 apr_pool_t *scratch_pool);
733 /** Call function @a func while holding a write lock on
734 * @a local_abspath. The @a baton, and @a result_pool and
735 * @a scratch_pool, is passed @a func.
737 * If @a lock_anchor is TRUE, determine if @a local_abspath has an anchor
738 * that should be locked instead.
740 * Use @a wc_ctx for working copy access.
741 * The lock is guaranteed to be released after @a func returns.
744 svn_wc__call_with_write_lock(svn_wc__with_write_lock_func_t func,
746 svn_wc_context_t *wc_ctx,
747 const char *local_abspath,
748 svn_boolean_t lock_anchor,
749 apr_pool_t *result_pool,
750 apr_pool_t *scratch_pool);
752 /** Evaluate the expression @a expr while holding a write lock on
755 * @a expr must yield an (svn_error_t *) error code. If the error code
756 * is not #SVN_NO_ERROR, cause the function using this macro to return
757 * the error to its caller.
759 * If @a lock_anchor is TRUE, determine if @a local_abspath has an anchor
760 * that should be locked instead.
762 * Use @a wc_ctx for working copy access.
764 * The lock is guaranteed to be released after evaluating @a expr.
766 #define SVN_WC__CALL_WITH_WRITE_LOCK(expr, wc_ctx, local_abspath, \
767 lock_anchor, scratch_pool) \
769 svn_error_t *svn_wc__err1, *svn_wc__err2; \
770 const char *svn_wc__lock_root_abspath; \
771 SVN_ERR(svn_wc__acquire_write_lock(&svn_wc__lock_root_abspath, wc_ctx, \
772 local_abspath, lock_anchor, \
773 scratch_pool, scratch_pool)); \
774 svn_wc__err1 = (expr); \
775 svn_wc__err2 = svn_wc__release_write_lock( \
776 wc_ctx, svn_wc__lock_root_abspath, scratch_pool); \
777 SVN_ERR(svn_error_compose_create(svn_wc__err1, svn_wc__err2)); \
781 /** A callback invoked by svn_wc__prop_list_recursive().
782 * It is equivalent to svn_proplist_receiver_t declared in svn_client.h,
783 * but kept private within the svn_wc__ namespace because it is used within
784 * the bowels of libsvn_wc which don't include svn_client.h.
786 * @since New in 1.7. */
787 typedef svn_error_t *(*svn_wc__proplist_receiver_t)(void *baton,
788 const char *local_abspath,
790 apr_pool_t *scratch_pool);
792 /** Call @a receiver_func, passing @a receiver_baton, an absolute path, and
793 * a hash table mapping <tt>const char *</tt> names onto <tt>const
794 * svn_string_t *</tt> values for all the regular properties of the node
795 * at @a local_abspath and any node beneath @a local_abspath within the
796 * specified @a depth. @a receiver_fun must not be NULL.
798 * If @a propname is not NULL, the passed hash table will only contain
799 * the property @a propname.
801 * If @a pristine is not @c TRUE, and @a base_props is FALSE show local
802 * modifications to the properties.
804 * If a node has no properties, @a receiver_func is not called for the node.
806 * If @a changelists are non-NULL and non-empty, filter by them.
808 * Use @a wc_ctx to access the working copy, and @a scratch_pool for
809 * temporary allocations.
811 * If the node at @a local_abspath does not exist,
812 * #SVN_ERR_WC_PATH_NOT_FOUND is returned.
817 svn_wc__prop_list_recursive(svn_wc_context_t *wc_ctx,
818 const char *local_abspath,
819 const char *propname,
821 svn_boolean_t pristine,
822 const apr_array_header_t *changelists,
823 svn_wc__proplist_receiver_t receiver_func,
824 void *receiver_baton,
825 svn_cancel_func_t cancel_func,
827 apr_pool_t *scratch_pool);
830 * Set @a *inherited_props to a depth-first ordered array of
831 * #svn_prop_inherited_item_t * structures representing the properties
832 * inherited by @a local_abspath from the ACTUAL tree above
833 * @a local_abspath (looking through to the WORKING or BASE tree as
834 * required), up to and including the root of the working copy and
835 * any cached inherited properties inherited by the root.
837 * The #svn_prop_inherited_item_t->path_or_url members of the
838 * #svn_prop_inherited_item_t * structures in @a *inherited_props are
839 * paths relative to the repository root URL for cached inherited
840 * properties and absolute working copy paths otherwise.
842 * Allocate @a *inherited_props in @a result_pool. Use @a scratch_pool
843 * for temporary allocations.
846 svn_wc__get_iprops(apr_array_header_t **inherited_props,
847 svn_wc_context_t *wc_ctx,
848 const char *local_abspath,
849 const char *propname,
850 apr_pool_t *result_pool,
851 apr_pool_t *scratch_pool);
853 /** Obtain a mapping of const char * local_abspaths to const svn_string_t*
854 * property values in *VALUES, of all PROPNAME properties on LOCAL_ABSPATH
855 * and its descendants.
857 * Allocate the result in RESULT_POOL, and perform temporary allocations in
861 svn_wc__prop_retrieve_recursive(apr_hash_t **values,
862 svn_wc_context_t *wc_ctx,
863 const char *local_abspath,
864 const char *propname,
865 apr_pool_t *result_pool,
866 apr_pool_t *scratch_pool);
869 * Set @a *iprops_paths to a hash mapping const char * absolute working
870 * copy paths to the nodes repository root relative path for each path
871 * in the working copy at or below @a local_abspath, limited by @a depth,
872 * that has cached inherited properties for the base node of the path.
874 * Allocate @a *iprop_paths
875 * in @a result_pool. Use @a scratch_pool for temporary allocations.
878 svn_wc__get_cached_iprop_children(apr_hash_t **iprop_paths,
880 svn_wc_context_t *wc_ctx,
881 const char *local_abspath,
882 apr_pool_t *result_pool,
883 apr_pool_t *scratch_pool);
887 * For use by entries.c and entries-dump.c to read old-format working copies.
890 svn_wc__read_entries_old(apr_hash_t **entries,
891 const char *dir_abspath,
892 apr_pool_t *result_pool,
893 apr_pool_t *scratch_pool);
896 * Recursively clear the dav cache (wcprops) in @a wc_ctx for the tree
897 * rooted at @a local_abspath.
900 svn_wc__node_clear_dav_cache_recursive(svn_wc_context_t *wc_ctx,
901 const char *local_abspath,
902 apr_pool_t *scratch_pool);
905 * Set @a lock_tokens to a hash mapping <tt>const char *</tt> URL
906 * to <tt>const char *</tt> lock tokens for every path at or under
907 * @a local_abspath in @a wc_ctx which has such a lock token set on it.
908 * Allocate the hash and all items therein from @a result_pool.
911 svn_wc__node_get_lock_tokens_recursive(apr_hash_t **lock_tokens,
912 svn_wc_context_t *wc_ctx,
913 const char *local_abspath,
914 apr_pool_t *result_pool,
915 apr_pool_t *scratch_pool);
917 /* Set @a *min_revision and @a *max_revision to the lowest and highest revision
918 * numbers found within @a local_abspath, using context @a wc_ctx.
919 * If @a committed is TRUE, set @a *min_revision and @a *max_revision
920 * to the lowest and highest comitted (i.e. "last changed") revision numbers,
921 * respectively. Use @a scratch_pool for temporary allocations.
923 * Either of MIN_REVISION and MAX_REVISION may be passed as NULL if
924 * the caller doesn't care about that return value.
926 * This function provides a subset of the functionality of
927 * svn_wc_revision_status2() and is more efficient if the caller
928 * doesn't need all information returned by svn_wc_revision_status2(). */
930 svn_wc__min_max_revisions(svn_revnum_t *min_revision,
931 svn_revnum_t *max_revision,
932 svn_wc_context_t *wc_ctx,
933 const char *local_abspath,
934 svn_boolean_t committed,
935 apr_pool_t *scratch_pool);
937 /* Indicate in @a is_switched whether any node beneath @a local_abspath
938 * is switched, using context @a wc_ctx.
939 * Use @a scratch_pool for temporary allocations.
941 * If @a trail_url is non-NULL, use it to determine if @a local_abspath itself
942 * is switched. It should be any trailing portion of @a local_abspath's
943 * expected URL, long enough to include any parts that the caller considers
944 * might be changed by a switch. If it does not match the end of
945 * @a local_abspath's actual URL, then report a "switched" status.
947 * This function provides a subset of the functionality of
948 * svn_wc_revision_status2() and is more efficient if the caller
949 * doesn't need all information returned by svn_wc_revision_status2(). */
951 svn_wc__has_switched_subtrees(svn_boolean_t *is_switched,
952 svn_wc_context_t *wc_ctx,
953 const char *local_abspath,
954 const char *trail_url,
955 apr_pool_t *scratch_pool);
957 /* Set @a *excluded_subtrees to a hash mapping <tt>const char *</tt>
958 * local * absolute paths to <tt>const char *</tt> local absolute paths for
959 * every path under @a local_abspath in @a wc_ctx which are excluded
960 * by the server (e.g. because of authz) or the users.
961 * If no excluded paths are found then @a *server_excluded_subtrees
963 * Allocate the hash and all items therein from @a result_pool.
966 svn_wc__get_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
967 svn_wc_context_t *wc_ctx,
968 const char *local_abspath,
969 apr_pool_t *result_pool,
970 apr_pool_t *scratch_pool);
972 /* Indicate in @a *is_modified whether the working copy has local
973 * modifications, using context @a wc_ctx.
975 * If IGNORE_UNVERSIONED, unversioned paths inside the tree rooted by
976 * LOCAL_ABSPATH are not seen as a change, otherwise they are.
977 * (svn:ignored paths are always ignored)
979 * Use @a scratch_pool for temporary allocations. */
981 svn_wc__has_local_mods(svn_boolean_t *is_modified,
982 svn_wc_context_t *wc_ctx,
983 const char *local_abspath,
984 svn_boolean_t ignore_unversioned,
985 svn_cancel_func_t cancel_func,
987 apr_pool_t *scratch_pool);
989 /* Renames a working copy from @a from_abspath to @a dst_abspath and makes sure
990 open handles are closed to allow this on all platforms.
992 Summary: This avoids a file lock problem on wc.db on Windows, that is
993 triggered by libsvn_client'ss copy to working copy code. */
995 svn_wc__rename_wc(svn_wc_context_t *wc_ctx,
996 const char *from_abspath,
997 const char *dst_abspath,
998 apr_pool_t *scratch_pool);
1000 /* Set *TMPDIR_ABSPATH to a directory that is suitable for temporary
1001 files which may need to be moved (atomically and same-device) into
1002 the working copy indicated by WRI_ABSPATH. */
1004 svn_wc__get_tmpdir(const char **tmpdir_abspath,
1005 svn_wc_context_t *wc_ctx,
1006 const char *wri_abspath,
1007 apr_pool_t *result_pool,
1008 apr_pool_t *scratch_pool);
1010 /* Gets information needed by the commit harvester.
1012 * ### Currently this API is work in progress and is designed for just this
1013 * ### caller. It is certainly possible (and likely) that this function and
1014 * ### it's caller will eventually move into a wc and maybe wc_db api.
1017 svn_wc__node_get_commit_status(svn_boolean_t *added,
1018 svn_boolean_t *deleted,
1019 svn_boolean_t *is_replace_root,
1020 svn_boolean_t *is_op_root,
1021 svn_revnum_t *revision,
1022 svn_revnum_t *original_revision,
1023 const char **original_repos_relpath,
1024 svn_wc_context_t *wc_ctx,
1025 const char *local_abspath,
1026 apr_pool_t *result_pool,
1027 apr_pool_t *scratch_pool);
1029 /* Gets the md5 checksum for the pristine file identified by a sha1_checksum in the
1030 working copy identified by wri_abspath.
1032 Wraps svn_wc__db_pristine_get_md5().
1035 svn_wc__node_get_md5_from_sha1(const svn_checksum_t **md5_checksum,
1036 svn_wc_context_t *wc_ctx,
1037 const char *wri_abspath,
1038 const svn_checksum_t *sha1_checksum,
1039 apr_pool_t *result_pool,
1040 apr_pool_t *scratch_pool);
1042 /* Like svn_wc_get_pristine_contents2(), but keyed on the CHECKSUM
1043 rather than on the local absolute path of the working file.
1044 WRI_ABSPATH is any versioned path of the working copy in whose
1045 pristine database we'll be looking for these contents. */
1047 svn_wc__get_pristine_contents_by_checksum(svn_stream_t **contents,
1048 svn_wc_context_t *wc_ctx,
1049 const char *wri_abspath,
1050 const svn_checksum_t *checksum,
1051 apr_pool_t *result_pool,
1052 apr_pool_t *scratch_pool);
1054 /* Gets an array of const char *repos_relpaths of descendants of LOCAL_ABSPATH,
1055 * which must be the op root of an addition, copy or move. The descendants
1056 * returned are at the same op_depth, but are to be deleted by the commit
1057 * processing because they are not present in the local copy.
1060 svn_wc__get_not_present_descendants(const apr_array_header_t **descendants,
1061 svn_wc_context_t *wc_ctx,
1062 const char *local_abspath,
1063 apr_pool_t *result_pool,
1064 apr_pool_t *scratch_pool);
1067 /* Checks a node LOCAL_ABSPATH in WC_CTX for several kinds of obstructions
1068 * for tasks like merge processing.
1070 * If a node is not obstructed it sets *OBSTRUCTION_STATE to
1071 * svn_wc_notify_state_inapplicable. If a node is obstructed or when its
1072 * direct parent does not exist or is deleted return _state_obstructed. When
1073 * a node doesn't exist but should exist return svn_wc_notify_state_missing.
1075 * A node is also obstructed if it is marked excluded or server-excluded or when
1076 * an unversioned file or directory exists. And if NO_WCROOT_CHECK is FALSE,
1077 * the root of a working copy is also obstructed; this to allow detecting
1078 * obstructing working copies.
1080 * If KIND is not NULL, set *KIND to the kind of node registered in the working
1081 * copy, or SVN_NODE_NONE if the node doesn't
1083 * If DELETED is not NULL, set *DELETED to TRUE if the node is marked as
1084 * deleted in the working copy.
1086 * If EXCLUDED is not NULL, set *EXCLUDED to TRUE if the node is marked as
1087 * user or server excluded.
1089 * If PARENT_DEPTH is not NULL, set *PARENT_DEPTH to the depth stored on the
1090 * parent. (Set to svn_depth_unknown if LOCAL_ABSPATH itself exists as node)
1092 * All output arguments except OBSTRUCTION_STATE can be NULL to ommit the
1095 * This function performs temporary allocations in SCRATCH_POOL.
1098 svn_wc__check_for_obstructions(svn_wc_notify_state_t *obstruction_state,
1099 svn_node_kind_t *kind,
1100 svn_boolean_t *deleted,
1101 svn_boolean_t *excluded,
1102 svn_depth_t *parent_depth,
1103 svn_wc_context_t *wc_ctx,
1104 const char *local_abspath,
1105 svn_boolean_t no_wcroot_check,
1106 apr_pool_t *scratch_pool);
1110 * A structure which describes various system-generated metadata about
1111 * a working-copy path or URL.
1113 * @note Fields may be added to the end of this structure in future
1114 * versions. Therefore, users shouldn't allocate structures of this
1115 * type, to preserve binary compatibility.
1117 * @since New in 1.7.
1119 typedef struct svn_wc__info2_t
1121 /** Where the item lives in the repository. */
1124 /** The root URL of the repository. */
1125 const char *repos_root_URL;
1127 /** The repository's UUID. */
1128 const char *repos_UUID;
1130 /** The revision of the object. If the target is a working-copy
1131 * path, then this is its current working revision number. If the target
1132 * is a URL, then this is the repository revision that it lives in. */
1135 /** The node's kind. */
1136 svn_node_kind_t kind;
1138 /** The size of the file in the repository (untranslated,
1139 * e.g. without adjustment of line endings and keyword
1140 * expansion). Only applicable for file -- not directory -- URLs.
1141 * For working copy paths, @a size will be #SVN_INVALID_FILESIZE. */
1142 svn_filesize_t size;
1144 /** The last revision in which this object changed. */
1145 svn_revnum_t last_changed_rev;
1147 /** The date of the last_changed_rev. */
1148 apr_time_t last_changed_date;
1150 /** The author of the last_changed_rev. */
1151 const char *last_changed_author;
1153 /** An exclusive lock, if present. Could be either local or remote. */
1156 /* Possible information about the working copy, NULL if not valid. */
1157 struct svn_wc_info_t *wc_info;
1161 /** The callback invoked by info retrievers. Each invocation
1162 * describes @a local_abspath with the information present in @a info.
1163 * Use @a scratch_pool for all temporary allocation.
1165 * @since New in 1.7.
1167 typedef svn_error_t *(*svn_wc__info_receiver2_t)(void *baton,
1168 const char *local_abspath,
1169 const svn_wc__info2_t *info,
1170 apr_pool_t *scratch_pool);
1172 /* Walk the children of LOCAL_ABSPATH and push svn_wc__info2_t's through
1173 RECEIVER/RECEIVER_BATON. Honor DEPTH while crawling children, and
1174 filter the pushed items against CHANGELISTS.
1176 If FETCH_EXCLUDED is TRUE, also fetch excluded nodes.
1177 If FETCH_ACTUAL_ONLY is TRUE, also fetch actual-only nodes. */
1179 svn_wc__get_info(svn_wc_context_t *wc_ctx,
1180 const char *local_abspath,
1182 svn_boolean_t fetch_excluded,
1183 svn_boolean_t fetch_actual_only,
1184 const apr_array_header_t *changelists,
1185 svn_wc__info_receiver2_t receiver,
1186 void *receiver_baton,
1187 svn_cancel_func_t cancel_func,
1189 apr_pool_t *scratch_pool);
1191 /* Alternative version of svn_wc_delete4().
1192 * It can delete multiple TARGETS more efficiently (within a single sqlite
1193 * transaction per working copy), but lacks support for moves.
1195 * ### Inconsistency: if DELETE_UNVERSIONED_TARGET is FALSE and a target is
1196 * unversioned, svn_wc__delete_many() will continue whereas
1197 * svn_wc_delete4() will throw an error.
1200 svn_wc__delete_many(svn_wc_context_t *wc_ctx,
1201 const apr_array_header_t *targets,
1202 svn_boolean_t keep_local,
1203 svn_boolean_t delete_unversioned_target,
1204 svn_cancel_func_t cancel_func,
1206 svn_wc_notify_func2_t notify_func,
1208 apr_pool_t *scratch_pool);
1211 /* If the node at LOCAL_ABSPATH was moved away set *MOVED_TO_ABSPATH to
1212 * the absolute path of the copied move-target node, and *COPY_OP_ROOT_ABSPATH
1213 * to the absolute path of the root node of the copy operation.
1215 * If the node was not moved, set *MOVED_TO_ABSPATH and *COPY_OP_ROOT_ABSPATH
1218 * Either MOVED_TO_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
1219 * that the caller is not interested in the result.
1222 svn_wc__node_was_moved_away(const char **moved_to_abspath,
1223 const char **copy_op_root_abspath,
1224 svn_wc_context_t *wc_ctx,
1225 const char *local_abspath,
1226 apr_pool_t *result_pool,
1227 apr_pool_t *scratch_pool);
1229 /* If the node at LOCAL_ABSPATH was moved here set *MOVED_FROM_ABSPATH to
1230 * the absolute path of the deleted move-source node, and set
1231 * *DELETE_OP_ROOT_ABSPATH to the absolute path of the root node of the
1234 * If the node was not moved, set *MOVED_FROM_ABSPATH and
1235 * *DELETE_OP_ROOT_ABSPATH to NULL.
1237 * Either MOVED_FROM_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
1238 * that the caller is not interested in the result.
1241 svn_wc__node_was_moved_here(const char **moved_from_abspath,
1242 const char **delete_op_root_abspath,
1243 svn_wc_context_t *wc_ctx,
1244 const char *local_abspath,
1245 apr_pool_t *result_pool,
1246 apr_pool_t *scratch_pool);
1248 /* During an upgrade to wc-ng, supply known details about an existing
1249 * external. The working copy will suck in and store the information supplied
1250 * about the existing external at @a local_abspath. */
1252 svn_wc__upgrade_add_external_info(svn_wc_context_t *wc_ctx,
1253 const char *local_abspath,
1254 svn_node_kind_t kind,
1255 const char *def_local_abspath,
1256 const char *repos_relpath,
1257 const char *repos_root_url,
1258 const char *repos_uuid,
1259 svn_revnum_t def_peg_revision,
1260 svn_revnum_t def_revision,
1261 apr_pool_t *scratch_pool);
1263 /* If the URL for @a item is relative, then using the repository root
1264 URL @a repos_root_url and the parent directory URL @parent_dir_url,
1265 resolve it into an absolute URL and save it in @a *resolved_url.
1267 Regardless if the URL is absolute or not, if there are no errors,
1268 the URL returned in @a *resolved_url will be canonicalized.
1270 The following relative URL formats are supported:
1272 ../ relative to the parent directory of the external
1273 ^/ relative to the repository root
1274 // relative to the scheme
1275 / relative to the server's hostname
1277 The ../ and ^/ relative URLs may use .. to remove path elements up
1280 The external URL should not be canonicalized before calling this function,
1281 as otherwise the scheme relative URL '//host/some/path' would have been
1282 canonicalized to '/host/some/path' and we would not be able to match on
1283 the leading '//'. */
1285 svn_wc__resolve_relative_external_url(const char **resolved_url,
1286 const svn_wc_external_item2_t *item,
1287 const char *repos_root_url,
1288 const char *parent_dir_url,
1289 apr_pool_t *result_pool,
1290 apr_pool_t *scratch_pool);
1292 typedef enum svn_wc__external_description_format_t
1294 /* LOCALPATH [-r PEG] URL */
1295 svn_wc__external_description_format_1 = 0,
1297 /* [-r REV] URL[@PEG] LOCALPATH, introduced in Subversion 1.5 */
1298 svn_wc__external_description_format_2
1299 } svn_wc__external_description_format_t;
1301 /* Additional information about what the external's parser has parsed. */
1302 typedef struct svn_wc__externals_parser_info_t
1304 /* The syntax format used by the external description. */
1305 svn_wc__external_description_format_t format;
1307 /* The string used for defining the operative revision, i.e.
1308 "-rN", "-rHEAD", or "-r{DATE}".
1309 NULL if revision was not given. */
1310 const char *rev_str;
1312 /* The string used for defining the peg revision (equals rev_str in
1313 format 1, is "@N", or "@HEAD" or "@{DATE}" in format 2).
1314 NULL if peg revision was not given. */
1315 const char *peg_rev_str;
1317 } svn_wc__externals_parser_info_t;
1319 /* Like svn_wc_parse_externals_description3() but returns an additional array
1320 * with elements of type svn_wc__externals_parser_info_t in @a *parser_infos_p.
1321 * @a parser_infos_p may be NULL if not required by the caller.
1324 svn_wc__parse_externals_description(apr_array_header_t **externals_p,
1325 apr_array_header_t **parser_infos_p,
1326 const char *defining_directory,
1328 svn_boolean_t canonicalize_url,
1332 * Set @a *editor and @a *edit_baton to an editor that generates
1333 * #svn_wc_status3_t structures and sends them through @a status_func /
1334 * @a status_baton. @a anchor_abspath is a working copy directory
1335 * directory which will be used as the root of our editor. If @a
1336 * target_basename is not "", it represents a node in the @a anchor_abspath
1337 * which is the subject of the editor drive (otherwise, the @a
1338 * anchor_abspath is the subject).
1340 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
1341 * be used in a call to the svn_wc_status_set_repos_locks() function.
1343 * Callers drive this editor to describe working copy out-of-dateness
1344 * with respect to the repository. If this information is not
1345 * available or not desired, callers should simply call the
1346 * close_edit() function of the @a editor vtable.
1348 * If the editor driver calls @a editor's set_target_revision() vtable
1349 * function, then when the edit drive is completed, @a *edit_revision
1350 * will contain the revision delivered via that interface.
1352 * Assuming the target is a directory, then:
1354 * - If @a get_all is @c FALSE, then only locally-modified entries will be
1355 * returned. If @c TRUE, then all entries will be returned.
1357 * - If @a depth is #svn_depth_empty, a status structure will
1358 * be returned for the target only; if #svn_depth_files, for the
1359 * target and its immediate file children; if
1360 * #svn_depth_immediates, for the target and its immediate
1361 * children; if #svn_depth_infinity, for the target and
1362 * everything underneath it, fully recursively.
1364 * If @a depth is #svn_depth_unknown, take depths from the
1365 * working copy and behave as above in each directory's case.
1367 * If the given @a depth is incompatible with the depth found in a
1368 * working copy directory, the found depth always governs.
1370 * If @a check_working_copy is not set, do not scan the working copy
1371 * for local modifications, taking only the BASE tree into account.
1373 * If @a no_ignore is set, statuses that would typically be ignored
1374 * will instead be reported.
1376 * @a ignore_patterns is an array of file patterns matching
1377 * unversioned files to ignore for the purposes of status reporting,
1378 * or @c NULL if the default set of ignorable file patterns should be used.
1380 * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
1381 * the @a statushash to determine if the client has canceled the operation.
1383 * If @a depth_as_sticky is set handle @a depth like when depth_is_sticky is
1384 * passed for updating. This will show excluded nodes show up as added in the
1387 * If @a server_performs_filtering is TRUE, assume that the server handles
1388 * the ambient depth filtering, so this doesn't have to be handled in the
1391 * Allocate the editor itself in @a result_pool, and use @a scratch_pool
1392 * for temporary allocations. The editor will do its temporary allocations
1393 * in a subpool of @a result_pool.
1395 * @since New in 1.8.
1398 svn_wc__get_status_editor(const svn_delta_editor_t **editor,
1400 void **set_locks_baton,
1401 svn_revnum_t *edit_revision,
1402 svn_wc_context_t *wc_ctx,
1403 const char *anchor_abspath,
1404 const char *target_basename,
1406 svn_boolean_t get_all,
1407 svn_boolean_t check_working_copy,
1408 svn_boolean_t no_ignore,
1409 svn_boolean_t depth_as_sticky,
1410 svn_boolean_t server_performs_filtering,
1411 const apr_array_header_t *ignore_patterns,
1412 svn_wc_status_func4_t status_func,
1414 svn_cancel_func_t cancel_func,
1416 apr_pool_t *result_pool,
1417 apr_pool_t *scratch_pool);
1421 * Set @a *editor and @a *edit_baton to an editor and baton for updating a
1424 * @a anchor_abspath is a local working copy directory, with a fully recursive
1425 * write lock in @a wc_ctx, which will be used as the root of our editor.
1427 * @a target_basename is the entry in @a anchor_abspath that will actually be
1428 * updated, or the empty string if all of @a anchor_abspath should be updated.
1430 * The editor invokes @a notify_func with @a notify_baton as the update
1431 * progresses, if @a notify_func is non-NULL.
1433 * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
1434 * @a cancel_baton as the update progresses to see if it should continue.
1436 * If @a conflict_func is non-NULL, then invoke it with @a
1437 * conflict_baton whenever a conflict is encountered, giving the
1438 * callback a chance to resolve the conflict before the editor takes
1439 * more drastic measures (such as marking a file conflicted, or
1440 * bailing out of the update).
1442 * If @a external_func is non-NULL, then invoke it with @a external_baton
1443 * whenever external changes are encountered, giving the callback a chance
1444 * to store the external information for processing.
1446 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
1447 * any merging; otherwise, use the built-in merge code.
1449 * @a preserved_exts is an array of filename patterns which, when
1450 * matched against the extensions of versioned files, determine for
1451 * which such files any related generated conflict files will preserve
1452 * the original file's extension as their own. If a file's extension
1453 * does not match any of the patterns in @a preserved_exts (which is
1454 * certainly the case if @a preserved_exts is @c NULL or empty),
1455 * generated conflict files will carry Subversion's custom extensions.
1457 * @a target_revision is a pointer to a revision location which, after
1458 * successful completion of the drive of this editor, will be
1459 * populated with the revision to which the working copy was updated.
1461 * @a wcroot_iprops is a hash mapping const char * absolute working copy
1462 * paths which are working copy roots (at or under the target within the
1463 * constraints dictated by @a depth) to depth-first ordered arrays of
1464 * svn_prop_inherited_item_t * structures which represent the inherited
1465 * properties for the base of those paths at @a target_revision. After a
1466 * successful drive of this editor, the base nodes for these paths will
1467 * have their inherited properties cache updated with the values from
1470 * If @a use_commit_times is TRUE, then all edited/added files will
1471 * have their working timestamp set to the last-committed-time. If
1472 * FALSE, the working files will be touched with the 'now' time.
1474 * If @a allow_unver_obstructions is TRUE, then allow unversioned
1475 * obstructions when adding a path.
1477 * If @a adds_as_modification is TRUE, a local addition at the same path
1478 * as an incoming addition of the same node kind results in a normal node
1479 * with a possible local modification, instead of a tree conflict.
1481 * If @a depth is #svn_depth_infinity, update fully recursively.
1482 * Else if it is #svn_depth_immediates, update the uppermost
1483 * directory, its file entries, and the presence or absence of
1484 * subdirectories (but do not descend into the subdirectories).
1485 * Else if it is #svn_depth_files, update the uppermost directory
1486 * and its immediate file entries, but not subdirectories.
1487 * Else if it is #svn_depth_empty, update exactly the uppermost
1488 * target, and don't touch its entries.
1490 * If @a depth_is_sticky is set and @a depth is not
1491 * #svn_depth_unknown, then in addition to updating PATHS, also set
1492 * their sticky ambient depth value to @a depth.
1494 * If @a server_performs_filtering is TRUE, assume that the server handles
1495 * the ambient depth filtering, so this doesn't have to be handled in the
1498 * If @a clean_checkout is TRUE, assume that we are checking out into an
1499 * empty directory, and so bypass a number of conflict checks that are
1500 * unnecessary in this case.
1502 * If @a fetch_dirents_func is not NULL, the update editor may call this
1503 * callback, when asked to perform a depth restricted update. It will do this
1504 * before returning the editor to allow using the primary ra session for this.
1506 * @since New in 1.8.
1509 svn_wc__get_update_editor(const svn_delta_editor_t **editor,
1511 svn_revnum_t *target_revision,
1512 svn_wc_context_t *wc_ctx,
1513 const char *anchor_abspath,
1514 const char *target_basename,
1515 apr_hash_t *wcroot_iprops,
1516 svn_boolean_t use_commit_times,
1518 svn_boolean_t depth_is_sticky,
1519 svn_boolean_t allow_unver_obstructions,
1520 svn_boolean_t adds_as_modification,
1521 svn_boolean_t server_performs_filtering,
1522 svn_boolean_t clean_checkout,
1523 const char *diff3_cmd,
1524 const apr_array_header_t *preserved_exts,
1525 svn_wc_dirents_func_t fetch_dirents_func,
1526 void *fetch_dirents_baton,
1527 svn_wc_conflict_resolver_func2_t conflict_func,
1528 void *conflict_baton,
1529 svn_wc_external_update_t external_func,
1530 void *external_baton,
1531 svn_cancel_func_t cancel_func,
1533 svn_wc_notify_func2_t notify_func,
1535 apr_pool_t *result_pool,
1536 apr_pool_t *scratch_pool);
1540 * A variant of svn_wc__get_update_editor().
1542 * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
1543 * a working copy to a new @a switch_url. (Right now, this URL must be
1544 * within the same repository that the working copy already comes
1545 * from.) @a switch_url must not be @c NULL.
1547 * All other parameters behave as for svn_wc__get_update_editor().
1549 * @since New in 1.8.
1552 svn_wc__get_switch_editor(const svn_delta_editor_t **editor,
1554 svn_revnum_t *target_revision,
1555 svn_wc_context_t *wc_ctx,
1556 const char *anchor_abspath,
1557 const char *target_basename,
1558 const char *switch_url,
1559 apr_hash_t *wcroot_iprops,
1560 svn_boolean_t use_commit_times,
1562 svn_boolean_t depth_is_sticky,
1563 svn_boolean_t allow_unver_obstructions,
1564 svn_boolean_t server_performs_filtering,
1565 const char *diff3_cmd,
1566 const apr_array_header_t *preserved_exts,
1567 svn_wc_dirents_func_t fetch_dirents_func,
1568 void *fetch_dirents_baton,
1569 svn_wc_conflict_resolver_func2_t conflict_func,
1570 void *conflict_baton,
1571 svn_wc_external_update_t external_func,
1572 void *external_baton,
1573 svn_cancel_func_t cancel_func,
1575 svn_wc_notify_func2_t notify_func,
1577 apr_pool_t *result_pool,
1578 apr_pool_t *scratch_pool);
1583 * Return an @a editor/@a edit_baton for diffing a working copy against the
1584 * repository. The editor is allocated in @a result_pool; temporary
1585 * calculations are performed in @a scratch_pool.
1587 * This editor supports diffing either the actual files and properties in the
1588 * working copy (when @a use_text_base is #FALSE), or the current pristine
1589 * information (when @a use_text_base is #TRUE) against the editor driver.
1591 * @a anchor_abspath/@a target represent the base of the hierarchy to be
1592 * compared. The diff callback paths will be relative to this path.
1594 * Diffs will be reported as valid relpaths, with @a anchor_abspath being
1597 * @a diff_processor will retrieve the diff report.
1599 * If @a depth is #svn_depth_empty, just diff exactly @a target or
1600 * @a anchor_path if @a target is empty. If #svn_depth_files then do the same
1601 * and for top-level file entries as well (if any). If
1602 * #svn_depth_immediates, do the same as #svn_depth_files but also diff
1603 * top-level subdirectories at #svn_depth_empty. If #svn_depth_infinity,
1604 * then diff fully recursively. If @a depth is #svn_depth_unknown, then...
1606 * ### ... then the @a server_performs_filtering option is meaningful.
1607 * ### But what does this depth mean exactly? Something about 'ambient'
1608 * ### depth? How does it compare with depth 'infinity'?
1610 * @a ignore_ancestry determines whether paths that have discontinuous node
1611 * ancestry are treated as delete/add or as simple modifications. If
1612 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
1613 * result in the diff given as a full delete followed by an add.
1615 * @a show_copies_as_adds determines whether paths added with history will
1616 * appear as a diff against their copy source, or whether such paths will
1617 * appear as if they were newly added in their entirety.
1619 * If @a use_git_diff_format is TRUE, copied paths will be treated as added
1620 * if they weren't modified after being copied. This allows the callbacks
1621 * to generate appropriate --git diff headers for such files.
1623 * Normally, the difference from repository->working_copy is shown. If
1624 * @a reverse_order is TRUE, then we want to show working_copy->repository
1625 * diffs. Most of the reversal is done by the caller; here we just swap the
1626 * order of reporting a replacement so that the local addition is reported
1627 * before the remote delete. (The caller's diff processor can then transform
1628 * adds into deletes and deletes into adds, but it can't reorder the output.)
1630 * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
1631 * to periodically check if the client has canceled the operation.
1633 * @a changelist_filter is an array of <tt>const char *</tt> changelist
1634 * names, used as a restrictive filter on items whose differences are
1635 * reported; that is, don't generate diffs about any item unless
1636 * it's a member of one of those changelists. If @a changelist_filter is
1637 * empty (or altogether @c NULL), no changelist filtering occurs.
1639 * If @a server_performs_filtering is TRUE, assume that the server handles
1640 * the ambient depth filtering, so this doesn't have to be handled in the
1644 * A diagram illustrating how this function is used.
1646 * Steps 1 and 2 create the chain; step 3 drives it.
1648 * 1. svn_wc__get_diff_editor(diff_cbs)
1650 * 2. svn_ra_do_diff3(editor) | |
1653 * +----------+ +----------+ +----------+
1655 * +--> | reporter | ----> | editor | ----> | diff_cbs | ----> text
1657 * | +----------+ +----------+ +----------+
1659 * 3. svn_wc_crawl_revisions5(WC,reporter)
1662 * @since New in 1.8.
1665 svn_wc__get_diff_editor(const svn_delta_editor_t **editor,
1667 svn_wc_context_t *wc_ctx,
1668 const char *anchor_abspath,
1671 svn_boolean_t ignore_ancestry,
1672 svn_boolean_t use_text_base,
1673 svn_boolean_t reverse_order,
1674 svn_boolean_t server_performs_filtering,
1675 const apr_array_header_t *changelist_filter,
1676 const svn_diff_tree_processor_t *diff_processor,
1677 svn_cancel_func_t cancel_func,
1679 apr_pool_t *result_pool,
1680 apr_pool_t *scratch_pool);
1682 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1683 * notifications like how the repos diff in libsvn_client does.
1685 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1687 typedef svn_error_t *
1688 (*svn_wc__diff_state_handle_t)(svn_boolean_t tree_conflicted,
1689 svn_wc_notify_state_t *state,
1690 svn_wc_notify_state_t *prop_state,
1691 const char *relpath,
1692 svn_node_kind_t kind,
1693 svn_boolean_t before_op,
1694 svn_boolean_t for_add,
1695 svn_boolean_t for_delete,
1697 apr_pool_t *scratch_pool);
1699 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1700 * notifications like how the repos diff in libsvn_client does.
1702 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1704 typedef svn_error_t *
1705 (*svn_wc__diff_state_close_t)(const char *relpath,
1706 svn_node_kind_t kind,
1708 apr_pool_t *scratch_pool);
1710 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1713 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1715 typedef svn_error_t *
1716 (*svn_wc__diff_state_absent_t)(const char *relpath,
1718 apr_pool_t *scratch_pool);
1720 /** Obtains a diff processor that will drive the diff callbacks when it
1724 svn_wc__wrap_diff_callbacks(const svn_diff_tree_processor_t **diff_processor,
1725 const svn_wc_diff_callbacks4_t *callbacks,
1726 void *callback_baton,
1727 svn_boolean_t walk_deleted_dirs,
1728 apr_pool_t *result_pool,
1729 apr_pool_t *scratch_pool);
1733 * Assuming @a local_abspath itself or any of its children are under version
1734 * control or a tree conflict victim and in a state of conflict, take these
1735 * nodes out of this state.
1737 * If @a resolve_text is TRUE then any text conflict is resolved,
1738 * if @a resolve_tree is TRUE then any tree conflicts are resolved.
1739 * If @a resolve_prop is set to "" all property conflicts are resolved,
1740 * if it is set to any other string value, conflicts on that specific
1741 * property are resolved and when resolve_prop is NULL, no property
1742 * conflicts are resolved.
1744 * If @a depth is #svn_depth_empty, act only on @a local_abspath; if
1745 * #svn_depth_files, resolve @a local_abspath and its conflicted file
1746 * children (if any); if #svn_depth_immediates, resolve @a local_abspath
1747 * and all its immediate conflicted children (both files and directories,
1748 * if any); if #svn_depth_infinity, resolve @a local_abspath and every
1749 * conflicted file or directory anywhere beneath it.
1751 * If @a conflict_choice is #svn_wc_conflict_choose_base, resolve the
1752 * conflict with the old file contents; if
1753 * #svn_wc_conflict_choose_mine_full, use the original working contents;
1754 * if #svn_wc_conflict_choose_theirs_full, the new contents; and if
1755 * #svn_wc_conflict_choose_merged, don't change the contents at all,
1756 * just remove the conflict status, which is the pre-1.5 behavior.
1758 * If @a conflict_choice is #svn_wc_conflict_choose_unspecified, invoke the
1759 * @a conflict_func with the @a conflict_baton argument to obtain a
1760 * resolution decision for each conflict.
1762 * #svn_wc_conflict_choose_theirs_conflict and
1763 * #svn_wc_conflict_choose_mine_conflict are not legal for binary
1764 * files or properties.
1766 * @a wc_ctx is a working copy context, with a write lock, for @a
1769 * The implementation details are opaque, as our "conflicted" criteria
1770 * might change over time. (At the moment, this routine removes the
1771 * three fulltext 'backup' files and any .prej file created in a conflict,
1772 * and modifies @a local_abspath's entry.)
1774 * If @a local_abspath is not under version control and not a tree
1775 * conflict, return #SVN_ERR_ENTRY_NOT_FOUND. If @a path isn't in a
1776 * state of conflict to begin with, do nothing, and return #SVN_NO_ERROR.
1778 * If @c local_abspath was successfully taken out of a state of conflict,
1779 * report this information to @c notify_func (if non-@c NULL.) If only
1780 * text, only property, or only tree conflict resolution was requested,
1781 * and it was successful, then success gets reported.
1783 * Temporary allocations will be performed in @a scratch_pool.
1785 * @since New in 1.8.
1788 svn_wc__resolve_conflicts(svn_wc_context_t *wc_ctx,
1789 const char *local_abspath,
1791 svn_boolean_t resolve_text,
1792 const char *resolve_prop,
1793 svn_boolean_t resolve_tree,
1794 svn_wc_conflict_choice_t conflict_choice,
1795 svn_wc_conflict_resolver_func2_t conflict_func,
1796 void *conflict_baton,
1797 svn_cancel_func_t cancel_func,
1799 svn_wc_notify_func2_t notify_func,
1801 apr_pool_t *scratch_pool);
1804 * Resolve the text conflict at LOCAL_ABSPATH as per CHOICE, and then
1805 * mark the conflict resolved.
1806 * The working copy must already be locked for resolving, e.g. by calling
1807 * svn_wc__acquire_write_lock_for_resolve() first.
1808 * @since New in 1.10.
1811 svn_wc__conflict_text_mark_resolved(svn_wc_context_t *wc_ctx,
1812 const char *local_abspath,
1813 svn_wc_conflict_choice_t choice,
1814 svn_cancel_func_t cancel_func,
1816 svn_wc_notify_func2_t notify_func,
1818 apr_pool_t *scratch_pool);
1821 * Resolve the conflicted property PROPNAME at LOCAL_ABSPATH as per CHOICE,
1822 * and then mark the conflict resolved. If MERGED_VALUE is not NULL, this is
1823 * the new merged property, used when choosing #svn_wc_conflict_choose_merged.
1825 * The working copy must already be locked for resolving, e.g. by calling
1826 * svn_wc__acquire_write_lock_for_resolve() first.
1827 * @since New in 1.10.
1830 svn_wc__conflict_prop_mark_resolved(svn_wc_context_t *wc_ctx,
1831 const char *local_abspath,
1832 const char *propname,
1833 svn_wc_conflict_choice_t choice,
1834 const svn_string_t *merged_value,
1835 svn_wc_notify_func2_t notify_func,
1837 apr_pool_t *scratch_pool);
1839 /* Resolve a tree conflict where the victim at LOCAL_ABSPATH is a directory
1840 * which was locally deleted, replaced or moved away, and which received an
1841 * arbitrary incoming change during an update or switch operation.
1843 * The conflict is resolved by accepting the current working copy state and
1844 * breaking the 'moved-here' link for any files or directories which were
1845 * moved out of the victim directory before the update operation.
1846 * As a result, any such files or directories become copies (rather than moves)
1847 * of content which the victim directory contained before it was updated.
1849 * The tree conflict at LOCAL_ABSPATH must have the following properties or
1850 * SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
1852 * operation: svn_wc_operation_update or svn_wc_operation_switch
1853 * local change: svn_wc_conflict_reason_deleted or
1854 * svn_wc_conflict_reason_replaced or
1855 * svn_wc_conflict_reason_moved_away
1856 * incoming change: any
1858 * The working copy must already be locked for resolving, e.g. by calling
1859 * svn_wc__acquire_write_lock_for_resolve() first.
1861 * @since New in 1.10.
1864 svn_wc__conflict_tree_update_break_moved_away(svn_wc_context_t *wc_ctx,
1865 const char *local_abspath,
1866 svn_cancel_func_t cancel_func,
1868 svn_wc_notify_func2_t notify_func,
1870 apr_pool_t *scratch_pool);
1873 /* Resolve a tree conflict where the victim at LOCAL_ABSPATH is a directory
1874 * which was locally deleted or replaced, and which received an edit (some
1875 * change inside the directory, or a change to the direcotory's properties)
1876 * during an update or switch operation.
1878 * The conflict is resolved by keeping the victim deleted, and propagating
1879 * its tree conflict to any children which were moved out of the directory
1880 * before the update operation.
1881 * As a result, any such files or directories become victims of the tree
1882 * conflict as well and must be resolved independently.
1883 * Additionally, LOCAL_ABSPATH itself may become the victim of a different
1884 * tree conflict as a result of resolving the existing tree conflict.
1886 * The tree conflict at LOCAL_ABSPATH must have the following properties or
1887 * SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
1889 * operation: svn_wc_operation_update or svn_wc_operation_switch
1890 * local change: svn_wc_conflict_reason_deleted or
1891 * svn_wc_conflict_reason_replaced
1892 * incoming change: svn_wc_conflict_action_edit
1894 * If this conflict cannot be resolved because the conflict cannot be
1895 * propagated to moved-away children, this function returns
1896 * SVN_ERR_WC_OBSTRUCTED_UPDATE or SVN_ERR_WC_FOUND_CONFLICT.
1897 * The caller should continue by resolving other conflicts and attempt to
1898 * resolve this conflict again later.
1900 * The working copy must already be locked for resolving, e.g. by calling
1901 * svn_wc__acquire_write_lock_for_resolve() first.
1903 * @since New in 1.10.
1906 svn_wc__conflict_tree_update_raise_moved_away(svn_wc_context_t *wc_ctx,
1907 const char *local_abspath,
1908 svn_cancel_func_t cancel_func,
1910 svn_wc_notify_func2_t notify_func,
1912 apr_pool_t *scratch_pool);
1914 /* Resolve a tree conflict where the victim at LOCAL_ABSPATH is a file or
1915 * directory which was locally moved away, and which received an edit (some
1916 * change inside the directory or file, or a change to properties) during an
1917 * update or switch operation.
1919 * The conflict is resolved by keeping the victim moved-away, and propagating
1920 * the incoming edits to the victim's moved-to location.
1922 * The tree conflict at LOCAL_ABSPATH must have the following properties or
1923 * SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE will be returned:
1925 * operation: svn_wc_operation_update or svn_wc_operation_switch
1926 * local change: svn_wc_conflict_reason_moved_away
1927 * incoming change: svn_wc_conflict_action_edit
1929 * If this conflict cannot be resolved this function returns
1930 * SVN_ERR_WC_OBSTRUCTED_UPDATE or SVN_ERR_WC_FOUND_CONFLICT.
1931 * The caller should continue by resolving other conflicts and attempt to
1932 * resolve this conflict again later.
1934 * The working copy must already be locked for resolving, e.g. by calling
1935 * svn_wc__acquire_write_lock_for_resolve() first.
1937 * @since New in 1.10.
1940 svn_wc__conflict_tree_update_moved_away_node(svn_wc_context_t *wc_ctx,
1941 const char *local_abspath,
1942 svn_cancel_func_t cancel_func,
1944 svn_wc_notify_func2_t notify_func,
1946 apr_pool_t *scratch_pool);
1948 /* Merge local changes from a tree conflict victim of an incoming deletion
1949 * to the specified DEST_ABSPATH added during an update. Both LOCAL_ABSPATH
1950 * and DEST_ABSPATH must be directories.
1952 * Assuming DEST_ABSPATH is the correct move destination, this function
1953 * allows local changes to "follow" incoming moves during updates.
1955 * @since New in 1.10. */
1957 svn_wc__conflict_tree_update_incoming_move(svn_wc_context_t *wc_ctx,
1958 const char *local_abspath,
1959 const char *dest_abspath,
1960 svn_cancel_func_t cancel_func,
1962 svn_wc_notify_func2_t notify_func,
1964 apr_pool_t *scratch_pool);
1966 /* Resolve a 'local dir add vs incoming dir add' tree conflict upon update
1967 * by merging the locally added directory with the incoming added directory.
1969 * @since New in 1.10. */
1971 svn_wc__conflict_tree_update_local_add(svn_wc_context_t *wc_ctx,
1972 const char *local_abspath,
1973 svn_cancel_func_t cancel_func,
1975 svn_wc_notify_func2_t notify_func,
1977 apr_pool_t *scratch_pool);
1979 /* Find nodes in the working copy which corresponds to the new location
1980 * MOVED_TO_REPOS_RELPATH of the tree conflict victim at VICTIM_ABSPATH.
1981 * The nodes must be of the same node kind as VICTIM_NODE_KIND.
1982 * If no such node can be found, set *POSSIBLE_TARGETS to an empty array.
1984 * The nodes should be useful for conflict resolution, e.g. it should be
1985 * possible to merge changes into these nodes to resolve an incoming-move
1986 * tree conflict. But the exact criteria for selecting a node are left
1987 * to the implementation of this function.
1988 * Note that this function may not necessarily return a node which was
1989 * actually moved. The only hard guarantee is that the node corresponds to
1990 * the repository relpath MOVED_TO_REPOS_RELPATH specified by the caller.
1991 * Users should perform a sanity check on the results returned from this
1992 * function, e.g. establish whether the MOVED_TO_REPOS_RELPATH at its
1993 * current checked-out revision shares ancestry with the conflict victim.
1996 svn_wc__guess_incoming_move_target_nodes(apr_array_header_t **possible_targets,
1997 svn_wc_context_t *wc_ctx,
1998 const char *victim_abspath,
1999 svn_node_kind_t victim_node_kind,
2000 const char *moved_to_repos_relpath,
2001 apr_pool_t *result_pool,
2002 apr_pool_t *scratch_pool);
2005 * Move @a src_abspath to @a dst_abspath, by scheduling @a dst_abspath
2006 * for addition to the repository, remembering the history. Mark @a src_abspath
2007 * as deleted after moving.@a wc_ctx is used for accessing the working copy and
2008 * must contain a write lock for the parent directory of @a src_abspath and
2011 * If @a metadata_only is TRUE then this is a database-only operation and
2012 * the working directories and files are not changed.
2014 * @a src_abspath must be a file or directory under version control;
2015 * the parent of @a dst_abspath must be a directory under version control
2016 * in the same working copy; @a dst_abspath will be the name of the copied
2017 * item, and it must not exist already if @a metadata_only is FALSE. Note that
2018 * when @a src points to a versioned file, the working file doesn't
2019 * necessarily exist in which case its text-base is used instead.
2021 * If @a allow_mixed_revisions is @c FALSE, #SVN_ERR_WC_MIXED_REVISIONS
2022 * will be raised if the move source is a mixed-revision subtree.
2023 * If @a allow_mixed_revisions is TRUE, a mixed-revision move source is
2024 * allowed but the move will degrade to a copy and a delete without local
2025 * move tracking. This parameter should be set to FALSE except where backwards
2026 * compatibility to svn_wc_move() is required.
2028 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
2029 * various points during the operation. If it returns an error
2030 * (typically #SVN_ERR_CANCELLED), return that error immediately.
2032 * If @a notify_func is non-NULL, call it with @a notify_baton and the path
2033 * of the root node (only) of the destination.
2035 * Use @a scratch_pool for temporary allocations.
2037 * @since New in 1.8.
2040 svn_wc__move2(svn_wc_context_t *wc_ctx,
2041 const char *src_abspath,
2042 const char *dst_abspath,
2043 svn_boolean_t metadata_only,
2044 svn_boolean_t allow_mixed_revisions,
2045 svn_cancel_func_t cancel_func,
2047 svn_wc_notify_func2_t notify_func,
2049 apr_pool_t *scratch_pool);
2052 /* During merge when we encounter added directories, we add them using
2053 svn_wc_add4(), recording its original location, etc. But at that time
2054 we don't have its original properties. This function allows updating the
2055 BASE properties of such a special added node, but only before it receives
2058 NEW_ORIGINAL_PROPS is a new set of properties, including entry props that
2059 will be applied to LOCAL_ABSPATH as pristine properties.
2061 The copyfrom_* arguments are used to verify (some of) the assumptions of
2064 svn_wc__complete_directory_add(svn_wc_context_t *wc_ctx,
2065 const char *local_abspath,
2066 apr_hash_t *new_original_props,
2067 const char *copyfrom_url,
2068 svn_revnum_t copyfrom_rev,
2069 apr_pool_t *scratch_pool);
2072 /* Acquire a write lock on LOCAL_ABSPATH or an ancestor that covers
2073 all possible paths affected by resolving the conflicts in the tree
2074 LOCAL_ABSPATH. Set *LOCK_ROOT_ABSPATH to the path of the lock
2077 svn_wc__acquire_write_lock_for_resolve(const char **lock_root_abspath,
2078 svn_wc_context_t *wc_ctx,
2079 const char *local_abspath,
2080 apr_pool_t *result_pool,
2081 apr_pool_t *scratch_pool);
2083 /* The implemementation of svn_wc_diff6(), but reporting to a diff processor
2085 * New mode, when ANCHOR_AT_GIVEN_PATHS is true:
2087 * Anchor the DIFF_PROCESSOR at LOCAL_ABSPATH.
2089 * Backward compatibility mode for svn_wc_diff6(),
2090 * when ANCHOR_AT_GIVEN_PATHS is false:
2092 * Send diff processor relpaths relative to LOCAL_ABSPATH if it is a
2093 * directory; otherwise, relative to the parent of LOCAL_ABSPATH.
2094 * This matches the "anchor and target" semantics of svn_wc_diff6().
2097 svn_wc__diff7(svn_boolean_t anchor_at_given_paths,
2098 svn_wc_context_t *wc_ctx,
2099 const char *local_abspath,
2101 svn_boolean_t ignore_ancestry,
2102 const apr_array_header_t *changelist_filter,
2103 const svn_diff_tree_processor_t *diff_processor,
2104 svn_cancel_func_t cancel_func,
2106 apr_pool_t *result_pool,
2107 apr_pool_t *scratch_pool);
2110 * Read all conflicts at LOCAL_ABSPATH into an array containing pointers to
2111 * svn_wc_conflict_description2_t data structures alloated in RESULT_POOL.
2114 svn_wc__read_conflict_descriptions2_t(const apr_array_header_t **conflicts,
2115 svn_wc_context_t *wc_ctx,
2116 const char *local_abspath,
2117 apr_pool_t *result_pool,
2118 apr_pool_t *scratch_pool);
2120 /* Internal version of svn_wc_translated_stream(), accepting a working
2123 svn_wc__translated_stream(svn_stream_t **stream,
2124 svn_wc_context_t *wc_ctx,
2125 const char *local_abspath,
2126 const char *versioned_abspath,
2128 apr_pool_t *result_pool,
2129 apr_pool_t *scratch_pool);
2133 #endif /* __cplusplus */
2135 #endif /* SVN_WC_PRIVATE_H */