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);
352 * The following are temporary APIs to aid in the transition from wc-1 to
353 * wc-ng. Use them for new development now, but they may be disappearing
354 * before the 1.7 release.
359 * Convert from svn_wc_conflict_description2_t to
360 * svn_wc_conflict_description_t. This is needed by some backwards-compat
361 * code in libsvn_client/ctx.c
363 * Allocate the result in RESULT_POOL.
365 svn_wc_conflict_description_t *
366 svn_wc__cd2_to_cd(const svn_wc_conflict_description2_t *conflict,
367 apr_pool_t *result_pool);
371 * Convert from svn_wc_status3_t to svn_wc_status2_t.
372 * Allocate the result in RESULT_POOL.
375 svn_wc__status2_from_3(svn_wc_status2_t **status,
376 const svn_wc_status3_t *old_status,
377 svn_wc_context_t *wc_ctx,
378 const char *local_abspath,
379 apr_pool_t *result_pool,
380 apr_pool_t *scratch_pool);
384 * Set @a *children to a new array of the immediate children of the working
385 * node at @a dir_abspath. The elements of @a *children are (const char *)
388 * Include children that are scheduled for deletion. Iff @a show_hidden
389 * is true, also include children that are 'excluded' or 'server-excluded' or
392 * Return every path that refers to a child of the working node at
393 * @a dir_abspath. Do not include a path just because it was a child of a
394 * deleted directory that existed at @a dir_abspath if that directory is now
395 * sheduled to be replaced by the working node at @a dir_abspath.
397 * Allocate @a *children in @a result_pool. Use @a wc_ctx to access the
398 * working copy, and @a scratch_pool for all temporary allocations.
401 svn_wc__node_get_children_of_working_node(const apr_array_header_t **children,
402 svn_wc_context_t *wc_ctx,
403 const char *dir_abspath,
404 svn_boolean_t show_hidden,
405 apr_pool_t *result_pool,
406 apr_pool_t *scratch_pool);
409 * Like svn_wc__node_get_children_of_working_node(), except also include any
410 * path that was a child of a deleted directory that existed at
411 * @a dir_abspath, even if that directory is now scheduled to be replaced by
412 * the working node at @a dir_abspath.
415 svn_wc__node_get_children(const apr_array_header_t **children,
416 svn_wc_context_t *wc_ctx,
417 const char *dir_abspath,
418 svn_boolean_t show_hidden,
419 apr_pool_t *result_pool,
420 apr_pool_t *scratch_pool);
424 * Fetch the repository information for the working version
425 * of the node at @a local_abspath into @a *revision, @a *repos_relpath,
426 * @a *repos_root_url and @a *repos_uuid. Use @a wc_ctx to access the working
427 * copy. Allocate results in @a result_pool.
429 * @a *revision will be set to SVN_INVALID_REVNUM for any shadowed node (including
430 * added and deleted nodes). All other output values will be set to the current
431 * values or those they would have after a commit.
433 * All output argument may be NULL, indicating no interest.
436 svn_wc__node_get_repos_info(svn_revnum_t *revision,
437 const char **repos_relpath,
438 const char **repos_root_url,
439 const char **repos_uuid,
440 svn_wc_context_t *wc_ctx,
441 const char *local_abspath,
442 apr_pool_t *result_pool,
443 apr_pool_t *scratch_pool);
448 * Get the depth of @a local_abspath using @a wc_ctx. If @a local_abspath is
449 * not in the working copy, return @c SVN_ERR_WC_PATH_NOT_FOUND.
452 svn_wc__node_get_depth(svn_depth_t *depth,
453 svn_wc_context_t *wc_ctx,
454 const char *local_abspath,
455 apr_pool_t *scratch_pool);
458 * Get the changed revision, date and author for @a local_abspath using @a
459 * wc_ctx. Allocate the return values in @a result_pool; use @a scratch_pool
460 * for temporary allocations. Any of the return pointers may be @c NULL, in
461 * which case they are not set.
463 * If @a local_abspath is not in the working copy, return
464 * @c SVN_ERR_WC_PATH_NOT_FOUND.
467 svn_wc__node_get_changed_info(svn_revnum_t *changed_rev,
468 apr_time_t *changed_date,
469 const char **changed_author,
470 svn_wc_context_t *wc_ctx,
471 const char *local_abspath,
472 apr_pool_t *result_pool,
473 apr_pool_t *scratch_pool);
477 * Set @a *url to the corresponding url for @a local_abspath, using @a wc_ctx.
478 * If the node is added, return the url it will have in the repository.
480 * If @a local_abspath is not in the working copy, return
481 * @c SVN_ERR_WC_PATH_NOT_FOUND.
484 svn_wc__node_get_url(const char **url,
485 svn_wc_context_t *wc_ctx,
486 const char *local_abspath,
487 apr_pool_t *result_pool,
488 apr_pool_t *scratch_pool);
491 * Retrieves the origin of the node as it is known in the repository. For
492 * a copied node this retrieves where the node is copied from, for an added
493 * node this returns NULL/INVALID outputs, and for any other node this
494 * retrieves the repository location.
496 * All output arguments may be NULL.
498 * If @a is_copy is not NULL, sets @a *is_copy to TRUE if the origin is a copy
499 * of the original node.
501 * If not NULL, sets @a revision, @a repos_relpath, @a repos_root_url and
502 * @a repos_uuid to the original (if a copy) or their current values.
504 * If @a copy_root_abspath is not NULL, and @a *is_copy indicates that the
505 * node was copied, set @a *copy_root_abspath to the local absolute path of
506 * the root of the copied subtree containing the node. If the copied node is
507 * a root by itself, @a *copy_root_abspath will match @a local_abspath (but
508 * won't necessarily point to the same string in memory).
510 * If @a scan_deleted is TRUE, determine the origin of the deleted node. If
511 * @a scan_deleted is FALSE, return NULL, SVN_INVALID_REVNUM or FALSE for
514 * Allocate the result in @a result_pool. Perform temporary allocations in
517 svn_wc__node_get_origin(svn_boolean_t *is_copy,
518 svn_revnum_t *revision,
519 const char **repos_relpath,
520 const char **repos_root_url,
521 const char **repos_uuid,
522 const char **copy_root_abspath,
523 svn_wc_context_t *wc_ctx,
524 const char *local_abspath,
525 svn_boolean_t scan_deleted,
526 apr_pool_t *result_pool,
527 apr_pool_t *scratch_pool);
530 * Set @a *is_deleted to TRUE if @a local_abspath is deleted, using
531 * @a wc_ctx. If @a local_abspath is not in the working copy, return
532 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
536 svn_wc__node_is_status_deleted(svn_boolean_t *is_deleted,
537 svn_wc_context_t *wc_ctx,
538 const char *local_abspath,
539 apr_pool_t *scratch_pool);
542 * Set @a *deleted_ancestor_abspath to the root of the delete operation
543 * that deleted @a local_abspath. If @a local_abspath itself was deleted
544 * and has no deleted ancestor, @a *deleted_ancestor_abspath will equal
545 * @a local_abspath. If @a local_abspath was not deleted,
546 * set @a *deleted_ancestor_abspath to @c NULL.
548 * A node is considered 'deleted' if it is deleted or moved-away, and is
551 * @a *deleted_ancestor_abspath is allocated in @a result_pool.
552 * Use @a scratch_pool for all temporary allocations.
555 svn_wc__node_get_deleted_ancestor(const char **deleted_ancestor_abspath,
556 svn_wc_context_t *wc_ctx,
557 const char *local_abspath,
558 apr_pool_t *result_pool,
559 apr_pool_t *scratch_pool);
562 * Set @a *not_present to TRUE when @a local_abspath has status
563 * svn_wc__db_status_not_present. Set @a *user_excluded to TRUE when
564 * @a local_abspath has status svn_wc__db_status_excluded. Set
565 * @a *server_excluded to TRUE when @a local_abspath has status
566 * svn_wc__db_status_server_excluded. Otherwise set these values to FALSE.
567 * If @a base_only is TRUE then only the base node will be examined,
568 * otherwise the current base or working node will be examined.
570 * If a value is not interesting you can pass #NULL.
572 * If @a local_abspath is not in the working copy, return
573 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
577 svn_wc__node_is_not_present(svn_boolean_t *not_present,
578 svn_boolean_t *user_excluded,
579 svn_boolean_t *server_excluded,
580 svn_wc_context_t *wc_ctx,
581 const char *local_abspath,
582 svn_boolean_t base_only,
583 apr_pool_t *scratch_pool);
586 * Set @a *is_added to whether @a local_abspath is added, using
587 * @a wc_ctx. If @a local_abspath is not in the working copy, return
588 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
591 * NOTE: "added" in this sense, means it was added, copied-here, or
592 * moved-here. This function provides NO information on whether this
593 * addition has replaced another node.
595 * To be clear, this does NOT correspond to svn_wc_schedule_add.
598 svn_wc__node_is_added(svn_boolean_t *is_added,
599 svn_wc_context_t *wc_ctx,
600 const char *local_abspath,
601 apr_pool_t *scratch_pool);
604 * Set @a *has_working to whether @a local_abspath has a working node (which
605 * might shadow BASE nodes)
607 * This is a check similar to status = added or status = deleted.
610 svn_wc__node_has_working(svn_boolean_t *has_working,
611 svn_wc_context_t *wc_ctx,
612 const char *local_abspath,
613 apr_pool_t *scratch_pool);
617 * Get the repository location of the base node at @a local_abspath.
619 * Set *REVISION, *REPOS_RELPATH, *REPOS_ROOT_URL *REPOS_UUID and *LOCK_TOKEN
620 * to the location that this node was checked out at or last updated/switched
621 * to, regardless of any uncommitted changes (delete, replace and/or copy-here/
624 * If there is no BASE node at @a local_abspath or if @a show_hidden is FALSE,
625 * no status 'normal' or 'incomplete' BASE node report
626 * SVN_ERR_WC_PATH_NOT_FOUND, or if @a ignore_enoent is TRUE, @a kind
627 * svn_node_unknown, @a revision SVN_INVALID_REVNUM and all other values NULL.
629 * All output arguments may be NULL.
631 * Allocate the results in @a result_pool. Perform temporary allocations in
635 svn_wc__node_get_base(svn_node_kind_t *kind,
636 svn_revnum_t *revision,
637 const char **repos_relpath,
638 const char **repos_root_url,
639 const char **repos_uuid,
640 const char **lock_token,
641 svn_wc_context_t *wc_ctx,
642 const char *local_abspath,
643 svn_boolean_t ignore_enoent,
644 svn_boolean_t show_hidden,
645 apr_pool_t *result_pool,
646 apr_pool_t *scratch_pool);
649 /* Get the working revision of @a local_abspath using @a wc_ctx. If @a
650 * local_abspath is not in the working copy, return @c
651 * SVN_ERR_WC_PATH_NOT_FOUND.
653 * This function is meant as a temporary solution for using the old-style
654 * semantics of entries. It will handle any uncommitted changes (delete,
655 * replace and/or copy-here/move-here).
657 * For a delete the @a revision is the BASE node of the operation root, e.g
658 * the path that was deleted. But if the delete is below an add, the
659 * revision is set to SVN_INVALID_REVNUM. For an add, copy or move we return
660 * SVN_INVALID_REVNUM. In case of a replacement, we return the BASE
663 * The @a changed_rev is set to the latest committed change to @a
664 * local_abspath before or equal to @a revision, unless the node is
665 * copied-here or moved-here. Then it is the revision of the latest committed
666 * change before or equal to the copyfrom_rev. NOTE, that we use
667 * SVN_INVALID_REVNUM for a scheduled copy or move.
669 * The @a changed_date and @a changed_author are the ones associated with @a
673 svn_wc__node_get_pre_ng_status_data(svn_revnum_t *revision,
674 svn_revnum_t *changed_rev,
675 apr_time_t *changed_date,
676 const char **changed_author,
677 svn_wc_context_t *wc_ctx,
678 const char *local_abspath,
679 apr_pool_t *result_pool,
680 apr_pool_t *scratch_pool);
683 * Acquire a recursive write lock for @a local_abspath. If @a lock_anchor
684 * is true, determine if @a local_abspath has an anchor that should be locked
685 * instead; otherwise, @a local_abspath must be a versioned directory.
686 * Store the obtained lock in @a wc_ctx.
688 * If @a lock_root_abspath is not NULL, store the root of the lock in
689 * @a *lock_root_abspath. If @a lock_root_abspath is NULL, then @a
690 * lock_anchor must be FALSE.
692 * Returns @c SVN_ERR_WC_LOCKED if an existing lock is encountered, in
693 * which case any locks acquired will have been released.
695 * If @a lock_anchor is TRUE and @a lock_root_abspath is not NULL, @a
696 * lock_root_abspath will be set even when SVN_ERR_WC_LOCKED is returned.
699 svn_wc__acquire_write_lock(const char **lock_root_abspath,
700 svn_wc_context_t *wc_ctx,
701 const char *local_abspath,
702 svn_boolean_t lock_anchor,
703 apr_pool_t *result_pool,
704 apr_pool_t *scratch_pool);
708 * Recursively release write locks for @a local_abspath, using @a wc_ctx
709 * for working copy access. Only locks held by @a wc_ctx are released.
710 * Locks are not removed if work queue items are present.
712 * If @a local_abspath is not the root of an owned SVN_ERR_WC_NOT_LOCKED
716 svn_wc__release_write_lock(svn_wc_context_t *wc_ctx,
717 const char *local_abspath,
718 apr_pool_t *scratch_pool);
720 /** A callback invoked by the svn_wc__call_with_write_lock() function. */
721 typedef svn_error_t *(*svn_wc__with_write_lock_func_t)(void *baton,
722 apr_pool_t *result_pool,
723 apr_pool_t *scratch_pool);
726 /** Call function @a func while holding a write lock on
727 * @a local_abspath. The @a baton, and @a result_pool and
728 * @a scratch_pool, is passed @a func.
730 * If @a lock_anchor is TRUE, determine if @a local_abspath has an anchor
731 * that should be locked instead.
733 * Use @a wc_ctx for working copy access.
734 * The lock is guaranteed to be released after @a func returns.
737 svn_wc__call_with_write_lock(svn_wc__with_write_lock_func_t func,
739 svn_wc_context_t *wc_ctx,
740 const char *local_abspath,
741 svn_boolean_t lock_anchor,
742 apr_pool_t *result_pool,
743 apr_pool_t *scratch_pool);
745 /** Evaluate the expression @a expr while holding a write lock on
748 * @a expr must yield an (svn_error_t *) error code. If the error code
749 * is not #SVN_NO_ERROR, cause the function using this macro to return
750 * the error to its caller.
752 * If @a lock_anchor is TRUE, determine if @a local_abspath has an anchor
753 * that should be locked instead.
755 * Use @a wc_ctx for working copy access.
757 * The lock is guaranteed to be released after evaluating @a expr.
759 #define SVN_WC__CALL_WITH_WRITE_LOCK(expr, wc_ctx, local_abspath, \
760 lock_anchor, scratch_pool) \
762 svn_error_t *svn_wc__err1, *svn_wc__err2; \
763 const char *svn_wc__lock_root_abspath; \
764 SVN_ERR(svn_wc__acquire_write_lock(&svn_wc__lock_root_abspath, wc_ctx, \
765 local_abspath, lock_anchor, \
766 scratch_pool, scratch_pool)); \
767 svn_wc__err1 = (expr); \
768 svn_wc__err2 = svn_wc__release_write_lock( \
769 wc_ctx, svn_wc__lock_root_abspath, scratch_pool); \
770 SVN_ERR(svn_error_compose_create(svn_wc__err1, svn_wc__err2)); \
775 * Calculates the schedule and copied status of a node as that would
776 * have been stored in an svn_wc_entry_t instance.
778 * If not @c NULL, @a schedule and @a copied are set to their calculated
782 svn_wc__node_get_schedule(svn_wc_schedule_t *schedule,
783 svn_boolean_t *copied,
784 svn_wc_context_t *wc_ctx,
785 const char *local_abspath,
786 apr_pool_t *scratch_pool);
788 /** A callback invoked by svn_wc__prop_list_recursive().
789 * It is equivalent to svn_proplist_receiver_t declared in svn_client.h,
790 * but kept private within the svn_wc__ namespace because it is used within
791 * the bowels of libsvn_wc which don't include svn_client.h.
793 * @since New in 1.7. */
794 typedef svn_error_t *(*svn_wc__proplist_receiver_t)(void *baton,
795 const char *local_abspath,
797 apr_pool_t *scratch_pool);
799 /** Call @a receiver_func, passing @a receiver_baton, an absolute path, and
800 * a hash table mapping <tt>const char *</tt> names onto <tt>const
801 * svn_string_t *</tt> values for all the regular properties of the node
802 * at @a local_abspath and any node beneath @a local_abspath within the
803 * specified @a depth. @a receiver_fun must not be NULL.
805 * If @a propname is not NULL, the passed hash table will only contain
806 * the property @a propname.
808 * If @a pristine is not @c TRUE, and @a base_props is FALSE show local
809 * modifications to the properties.
811 * If a node has no properties, @a receiver_func is not called for the node.
813 * If @a changelists are non-NULL and non-empty, filter by them.
815 * Use @a wc_ctx to access the working copy, and @a scratch_pool for
816 * temporary allocations.
818 * If the node at @a local_abspath does not exist,
819 * #SVN_ERR_WC_PATH_NOT_FOUND is returned.
824 svn_wc__prop_list_recursive(svn_wc_context_t *wc_ctx,
825 const char *local_abspath,
826 const char *propname,
828 svn_boolean_t pristine,
829 const apr_array_header_t *changelists,
830 svn_wc__proplist_receiver_t receiver_func,
831 void *receiver_baton,
832 svn_cancel_func_t cancel_func,
834 apr_pool_t *scratch_pool);
837 * Set @a *inherited_props to a depth-first ordered array of
838 * #svn_prop_inherited_item_t * structures representing the properties
839 * inherited by @a local_abspath from the ACTUAL tree above
840 * @a local_abspath (looking through to the WORKING or BASE tree as
841 * required), up to and including the root of the working copy and
842 * any cached inherited properties inherited by the root.
844 * The #svn_prop_inherited_item_t->path_or_url members of the
845 * #svn_prop_inherited_item_t * structures in @a *inherited_props are
846 * paths relative to the repository root URL for cached inherited
847 * properties and absolute working copy paths otherwise.
849 * Allocate @a *inherited_props in @a result_pool. Use @a scratch_pool
850 * for temporary allocations.
853 svn_wc__get_iprops(apr_array_header_t **inherited_props,
854 svn_wc_context_t *wc_ctx,
855 const char *local_abspath,
856 const char *propname,
857 apr_pool_t *result_pool,
858 apr_pool_t *scratch_pool);
860 /** Obtain a mapping of const char * local_abspaths to const svn_string_t*
861 * property values in *VALUES, of all PROPNAME properties on LOCAL_ABSPATH
862 * and its descendants.
864 * Allocate the result in RESULT_POOL, and perform temporary allocations in
868 svn_wc__prop_retrieve_recursive(apr_hash_t **values,
869 svn_wc_context_t *wc_ctx,
870 const char *local_abspath,
871 const char *propname,
872 apr_pool_t *result_pool,
873 apr_pool_t *scratch_pool);
876 * Set @a *iprops_paths to a hash mapping const char * absolute working
877 * copy paths to the nodes repository root relative path for each path
878 * in the working copy at or below @a local_abspath, limited by @a depth,
879 * that has cached inherited properties for the base node of the path.
881 * Allocate @a *iprop_paths
882 * in @a result_pool. Use @a scratch_pool for temporary allocations.
885 svn_wc__get_cached_iprop_children(apr_hash_t **iprop_paths,
887 svn_wc_context_t *wc_ctx,
888 const char *local_abspath,
889 apr_pool_t *result_pool,
890 apr_pool_t *scratch_pool);
894 * For use by entries.c and entries-dump.c to read old-format working copies.
897 svn_wc__read_entries_old(apr_hash_t **entries,
898 const char *dir_abspath,
899 apr_pool_t *result_pool,
900 apr_pool_t *scratch_pool);
903 * Recursively clear the dav cache (wcprops) in @a wc_ctx for the tree
904 * rooted at @a local_abspath.
907 svn_wc__node_clear_dav_cache_recursive(svn_wc_context_t *wc_ctx,
908 const char *local_abspath,
909 apr_pool_t *scratch_pool);
912 * Set @a lock_tokens to a hash mapping <tt>const char *</tt> URL
913 * to <tt>const char *</tt> lock tokens for every path at or under
914 * @a local_abspath in @a wc_ctx which has such a lock token set on it.
915 * Allocate the hash and all items therein from @a result_pool.
918 svn_wc__node_get_lock_tokens_recursive(apr_hash_t **lock_tokens,
919 svn_wc_context_t *wc_ctx,
920 const char *local_abspath,
921 apr_pool_t *result_pool,
922 apr_pool_t *scratch_pool);
924 /* Set @a *min_revision and @a *max_revision to the lowest and highest revision
925 * numbers found within @a local_abspath, using context @a wc_ctx.
926 * If @a committed is TRUE, set @a *min_revision and @a *max_revision
927 * to the lowest and highest comitted (i.e. "last changed") revision numbers,
928 * respectively. Use @a scratch_pool for temporary allocations.
930 * Either of MIN_REVISION and MAX_REVISION may be passed as NULL if
931 * the caller doesn't care about that return value.
933 * This function provides a subset of the functionality of
934 * svn_wc_revision_status2() and is more efficient if the caller
935 * doesn't need all information returned by svn_wc_revision_status2(). */
937 svn_wc__min_max_revisions(svn_revnum_t *min_revision,
938 svn_revnum_t *max_revision,
939 svn_wc_context_t *wc_ctx,
940 const char *local_abspath,
941 svn_boolean_t committed,
942 apr_pool_t *scratch_pool);
944 /* Indicate in @a is_switched whether any node beneath @a local_abspath
945 * is switched, using context @a wc_ctx.
946 * Use @a scratch_pool for temporary allocations.
948 * If @a trail_url is non-NULL, use it to determine if @a local_abspath itself
949 * is switched. It should be any trailing portion of @a local_abspath's
950 * expected URL, long enough to include any parts that the caller considers
951 * might be changed by a switch. If it does not match the end of
952 * @a local_abspath's actual URL, then report a "switched" status.
954 * This function provides a subset of the functionality of
955 * svn_wc_revision_status2() and is more efficient if the caller
956 * doesn't need all information returned by svn_wc_revision_status2(). */
958 svn_wc__has_switched_subtrees(svn_boolean_t *is_switched,
959 svn_wc_context_t *wc_ctx,
960 const char *local_abspath,
961 const char *trail_url,
962 apr_pool_t *scratch_pool);
964 /* Set @a *excluded_subtrees to a hash mapping <tt>const char *</tt>
965 * local * absolute paths to <tt>const char *</tt> local absolute paths for
966 * every path under @a local_abspath in @a wc_ctx which are excluded
967 * by the server (e.g. because of authz) or the users.
968 * If no excluded paths are found then @a *server_excluded_subtrees
970 * Allocate the hash and all items therein from @a result_pool.
973 svn_wc__get_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
974 svn_wc_context_t *wc_ctx,
975 const char *local_abspath,
976 apr_pool_t *result_pool,
977 apr_pool_t *scratch_pool);
979 /* Indicate in @a *is_modified whether the working copy has local
980 * modifications, using context @a wc_ctx.
981 * Use @a scratch_pool for temporary allocations.
983 * This function provides a subset of the functionality of
984 * svn_wc_revision_status2() and is more efficient if the caller
985 * doesn't need all information returned by svn_wc_revision_status2(). */
987 svn_wc__has_local_mods(svn_boolean_t *is_modified,
988 svn_wc_context_t *wc_ctx,
989 const char *local_abspath,
990 svn_cancel_func_t cancel_func,
992 apr_pool_t *scratch_pool);
994 /* Renames a working copy from @a from_abspath to @a dst_abspath and makes sure
995 open handles are closed to allow this on all platforms.
997 Summary: This avoids a file lock problem on wc.db on Windows, that is
998 triggered by libsvn_client'ss copy to working copy code. */
1000 svn_wc__rename_wc(svn_wc_context_t *wc_ctx,
1001 const char *from_abspath,
1002 const char *dst_abspath,
1003 apr_pool_t *scratch_pool);
1005 /* Set *TMPDIR_ABSPATH to a directory that is suitable for temporary
1006 files which may need to be moved (atomically and same-device) into
1007 the working copy indicated by WRI_ABSPATH. */
1009 svn_wc__get_tmpdir(const char **tmpdir_abspath,
1010 svn_wc_context_t *wc_ctx,
1011 const char *wri_abspath,
1012 apr_pool_t *result_pool,
1013 apr_pool_t *scratch_pool);
1015 /* Gets information needed by the commit harvester.
1017 * ### Currently this API is work in progress and is designed for just this
1018 * ### caller. It is certainly possible (and likely) that this function and
1019 * ### it's caller will eventually move into a wc and maybe wc_db api.
1022 svn_wc__node_get_commit_status(svn_boolean_t *added,
1023 svn_boolean_t *deleted,
1024 svn_boolean_t *is_replace_root,
1025 svn_boolean_t *is_op_root,
1026 svn_revnum_t *revision,
1027 svn_revnum_t *original_revision,
1028 const char **original_repos_relpath,
1029 svn_wc_context_t *wc_ctx,
1030 const char *local_abspath,
1031 apr_pool_t *result_pool,
1032 apr_pool_t *scratch_pool);
1034 /* Gets the md5 checksum for the pristine file identified by a sha1_checksum in the
1035 working copy identified by wri_abspath.
1037 Wraps svn_wc__db_pristine_get_md5().
1040 svn_wc__node_get_md5_from_sha1(const svn_checksum_t **md5_checksum,
1041 svn_wc_context_t *wc_ctx,
1042 const char *wri_abspath,
1043 const svn_checksum_t *sha1_checksum,
1044 apr_pool_t *result_pool,
1045 apr_pool_t *scratch_pool);
1047 /* Like svn_wc_get_pristine_contents2(), but keyed on the CHECKSUM
1048 rather than on the local absolute path of the working file.
1049 WRI_ABSPATH is any versioned path of the working copy in whose
1050 pristine database we'll be looking for these contents. */
1052 svn_wc__get_pristine_contents_by_checksum(svn_stream_t **contents,
1053 svn_wc_context_t *wc_ctx,
1054 const char *wri_abspath,
1055 const svn_checksum_t *checksum,
1056 apr_pool_t *result_pool,
1057 apr_pool_t *scratch_pool);
1059 /* Gets an array of const char *repos_relpaths of descendants of LOCAL_ABSPATH,
1060 * which must be the op root of an addition, copy or move. The descendants
1061 * returned are at the same op_depth, but are to be deleted by the commit
1062 * processing because they are not present in the local copy.
1065 svn_wc__get_not_present_descendants(const apr_array_header_t **descendants,
1066 svn_wc_context_t *wc_ctx,
1067 const char *local_abspath,
1068 apr_pool_t *result_pool,
1069 apr_pool_t *scratch_pool);
1072 /* Checks a node LOCAL_ABSPATH in WC_CTX for several kinds of obstructions
1073 * for tasks like merge processing.
1075 * If a node is not obstructed it sets *OBSTRUCTION_STATE to
1076 * svn_wc_notify_state_inapplicable. If a node is obstructed or when its
1077 * direct parent does not exist or is deleted return _state_obstructed. When
1078 * a node doesn't exist but should exist return svn_wc_notify_state_missing.
1080 * A node is also obstructed if it is marked excluded or server-excluded or when
1081 * an unversioned file or directory exists. And if NO_WCROOT_CHECK is FALSE,
1082 * the root of a working copy is also obstructed; this to allow detecting
1083 * obstructing working copies.
1085 * If KIND is not NULL, set *KIND to the kind of node registered in the working
1086 * copy, or SVN_NODE_NONE if the node doesn't
1088 * If DELETED is not NULL, set *DELETED to TRUE if the node is marked as
1089 * deleted in the working copy.
1091 * If EXCLUDED is not NULL, set *EXCLUDED to TRUE if the node is marked as
1092 * user or server excluded.
1094 * If PARENT_DEPTH is not NULL, set *PARENT_DEPTH to the depth stored on the
1095 * parent. (Set to svn_depth_unknown if LOCAL_ABSPATH itself exists as node)
1097 * All output arguments except OBSTRUCTION_STATE can be NULL to ommit the
1100 * This function performs temporary allocations in SCRATCH_POOL.
1103 svn_wc__check_for_obstructions(svn_wc_notify_state_t *obstruction_state,
1104 svn_node_kind_t *kind,
1105 svn_boolean_t *deleted,
1106 svn_boolean_t *excluded,
1107 svn_depth_t *parent_depth,
1108 svn_wc_context_t *wc_ctx,
1109 const char *local_abspath,
1110 svn_boolean_t no_wcroot_check,
1111 apr_pool_t *scratch_pool);
1115 * A structure which describes various system-generated metadata about
1116 * a working-copy path or URL.
1118 * @note Fields may be added to the end of this structure in future
1119 * versions. Therefore, users shouldn't allocate structures of this
1120 * type, to preserve binary compatibility.
1122 * @since New in 1.7.
1124 typedef struct svn_wc__info2_t
1126 /** Where the item lives in the repository. */
1129 /** The root URL of the repository. */
1130 const char *repos_root_URL;
1132 /** The repository's UUID. */
1133 const char *repos_UUID;
1135 /** The revision of the object. If the target is a working-copy
1136 * path, then this is its current working revision number. If the target
1137 * is a URL, then this is the repository revision that it lives in. */
1140 /** The node's kind. */
1141 svn_node_kind_t kind;
1143 /** The size of the file in the repository (untranslated,
1144 * e.g. without adjustment of line endings and keyword
1145 * expansion). Only applicable for file -- not directory -- URLs.
1146 * For working copy paths, @a size will be #SVN_INVALID_FILESIZE. */
1147 svn_filesize_t size;
1149 /** The last revision in which this object changed. */
1150 svn_revnum_t last_changed_rev;
1152 /** The date of the last_changed_rev. */
1153 apr_time_t last_changed_date;
1155 /** The author of the last_changed_rev. */
1156 const char *last_changed_author;
1158 /** An exclusive lock, if present. Could be either local or remote. */
1161 /* Possible information about the working copy, NULL if not valid. */
1162 struct svn_wc_info_t *wc_info;
1166 /** The callback invoked by info retrievers. Each invocation
1167 * describes @a local_abspath with the information present in @a info.
1168 * Use @a scratch_pool for all temporary allocation.
1170 * @since New in 1.7.
1172 typedef svn_error_t *(*svn_wc__info_receiver2_t)(void *baton,
1173 const char *local_abspath,
1174 const svn_wc__info2_t *info,
1175 apr_pool_t *scratch_pool);
1177 /* Walk the children of LOCAL_ABSPATH and push svn_wc__info2_t's through
1178 RECEIVER/RECEIVER_BATON. Honor DEPTH while crawling children, and
1179 filter the pushed items against CHANGELISTS.
1181 If FETCH_EXCLUDED is TRUE, also fetch excluded nodes.
1182 If FETCH_ACTUAL_ONLY is TRUE, also fetch actual-only nodes. */
1184 svn_wc__get_info(svn_wc_context_t *wc_ctx,
1185 const char *local_abspath,
1187 svn_boolean_t fetch_excluded,
1188 svn_boolean_t fetch_actual_only,
1189 const apr_array_header_t *changelists,
1190 svn_wc__info_receiver2_t receiver,
1191 void *receiver_baton,
1192 svn_cancel_func_t cancel_func,
1194 apr_pool_t *scratch_pool);
1196 /* Alternative version of svn_wc_delete4().
1197 * It can delete multiple TARGETS more efficiently (within a single sqlite
1198 * transaction per working copy), but lacks support for moves.
1200 * ### Inconsistency: if DELETE_UNVERSIONED_TARGET is FALSE and a target is
1201 * unversioned, svn_wc__delete_many() will continue whereas
1202 * svn_wc_delete4() will throw an error.
1205 svn_wc__delete_many(svn_wc_context_t *wc_ctx,
1206 const apr_array_header_t *targets,
1207 svn_boolean_t keep_local,
1208 svn_boolean_t delete_unversioned_target,
1209 svn_cancel_func_t cancel_func,
1211 svn_wc_notify_func2_t notify_func,
1213 apr_pool_t *scratch_pool);
1216 /* If the node at LOCAL_ABSPATH was moved away set *MOVED_TO_ABSPATH to
1217 * the absolute path of the copied move-target node, and *COPY_OP_ROOT_ABSPATH
1218 * to the absolute path of the root node of the copy operation.
1220 * If the node was not moved, set *MOVED_TO_ABSPATH and *COPY_OP_ROOT_ABSPATH
1223 * Either MOVED_TO_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
1224 * that the caller is not interested in the result.
1227 svn_wc__node_was_moved_away(const char **moved_to_abspath,
1228 const char **copy_op_root_abspath,
1229 svn_wc_context_t *wc_ctx,
1230 const char *local_abspath,
1231 apr_pool_t *result_pool,
1232 apr_pool_t *scratch_pool);
1234 /* If the node at LOCAL_ABSPATH was moved here set *MOVED_FROM_ABSPATH to
1235 * the absolute path of the deleted move-source node, and set
1236 * *DELETE_OP_ROOT_ABSPATH to the absolute path of the root node of the
1239 * If the node was not moved, set *MOVED_FROM_ABSPATH and
1240 * *DELETE_OP_ROOT_ABSPATH to NULL.
1242 * Either MOVED_FROM_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
1243 * that the caller is not interested in the result.
1246 svn_wc__node_was_moved_here(const char **moved_from_abspath,
1247 const char **delete_op_root_abspath,
1248 svn_wc_context_t *wc_ctx,
1249 const char *local_abspath,
1250 apr_pool_t *result_pool,
1251 apr_pool_t *scratch_pool);
1253 /* During an upgrade to wc-ng, supply known details about an existing
1254 * external. The working copy will suck in and store the information supplied
1255 * about the existing external at @a local_abspath. */
1257 svn_wc__upgrade_add_external_info(svn_wc_context_t *wc_ctx,
1258 const char *local_abspath,
1259 svn_node_kind_t kind,
1260 const char *def_local_abspath,
1261 const char *repos_relpath,
1262 const char *repos_root_url,
1263 const char *repos_uuid,
1264 svn_revnum_t def_peg_revision,
1265 svn_revnum_t def_revision,
1266 apr_pool_t *scratch_pool);
1268 /* If the URL for @a item is relative, then using the repository root
1269 URL @a repos_root_url and the parent directory URL @parent_dir_url,
1270 resolve it into an absolute URL and save it in @a *resolved_url.
1272 Regardless if the URL is absolute or not, if there are no errors,
1273 the URL returned in @a *resolved_url will be canonicalized.
1275 The following relative URL formats are supported:
1277 ../ relative to the parent directory of the external
1278 ^/ relative to the repository root
1279 // relative to the scheme
1280 / relative to the server's hostname
1282 The ../ and ^/ relative URLs may use .. to remove path elements up
1285 The external URL should not be canonicalized before calling this function,
1286 as otherwise the scheme relative URL '//host/some/path' would have been
1287 canonicalized to '/host/some/path' and we would not be able to match on
1288 the leading '//'. */
1290 svn_wc__resolve_relative_external_url(const char **resolved_url,
1291 const svn_wc_external_item2_t *item,
1292 const char *repos_root_url,
1293 const char *parent_dir_url,
1294 apr_pool_t *result_pool,
1295 apr_pool_t *scratch_pool);
1299 * Set @a *editor and @a *edit_baton to an editor that generates
1300 * #svn_wc_status3_t structures and sends them through @a status_func /
1301 * @a status_baton. @a anchor_abspath is a working copy directory
1302 * directory which will be used as the root of our editor. If @a
1303 * target_basename is not "", it represents a node in the @a anchor_abspath
1304 * which is the subject of the editor drive (otherwise, the @a
1305 * anchor_abspath is the subject).
1307 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
1308 * be used in a call to the svn_wc_status_set_repos_locks() function.
1310 * Callers drive this editor to describe working copy out-of-dateness
1311 * with respect to the repository. If this information is not
1312 * available or not desired, callers should simply call the
1313 * close_edit() function of the @a editor vtable.
1315 * If the editor driver calls @a editor's set_target_revision() vtable
1316 * function, then when the edit drive is completed, @a *edit_revision
1317 * will contain the revision delivered via that interface.
1319 * Assuming the target is a directory, then:
1321 * - If @a get_all is FALSE, then only locally-modified entries will be
1322 * returned. If TRUE, then all entries will be returned.
1324 * - If @a depth is #svn_depth_empty, a status structure will
1325 * be returned for the target only; if #svn_depth_files, for the
1326 * target and its immediate file children; if
1327 * #svn_depth_immediates, for the target and its immediate
1328 * children; if #svn_depth_infinity, for the target and
1329 * everything underneath it, fully recursively.
1331 * If @a depth is #svn_depth_unknown, take depths from the
1332 * working copy and behave as above in each directory's case.
1334 * If the given @a depth is incompatible with the depth found in a
1335 * working copy directory, the found depth always governs.
1337 * If @a no_ignore is set, statuses that would typically be ignored
1338 * will instead be reported.
1340 * @a ignore_patterns is an array of file patterns matching
1341 * unversioned files to ignore for the purposes of status reporting,
1342 * or @c NULL if the default set of ignorable file patterns should be used.
1344 * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
1345 * the @a statushash to determine if the client has canceled the operation.
1347 * If @a depth_as_sticky is set handle @a depth like when depth_is_sticky is
1348 * passed for updating. This will show excluded nodes show up as added in the
1351 * If @a server_performs_filtering is TRUE, assume that the server handles
1352 * the ambient depth filtering, so this doesn't have to be handled in the
1355 * Allocate the editor itself in @a result_pool, and use @a scratch_pool
1356 * for temporary allocations. The editor will do its temporary allocations
1357 * in a subpool of @a result_pool.
1359 * @since New in 1.8.
1362 svn_wc__get_status_editor(const svn_delta_editor_t **editor,
1364 void **set_locks_baton,
1365 svn_revnum_t *edit_revision,
1366 svn_wc_context_t *wc_ctx,
1367 const char *anchor_abspath,
1368 const char *target_basename,
1370 svn_boolean_t get_all,
1371 svn_boolean_t no_ignore,
1372 svn_boolean_t depth_as_sticky,
1373 svn_boolean_t server_performs_filtering,
1374 const apr_array_header_t *ignore_patterns,
1375 svn_wc_status_func4_t status_func,
1377 svn_cancel_func_t cancel_func,
1379 apr_pool_t *result_pool,
1380 apr_pool_t *scratch_pool);
1384 * Set @a *editor and @a *edit_baton to an editor and baton for updating a
1387 * @a anchor_abspath is a local working copy directory, with a fully recursive
1388 * write lock in @a wc_ctx, which will be used as the root of our editor.
1390 * @a target_basename is the entry in @a anchor_abspath that will actually be
1391 * updated, or the empty string if all of @a anchor_abspath should be updated.
1393 * The editor invokes @a notify_func with @a notify_baton as the update
1394 * progresses, if @a notify_func is non-NULL.
1396 * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
1397 * @a cancel_baton as the update progresses to see if it should continue.
1399 * If @a conflict_func is non-NULL, then invoke it with @a
1400 * conflict_baton whenever a conflict is encountered, giving the
1401 * callback a chance to resolve the conflict before the editor takes
1402 * more drastic measures (such as marking a file conflicted, or
1403 * bailing out of the update).
1405 * If @a external_func is non-NULL, then invoke it with @a external_baton
1406 * whenever external changes are encountered, giving the callback a chance
1407 * to store the external information for processing.
1409 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
1410 * any merging; otherwise, use the built-in merge code.
1412 * @a preserved_exts is an array of filename patterns which, when
1413 * matched against the extensions of versioned files, determine for
1414 * which such files any related generated conflict files will preserve
1415 * the original file's extension as their own. If a file's extension
1416 * does not match any of the patterns in @a preserved_exts (which is
1417 * certainly the case if @a preserved_exts is @c NULL or empty),
1418 * generated conflict files will carry Subversion's custom extensions.
1420 * @a target_revision is a pointer to a revision location which, after
1421 * successful completion of the drive of this editor, will be
1422 * populated with the revision to which the working copy was updated.
1424 * @a wcroot_iprops is a hash mapping const char * absolute working copy
1425 * paths which are working copy roots (at or under the target within the
1426 * constraints dictated by @a depth) to depth-first ordered arrays of
1427 * svn_prop_inherited_item_t * structures which represent the inherited
1428 * properties for the base of those paths at @a target_revision. After a
1429 * successful drive of this editor, the base nodes for these paths will
1430 * have their inherited properties cache updated with the values from
1433 * If @a use_commit_times is TRUE, then all edited/added files will
1434 * have their working timestamp set to the last-committed-time. If
1435 * FALSE, the working files will be touched with the 'now' time.
1437 * If @a allow_unver_obstructions is TRUE, then allow unversioned
1438 * obstructions when adding a path.
1440 * If @a adds_as_modification is TRUE, a local addition at the same path
1441 * as an incoming addition of the same node kind results in a normal node
1442 * with a possible local modification, instead of a tree conflict.
1444 * If @a depth is #svn_depth_infinity, update fully recursively.
1445 * Else if it is #svn_depth_immediates, update the uppermost
1446 * directory, its file entries, and the presence or absence of
1447 * subdirectories (but do not descend into the subdirectories).
1448 * Else if it is #svn_depth_files, update the uppermost directory
1449 * and its immediate file entries, but not subdirectories.
1450 * Else if it is #svn_depth_empty, update exactly the uppermost
1451 * target, and don't touch its entries.
1453 * If @a depth_is_sticky is set and @a depth is not
1454 * #svn_depth_unknown, then in addition to updating PATHS, also set
1455 * their sticky ambient depth value to @a depth.
1457 * If @a server_performs_filtering is TRUE, assume that the server handles
1458 * the ambient depth filtering, so this doesn't have to be handled in the
1461 * If @a clean_checkout is TRUE, assume that we are checking out into an
1462 * empty directory, and so bypass a number of conflict checks that are
1463 * unnecessary in this case.
1465 * If @a fetch_dirents_func is not NULL, the update editor may call this
1466 * callback, when asked to perform a depth restricted update. It will do this
1467 * before returning the editor to allow using the primary ra session for this.
1469 * @since New in 1.8.
1472 svn_wc__get_update_editor(const svn_delta_editor_t **editor,
1474 svn_revnum_t *target_revision,
1475 svn_wc_context_t *wc_ctx,
1476 const char *anchor_abspath,
1477 const char *target_basename,
1478 apr_hash_t *wcroot_iprops,
1479 svn_boolean_t use_commit_times,
1481 svn_boolean_t depth_is_sticky,
1482 svn_boolean_t allow_unver_obstructions,
1483 svn_boolean_t adds_as_modification,
1484 svn_boolean_t server_performs_filtering,
1485 svn_boolean_t clean_checkout,
1486 const char *diff3_cmd,
1487 const apr_array_header_t *preserved_exts,
1488 svn_wc_dirents_func_t fetch_dirents_func,
1489 void *fetch_dirents_baton,
1490 svn_wc_conflict_resolver_func2_t conflict_func,
1491 void *conflict_baton,
1492 svn_wc_external_update_t external_func,
1493 void *external_baton,
1494 svn_cancel_func_t cancel_func,
1496 svn_wc_notify_func2_t notify_func,
1498 apr_pool_t *result_pool,
1499 apr_pool_t *scratch_pool);
1503 * A variant of svn_wc__get_update_editor().
1505 * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
1506 * a working copy to a new @a switch_url. (Right now, this URL must be
1507 * within the same repository that the working copy already comes
1508 * from.) @a switch_url must not be @c NULL.
1510 * All other parameters behave as for svn_wc__get_update_editor().
1512 * @since New in 1.8.
1515 svn_wc__get_switch_editor(const svn_delta_editor_t **editor,
1517 svn_revnum_t *target_revision,
1518 svn_wc_context_t *wc_ctx,
1519 const char *anchor_abspath,
1520 const char *target_basename,
1521 const char *switch_url,
1522 apr_hash_t *wcroot_iprops,
1523 svn_boolean_t use_commit_times,
1525 svn_boolean_t depth_is_sticky,
1526 svn_boolean_t allow_unver_obstructions,
1527 svn_boolean_t server_performs_filtering,
1528 const char *diff3_cmd,
1529 const apr_array_header_t *preserved_exts,
1530 svn_wc_dirents_func_t fetch_dirents_func,
1531 void *fetch_dirents_baton,
1532 svn_wc_conflict_resolver_func2_t conflict_func,
1533 void *conflict_baton,
1534 svn_wc_external_update_t external_func,
1535 void *external_baton,
1536 svn_cancel_func_t cancel_func,
1538 svn_wc_notify_func2_t notify_func,
1540 apr_pool_t *result_pool,
1541 apr_pool_t *scratch_pool);
1546 * Return an @a editor/@a edit_baton for diffing a working copy against the
1547 * repository. The editor is allocated in @a result_pool; temporary
1548 * calculations are performed in @a scratch_pool.
1550 * This editor supports diffing either the actual files and properties in the
1551 * working copy (when @a use_text_base is #FALSE), or the current pristine
1552 * information (when @a use_text_base is #TRUE) against the editor driver.
1554 * @a anchor_abspath/@a target represent the base of the hierarchy to be
1555 * compared. The diff callback paths will be relative to this path.
1557 * Diffs will be reported as valid relpaths, with @a anchor_abspath being
1560 * @a callbacks/@a callback_baton is the callback table to use.
1562 * If @a depth is #svn_depth_empty, just diff exactly @a target or
1563 * @a anchor_path if @a target is empty. If #svn_depth_files then do the same
1564 * and for top-level file entries as well (if any). If
1565 * #svn_depth_immediates, do the same as #svn_depth_files but also diff
1566 * top-level subdirectories at #svn_depth_empty. If #svn_depth_infinity,
1567 * then diff fully recursively. If @a depth is #svn_depth_unknown, then...
1569 * ### ... then the @a server_performs_filtering option is meaningful.
1570 * ### But what does this depth mean exactly? Something about 'ambient'
1571 * ### depth? How does it compare with depth 'infinity'?
1573 * @a ignore_ancestry determines whether paths that have discontinuous node
1574 * ancestry are treated as delete/add or as simple modifications. If
1575 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
1576 * result in the diff given as a full delete followed by an add.
1578 * @a show_copies_as_adds determines whether paths added with history will
1579 * appear as a diff against their copy source, or whether such paths will
1580 * appear as if they were newly added in their entirety.
1582 * If @a use_git_diff_format is TRUE, copied paths will be treated as added
1583 * if they weren't modified after being copied. This allows the callbacks
1584 * to generate appropriate --git diff headers for such files.
1586 * Normally, the difference from repository->working_copy is shown.
1587 * If @a reverse_order is TRUE, then show working_copy->repository diffs.
1589 * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
1590 * to periodically check if the client has canceled the operation.
1592 * @a changelist_filter is an array of <tt>const char *</tt> changelist
1593 * names, used as a restrictive filter on items whose differences are
1594 * reported; that is, don't generate diffs about any item unless
1595 * it's a member of one of those changelists. If @a changelist_filter is
1596 * empty (or altogether @c NULL), no changelist filtering occurs.
1598 * If @a server_performs_filtering is TRUE, assume that the server handles
1599 * the ambient depth filtering, so this doesn't have to be handled in the
1603 * A diagram illustrating how this function is used.
1605 * Steps 1 and 2 create the chain; step 3 drives it.
1607 * 1. svn_wc__get_diff_editor(diff_cbs)
1609 * 2. svn_ra_do_diff3(editor) | |
1612 * +----------+ +----------+ +----------+
1614 * +--> | reporter | ----> | editor | ----> | diff_cbs | ----> text
1616 * | +----------+ +----------+ +----------+
1618 * 3. svn_wc_crawl_revisions5(WC,reporter)
1621 * @since New in 1.8.
1624 svn_wc__get_diff_editor(const svn_delta_editor_t **editor,
1626 svn_wc_context_t *wc_ctx,
1627 const char *anchor_abspath,
1630 svn_boolean_t ignore_ancestry,
1631 svn_boolean_t show_copies_as_adds,
1632 svn_boolean_t use_git_diff_format,
1633 svn_boolean_t use_text_base,
1634 svn_boolean_t reverse_order,
1635 svn_boolean_t server_performs_filtering,
1636 const apr_array_header_t *changelist_filter,
1637 const svn_wc_diff_callbacks4_t *callbacks,
1638 void *callback_baton,
1639 svn_cancel_func_t cancel_func,
1641 apr_pool_t *result_pool,
1642 apr_pool_t *scratch_pool);
1644 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1645 * notifications like how the repos diff in libsvn_client does.
1647 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1649 typedef svn_error_t *
1650 (*svn_wc__diff_state_handle_t)(svn_boolean_t tree_conflicted,
1651 svn_wc_notify_state_t *state,
1652 svn_wc_notify_state_t *prop_state,
1653 const char *relpath,
1654 svn_node_kind_t kind,
1655 svn_boolean_t before_op,
1656 svn_boolean_t for_add,
1657 svn_boolean_t for_delete,
1659 apr_pool_t *scratch_pool);
1661 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1662 * notifications like how the repos diff in libsvn_client does.
1664 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1666 typedef svn_error_t *
1667 (*svn_wc__diff_state_close_t)(const char *relpath,
1668 svn_node_kind_t kind,
1670 apr_pool_t *scratch_pool);
1672 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1675 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1677 typedef svn_error_t *
1678 (*svn_wc__diff_state_absent_t)(const char *relpath,
1680 apr_pool_t *scratch_pool);
1682 /** Obtains a diff processor that will drive the diff callbacks when it
1686 svn_wc__wrap_diff_callbacks(const svn_diff_tree_processor_t **diff_processor,
1687 const svn_wc_diff_callbacks4_t *callbacks,
1688 void *callback_baton,
1689 svn_boolean_t walk_deleted_dirs,
1690 apr_pool_t *result_pool,
1691 apr_pool_t *scratch_pool);
1695 * Assuming @a local_abspath itself or any of its children are under version
1696 * control or a tree conflict victim and in a state of conflict, take these
1697 * nodes out of this state.
1699 * If @a resolve_text is TRUE then any text conflict is resolved,
1700 * if @a resolve_tree is TRUE then any tree conflicts are resolved.
1701 * If @a resolve_prop is set to "" all property conflicts are resolved,
1702 * if it is set to any other string value, conflicts on that specific
1703 * property are resolved and when resolve_prop is NULL, no property
1704 * conflicts are resolved.
1706 * If @a depth is #svn_depth_empty, act only on @a local_abspath; if
1707 * #svn_depth_files, resolve @a local_abspath and its conflicted file
1708 * children (if any); if #svn_depth_immediates, resolve @a local_abspath
1709 * and all its immediate conflicted children (both files and directories,
1710 * if any); if #svn_depth_infinity, resolve @a local_abspath and every
1711 * conflicted file or directory anywhere beneath it.
1713 * If @a conflict_choice is #svn_wc_conflict_choose_base, resolve the
1714 * conflict with the old file contents; if
1715 * #svn_wc_conflict_choose_mine_full, use the original working contents;
1716 * if #svn_wc_conflict_choose_theirs_full, the new contents; and if
1717 * #svn_wc_conflict_choose_merged, don't change the contents at all,
1718 * just remove the conflict status, which is the pre-1.5 behavior.
1720 * If @a conflict_choice is #svn_wc_conflict_choose_unspecified, invoke the
1721 * @a conflict_func with the @a conflict_baton argument to obtain a
1722 * resolution decision for each conflict.
1724 * #svn_wc_conflict_choose_theirs_conflict and
1725 * #svn_wc_conflict_choose_mine_conflict are not legal for binary
1726 * files or properties.
1728 * @a wc_ctx is a working copy context, with a write lock, for @a
1731 * The implementation details are opaque, as our "conflicted" criteria
1732 * might change over time. (At the moment, this routine removes the
1733 * three fulltext 'backup' files and any .prej file created in a conflict,
1734 * and modifies @a local_abspath's entry.)
1736 * If @a local_abspath is not under version control and not a tree
1737 * conflict, return #SVN_ERR_ENTRY_NOT_FOUND. If @a path isn't in a
1738 * state of conflict to begin with, do nothing, and return #SVN_NO_ERROR.
1740 * If @c local_abspath was successfully taken out of a state of conflict,
1741 * report this information to @c notify_func (if non-@c NULL.) If only
1742 * text, only property, or only tree conflict resolution was requested,
1743 * and it was successful, then success gets reported.
1745 * Temporary allocations will be performed in @a scratch_pool.
1747 * @since New in 1.8.
1750 svn_wc__resolve_conflicts(svn_wc_context_t *wc_ctx,
1751 const char *local_abspath,
1753 svn_boolean_t resolve_text,
1754 const char *resolve_prop,
1755 svn_boolean_t resolve_tree,
1756 svn_wc_conflict_choice_t conflict_choice,
1757 svn_wc_conflict_resolver_func2_t conflict_func,
1758 void *conflict_baton,
1759 svn_cancel_func_t cancel_func,
1761 svn_wc_notify_func2_t notify_func,
1763 apr_pool_t *scratch_pool);
1766 * Move @a src_abspath to @a dst_abspath, by scheduling @a dst_abspath
1767 * for addition to the repository, remembering the history. Mark @a src_abspath
1768 * as deleted after moving.@a wc_ctx is used for accessing the working copy and
1769 * must contain a write lock for the parent directory of @a src_abspath and
1772 * If @a metadata_only is TRUE then this is a database-only operation and
1773 * the working directories and files are not changed.
1775 * @a src_abspath must be a file or directory under version control;
1776 * the parent of @a dst_abspath must be a directory under version control
1777 * in the same working copy; @a dst_abspath will be the name of the copied
1778 * item, and it must not exist already if @a metadata_only is FALSE. Note that
1779 * when @a src points to a versioned file, the working file doesn't
1780 * necessarily exist in which case its text-base is used instead.
1782 * If @a allow_mixed_revisions is @c FALSE, #SVN_ERR_WC_MIXED_REVISIONS
1783 * will be raised if the move source is a mixed-revision subtree.
1784 * If @a allow_mixed_revisions is TRUE, a mixed-revision move source is
1785 * allowed but the move will degrade to a copy and a delete without local
1786 * move tracking. This parameter should be set to FALSE except where backwards
1787 * compatibility to svn_wc_move() is required.
1789 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
1790 * various points during the operation. If it returns an error
1791 * (typically #SVN_ERR_CANCELLED), return that error immediately.
1793 * If @a notify_func is non-NULL, call it with @a notify_baton and the path
1794 * of the root node (only) of the destination.
1796 * Use @a scratch_pool for temporary allocations.
1798 * @since New in 1.8.
1801 svn_wc__move2(svn_wc_context_t *wc_ctx,
1802 const char *src_abspath,
1803 const char *dst_abspath,
1804 svn_boolean_t metadata_only,
1805 svn_boolean_t allow_mixed_revisions,
1806 svn_cancel_func_t cancel_func,
1808 svn_wc_notify_func2_t notify_func,
1810 apr_pool_t *scratch_pool);
1813 /* During merge when we encounter added directories, we add them using
1814 svn_wc_add4(), recording its original location, etc. But at that time
1815 we don't have its original properties. This function allows updating the
1816 BASE properties of such a special added node, but only before it receives
1819 NEW_ORIGINAL_PROPS is a new set of properties, including entry props that
1820 will be applied to LOCAL_ABSPATH as pristine properties.
1822 The copyfrom_* arguments are used to verify (some of) the assumptions of
1825 svn_wc__complete_directory_add(svn_wc_context_t *wc_ctx,
1826 const char *local_abspath,
1827 apr_hash_t *new_original_props,
1828 const char *copyfrom_url,
1829 svn_revnum_t copyfrom_rev,
1830 apr_pool_t *scratch_pool);
1833 /* Acquire a write lock on LOCAL_ABSPATH or an ancestor that covers
1834 all possible paths affected by resolving the conflicts in the tree
1835 LOCAL_ABSPATH. Set *LOCK_ROOT_ABSPATH to the path of the lock
1838 svn_wc__acquire_write_lock_for_resolve(const char **lock_root_abspath,
1839 svn_wc_context_t *wc_ctx,
1840 const char *local_abspath,
1841 apr_pool_t *result_pool,
1842 apr_pool_t *scratch_pool);
1845 #endif /* __cplusplus */
1847 #endif /* SVN_WC_PRIVATE_H */