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_cancel_func_t cancel_func,
87 svn_wc_notify_func2_t notify_func,
89 apr_pool_t *result_pool,
90 apr_pool_t *scratch_pool);
92 /* Like svn_wc_crawl_revisionsX, but only supports updating a file external
93 LOCAL_ABSPATH which may or may not exist yet. */
95 svn_wc__crawl_file_external(svn_wc_context_t *wc_ctx,
96 const char *local_abspath,
97 const svn_ra_reporter3_t *reporter,
99 svn_boolean_t restore_files,
100 svn_boolean_t use_commit_times,
101 svn_cancel_func_t cancel_func,
103 svn_wc_notify_func2_t notify_func,
105 apr_pool_t *scratch_pool);
107 /* Check if LOCAL_ABSPATH is an external in the working copy identified
108 by WRI_ABSPATH. If not return SVN_ERR_WC_PATH_NOT_FOUND.
110 If it is an external return more information on this external.
112 If IGNORE_ENOENT, then set *external_kind to svn_node_none, when
113 LOCAL_ABSPATH is not an external instead of returning an error.
115 Here is an overview of how DEFINING_REVISION and
116 DEFINING_OPERATIONAL_REVISION would be set for which kinds of externals
119 svn:externals line DEFINING_REV. DEFINING_OP._REV.
123 -r1 ^/foo bar 1 SVN_INVALID_REVNUM
124 ^/foo bar SVN_INVALID_REVNUM SVN_INVALID_REVNUM
125 ^/foo@HEAD bar SVN_INVALID_REVNUM SVN_INVALID_REVNUM
126 -rHEAD ^/foo bar -- not a valid externals definition --
129 svn_wc__read_external_info(svn_node_kind_t *external_kind,
130 const char **defining_abspath,
131 const char **defining_url,
132 svn_revnum_t *defining_operational_revision,
133 svn_revnum_t *defining_revision,
134 svn_wc_context_t *wc_ctx,
135 const char *wri_abspath,
136 const char *local_abspath,
137 svn_boolean_t ignore_enoent,
138 apr_pool_t *result_pool,
139 apr_pool_t *scratch_pool);
141 /** See svn_wc__committable_externals_below(). */
142 typedef struct svn_wc__committable_external_info_t {
144 /* The local absolute path where the external should be checked out. */
145 const char *local_abspath;
147 /* The relpath part of the source URL the external should be checked out
149 const char *repos_relpath;
151 /* The root URL part of the source URL the external should be checked out
153 const char *repos_root_url;
155 /* Set to either svn_node_file or svn_node_dir. */
156 svn_node_kind_t kind;
158 } svn_wc__committable_external_info_t;
160 /* Add svn_wc__committable_external_info_t* items to *EXTERNALS, describing
161 * 'committable' externals checked out below LOCAL_ABSPATH. Recursively find
162 * all nested externals (externals defined inside externals).
164 * In this context, a 'committable' external belongs to the same repository as
165 * LOCAL_ABSPATH, is not revision-pegged and is currently checked out in the
166 * WC. (Local modifications are not tested for.)
168 * *EXTERNALS must be initialized either to NULL or to a pointer created with
169 * apr_array_make(..., sizeof(svn_wc__committable_external_info_t *)). If
170 * *EXTERNALS is initialized to NULL, an array will be allocated from
171 * RESULT_POOL as necessary. If no committable externals are found,
172 * *EXTERNALS is left unchanged.
174 * DEPTH limits the recursion below LOCAL_ABSPATH.
176 * This function will not find externals defined in some parent WC above
177 * LOCAL_ABSPATH's WC-root.
179 * ###TODO: Add a WRI_ABSPATH (wc root indicator) separate from LOCAL_ABSPATH,
180 * to allow searching any wc-root for externals under LOCAL_ABSPATH, not only
181 * LOCAL_ABSPATH's most immediate wc-root. */
183 svn_wc__committable_externals_below(apr_array_header_t **externals,
184 svn_wc_context_t *wc_ctx,
185 const char *local_abspath,
187 apr_pool_t *result_pool,
188 apr_pool_t *scratch_pool);
190 /* Gets a mapping from const char * local abspaths of externals to the const
191 char * local abspath of where they are defined for all externals defined
192 at or below LOCAL_ABSPATH.
194 ### Returns NULL in *EXTERNALS until we bumped to format 29.
196 Allocate the result in RESULT_POOL and perform temporary allocations in
199 svn_wc__externals_defined_below(apr_hash_t **externals,
200 svn_wc_context_t *wc_ctx,
201 const char *local_abspath,
202 apr_pool_t *result_pool,
203 apr_pool_t *scratch_pool);
206 /* Registers a new external at LOCAL_ABSPATH in the working copy containing
209 The node is registered as defined on DEFINING_ABSPATH (must be an ancestor
210 of LOCAL_ABSPATH) of kind KIND.
212 The external is registered as from repository REPOS_ROOT_URL with uuid
213 REPOS_UUID and the defining relative path REPOS_RELPATH.
215 If the revision of the node is locked OPERATIONAL_REVISION and REVISION
216 are the peg and normal revision; otherwise their value is
219 ### Only KIND svn_node_dir is supported.
221 Perform temporary allocations in SCRATCH_POOL.
224 svn_wc__external_register(svn_wc_context_t *wc_ctx,
225 const char *defining_abspath,
226 const char *local_abspath,
227 svn_node_kind_t kind,
228 const char *repos_root_url,
229 const char *repos_uuid,
230 const char *repos_relpath,
231 svn_revnum_t operational_revision,
232 svn_revnum_t revision,
233 apr_pool_t *scratch_pool);
235 /* Remove the external at LOCAL_ABSPATH from the working copy identified by
236 WRI_ABSPATH using WC_CTX.
238 If DECLARATION_ONLY is TRUE, only remove the registration and leave the
239 on-disk structure untouched.
241 If not NULL, call CANCEL_FUNC with CANCEL_BATON to allow canceling while
242 removing the working copy files.
244 ### This function wraps svn_wc_remove_from_revision_control2().
247 svn_wc__external_remove(svn_wc_context_t *wc_ctx,
248 const char *wri_abspath,
249 const char *local_abspath,
250 svn_boolean_t declaration_only,
251 svn_cancel_func_t cancel_func,
253 apr_pool_t *scratch_pool);
255 /* Gather all svn:externals property values from the actual properties on
256 directories below LOCAL_ABSPATH as a mapping of const char *local_abspath
257 to const char * values.
259 Use DEPTH as how it would be used to limit the externals property results
260 on update. (So any depth < infinity will only read svn:externals on
261 LOCAL_ABSPATH itself)
263 If DEPTHS is not NULL, set *depths to an apr_hash_t* mapping the same
264 local_abspaths to the const char * ambient depth of the node.
266 Allocate the result in RESULT_POOL and perform temporary allocations in
269 svn_wc__externals_gather_definitions(apr_hash_t **externals,
270 apr_hash_t **ambient_depths,
271 svn_wc_context_t *wc_ctx,
272 const char *local_abspath,
274 apr_pool_t *result_pool,
275 apr_pool_t *scratch_pool);
277 /* Close the DB for LOCAL_ABSPATH. Perform temporary allocations in
280 Wraps svn_wc__db_drop_root(). */
282 svn_wc__close_db(const char *external_abspath,
283 svn_wc_context_t *wc_ctx,
284 apr_pool_t *scratch_pool);
286 /** Set @a *tree_conflict to a newly allocated @c
287 * svn_wc_conflict_description_t structure describing the tree
288 * conflict state of @a victim_abspath, or to @c NULL if @a victim_abspath
289 * is not in a state of tree conflict. @a wc_ctx is a working copy context
290 * used to access @a victim_path. Allocate @a *tree_conflict in @a result_pool,
291 * use @a scratch_pool for temporary allocations.
294 svn_wc__get_tree_conflict(const svn_wc_conflict_description2_t **tree_conflict,
295 svn_wc_context_t *wc_ctx,
296 const char *victim_abspath,
297 apr_pool_t *result_pool,
298 apr_pool_t *scratch_pool);
300 /** Record the tree conflict described by @a conflict in the WC for
301 * @a conflict->local_abspath. Use @a scratch_pool for all temporary
304 * Returns an SVN_ERR_WC_PATH_UNEXPECTED_STATUS error when
305 * CONFLICT->LOCAL_ABSPATH is already tree conflicted.
307 * ### This function can't set moved_away, moved_here conflicts for
308 * any operation, except merges.
311 svn_wc__add_tree_conflict(svn_wc_context_t *wc_ctx,
312 const svn_wc_conflict_description2_t *conflict,
313 apr_pool_t *scratch_pool);
315 /* Remove any tree conflict on victim @a victim_abspath using @a wc_ctx.
316 * (If there is no such conflict recorded, do nothing and return success.)
318 * Do all temporary allocations in @a scratch_pool.
321 svn_wc__del_tree_conflict(svn_wc_context_t *wc_ctx,
322 const char *victim_abspath,
323 apr_pool_t *scratch_pool);
325 /** Check whether LOCAL_ABSPATH has a parent directory that knows about its
326 * existence. Set *IS_WCROOT to FALSE if a parent is found, and to TRUE
327 * if there is no such parent.
329 * Like svn_wc_is_wc_root2(), but doesn't consider switched subdirs or
330 * deleted entries as working copy roots.
333 svn_wc__is_wcroot(svn_boolean_t *is_wcroot,
334 svn_wc_context_t *wc_ctx,
335 const char *local_abspath,
336 apr_pool_t *scratch_pool);
339 /** Set @a *wcroot_abspath to the local abspath of the root of the
340 * working copy in which @a local_abspath resides.
343 svn_wc__get_wcroot(const char **wcroot_abspath,
344 svn_wc_context_t *wc_ctx,
345 const char *local_abspath,
346 apr_pool_t *result_pool,
347 apr_pool_t *scratch_pool);
350 * The following are temporary APIs to aid in the transition from wc-1 to
351 * wc-ng. Use them for new development now, but they may be disappearing
352 * before the 1.7 release.
356 * Convert from svn_wc_conflict_description2_t to
357 * svn_wc_conflict_description_t. This is needed by some backwards-compat
358 * code in libsvn_client/ctx.c
360 * Allocate the result in RESULT_POOL.
362 svn_wc_conflict_description_t *
363 svn_wc__cd2_to_cd(const svn_wc_conflict_description2_t *conflict,
364 apr_pool_t *result_pool);
368 * Convert from svn_wc_status3_t to svn_wc_status2_t.
369 * Allocate the result in RESULT_POOL.
371 * Deprecated because svn_wc_status2_t is deprecated and the only
372 * calls are from other deprecated functions.
376 svn_wc__status2_from_3(svn_wc_status2_t **status,
377 const svn_wc_status3_t *old_status,
378 svn_wc_context_t *wc_ctx,
379 const char *local_abspath,
380 apr_pool_t *result_pool,
381 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, but not those that
389 * are excluded, server-excluded or not-present.
391 * Return every path that refers to a child of the working node at
392 * @a dir_abspath. Do not include a path just because it was a child of a
393 * deleted directory that existed at @a dir_abspath if that directory is now
394 * sheduled to be replaced by the working node at @a dir_abspath.
396 * Allocate @a *children in @a result_pool. Use @a wc_ctx to access the
397 * working copy, and @a scratch_pool for all temporary allocations.
400 svn_wc__node_get_children_of_working_node(const apr_array_header_t **children,
401 svn_wc_context_t *wc_ctx,
402 const char *dir_abspath,
403 apr_pool_t *result_pool,
404 apr_pool_t *scratch_pool);
407 * Gets the immediate 'not-present' children of a node.
409 * #### Needed during 'svn cp WC URL' to handle mixed revision cases
412 svn_wc__node_get_not_present_children(const apr_array_header_t **children,
413 svn_wc_context_t *wc_ctx,
414 const char *dir_abspath,
415 apr_pool_t *result_pool,
416 apr_pool_t *scratch_pool);
419 * Fetch the repository information for the working version
420 * of the node at @a local_abspath into @a *revision, @a *repos_relpath,
421 * @a *repos_root_url and @a *repos_uuid. Use @a wc_ctx to access the working
422 * copy. Allocate results in @a result_pool.
424 * @a *revision will be set to SVN_INVALID_REVNUM for any shadowed node (including
425 * added and deleted nodes). All other output values will be set to the current
426 * values or those they would have after a commit.
428 * All output argument may be NULL, indicating no interest.
431 svn_wc__node_get_repos_info(svn_revnum_t *revision,
432 const char **repos_relpath,
433 const char **repos_root_url,
434 const char **repos_uuid,
435 svn_wc_context_t *wc_ctx,
436 const char *local_abspath,
437 apr_pool_t *result_pool,
438 apr_pool_t *scratch_pool);
441 * Get the changed revision, date and author for @a local_abspath using @a
442 * wc_ctx. Allocate the return values in @a result_pool; use @a scratch_pool
443 * for temporary allocations. Any of the return pointers may be @c NULL, in
444 * which case they are not set.
446 * If @a local_abspath is not in the working copy, return
447 * @c SVN_ERR_WC_PATH_NOT_FOUND.
450 svn_wc__node_get_changed_info(svn_revnum_t *changed_rev,
451 apr_time_t *changed_date,
452 const char **changed_author,
453 svn_wc_context_t *wc_ctx,
454 const char *local_abspath,
455 apr_pool_t *result_pool,
456 apr_pool_t *scratch_pool);
460 * Set @a *url to the corresponding url for @a local_abspath, using @a wc_ctx.
461 * If the node is added, return the url it will have in the repository.
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_url(const char **url,
468 svn_wc_context_t *wc_ctx,
469 const char *local_abspath,
470 apr_pool_t *result_pool,
471 apr_pool_t *scratch_pool);
474 * Retrieves the origin of the node as it is known in the repository. For
475 * a copied node this retrieves where the node is copied from, for an added
476 * node this returns NULL/INVALID outputs, and for any other node this
477 * retrieves the repository location.
479 * All output arguments may be NULL.
481 * If @a is_copy is not NULL, sets @a *is_copy to TRUE if the origin is a copy
482 * of the original node.
484 * If not NULL, sets @a revision, @a repos_relpath, @a repos_root_url and
485 * @a repos_uuid to the original (if a copy) or their current values.
487 * If not NULL, set @a depth, to the recorded depth on @a local_abspath.
489 * If @a copy_root_abspath is not NULL, and @a *is_copy indicates that the
490 * node was copied, set @a *copy_root_abspath to the local absolute path of
491 * the root of the copied subtree containing the node. If the copied node is
492 * a root by itself, @a *copy_root_abspath will match @a local_abspath (but
493 * won't necessarily point to the same string in memory).
495 * If @a scan_deleted is TRUE, determine the origin of the deleted node. If
496 * @a scan_deleted is FALSE, return NULL, SVN_INVALID_REVNUM or FALSE for
499 * Allocate the result in @a result_pool. Perform temporary allocations in
502 svn_wc__node_get_origin(svn_boolean_t *is_copy,
503 svn_revnum_t *revision,
504 const char **repos_relpath,
505 const char **repos_root_url,
506 const char **repos_uuid,
508 const char **copy_root_abspath,
509 svn_wc_context_t *wc_ctx,
510 const char *local_abspath,
511 svn_boolean_t scan_deleted,
512 apr_pool_t *result_pool,
513 apr_pool_t *scratch_pool);
516 * Set @a *not_present to TRUE when @a local_abspath has status
517 * svn_wc__db_status_not_present. Set @a *user_excluded to TRUE when
518 * @a local_abspath has status svn_wc__db_status_excluded. Set
519 * @a *server_excluded to TRUE when @a local_abspath has status
520 * svn_wc__db_status_server_excluded. Otherwise set these values to FALSE.
521 * If @a base_only is TRUE then only the base node will be examined,
522 * otherwise the current base or working node will be examined.
524 * If a value is not interesting you can pass #NULL.
526 * If @a local_abspath is not in the working copy, return
527 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
531 svn_wc__node_is_not_present(svn_boolean_t *not_present,
532 svn_boolean_t *user_excluded,
533 svn_boolean_t *server_excluded,
534 svn_wc_context_t *wc_ctx,
535 const char *local_abspath,
536 svn_boolean_t base_only,
537 apr_pool_t *scratch_pool);
540 * Set @a *is_added to whether @a local_abspath is added, using
541 * @a wc_ctx. If @a local_abspath is not in the working copy, return
542 * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a scratch_pool for all temporary
545 * NOTE: "added" in this sense, means it was added, copied-here, or
546 * moved-here. This function provides NO information on whether this
547 * addition has replaced another node.
549 * To be clear, this does NOT correspond to svn_wc_schedule_add.
552 svn_wc__node_is_added(svn_boolean_t *is_added,
553 svn_wc_context_t *wc_ctx,
554 const char *local_abspath,
555 apr_pool_t *scratch_pool);
558 * Set @a *has_working to whether @a local_abspath has a working node (which
559 * might shadow BASE nodes)
561 * This is a check similar to status = added or status = deleted.
564 svn_wc__node_has_working(svn_boolean_t *has_working,
565 svn_wc_context_t *wc_ctx,
566 const char *local_abspath,
567 apr_pool_t *scratch_pool);
571 * Get the repository location of the base node at @a local_abspath.
573 * Set *REVISION, *REPOS_RELPATH, *REPOS_ROOT_URL *REPOS_UUID and *LOCK_TOKEN
574 * to the location that this node was checked out at or last updated/switched
575 * to, regardless of any uncommitted changes (delete, replace and/or copy-here/
578 * If there is no BASE node at @a local_abspath or if @a show_hidden is FALSE,
579 * no status 'normal' or 'incomplete' BASE node report
580 * SVN_ERR_WC_PATH_NOT_FOUND, or if @a ignore_enoent is TRUE, @a kind
581 * svn_node_unknown, @a revision SVN_INVALID_REVNUM and all other values NULL.
583 * All output arguments may be NULL.
585 * Allocate the results in @a result_pool. Perform temporary allocations in
589 svn_wc__node_get_base(svn_node_kind_t *kind,
590 svn_revnum_t *revision,
591 const char **repos_relpath,
592 const char **repos_root_url,
593 const char **repos_uuid,
594 const char **lock_token,
595 svn_wc_context_t *wc_ctx,
596 const char *local_abspath,
597 svn_boolean_t ignore_enoent,
598 apr_pool_t *result_pool,
599 apr_pool_t *scratch_pool);
602 /* Get the working revision of @a local_abspath using @a wc_ctx. If @a
603 * local_abspath is not in the working copy, return @c
604 * SVN_ERR_WC_PATH_NOT_FOUND.
606 * This function is meant as a temporary solution for using the old-style
607 * semantics of entries. It will handle any uncommitted changes (delete,
608 * replace and/or copy-here/move-here).
610 * For a delete the @a revision is the BASE node of the operation root, e.g
611 * the path that was deleted. But if the delete is below an add, the
612 * revision is set to SVN_INVALID_REVNUM. For an add, copy or move we return
613 * SVN_INVALID_REVNUM. In case of a replacement, we return the BASE
616 * The @a changed_rev is set to the latest committed change to @a
617 * local_abspath before or equal to @a revision, unless the node is
618 * copied-here or moved-here. Then it is the revision of the latest committed
619 * change before or equal to the copyfrom_rev. NOTE, that we use
620 * SVN_INVALID_REVNUM for a scheduled copy or move.
622 * The @a changed_date and @a changed_author are the ones associated with @a
626 svn_wc__node_get_pre_ng_status_data(svn_revnum_t *revision,
627 svn_revnum_t *changed_rev,
628 apr_time_t *changed_date,
629 const char **changed_author,
630 svn_wc_context_t *wc_ctx,
631 const char *local_abspath,
632 apr_pool_t *result_pool,
633 apr_pool_t *scratch_pool);
636 * Acquire a recursive write lock for @a local_abspath. If @a lock_anchor
637 * is true, determine if @a local_abspath has an anchor that should be locked
638 * instead; otherwise, @a local_abspath must be a versioned directory.
639 * Store the obtained lock in @a wc_ctx.
641 * If @a lock_root_abspath is not NULL, store the root of the lock in
642 * @a *lock_root_abspath. If @a lock_root_abspath is NULL, then @a
643 * lock_anchor must be FALSE.
645 * Returns @c SVN_ERR_WC_LOCKED if an existing lock is encountered, in
646 * which case any locks acquired will have been released.
648 * If @a lock_anchor is TRUE and @a lock_root_abspath is not NULL, @a
649 * lock_root_abspath will be set even when SVN_ERR_WC_LOCKED is returned.
652 svn_wc__acquire_write_lock(const char **lock_root_abspath,
653 svn_wc_context_t *wc_ctx,
654 const char *local_abspath,
655 svn_boolean_t lock_anchor,
656 apr_pool_t *result_pool,
657 apr_pool_t *scratch_pool);
661 * Recursively release write locks for @a local_abspath, using @a wc_ctx
662 * for working copy access. Only locks held by @a wc_ctx are released.
663 * Locks are not removed if work queue items are present.
665 * If @a local_abspath is not the root of an owned SVN_ERR_WC_NOT_LOCKED
669 svn_wc__release_write_lock(svn_wc_context_t *wc_ctx,
670 const char *local_abspath,
671 apr_pool_t *scratch_pool);
673 /** A callback invoked by the svn_wc__call_with_write_lock() function. */
674 typedef svn_error_t *(*svn_wc__with_write_lock_func_t)(void *baton,
675 apr_pool_t *result_pool,
676 apr_pool_t *scratch_pool);
679 /** Call function @a func while holding a write lock on
680 * @a local_abspath. The @a baton, and @a result_pool and
681 * @a scratch_pool, is passed @a func.
683 * If @a lock_anchor is TRUE, determine if @a local_abspath has an anchor
684 * that should be locked instead.
686 * Use @a wc_ctx for working copy access.
687 * The lock is guaranteed to be released after @a func returns.
690 svn_wc__call_with_write_lock(svn_wc__with_write_lock_func_t func,
692 svn_wc_context_t *wc_ctx,
693 const char *local_abspath,
694 svn_boolean_t lock_anchor,
695 apr_pool_t *result_pool,
696 apr_pool_t *scratch_pool);
698 /** Evaluate the expression @a expr while holding a write lock on
701 * @a expr must yield an (svn_error_t *) error code. If the error code
702 * is not #SVN_NO_ERROR, cause the function using this macro to return
703 * the error to its caller.
705 * If @a lock_anchor is TRUE, determine if @a local_abspath has an anchor
706 * that should be locked instead.
708 * Use @a wc_ctx for working copy access.
710 * The lock is guaranteed to be released after evaluating @a expr.
712 #define SVN_WC__CALL_WITH_WRITE_LOCK(expr, wc_ctx, local_abspath, \
713 lock_anchor, scratch_pool) \
715 svn_error_t *svn_wc__err1, *svn_wc__err2; \
716 const char *svn_wc__lock_root_abspath; \
717 SVN_ERR(svn_wc__acquire_write_lock(&svn_wc__lock_root_abspath, wc_ctx, \
718 local_abspath, lock_anchor, \
719 scratch_pool, scratch_pool)); \
720 svn_wc__err1 = (expr); \
721 svn_wc__err2 = svn_wc__release_write_lock( \
722 wc_ctx, svn_wc__lock_root_abspath, scratch_pool); \
723 SVN_ERR(svn_error_compose_create(svn_wc__err1, svn_wc__err2)); \
727 /** A callback invoked by svn_wc__prop_list_recursive().
728 * It is equivalent to svn_proplist_receiver_t declared in svn_client.h,
729 * but kept private within the svn_wc__ namespace because it is used within
730 * the bowels of libsvn_wc which don't include svn_client.h.
732 * @since New in 1.7. */
733 typedef svn_error_t *(*svn_wc__proplist_receiver_t)(void *baton,
734 const char *local_abspath,
736 apr_pool_t *scratch_pool);
738 /** Call @a receiver_func, passing @a receiver_baton, an absolute path, and
739 * a hash table mapping <tt>const char *</tt> names onto <tt>const
740 * svn_string_t *</tt> values for all the regular properties of the node
741 * at @a local_abspath and any node beneath @a local_abspath within the
742 * specified @a depth. @a receiver_fun must not be NULL.
744 * If @a propname is not NULL, the passed hash table will only contain
745 * the property @a propname.
747 * If @a pristine is not @c TRUE, and @a base_props is FALSE show local
748 * modifications to the properties.
750 * If a node has no properties, @a receiver_func is not called for the node.
752 * If @a changelists are non-NULL and non-empty, filter by them.
754 * Use @a wc_ctx to access the working copy, and @a scratch_pool for
755 * temporary allocations.
757 * If the node at @a local_abspath does not exist,
758 * #SVN_ERR_WC_PATH_NOT_FOUND is returned.
763 svn_wc__prop_list_recursive(svn_wc_context_t *wc_ctx,
764 const char *local_abspath,
765 const char *propname,
767 svn_boolean_t pristine,
768 const apr_array_header_t *changelists,
769 svn_wc__proplist_receiver_t receiver_func,
770 void *receiver_baton,
771 svn_cancel_func_t cancel_func,
773 apr_pool_t *scratch_pool);
776 * Set @a *inherited_props to a depth-first ordered array of
777 * #svn_prop_inherited_item_t * structures representing the properties
778 * inherited by @a local_abspath from the ACTUAL tree above
779 * @a local_abspath (looking through to the WORKING or BASE tree as
780 * required), up to and including the root of the working copy and
781 * any cached inherited properties inherited by the root.
783 * The #svn_prop_inherited_item_t->path_or_url members of the
784 * #svn_prop_inherited_item_t * structures in @a *inherited_props are
785 * paths relative to the repository root URL for cached inherited
786 * properties and absolute working copy paths otherwise.
788 * Allocate @a *inherited_props in @a result_pool. Use @a scratch_pool
789 * for temporary allocations.
792 svn_wc__get_iprops(apr_array_header_t **inherited_props,
793 svn_wc_context_t *wc_ctx,
794 const char *local_abspath,
795 const char *propname,
796 apr_pool_t *result_pool,
797 apr_pool_t *scratch_pool);
799 /** Obtain a mapping of const char * local_abspaths to const svn_string_t*
800 * property values in *VALUES, of all PROPNAME properties on LOCAL_ABSPATH
801 * and its descendants.
803 * Allocate the result in RESULT_POOL, and perform temporary allocations in
807 svn_wc__prop_retrieve_recursive(apr_hash_t **values,
808 svn_wc_context_t *wc_ctx,
809 const char *local_abspath,
810 const char *propname,
811 apr_pool_t *result_pool,
812 apr_pool_t *scratch_pool);
815 * Set @a *iprops_paths to a hash mapping const char * absolute working
816 * copy paths to the nodes repository root relative path for each path
817 * in the working copy at or below @a local_abspath, limited by @a depth,
818 * that has cached inherited properties for the base node of the path.
820 * Allocate @a *iprop_paths
821 * in @a result_pool. Use @a scratch_pool for temporary allocations.
824 svn_wc__get_cached_iprop_children(apr_hash_t **iprop_paths,
826 svn_wc_context_t *wc_ctx,
827 const char *local_abspath,
828 apr_pool_t *result_pool,
829 apr_pool_t *scratch_pool);
833 * For use by entries.c and entries-dump.c to read old-format working copies.
836 svn_wc__read_entries_old(apr_hash_t **entries,
837 const char *dir_abspath,
838 apr_pool_t *result_pool,
839 apr_pool_t *scratch_pool);
842 * Recursively clear the dav cache (wcprops) in @a wc_ctx for the tree
843 * rooted at @a local_abspath.
846 svn_wc__node_clear_dav_cache_recursive(svn_wc_context_t *wc_ctx,
847 const char *local_abspath,
848 apr_pool_t *scratch_pool);
851 * Set @a lock_tokens to a hash mapping <tt>const char *</tt> URL
852 * to <tt>const char *</tt> lock tokens for every path at or under
853 * @a local_abspath in @a wc_ctx which has such a lock token set on it.
854 * Allocate the hash and all items therein from @a result_pool.
857 svn_wc__node_get_lock_tokens_recursive(apr_hash_t **lock_tokens,
858 svn_wc_context_t *wc_ctx,
859 const char *local_abspath,
860 apr_pool_t *result_pool,
861 apr_pool_t *scratch_pool);
863 /* Set @a *min_revision and @a *max_revision to the lowest and highest revision
864 * numbers found within @a local_abspath, using context @a wc_ctx.
865 * If @a committed is TRUE, set @a *min_revision and @a *max_revision
866 * to the lowest and highest comitted (i.e. "last changed") revision numbers,
867 * respectively. Use @a scratch_pool for temporary allocations.
869 * Either of MIN_REVISION and MAX_REVISION may be passed as NULL if
870 * the caller doesn't care about that return value.
872 * This function provides a subset of the functionality of
873 * svn_wc_revision_status2() and is more efficient if the caller
874 * doesn't need all information returned by svn_wc_revision_status2(). */
876 svn_wc__min_max_revisions(svn_revnum_t *min_revision,
877 svn_revnum_t *max_revision,
878 svn_wc_context_t *wc_ctx,
879 const char *local_abspath,
880 svn_boolean_t committed,
881 apr_pool_t *scratch_pool);
883 /* Indicate in @a is_switched whether any node beneath @a local_abspath
884 * is switched, using context @a wc_ctx.
885 * Use @a scratch_pool for temporary allocations.
887 * If @a trail_url is non-NULL, use it to determine if @a local_abspath itself
888 * is switched. It should be any trailing portion of @a local_abspath's
889 * expected URL, long enough to include any parts that the caller considers
890 * might be changed by a switch. If it does not match the end of
891 * @a local_abspath's actual URL, then report a "switched" status.
893 * This function provides a subset of the functionality of
894 * svn_wc_revision_status2() and is more efficient if the caller
895 * doesn't need all information returned by svn_wc_revision_status2(). */
897 svn_wc__has_switched_subtrees(svn_boolean_t *is_switched,
898 svn_wc_context_t *wc_ctx,
899 const char *local_abspath,
900 const char *trail_url,
901 apr_pool_t *scratch_pool);
903 /* Set @a *excluded_subtrees to a hash mapping <tt>const char *</tt>
904 * local * absolute paths to <tt>const char *</tt> local absolute paths for
905 * every path under @a local_abspath in @a wc_ctx which are excluded
906 * by the server (e.g. because of authz) or the users.
907 * If no excluded paths are found then @a *server_excluded_subtrees
909 * Allocate the hash and all items therein from @a result_pool.
912 svn_wc__get_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
913 svn_wc_context_t *wc_ctx,
914 const char *local_abspath,
915 apr_pool_t *result_pool,
916 apr_pool_t *scratch_pool);
918 /* Indicate in @a *is_modified whether the working copy has local
919 * modifications, using context @a wc_ctx.
921 * If IGNORE_UNVERSIONED, unversioned paths inside the tree rooted by
922 * LOCAL_ABSPATH are not seen as a change, otherwise they are.
923 * (svn:ignored paths are always ignored)
925 * Use @a scratch_pool for temporary allocations. */
927 svn_wc__has_local_mods(svn_boolean_t *is_modified,
928 svn_wc_context_t *wc_ctx,
929 const char *local_abspath,
930 svn_boolean_t ignore_unversioned,
931 svn_cancel_func_t cancel_func,
933 apr_pool_t *scratch_pool);
935 /* Renames a working copy from @a from_abspath to @a dst_abspath and makes sure
936 open handles are closed to allow this on all platforms.
938 Summary: This avoids a file lock problem on wc.db on Windows, that is
939 triggered by libsvn_client'ss copy to working copy code. */
941 svn_wc__rename_wc(svn_wc_context_t *wc_ctx,
942 const char *from_abspath,
943 const char *dst_abspath,
944 apr_pool_t *scratch_pool);
946 /* Set *TMPDIR_ABSPATH to a directory that is suitable for temporary
947 files which may need to be moved (atomically and same-device) into
948 the working copy indicated by WRI_ABSPATH. */
950 svn_wc__get_tmpdir(const char **tmpdir_abspath,
951 svn_wc_context_t *wc_ctx,
952 const char *wri_abspath,
953 apr_pool_t *result_pool,
954 apr_pool_t *scratch_pool);
956 /* Gets information needed by the commit harvester.
958 * ### Currently this API is work in progress and is designed for just this
959 * ### caller. It is certainly possible (and likely) that this function and
960 * ### it's caller will eventually move into a wc and maybe wc_db api.
963 svn_wc__node_get_commit_status(svn_boolean_t *added,
964 svn_boolean_t *deleted,
965 svn_boolean_t *is_replace_root,
966 svn_boolean_t *is_op_root,
967 svn_revnum_t *revision,
968 svn_revnum_t *original_revision,
969 const char **original_repos_relpath,
970 svn_wc_context_t *wc_ctx,
971 const char *local_abspath,
972 apr_pool_t *result_pool,
973 apr_pool_t *scratch_pool);
975 /* Gets the md5 checksum for the pristine file identified by a sha1_checksum in the
976 working copy identified by wri_abspath.
978 Wraps svn_wc__db_pristine_get_md5().
981 svn_wc__node_get_md5_from_sha1(const svn_checksum_t **md5_checksum,
982 svn_wc_context_t *wc_ctx,
983 const char *wri_abspath,
984 const svn_checksum_t *sha1_checksum,
985 apr_pool_t *result_pool,
986 apr_pool_t *scratch_pool);
988 /* Like svn_wc_get_pristine_contents2(), but keyed on the CHECKSUM
989 rather than on the local absolute path of the working file.
990 WRI_ABSPATH is any versioned path of the working copy in whose
991 pristine database we'll be looking for these contents. */
993 svn_wc__get_pristine_contents_by_checksum(svn_stream_t **contents,
994 svn_wc_context_t *wc_ctx,
995 const char *wri_abspath,
996 const svn_checksum_t *checksum,
997 apr_pool_t *result_pool,
998 apr_pool_t *scratch_pool);
1000 /* Gets an array of const char *repos_relpaths of descendants of LOCAL_ABSPATH,
1001 * which must be the op root of an addition, copy or move. The descendants
1002 * returned are at the same op_depth, but are to be deleted by the commit
1003 * processing because they are not present in the local copy.
1006 svn_wc__get_not_present_descendants(const apr_array_header_t **descendants,
1007 svn_wc_context_t *wc_ctx,
1008 const char *local_abspath,
1009 apr_pool_t *result_pool,
1010 apr_pool_t *scratch_pool);
1013 /* Checks a node LOCAL_ABSPATH in WC_CTX for several kinds of obstructions
1014 * for tasks like merge processing.
1016 * If a node is not obstructed it sets *OBSTRUCTION_STATE to
1017 * svn_wc_notify_state_inapplicable. If a node is obstructed or when its
1018 * direct parent does not exist or is deleted return _state_obstructed. When
1019 * a node doesn't exist but should exist return svn_wc_notify_state_missing.
1021 * A node is also obstructed if it is marked excluded or server-excluded or when
1022 * an unversioned file or directory exists. And if NO_WCROOT_CHECK is FALSE,
1023 * the root of a working copy is also obstructed; this to allow detecting
1024 * obstructing working copies.
1026 * If KIND is not NULL, set *KIND to the kind of node registered in the working
1027 * copy, or SVN_NODE_NONE if the node doesn't
1029 * If DELETED is not NULL, set *DELETED to TRUE if the node is marked as
1030 * deleted in the working copy.
1032 * If EXCLUDED is not NULL, set *EXCLUDED to TRUE if the node is marked as
1033 * user or server excluded.
1035 * If PARENT_DEPTH is not NULL, set *PARENT_DEPTH to the depth stored on the
1036 * parent. (Set to svn_depth_unknown if LOCAL_ABSPATH itself exists as node)
1038 * All output arguments except OBSTRUCTION_STATE can be NULL to ommit the
1041 * This function performs temporary allocations in SCRATCH_POOL.
1044 svn_wc__check_for_obstructions(svn_wc_notify_state_t *obstruction_state,
1045 svn_node_kind_t *kind,
1046 svn_boolean_t *deleted,
1047 svn_boolean_t *excluded,
1048 svn_depth_t *parent_depth,
1049 svn_wc_context_t *wc_ctx,
1050 const char *local_abspath,
1051 svn_boolean_t no_wcroot_check,
1052 apr_pool_t *scratch_pool);
1056 * A structure which describes various system-generated metadata about
1057 * a working-copy path or URL.
1059 * @note Fields may be added to the end of this structure in future
1060 * versions. Therefore, users shouldn't allocate structures of this
1061 * type, to preserve binary compatibility.
1063 * @since New in 1.7.
1065 typedef struct svn_wc__info2_t
1067 /** Where the item lives in the repository. */
1070 /** The root URL of the repository. */
1071 const char *repos_root_URL;
1073 /** The repository's UUID. */
1074 const char *repos_UUID;
1076 /** The revision of the object. If the target is a working-copy
1077 * path, then this is its current working revision number. If the target
1078 * is a URL, then this is the repository revision that it lives in. */
1081 /** The node's kind. */
1082 svn_node_kind_t kind;
1084 /** The size of the file in the repository (untranslated,
1085 * e.g. without adjustment of line endings and keyword
1086 * expansion). Only applicable for file -- not directory -- URLs.
1087 * For working copy paths, @a size will be #SVN_INVALID_FILESIZE. */
1088 svn_filesize_t size;
1090 /** The last revision in which this object changed. */
1091 svn_revnum_t last_changed_rev;
1093 /** The date of the last_changed_rev. */
1094 apr_time_t last_changed_date;
1096 /** The author of the last_changed_rev. */
1097 const char *last_changed_author;
1099 /** An exclusive lock, if present. Could be either local or remote. */
1102 /* Possible information about the working copy, NULL if not valid. */
1103 struct svn_wc_info_t *wc_info;
1107 /** The callback invoked by info retrievers. Each invocation
1108 * describes @a local_abspath with the information present in @a info.
1109 * Use @a scratch_pool for all temporary allocation.
1111 * @since New in 1.7.
1113 typedef svn_error_t *(*svn_wc__info_receiver2_t)(void *baton,
1114 const char *local_abspath,
1115 const svn_wc__info2_t *info,
1116 apr_pool_t *scratch_pool);
1118 /* Walk the children of LOCAL_ABSPATH and push svn_wc__info2_t's through
1119 RECEIVER/RECEIVER_BATON. Honor DEPTH while crawling children, and
1120 filter the pushed items against CHANGELISTS.
1122 If FETCH_EXCLUDED is TRUE, also fetch excluded nodes.
1123 If FETCH_ACTUAL_ONLY is TRUE, also fetch actual-only nodes. */
1125 svn_wc__get_info(svn_wc_context_t *wc_ctx,
1126 const char *local_abspath,
1128 svn_boolean_t fetch_excluded,
1129 svn_boolean_t fetch_actual_only,
1130 const apr_array_header_t *changelists,
1131 svn_wc__info_receiver2_t receiver,
1132 void *receiver_baton,
1133 svn_cancel_func_t cancel_func,
1135 apr_pool_t *scratch_pool);
1137 /* Alternative version of svn_wc_delete4().
1138 * It can delete multiple TARGETS more efficiently (within a single sqlite
1139 * transaction per working copy), but lacks support for moves.
1141 * ### Inconsistency: if DELETE_UNVERSIONED_TARGET is FALSE and a target is
1142 * unversioned, svn_wc__delete_many() will continue whereas
1143 * svn_wc_delete4() will throw an error.
1146 svn_wc__delete_many(svn_wc_context_t *wc_ctx,
1147 const apr_array_header_t *targets,
1148 svn_boolean_t keep_local,
1149 svn_boolean_t delete_unversioned_target,
1150 svn_cancel_func_t cancel_func,
1152 svn_wc_notify_func2_t notify_func,
1154 apr_pool_t *scratch_pool);
1157 /* If the node at LOCAL_ABSPATH was moved away set *MOVED_TO_ABSPATH to
1158 * the absolute path of the copied move-target node, and *COPY_OP_ROOT_ABSPATH
1159 * to the absolute path of the root node of the copy operation.
1161 * If the node was not moved, set *MOVED_TO_ABSPATH and *COPY_OP_ROOT_ABSPATH
1164 * Either MOVED_TO_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
1165 * that the caller is not interested in the result.
1168 svn_wc__node_was_moved_away(const char **moved_to_abspath,
1169 const char **copy_op_root_abspath,
1170 svn_wc_context_t *wc_ctx,
1171 const char *local_abspath,
1172 apr_pool_t *result_pool,
1173 apr_pool_t *scratch_pool);
1175 /* If the node at LOCAL_ABSPATH was moved here set *MOVED_FROM_ABSPATH to
1176 * the absolute path of the deleted move-source node, and set
1177 * *DELETE_OP_ROOT_ABSPATH to the absolute path of the root node of the
1180 * If the node was not moved, set *MOVED_FROM_ABSPATH and
1181 * *DELETE_OP_ROOT_ABSPATH to NULL.
1183 * Either MOVED_FROM_ABSPATH or OP_ROOT_ABSPATH may be NULL to indicate
1184 * that the caller is not interested in the result.
1187 svn_wc__node_was_moved_here(const char **moved_from_abspath,
1188 const char **delete_op_root_abspath,
1189 svn_wc_context_t *wc_ctx,
1190 const char *local_abspath,
1191 apr_pool_t *result_pool,
1192 apr_pool_t *scratch_pool);
1194 /* During an upgrade to wc-ng, supply known details about an existing
1195 * external. The working copy will suck in and store the information supplied
1196 * about the existing external at @a local_abspath. */
1198 svn_wc__upgrade_add_external_info(svn_wc_context_t *wc_ctx,
1199 const char *local_abspath,
1200 svn_node_kind_t kind,
1201 const char *def_local_abspath,
1202 const char *repos_relpath,
1203 const char *repos_root_url,
1204 const char *repos_uuid,
1205 svn_revnum_t def_peg_revision,
1206 svn_revnum_t def_revision,
1207 apr_pool_t *scratch_pool);
1209 /* If the URL for @a item is relative, then using the repository root
1210 URL @a repos_root_url and the parent directory URL @parent_dir_url,
1211 resolve it into an absolute URL and save it in @a *resolved_url.
1213 Regardless if the URL is absolute or not, if there are no errors,
1214 the URL returned in @a *resolved_url will be canonicalized.
1216 The following relative URL formats are supported:
1218 ../ relative to the parent directory of the external
1219 ^/ relative to the repository root
1220 // relative to the scheme
1221 / relative to the server's hostname
1223 The ../ and ^/ relative URLs may use .. to remove path elements up
1226 The external URL should not be canonicalized before calling this function,
1227 as otherwise the scheme relative URL '//host/some/path' would have been
1228 canonicalized to '/host/some/path' and we would not be able to match on
1229 the leading '//'. */
1231 svn_wc__resolve_relative_external_url(const char **resolved_url,
1232 const svn_wc_external_item2_t *item,
1233 const char *repos_root_url,
1234 const char *parent_dir_url,
1235 apr_pool_t *result_pool,
1236 apr_pool_t *scratch_pool);
1238 typedef enum svn_wc__external_description_format_t
1240 /* LOCALPATH [-r PEG] URL */
1241 svn_wc__external_description_format_1 = 0,
1243 /* [-r REV] URL[@PEG] LOCALPATH, introduced in Subversion 1.5 */
1244 svn_wc__external_description_format_2
1245 } svn_wc__external_description_format_t;
1247 /* Additional information about what the external's parser has parsed. */
1248 typedef struct svn_wc__externals_parser_info_t
1250 /* The syntax format used by the external description. */
1251 svn_wc__external_description_format_t format;
1253 /* The string used for defining the operative revision, i.e.
1254 "-rN", "-rHEAD", or "-r{DATE}".
1255 NULL if revision was not given. */
1256 const char *rev_str;
1258 /* The string used for defining the peg revision (equals rev_str in
1259 format 1, is "@N", or "@HEAD" or "@{DATE}" in format 2).
1260 NULL if peg revision was not given. */
1261 const char *peg_rev_str;
1263 } svn_wc__externals_parser_info_t;
1265 /* Like svn_wc_parse_externals_description3() but returns an additional array
1266 * with elements of type svn_wc__externals_parser_info_t in @a *parser_infos_p.
1267 * @a parser_infos_p may be NULL if not required by the caller.
1270 svn_wc__parse_externals_description(apr_array_header_t **externals_p,
1271 apr_array_header_t **parser_infos_p,
1272 const char *defining_directory,
1274 svn_boolean_t canonicalize_url,
1278 * Set @a *editor and @a *edit_baton to an editor that generates
1279 * #svn_wc_status3_t structures and sends them through @a status_func /
1280 * @a status_baton. @a anchor_abspath is a working copy directory
1281 * directory which will be used as the root of our editor. If @a
1282 * target_basename is not "", it represents a node in the @a anchor_abspath
1283 * which is the subject of the editor drive (otherwise, the @a
1284 * anchor_abspath is the subject).
1286 * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
1287 * be used in a call to the svn_wc_status_set_repos_locks() function.
1289 * Callers drive this editor to describe working copy out-of-dateness
1290 * with respect to the repository. If this information is not
1291 * available or not desired, callers should simply call the
1292 * close_edit() function of the @a editor vtable.
1294 * If the editor driver calls @a editor's set_target_revision() vtable
1295 * function, then when the edit drive is completed, @a *edit_revision
1296 * will contain the revision delivered via that interface.
1298 * Assuming the target is a directory, then:
1300 * - If @a get_all is @c FALSE, then only locally-modified entries will be
1301 * returned. If @c TRUE, then all entries will be returned.
1303 * - If @a depth is #svn_depth_empty, a status structure will
1304 * be returned for the target only; if #svn_depth_files, for the
1305 * target and its immediate file children; if
1306 * #svn_depth_immediates, for the target and its immediate
1307 * children; if #svn_depth_infinity, for the target and
1308 * everything underneath it, fully recursively.
1310 * If @a depth is #svn_depth_unknown, take depths from the
1311 * working copy and behave as above in each directory's case.
1313 * If the given @a depth is incompatible with the depth found in a
1314 * working copy directory, the found depth always governs.
1316 * If @a check_working_copy is not set, do not scan the working copy
1317 * for local modifications, taking only the BASE tree into account.
1319 * If @a no_ignore is set, statuses that would typically be ignored
1320 * will instead be reported.
1322 * @a ignore_patterns is an array of file patterns matching
1323 * unversioned files to ignore for the purposes of status reporting,
1324 * or @c NULL if the default set of ignorable file patterns should be used.
1326 * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
1327 * the @a statushash to determine if the client has canceled the operation.
1329 * If @a depth_as_sticky is set handle @a depth like when depth_is_sticky is
1330 * passed for updating. This will show excluded nodes show up as added in the
1333 * If @a server_performs_filtering is TRUE, assume that the server handles
1334 * the ambient depth filtering, so this doesn't have to be handled in the
1337 * Allocate the editor itself in @a result_pool, and use @a scratch_pool
1338 * for temporary allocations. The editor will do its temporary allocations
1339 * in a subpool of @a result_pool.
1341 * @since New in 1.8.
1344 svn_wc__get_status_editor(const svn_delta_editor_t **editor,
1346 void **set_locks_baton,
1347 svn_revnum_t *edit_revision,
1348 svn_wc_context_t *wc_ctx,
1349 const char *anchor_abspath,
1350 const char *target_basename,
1352 svn_boolean_t get_all,
1353 svn_boolean_t check_working_copy,
1354 svn_boolean_t no_ignore,
1355 svn_boolean_t depth_as_sticky,
1356 svn_boolean_t server_performs_filtering,
1357 const apr_array_header_t *ignore_patterns,
1358 svn_wc_status_func4_t status_func,
1360 svn_cancel_func_t cancel_func,
1362 apr_pool_t *result_pool,
1363 apr_pool_t *scratch_pool);
1367 * Set @a *editor and @a *edit_baton to an editor and baton for updating a
1370 * @a anchor_abspath is a local working copy directory, with a fully recursive
1371 * write lock in @a wc_ctx, which will be used as the root of our editor.
1373 * @a target_basename is the entry in @a anchor_abspath that will actually be
1374 * updated, or the empty string if all of @a anchor_abspath should be updated.
1376 * The editor invokes @a notify_func with @a notify_baton as the update
1377 * progresses, if @a notify_func is non-NULL.
1379 * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
1380 * @a cancel_baton as the update progresses to see if it should continue.
1382 * If @a conflict_func is non-NULL, then invoke it with @a
1383 * conflict_baton whenever a conflict is encountered, giving the
1384 * callback a chance to resolve the conflict before the editor takes
1385 * more drastic measures (such as marking a file conflicted, or
1386 * bailing out of the update).
1388 * If @a external_func is non-NULL, then invoke it with @a external_baton
1389 * whenever external changes are encountered, giving the callback a chance
1390 * to store the external information for processing.
1392 * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
1393 * any merging; otherwise, use the built-in merge code.
1395 * @a preserved_exts is an array of filename patterns which, when
1396 * matched against the extensions of versioned files, determine for
1397 * which such files any related generated conflict files will preserve
1398 * the original file's extension as their own. If a file's extension
1399 * does not match any of the patterns in @a preserved_exts (which is
1400 * certainly the case if @a preserved_exts is @c NULL or empty),
1401 * generated conflict files will carry Subversion's custom extensions.
1403 * @a target_revision is a pointer to a revision location which, after
1404 * successful completion of the drive of this editor, will be
1405 * populated with the revision to which the working copy was updated.
1407 * @a wcroot_iprops is a hash mapping const char * absolute working copy
1408 * paths which are working copy roots (at or under the target within the
1409 * constraints dictated by @a depth) to depth-first ordered arrays of
1410 * svn_prop_inherited_item_t * structures which represent the inherited
1411 * properties for the base of those paths at @a target_revision. After a
1412 * successful drive of this editor, the base nodes for these paths will
1413 * have their inherited properties cache updated with the values from
1416 * If @a use_commit_times is TRUE, then all edited/added files will
1417 * have their working timestamp set to the last-committed-time. If
1418 * FALSE, the working files will be touched with the 'now' time.
1420 * If @a allow_unver_obstructions is TRUE, then allow unversioned
1421 * obstructions when adding a path.
1423 * If @a adds_as_modification is TRUE, a local addition at the same path
1424 * as an incoming addition of the same node kind results in a normal node
1425 * with a possible local modification, instead of a tree conflict.
1427 * If @a depth is #svn_depth_infinity, update fully recursively.
1428 * Else if it is #svn_depth_immediates, update the uppermost
1429 * directory, its file entries, and the presence or absence of
1430 * subdirectories (but do not descend into the subdirectories).
1431 * Else if it is #svn_depth_files, update the uppermost directory
1432 * and its immediate file entries, but not subdirectories.
1433 * Else if it is #svn_depth_empty, update exactly the uppermost
1434 * target, and don't touch its entries.
1436 * If @a depth_is_sticky is set and @a depth is not
1437 * #svn_depth_unknown, then in addition to updating PATHS, also set
1438 * their sticky ambient depth value to @a depth.
1440 * If @a server_performs_filtering is TRUE, assume that the server handles
1441 * the ambient depth filtering, so this doesn't have to be handled in the
1444 * If @a clean_checkout is TRUE, assume that we are checking out into an
1445 * empty directory, and so bypass a number of conflict checks that are
1446 * unnecessary in this case.
1448 * If @a fetch_dirents_func is not NULL, the update editor may call this
1449 * callback, when asked to perform a depth restricted update. It will do this
1450 * before returning the editor to allow using the primary ra session for this.
1452 * @since New in 1.8.
1455 svn_wc__get_update_editor(const svn_delta_editor_t **editor,
1457 svn_revnum_t *target_revision,
1458 svn_wc_context_t *wc_ctx,
1459 const char *anchor_abspath,
1460 const char *target_basename,
1461 apr_hash_t *wcroot_iprops,
1462 svn_boolean_t use_commit_times,
1464 svn_boolean_t depth_is_sticky,
1465 svn_boolean_t allow_unver_obstructions,
1466 svn_boolean_t adds_as_modification,
1467 svn_boolean_t server_performs_filtering,
1468 svn_boolean_t clean_checkout,
1469 const char *diff3_cmd,
1470 const apr_array_header_t *preserved_exts,
1471 svn_wc_dirents_func_t fetch_dirents_func,
1472 void *fetch_dirents_baton,
1473 svn_wc_conflict_resolver_func2_t conflict_func,
1474 void *conflict_baton,
1475 svn_wc_external_update_t external_func,
1476 void *external_baton,
1477 svn_cancel_func_t cancel_func,
1479 svn_wc_notify_func2_t notify_func,
1481 apr_pool_t *result_pool,
1482 apr_pool_t *scratch_pool);
1486 * A variant of svn_wc__get_update_editor().
1488 * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
1489 * a working copy to a new @a switch_url. (Right now, this URL must be
1490 * within the same repository that the working copy already comes
1491 * from.) @a switch_url must not be @c NULL.
1493 * All other parameters behave as for svn_wc__get_update_editor().
1495 * @since New in 1.8.
1498 svn_wc__get_switch_editor(const svn_delta_editor_t **editor,
1500 svn_revnum_t *target_revision,
1501 svn_wc_context_t *wc_ctx,
1502 const char *anchor_abspath,
1503 const char *target_basename,
1504 const char *switch_url,
1505 apr_hash_t *wcroot_iprops,
1506 svn_boolean_t use_commit_times,
1508 svn_boolean_t depth_is_sticky,
1509 svn_boolean_t allow_unver_obstructions,
1510 svn_boolean_t server_performs_filtering,
1511 const char *diff3_cmd,
1512 const apr_array_header_t *preserved_exts,
1513 svn_wc_dirents_func_t fetch_dirents_func,
1514 void *fetch_dirents_baton,
1515 svn_wc_conflict_resolver_func2_t conflict_func,
1516 void *conflict_baton,
1517 svn_wc_external_update_t external_func,
1518 void *external_baton,
1519 svn_cancel_func_t cancel_func,
1521 svn_wc_notify_func2_t notify_func,
1523 apr_pool_t *result_pool,
1524 apr_pool_t *scratch_pool);
1529 * Return an @a editor/@a edit_baton for diffing a working copy against the
1530 * repository. The editor is allocated in @a result_pool; temporary
1531 * calculations are performed in @a scratch_pool.
1533 * This editor supports diffing either the actual files and properties in the
1534 * working copy (when @a use_text_base is #FALSE), or the current pristine
1535 * information (when @a use_text_base is #TRUE) against the editor driver.
1537 * @a anchor_abspath/@a target represent the base of the hierarchy to be
1538 * compared. The diff callback paths will be relative to this path.
1540 * Diffs will be reported as valid relpaths, with @a anchor_abspath being
1543 * @a diff_processor will retrieve the diff report.
1545 * If @a depth is #svn_depth_empty, just diff exactly @a target or
1546 * @a anchor_path if @a target is empty. If #svn_depth_files then do the same
1547 * and for top-level file entries as well (if any). If
1548 * #svn_depth_immediates, do the same as #svn_depth_files but also diff
1549 * top-level subdirectories at #svn_depth_empty. If #svn_depth_infinity,
1550 * then diff fully recursively. If @a depth is #svn_depth_unknown, then...
1552 * ### ... then the @a server_performs_filtering option is meaningful.
1553 * ### But what does this depth mean exactly? Something about 'ambient'
1554 * ### depth? How does it compare with depth 'infinity'?
1556 * @a ignore_ancestry determines whether paths that have discontinuous node
1557 * ancestry are treated as delete/add or as simple modifications. If
1558 * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
1559 * result in the diff given as a full delete followed by an add.
1561 * @a show_copies_as_adds determines whether paths added with history will
1562 * appear as a diff against their copy source, or whether such paths will
1563 * appear as if they were newly added in their entirety.
1565 * If @a use_git_diff_format is TRUE, copied paths will be treated as added
1566 * if they weren't modified after being copied. This allows the callbacks
1567 * to generate appropriate --git diff headers for such files.
1569 * Normally, the difference from repository->working_copy is shown. If
1570 * @a reverse_order is TRUE, then we want to show working_copy->repository
1571 * diffs. Most of the reversal is done by the caller; here we just swap the
1572 * order of reporting a replacement so that the local addition is reported
1573 * before the remote delete. (The caller's diff processor can then transform
1574 * adds into deletes and deletes into adds, but it can't reorder the output.)
1576 * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
1577 * to periodically check if the client has canceled the operation.
1579 * @a changelist_filter is an array of <tt>const char *</tt> changelist
1580 * names, used as a restrictive filter on items whose differences are
1581 * reported; that is, don't generate diffs about any item unless
1582 * it's a member of one of those changelists. If @a changelist_filter is
1583 * empty (or altogether @c NULL), no changelist filtering occurs.
1585 * If @a server_performs_filtering is TRUE, assume that the server handles
1586 * the ambient depth filtering, so this doesn't have to be handled in the
1590 * A diagram illustrating how this function is used.
1592 * Steps 1 and 2 create the chain; step 3 drives it.
1594 * 1. svn_wc__get_diff_editor(diff_cbs)
1596 * 2. svn_ra_do_diff3(editor) | |
1599 * +----------+ +----------+ +----------+
1601 * +--> | reporter | ----> | editor | ----> | diff_cbs | ----> text
1603 * | +----------+ +----------+ +----------+
1605 * 3. svn_wc_crawl_revisions5(WC,reporter)
1608 * @since New in 1.8.
1611 svn_wc__get_diff_editor(const svn_delta_editor_t **editor,
1613 svn_wc_context_t *wc_ctx,
1614 const char *anchor_abspath,
1617 svn_boolean_t ignore_ancestry,
1618 svn_boolean_t use_text_base,
1619 svn_boolean_t reverse_order,
1620 svn_boolean_t server_performs_filtering,
1621 const apr_array_header_t *changelist_filter,
1622 const svn_diff_tree_processor_t *diff_processor,
1623 svn_cancel_func_t cancel_func,
1625 apr_pool_t *result_pool,
1626 apr_pool_t *scratch_pool);
1628 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1629 * notifications like how the repos diff in libsvn_client does.
1631 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1633 typedef svn_error_t *
1634 (*svn_wc__diff_state_handle_t)(svn_boolean_t tree_conflicted,
1635 svn_wc_notify_state_t *state,
1636 svn_wc_notify_state_t *prop_state,
1637 const char *relpath,
1638 svn_node_kind_t kind,
1639 svn_boolean_t before_op,
1640 svn_boolean_t for_add,
1641 svn_boolean_t for_delete,
1643 apr_pool_t *scratch_pool);
1645 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1646 * notifications like how the repos diff in libsvn_client does.
1648 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1650 typedef svn_error_t *
1651 (*svn_wc__diff_state_close_t)(const char *relpath,
1652 svn_node_kind_t kind,
1654 apr_pool_t *scratch_pool);
1656 /** Callback for the svn_diff_tree_processor_t wrapper, to allow handling
1659 * Probably only necessary while transitioning to svn_diff_tree_processor_t
1661 typedef svn_error_t *
1662 (*svn_wc__diff_state_absent_t)(const char *relpath,
1664 apr_pool_t *scratch_pool);
1666 /** Obtains a diff processor that will drive the diff callbacks when it
1670 svn_wc__wrap_diff_callbacks(const svn_diff_tree_processor_t **diff_processor,
1671 const svn_wc_diff_callbacks4_t *callbacks,
1672 void *callback_baton,
1673 svn_boolean_t walk_deleted_dirs,
1674 apr_pool_t *result_pool,
1675 apr_pool_t *scratch_pool);
1679 * Assuming @a local_abspath itself or any of its children are under version
1680 * control or a tree conflict victim and in a state of conflict, take these
1681 * nodes out of this state.
1683 * If @a resolve_text is TRUE then any text conflict is resolved,
1684 * if @a resolve_tree is TRUE then any tree conflicts are resolved.
1685 * If @a resolve_prop is set to "" all property conflicts are resolved,
1686 * if it is set to any other string value, conflicts on that specific
1687 * property are resolved and when resolve_prop is NULL, no property
1688 * conflicts are resolved.
1690 * If @a depth is #svn_depth_empty, act only on @a local_abspath; if
1691 * #svn_depth_files, resolve @a local_abspath and its conflicted file
1692 * children (if any); if #svn_depth_immediates, resolve @a local_abspath
1693 * and all its immediate conflicted children (both files and directories,
1694 * if any); if #svn_depth_infinity, resolve @a local_abspath and every
1695 * conflicted file or directory anywhere beneath it.
1697 * If @a conflict_choice is #svn_wc_conflict_choose_base, resolve the
1698 * conflict with the old file contents; if
1699 * #svn_wc_conflict_choose_mine_full, use the original working contents;
1700 * if #svn_wc_conflict_choose_theirs_full, the new contents; and if
1701 * #svn_wc_conflict_choose_merged, don't change the contents at all,
1702 * just remove the conflict status, which is the pre-1.5 behavior.
1704 * If @a conflict_choice is #svn_wc_conflict_choose_unspecified, invoke the
1705 * @a conflict_func with the @a conflict_baton argument to obtain a
1706 * resolution decision for each conflict.
1708 * #svn_wc_conflict_choose_theirs_conflict and
1709 * #svn_wc_conflict_choose_mine_conflict are not legal for binary
1710 * files or properties.
1712 * @a wc_ctx is a working copy context, with a write lock, for @a
1715 * The implementation details are opaque, as our "conflicted" criteria
1716 * might change over time. (At the moment, this routine removes the
1717 * three fulltext 'backup' files and any .prej file created in a conflict,
1718 * and modifies @a local_abspath's entry.)
1720 * If @a local_abspath is not under version control and not a tree
1721 * conflict, return #SVN_ERR_ENTRY_NOT_FOUND. If @a path isn't in a
1722 * state of conflict to begin with, do nothing, and return #SVN_NO_ERROR.
1724 * If @c local_abspath was successfully taken out of a state of conflict,
1725 * report this information to @c notify_func (if non-@c NULL.) If only
1726 * text, only property, or only tree conflict resolution was requested,
1727 * and it was successful, then success gets reported.
1729 * Temporary allocations will be performed in @a scratch_pool.
1731 * @since New in 1.8.
1734 svn_wc__resolve_conflicts(svn_wc_context_t *wc_ctx,
1735 const char *local_abspath,
1737 svn_boolean_t resolve_text,
1738 const char *resolve_prop,
1739 svn_boolean_t resolve_tree,
1740 svn_wc_conflict_choice_t conflict_choice,
1741 svn_wc_conflict_resolver_func2_t conflict_func,
1742 void *conflict_baton,
1743 svn_cancel_func_t cancel_func,
1745 svn_wc_notify_func2_t notify_func,
1747 apr_pool_t *scratch_pool);
1750 * Move @a src_abspath to @a dst_abspath, by scheduling @a dst_abspath
1751 * for addition to the repository, remembering the history. Mark @a src_abspath
1752 * as deleted after moving.@a wc_ctx is used for accessing the working copy and
1753 * must contain a write lock for the parent directory of @a src_abspath and
1756 * If @a metadata_only is TRUE then this is a database-only operation and
1757 * the working directories and files are not changed.
1759 * @a src_abspath must be a file or directory under version control;
1760 * the parent of @a dst_abspath must be a directory under version control
1761 * in the same working copy; @a dst_abspath will be the name of the copied
1762 * item, and it must not exist already if @a metadata_only is FALSE. Note that
1763 * when @a src points to a versioned file, the working file doesn't
1764 * necessarily exist in which case its text-base is used instead.
1766 * If @a allow_mixed_revisions is @c FALSE, #SVN_ERR_WC_MIXED_REVISIONS
1767 * will be raised if the move source is a mixed-revision subtree.
1768 * If @a allow_mixed_revisions is TRUE, a mixed-revision move source is
1769 * allowed but the move will degrade to a copy and a delete without local
1770 * move tracking. This parameter should be set to FALSE except where backwards
1771 * compatibility to svn_wc_move() is required.
1773 * If @a cancel_func is non-NULL, call it with @a cancel_baton at
1774 * various points during the operation. If it returns an error
1775 * (typically #SVN_ERR_CANCELLED), return that error immediately.
1777 * If @a notify_func is non-NULL, call it with @a notify_baton and the path
1778 * of the root node (only) of the destination.
1780 * Use @a scratch_pool for temporary allocations.
1782 * @since New in 1.8.
1785 svn_wc__move2(svn_wc_context_t *wc_ctx,
1786 const char *src_abspath,
1787 const char *dst_abspath,
1788 svn_boolean_t metadata_only,
1789 svn_boolean_t allow_mixed_revisions,
1790 svn_cancel_func_t cancel_func,
1792 svn_wc_notify_func2_t notify_func,
1794 apr_pool_t *scratch_pool);
1797 /* During merge when we encounter added directories, we add them using
1798 svn_wc_add4(), recording its original location, etc. But at that time
1799 we don't have its original properties. This function allows updating the
1800 BASE properties of such a special added node, but only before it receives
1803 NEW_ORIGINAL_PROPS is a new set of properties, including entry props that
1804 will be applied to LOCAL_ABSPATH as pristine properties.
1806 The copyfrom_* arguments are used to verify (some of) the assumptions of
1809 svn_wc__complete_directory_add(svn_wc_context_t *wc_ctx,
1810 const char *local_abspath,
1811 apr_hash_t *new_original_props,
1812 const char *copyfrom_url,
1813 svn_revnum_t copyfrom_rev,
1814 apr_pool_t *scratch_pool);
1817 /* Acquire a write lock on LOCAL_ABSPATH or an ancestor that covers
1818 all possible paths affected by resolving the conflicts in the tree
1819 LOCAL_ABSPATH. Set *LOCK_ROOT_ABSPATH to the path of the lock
1822 svn_wc__acquire_write_lock_for_resolve(const char **lock_root_abspath,
1823 svn_wc_context_t *wc_ctx,
1824 const char *local_abspath,
1825 apr_pool_t *result_pool,
1826 apr_pool_t *scratch_pool);
1828 /* The implemementation of svn_wc_diff6(), but reporting to a diff processor
1830 * If ROOT_RELPATH is not NULL, set *ROOT_RELPATH to the target of the diff
1831 * within the diff namespace. ("" or a single path component).
1833 * If ROOT_IS_FILE is NOT NULL set it
1834 * the first processor call. (The anchor is LOCAL_ABSPATH or an ancestor of it)
1837 svn_wc__diff7(const char **root_relpath,
1838 svn_boolean_t *root_is_dir,
1839 svn_wc_context_t *wc_ctx,
1840 const char *local_abspath,
1842 svn_boolean_t ignore_ancestry,
1843 const apr_array_header_t *changelist_filter,
1844 const svn_diff_tree_processor_t *diff_processor,
1845 svn_cancel_func_t cancel_func,
1847 apr_pool_t *result_pool,
1848 apr_pool_t *scratch_pool);
1852 #endif /* __cplusplus */
1854 #endif /* SVN_WC_PRIVATE_H */