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 * ====================================================================
24 * @brief The Subversion Working Copy Library - Metadata/Base-Text Support
30 * - Ability to manipulate working copy's administrative files.
33 * - The main working copy library
41 #include "svn_types.h"
42 #include "svn_error.h"
43 #include "svn_config.h"
46 #include "private/svn_skel.h"
47 #include "private/svn_sqlite.h"
48 #include "private/svn_wc_private.h"
50 #include "svn_private_config.h"
54 #endif /* __cplusplus */
56 /* INTERFACE CONVENTIONS
60 There are numerous functions within this API which take a (large) number
61 of "out" parameters. These are listed individually, rather than combined
62 into a struct, so that a caller can be fine-grained about the which
63 pieces of information are being requested. In many cases, only a subset
64 is required, so the implementation can perform various optimizations
65 to fulfill the limited request for information.
70 wc_db uses the dual-pool paradigm for all of its functions. Any OUT
71 parameter will be allocated within the result pool, and all temporary
72 allocations will be performed within the scratch pool.
74 The pool that DB is allocated within (the "state" pool) is only used
75 for a few, limited allocations to track each of the working copy roots
76 that the DB is asked to operate upon. The memory usage on this pool
77 is O(# wcroots), which should normally be one or a few. Custom clients
78 which hold open structures over a significant period of time should
79 pay particular attention to the number of roots touched, and the
80 resulting impact on memory consumption (which should still be minimal).
86 - any output arguments
89 - any other input arguments
94 This parameter is the primary context for all operations on the
95 metadata for working copies. This parameter is passed to almost every
96 function, and maintains information and state about every working
97 copy "touched" by any of the APIs in this interface.
100 All *_ABSPATH parameters in this API are absolute paths in the local
101 filesystem, represented in Subversion internal canonical form.
104 This parameter specifies a particular *versioned* node in the local
105 filesystem. From this node, a working copy root is implied, and will
106 be used for the given API operation.
109 This parameter is similar to LOCAL_ABSPATH, but the semantics of the
110 parameter and operation require the node to be a directory within
114 This is a "Working copy Root Indicator" path. This refers to a location
115 in the local filesystem that is anywhere inside a working copy. The given
116 operation will be performed within the context of the root of that
117 working copy. This does not necessarily need to refer to a specific
118 versioned node or the root of a working copy (although it can) -- any
119 location, existing or not, is sufficient, as long as it is inside a
121 ### TODO: Define behaviour for switches and externals.
122 ### Preference has been stated that WRI_ABSPATH should imply the root
123 ### of the parent WC of all switches and externals, but that may
124 ### not play out well, especially with multiple repositories involved.
127 /* Context data structure for interacting with the administrative data. */
128 typedef struct svn_wc__db_t svn_wc__db_t;
131 /* Enumerated values describing the state of a node. */
132 typedef enum svn_wc__db_status_t {
133 /* The node is present and has no known modifications applied to it. */
134 svn_wc__db_status_normal,
136 /* The node has been added (potentially obscuring a delete or move of
137 the BASE node; see HAVE_BASE param [### What param? This is an enum
138 not a function.] ). The text will be marked as
139 modified, and if properties exist, they will be marked as modified.
141 In many cases svn_wc__db_status_added means any of added, moved-here
142 or copied-here. See individual functions for clarification and
143 svn_wc__db_scan_addition() to get more details. */
144 svn_wc__db_status_added,
146 /* This node has been added with history, based on the move source.
147 Text and property modifications are based on whether changes have
148 been made against their pristine versions. */
149 svn_wc__db_status_moved_here,
151 /* This node has been added with history, based on the copy source.
152 Text and property modifications are based on whether changes have
153 been made against their pristine versions. */
154 svn_wc__db_status_copied,
156 /* This node has been deleted. No text or property modifications
158 svn_wc__db_status_deleted,
160 /* This node was named by the server, but no information was provided. */
161 svn_wc__db_status_server_excluded,
163 /* This node has been administratively excluded. */
164 svn_wc__db_status_excluded,
166 /* This node is not present in this revision. This typically happens
167 when a node is deleted and committed without updating its parent.
168 The parent revision indicates it should be present, but this node's
169 revision states otherwise. */
170 svn_wc__db_status_not_present,
172 /* This node is known, but its information is incomplete. Generally,
173 it should be treated similar to the other missing status values
174 until some (later) process updates the node with its data.
176 When the incomplete status applies to a directory, the list of
177 children and the list of its base properties as recorded in the
178 working copy do not match their working copy versions.
179 The update editor can complete a directory by using a different
181 svn_wc__db_status_incomplete,
183 /* The BASE node has been marked as deleted. Only used as an internal
184 status in wc_db.c and entries.c. */
185 svn_wc__db_status_base_deleted
187 } svn_wc__db_status_t;
189 /* Lock information. We write/read it all as one, so let's use a struct
191 typedef struct svn_wc__db_lock_t {
195 /* The owner of the lock, possibly NULL */
198 /* A comment about the lock, possibly NULL */
201 /* The date the lock was created */
206 /* ### NOTE: I have not provided docstrings for most of this file at this
207 ### point in time. The shape and extent of this API is still in massive
208 ### flux. I'm iterating in public, but do not want to doc until it feels
209 ### like it is "Right".
212 /* ### where/how to handle: text_time, locks, working_size */
216 @defgroup svn_wc__db_admin General administrative functions
220 /* Open a working copy administrative database context.
222 This context is (initially) not associated with any particular working
223 copy directory or working copy root (wcroot). As operations are performed,
224 this context will load the appropriate wcroot information.
226 The context is returned in DB.
228 CONFIG should hold the various configuration options that may apply to
229 the administrative operation. It should live at least as long as the
230 RESULT_POOL parameter.
232 When OPEN_WITHOUT_UPGRADE is TRUE, then the working copy databases will
233 be opened even when an old database format is found/detected during
234 the operation of a wc_db API). If open_without_upgrade is FALSE and an
235 upgrade is required, then SVN_ERR_WC_UPGRADE_REQUIRED will be returned
237 Passing TRUE will allow a bare minimum of APIs to function (most notably,
238 the temp_get_format() function will always return a value) since most of
239 these APIs expect a current-format database to be present.
241 If ENFORCE_EMPTY_WQ is TRUE, then any databases with stale work items in
242 their work queue will raise an error when they are opened. The operation
243 will raise SVN_ERR_WC_CLEANUP_REQUIRED. Passing FALSE for this routine
244 means that the work queue is being processed (via 'svn cleanup') and all
245 operations should be allowed.
247 The DB will be closed when RESULT_POOL is cleared. It may also be closed
248 manually using svn_wc__db_close(). In particular, this will close any
249 SQLite databases that have been opened and cached.
251 The context is allocated in RESULT_POOL. This pool is *retained* and used
252 for future allocations within the DB. Be forewarned about unbounded
253 memory growth if this DB is used across an unbounded number of wcroots
254 and versioned directories.
256 Temporary allocations will be made in SCRATCH_POOL.
259 svn_wc__db_open(svn_wc__db_t **db,
260 svn_config_t *config,
261 svn_boolean_t open_without_upgrade,
262 svn_boolean_t enforce_empty_wq,
263 apr_pool_t *result_pool,
264 apr_pool_t *scratch_pool);
269 svn_wc__db_close(svn_wc__db_t *db);
272 /* Initialize the SDB for LOCAL_ABSPATH, which should be a working copy path.
274 A REPOSITORY row will be constructed for the repository identified by
275 REPOS_ROOT_URL and REPOS_UUID. Neither of these may be NULL.
277 A BASE_NODE row will be created for the directory at REPOS_RELPATH at
278 revision INITIAL_REV.
279 If INITIAL_REV is greater than zero, then the node will be marked as
280 "incomplete" because we don't know its children. Contrary, if the
281 INITIAL_REV is zero, then this directory should represent the root and
282 we know it has no children, so the node is complete.
284 ### Is there any benefit to marking it 'complete' if rev==0? Seems like
285 ### an unnecessary special case.
287 DEPTH is the initial depth of the working copy; it must be a definite
288 depth, not svn_depth_unknown.
290 Use SCRATCH_POOL for temporary allocations.
293 svn_wc__db_init(svn_wc__db_t *db,
294 const char *local_abspath,
295 const char *repos_relpath,
296 const char *repos_root_url,
297 const char *repos_uuid,
298 svn_revnum_t initial_rev,
300 apr_pool_t *scratch_pool);
303 /* Compute the LOCAL_RELPATH for the given LOCAL_ABSPATH, relative
306 The LOCAL_RELPATH is a relative path to the working copy's root. That
307 root will be located by this function, and the path will be relative to
308 that location. If LOCAL_ABSPATH is the wcroot directory, then "" will
311 The LOCAL_RELPATH should ONLY be used for persisting paths to disk.
312 Those paths should not be abspaths, otherwise the working copy cannot
313 be moved. The working copy library should not make these paths visible
314 in its API (which should all be abspaths), and it should not be using
315 relpaths for other processing.
317 LOCAL_RELPATH will be allocated in RESULT_POOL. All other (temporary)
318 allocations will be made in SCRATCH_POOL.
320 This function is available when DB is opened with the OPEN_WITHOUT_UPGRADE
324 svn_wc__db_to_relpath(const char **local_relpath,
326 const char *wri_abspath,
327 const char *local_abspath,
328 apr_pool_t *result_pool,
329 apr_pool_t *scratch_pool);
332 /* Compute the LOCAL_ABSPATH for a LOCAL_RELPATH located within the working
333 copy identified by WRI_ABSPATH.
335 This is the reverse of svn_wc__db_to_relpath. It should be used for
336 returning a persisted relpath back into an abspath.
338 LOCAL_ABSPATH will be allocated in RESULT_POOL. All other (temporary)
339 allocations will be made in SCRATCH_POOL.
341 This function is available when DB is opened with the OPEN_WITHOUT_UPGRADE
345 svn_wc__db_from_relpath(const char **local_abspath,
347 const char *wri_abspath,
348 const char *local_relpath,
349 apr_pool_t *result_pool,
350 apr_pool_t *scratch_pool);
352 /* Compute the working copy root WCROOT_ABSPATH for WRI_ABSPATH using DB.
354 This function is available when DB is opened with the OPEN_WITHOUT_UPGRADE
358 svn_wc__db_get_wcroot(const char **wcroot_abspath,
360 const char *wri_abspath,
361 apr_pool_t *result_pool,
362 apr_pool_t *scratch_pool);
367 /* Different kinds of trees
369 The design doc mentions three different kinds of trees, BASE, WORKING and
370 ACTUAL: http://svn.apache.org/repos/asf/subversion/trunk/notes/wc-ng-design
371 We have different APIs to handle each tree, enumerated below, along with
372 a blurb to explain what that tree represents.
375 /* @defgroup svn_wc__db_base BASE tree management
377 BASE is what we get from the server. It is the *absolute* pristine copy.
378 You need to use checkout, update, switch, or commit to alter your view of
381 In the BASE tree, each node corresponds to a particular node-rev in the
382 repository. It can be a mixed-revision tree. Each node holds either a
383 copy of the node-rev as it exists in the repository (if presence =
384 'normal'), or a place-holder (if presence = 'server-excluded' or 'excluded' or
390 /* Add or replace a directory in the BASE tree.
392 The directory is located at LOCAL_ABSPATH on the local filesystem, and
393 corresponds to <REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID> in the
394 repository, at revision REVISION.
396 The directory properties are given by the PROPS hash (which is
397 const char *name => const svn_string_t *).
399 The last-change information is given by <CHANGED_REV, CHANGED_DATE,
402 The directory's children are listed in CHILDREN, as an array of
403 const char *. The child nodes do NOT have to exist when this API
404 is called. For each child node which does not exists, an "incomplete"
405 node will be added. These child nodes will be added regardless of
406 the DEPTH value. The caller must sort out which must be recorded,
407 and which must be omitted.
409 This subsystem does not use DEPTH, but it can be recorded here in
410 the BASE tree for higher-level code to use.
412 If DAV_CACHE is not NULL, sets LOCAL_ABSPATH's dav cache to the specified
415 If CONFLICT is not NULL, then it describes a conflict for this node. The
416 node will be record as conflicted (in ACTUAL).
418 If UPDATE_ACTUAL_PROPS is TRUE, set the properties store NEW_ACTUAL_PROPS
419 as the new set of properties in ACTUAL. If NEW_ACTUAL_PROPS is NULL or
420 when the value of NEW_ACTUAL_PROPS matches NEW_PROPS, store NULL in
421 ACTUAL, to mark the properties unmodified.
423 If NEW_IPROPS is not NULL, then it is a depth-first ordered array of
424 svn_prop_inherited_item_t * structures that is set as the base node's
425 inherited_properties.
427 Any work items that are necessary as part of this node construction may
428 be passed in WORK_ITEMS.
430 All temporary allocations will be made in SCRATCH_POOL.
433 svn_wc__db_base_add_directory(svn_wc__db_t *db,
434 const char *local_abspath,
435 const char *wri_abspath,
436 const char *repos_relpath,
437 const char *repos_root_url,
438 const char *repos_uuid,
439 svn_revnum_t revision,
440 const apr_hash_t *props,
441 svn_revnum_t changed_rev,
442 apr_time_t changed_date,
443 const char *changed_author,
444 const apr_array_header_t *children,
446 apr_hash_t *dav_cache,
447 const svn_skel_t *conflict,
448 svn_boolean_t update_actual_props,
449 apr_hash_t *new_actual_props,
450 apr_array_header_t *new_iprops,
451 const svn_skel_t *work_items,
452 apr_pool_t *scratch_pool);
454 /* Add a new directory in BASE, whether WORKING nodes exist or not. Mark it
455 as incomplete and with revision REVISION. If REPOS_RELPATH is not NULL,
456 apply REPOS_RELPATH, REPOS_ROOT_URL and REPOS_UUID.
457 Perform all temporary allocations in SCRATCH_POOL.
460 svn_wc__db_base_add_incomplete_directory(svn_wc__db_t *db,
461 const char *local_abspath,
462 const char *repos_relpath,
463 const char *repos_root_url,
464 const char *repos_uuid,
465 svn_revnum_t revision,
467 svn_boolean_t insert_base_deleted,
468 svn_boolean_t delete_working,
469 svn_skel_t *conflict,
470 svn_skel_t *work_items,
471 apr_pool_t *scratch_pool);
474 /* Add or replace a file in the BASE tree.
476 The file is located at LOCAL_ABSPATH on the local filesystem, and
477 corresponds to <REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID> in the
478 repository, at revision REVISION.
480 The file properties are given by the PROPS hash (which is
481 const char *name => const svn_string_t *).
483 The last-change information is given by <CHANGED_REV, CHANGED_DATE,
486 The checksum of the file contents is given in CHECKSUM. An entry in
487 the pristine text base is NOT required when this API is called.
489 If DAV_CACHE is not NULL, sets LOCAL_ABSPATH's dav cache to the specified
492 If CONFLICT is not NULL, then it describes a conflict for this node. The
493 node will be record as conflicted (in ACTUAL).
495 If UPDATE_ACTUAL_PROPS is TRUE, set the properties store NEW_ACTUAL_PROPS
496 as the new set of properties in ACTUAL. If NEW_ACTUAL_PROPS is NULL or
497 when the value of NEW_ACTUAL_PROPS matches NEW_PROPS, store NULL in
498 ACTUAL, to mark the properties unmodified.
500 Any work items that are necessary as part of this node construction may
501 be passed in WORK_ITEMS.
503 Unless KEEP_RECORDED_INFO is set to TRUE, recorded size and timestamp values
506 All temporary allocations will be made in SCRATCH_POOL.
509 svn_wc__db_base_add_file(svn_wc__db_t *db,
510 const char *local_abspath,
511 const char *wri_abspath,
512 const char *repos_relpath,
513 const char *repos_root_url,
514 const char *repos_uuid,
515 svn_revnum_t revision,
516 const apr_hash_t *props,
517 svn_revnum_t changed_rev,
518 apr_time_t changed_date,
519 const char *changed_author,
520 const svn_checksum_t *checksum,
521 apr_hash_t *dav_cache,
522 svn_boolean_t delete_working,
523 svn_boolean_t update_actual_props,
524 apr_hash_t *new_actual_props,
525 apr_array_header_t *new_iprops,
526 svn_boolean_t keep_recorded_info,
527 svn_boolean_t insert_base_deleted,
528 const svn_skel_t *conflict,
529 const svn_skel_t *work_items,
530 apr_pool_t *scratch_pool);
533 /* Add or replace a symlink in the BASE tree.
535 The symlink is located at LOCAL_ABSPATH on the local filesystem, and
536 corresponds to <REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID> in the
537 repository, at revision REVISION.
539 The symlink's properties are given by the PROPS hash (which is
540 const char *name => const svn_string_t *).
542 The last-change information is given by <CHANGED_REV, CHANGED_DATE,
545 The target of the symlink is specified by TARGET.
547 If DAV_CACHE is not NULL, sets LOCAL_ABSPATH's dav cache to the specified
550 If CONFLICT is not NULL, then it describes a conflict for this node. The
551 node will be record as conflicted (in ACTUAL).
553 If UPDATE_ACTUAL_PROPS is TRUE, set the properties store NEW_ACTUAL_PROPS
554 as the new set of properties in ACTUAL. If NEW_ACTUAL_PROPS is NULL or
555 when the value of NEW_ACTUAL_PROPS matches NEW_PROPS, store NULL in
556 ACTUAL, to mark the properties unmodified.
558 Any work items that are necessary as part of this node construction may
559 be passed in WORK_ITEMS.
561 All temporary allocations will be made in SCRATCH_POOL.
563 /* ### KFF: This is an interesting question, because currently
564 ### symlinks are versioned as regular files with the svn:special
565 ### property; then the file's text contents indicate that it is a
566 ### symlink and where that symlink points. That's for portability:
567 ### you can check 'em out onto a platform that doesn't support
568 ### symlinks, and even modify the link and check it back in. It's
569 ### a great solution; but then the question for wc-ng is:
571 ### Suppose you check out a symlink on platform X and platform Y.
572 ### X supports symlinks; Y does not. Should the wc-ng storage for
573 ### those two be the same? I mean, on platform Y, the file is just
574 ### going to look and behave like a regular file. It would be sort
575 ### of odd for the wc-ng storage for that file to be of a different
576 ### type from all the other files. (On the other hand, maybe it's
577 ### weird today that the wc-1 storage for a working symlink is to
578 ### be like a regular file (i.e., regular text-base and whatnot).
580 ### I'm still feeling my way around this problem; just pointing out
583 ### gjs: symlinks are stored in the database as first-class objects,
584 ### rather than in the filesystem as "special" regular files. thus,
585 ### all portability concerns are moot. higher-levels can figure out
586 ### how to represent the link in ACTUAL. higher-levels can also
587 ### deal with translating to/from the svn:special property and
588 ### the plain-text file contents.
589 ### dlr: What about hard links? At minimum, mention in doc string.
592 svn_wc__db_base_add_symlink(svn_wc__db_t *db,
593 const char *local_abspath,
594 const char *wri_abspath,
595 const char *repos_relpath,
596 const char *repos_root_url,
597 const char *repos_uuid,
598 svn_revnum_t revision,
599 const apr_hash_t *props,
600 svn_revnum_t changed_rev,
601 apr_time_t changed_date,
602 const char *changed_author,
604 apr_hash_t *dav_cache,
605 svn_boolean_t delete_working,
606 svn_boolean_t update_actual_props,
607 apr_hash_t *new_actual_props,
608 apr_array_header_t *new_iprops,
609 svn_boolean_t keep_recorded_info,
610 svn_boolean_t insert_base_deleted,
611 const svn_skel_t *conflict,
612 const svn_skel_t *work_items,
613 apr_pool_t *scratch_pool);
616 /* Create a node in the BASE tree that is present in name only.
618 The new node will be located at LOCAL_ABSPATH, and correspond to the
619 repository node described by <REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID>
620 at revision REVISION.
622 The node's kind is described by KIND, and the reason for its absence
623 is specified by STATUS. Only these values are allowed for STATUS:
625 svn_wc__db_status_server_excluded
626 svn_wc__db_status_excluded
628 If CONFLICT is not NULL, then it describes a conflict for this node. The
629 node will be record as conflicted (in ACTUAL).
631 Any work items that are necessary as part of this node construction may
632 be passed in WORK_ITEMS.
634 All temporary allocations will be made in SCRATCH_POOL.
637 svn_wc__db_base_add_excluded_node(svn_wc__db_t *db,
638 const char *local_abspath,
639 const char *repos_relpath,
640 const char *repos_root_url,
641 const char *repos_uuid,
642 svn_revnum_t revision,
643 svn_node_kind_t kind,
644 svn_wc__db_status_t status,
645 const svn_skel_t *conflict,
646 const svn_skel_t *work_items,
647 apr_pool_t *scratch_pool);
650 /* Create a node in the BASE tree that is present in name only.
652 The new node will be located at LOCAL_ABSPATH, and correspond to the
653 repository node described by <REPOS_RELPATH, REPOS_ROOT_URL, REPOS_UUID>
654 at revision REVISION.
656 The node's kind is described by KIND, and the reason for its absence
657 is 'svn_wc__db_status_not_present'.
659 If CONFLICT is not NULL, then it describes a conflict for this node. The
660 node will be record as conflicted (in ACTUAL).
662 Any work items that are necessary as part of this node construction may
663 be passed in WORK_ITEMS.
665 All temporary allocations will be made in SCRATCH_POOL.
668 svn_wc__db_base_add_not_present_node(svn_wc__db_t *db,
669 const char *local_abspath,
670 const char *repos_relpath,
671 const char *repos_root_url,
672 const char *repos_uuid,
673 svn_revnum_t revision,
674 svn_node_kind_t kind,
675 const svn_skel_t *conflict,
676 const svn_skel_t *work_items,
677 apr_pool_t *scratch_pool);
680 /* Remove a node and all its descendants from the BASE tree. This handles
681 the deletion of a tree from the update editor and some file external
684 The node to remove is indicated by LOCAL_ABSPATH from the local
687 This operation *installs* workqueue operations to update the local
688 filesystem after the database operation.
690 To maintain a consistent database this function will also remove
691 any working node that marks LOCAL_ABSPATH as base-deleted. If this
692 results in there being no working node for LOCAL_ABSPATH then any
693 actual node will be removed if the actual node does not mark a
696 If KEEP_AS_WORKING is TRUE, then the base tree is copied to higher
697 layers as a copy of itself before deleting the BASE nodes.
699 If KEEP_AS_WORKING is FALSE, and QUEUE_DELETES is TRUE, also queue
700 workqueue items to delete all in-wc representations that aren't
701 shadowed by higher layers.
702 (With KEEP_AS_WORKING TRUE, this is a no-op, as everything is
703 automatically shadowed by the created copy)
705 If REMOVE_LOCKS is TRUE, all locks of this node and any subnodes
706 are also removed. This is to be done during commit of deleted nodes.
708 If NOT_PRESENT_REVISION specifies a valid revision a not-present
709 node is installed in BASE node with kind NOT_PRESENT_KIND after
712 If CONFLICT and/or WORK_ITEMS are passed they are installed as part
713 of the operation, after the work items inserted by the operation
717 svn_wc__db_base_remove(svn_wc__db_t *db,
718 const char *local_abspath,
719 svn_boolean_t keep_as_working,
720 svn_boolean_t queue_deletes,
721 svn_boolean_t remove_locks,
722 svn_revnum_t not_present_revision,
723 svn_skel_t *conflict,
724 svn_skel_t *work_items,
725 apr_pool_t *scratch_pool);
728 /* Retrieve information about a node in the BASE tree.
730 For the BASE node implied by LOCAL_ABSPATH from the local filesystem,
731 return information in the provided OUT parameters. Each OUT parameter
732 may be NULL, indicating that specific item is not requested.
734 If there is no information about this node, then SVN_ERR_WC_PATH_NOT_FOUND
737 The OUT parameters, and their "not available" values are:
738 STATUS n/a (always available)
739 KIND n/a (always available)
740 REVISION SVN_INVALID_REVNUM
741 REPOS_RELPATH NULL (caller should scan up)
742 REPOS_ROOT_URL NULL (caller should scan up)
743 REPOS_UUID NULL (caller should scan up)
744 CHANGED_REV SVN_INVALID_REVNUM
747 DEPTH svn_depth_unknown
757 If the STATUS is normal, the REPOS_* values will be non-NULL.
759 If DEPTH is requested, and the node is NOT a directory, then the
760 value will be set to svn_depth_unknown. If LOCAL_ABSPATH is a link,
761 it's up to the caller to resolve depth for the link's target.
763 If CHECKSUM is requested, and the node is NOT a file, then it will
766 If TARGET is requested, and the node is NOT a symlink, then it will
769 *PROPS maps "const char *" names to "const svn_string_t *" values. If
770 the base node is capable of having properties but has none, set
771 *PROPS to an empty hash. If its status is such that it cannot have
772 properties, set *PROPS to NULL.
774 If UPDATE_ROOT is requested, set it to TRUE if the node should only
775 be updated when it is the root of an update (e.g. file externals).
777 All returned data will be allocated in RESULT_POOL. All temporary
778 allocations will be made in SCRATCH_POOL.
781 svn_wc__db_base_get_info(svn_wc__db_status_t *status,
782 svn_node_kind_t *kind,
783 svn_revnum_t *revision,
784 const char **repos_relpath,
785 const char **repos_root_url,
786 const char **repos_uuid,
787 svn_revnum_t *changed_rev,
788 apr_time_t *changed_date,
789 const char **changed_author,
791 const svn_checksum_t **checksum,
793 svn_wc__db_lock_t **lock,
794 svn_boolean_t *had_props,
796 svn_boolean_t *update_root,
798 const char *local_abspath,
799 apr_pool_t *result_pool,
800 apr_pool_t *scratch_pool);
802 /* Structure returned by svn_wc__db_base_get_children_info. Only has the
803 fields needed by the adm crawler. */
804 struct svn_wc__db_base_info_t {
805 svn_wc__db_status_t status;
806 svn_node_kind_t kind;
808 const char *repos_relpath;
809 const char *repos_root_url;
811 svn_boolean_t update_root;
812 svn_wc__db_lock_t *lock;
815 /* Return in *NODES a hash mapping name->struct svn_wc__db_base_info_t for
816 the children of DIR_ABSPATH at op_depth 0.
819 svn_wc__db_base_get_children_info(apr_hash_t **nodes,
821 const char *dir_abspath,
822 apr_pool_t *result_pool,
823 apr_pool_t *scratch_pool);
826 /* Set *PROPS to the properties of the node LOCAL_ABSPATH in the BASE tree.
828 *PROPS maps "const char *" names to "const svn_string_t *" values.
829 If the node has no properties, set *PROPS to an empty hash.
830 *PROPS will never be set to NULL.
831 If the node is not present in the BASE tree (with presence 'normal'
832 or 'incomplete'), return an error.
833 Allocate *PROPS and its keys and values in RESULT_POOL.
836 svn_wc__db_base_get_props(apr_hash_t **props,
838 const char *local_abspath,
839 apr_pool_t *result_pool,
840 apr_pool_t *scratch_pool);
843 /* Return a list of the BASE tree node's children's names.
845 For the node indicated by LOCAL_ABSPATH, this function will return
846 the names of all of its children in the array CHILDREN. The array
847 elements are const char * values.
849 If the node is not a directory, then SVN_ERR_WC_NOT_WORKING_COPY will
852 All returned data will be allocated in RESULT_POOL. All temporary
853 allocations will be made in SCRATCH_POOL.
856 svn_wc__db_base_get_children(const apr_array_header_t **children,
858 const char *local_abspath,
859 apr_pool_t *result_pool,
860 apr_pool_t *scratch_pool);
863 /* Set the dav cache for LOCAL_ABSPATH to PROPS. Use SCRATCH_POOL for
864 temporary allocations. */
866 svn_wc__db_base_set_dav_cache(svn_wc__db_t *db,
867 const char *local_abspath,
868 const apr_hash_t *props,
869 apr_pool_t *scratch_pool);
872 /* Retrieve the dav cache for LOCAL_ABSPATH into *PROPS, allocated in
873 RESULT_POOL. Use SCRATCH_POOL for temporary allocations. Return
874 SVN_ERR_WC_PATH_NOT_FOUND if no dav cache can be located for
875 LOCAL_ABSPATH in DB. */
877 svn_wc__db_base_get_dav_cache(apr_hash_t **props,
879 const char *local_abspath,
880 apr_pool_t *result_pool,
881 apr_pool_t *scratch_pool);
883 /* Recursively clear the dav cache for LOCAL_ABSPATH. Use
884 SCRATCH_POOL for temporary allocations. */
886 svn_wc__db_base_clear_dav_cache_recursive(svn_wc__db_t *db,
887 const char *local_abspath,
888 apr_pool_t *scratch_pool);
890 /* Set LOCK_TOKENS to a hash mapping const char * full URLs to const char *
891 * lock tokens for every base node at or under LOCAL_ABSPATH in DB which has
892 * such a lock token set on it.
893 * Allocate the hash and all items therein from RESULT_POOL. */
895 svn_wc__db_base_get_lock_tokens_recursive(apr_hash_t **lock_tokens,
897 const char *local_abspath,
898 apr_pool_t *result_pool,
899 apr_pool_t *scratch_pool);
901 /* ### anything else needed for maintaining the BASE tree? */
906 /* @defgroup svn_wc__db_pristine Pristine ("text base") management
910 /* Set *PRISTINE_ABSPATH to the path to the pristine text file
911 identified by SHA1_CHECKSUM. Error if it does not exist.
913 ### This is temporary - callers should not be looking at the file
916 Allocate the path in RESULT_POOL. */
918 svn_wc__db_pristine_get_path(const char **pristine_abspath,
920 const char *wri_abspath,
921 const svn_checksum_t *checksum,
922 apr_pool_t *result_pool,
923 apr_pool_t *scratch_pool);
925 /* Set *PRISTINE_ABSPATH to the path under WCROOT_ABSPATH that will be
926 used by the pristine text identified by SHA1_CHECKSUM. The file
930 svn_wc__db_pristine_get_future_path(const char **pristine_abspath,
931 const char *wcroot_abspath,
932 const svn_checksum_t *sha1_checksum,
933 apr_pool_t *result_pool,
934 apr_pool_t *scratch_pool);
937 /* If requested set *CONTENTS to a readable stream that will yield the pristine
938 text identified by SHA1_CHECKSUM (must be a SHA-1 checksum) within the WC
939 identified by WRI_ABSPATH in DB.
941 If requested set *SIZE to the size of the pristine stream in bytes,
943 Even if the pristine text is removed from the store while it is being
944 read, the stream will remain valid and readable until it is closed.
946 Allocate the stream in RESULT_POOL. */
948 svn_wc__db_pristine_read(svn_stream_t **contents,
949 svn_filesize_t *size,
951 const char *wri_abspath,
952 const svn_checksum_t *sha1_checksum,
953 apr_pool_t *result_pool,
954 apr_pool_t *scratch_pool);
957 /* Set *TEMP_DIR_ABSPATH to a directory in which the caller should create
958 a uniquely named file for later installation as a pristine text file.
960 The directory is guaranteed to be one that svn_wc__db_pristine_install()
961 can use: specifically, one from which it can atomically move the file.
963 Allocate *TEMP_DIR_ABSPATH in RESULT_POOL. */
965 svn_wc__db_pristine_get_tempdir(const char **temp_dir_abspath,
967 const char *wri_abspath,
968 apr_pool_t *result_pool,
969 apr_pool_t *scratch_pool);
972 /* Install the file TEMPFILE_ABSPATH (which is sitting in a directory given by
973 svn_wc__db_pristine_get_tempdir()) into the pristine data store, to be
974 identified by the SHA-1 checksum of its contents, SHA1_CHECKSUM, and whose
975 MD-5 checksum is MD5_CHECKSUM. */
977 svn_wc__db_pristine_install(svn_wc__db_t *db,
978 const char *tempfile_abspath,
979 const svn_checksum_t *sha1_checksum,
980 const svn_checksum_t *md5_checksum,
981 apr_pool_t *scratch_pool);
984 /* Set *MD5_CHECKSUM to the MD-5 checksum of a pristine text
985 identified by its SHA-1 checksum SHA1_CHECKSUM. Return an error
986 if the pristine text does not exist or its MD5 checksum is not found.
988 Allocate *MD5_CHECKSUM in RESULT_POOL. */
990 svn_wc__db_pristine_get_md5(const svn_checksum_t **md5_checksum,
992 const char *wri_abspath,
993 const svn_checksum_t *sha1_checksum,
994 apr_pool_t *result_pool,
995 apr_pool_t *scratch_pool);
998 /* Set *SHA1_CHECKSUM to the SHA-1 checksum of a pristine text
999 identified by its MD-5 checksum MD5_CHECKSUM. Return an error
1000 if the pristine text does not exist or its SHA-1 checksum is not found.
1002 Note: The MD-5 checksum is not strictly guaranteed to be unique in the
1003 database table, although duplicates are expected to be extremely rare.
1004 ### TODO: The behaviour is currently unspecified if the MD-5 checksum is
1005 not unique. Need to see whether this function is going to stay in use,
1006 and, if so, address this somehow.
1008 Allocate *SHA1_CHECKSUM in RESULT_POOL. */
1010 svn_wc__db_pristine_get_sha1(const svn_checksum_t **sha1_checksum,
1012 const char *wri_abspath,
1013 const svn_checksum_t *md5_checksum,
1014 apr_pool_t *result_pool,
1015 apr_pool_t *scratch_pool);
1018 /* If necessary transfers the PRISTINE files of the tree rooted at
1019 SRC_LOCAL_ABSPATH to the working copy identified by DST_WRI_ABSPATH. */
1021 svn_wc__db_pristine_transfer(svn_wc__db_t *db,
1022 const char *src_local_abspath,
1023 const char *dst_wri_abspath,
1024 svn_cancel_func_t cancel_func,
1026 apr_pool_t *scratch_pool);
1028 /* Remove the pristine text with SHA-1 checksum SHA1_CHECKSUM from the
1029 * pristine store, iff it is not referenced by any of the (other) WC DB
1032 svn_wc__db_pristine_remove(svn_wc__db_t *db,
1033 const char *wri_abspath,
1034 const svn_checksum_t *sha1_checksum,
1035 apr_pool_t *scratch_pool);
1038 /* Remove all unreferenced pristines in the WC of WRI_ABSPATH in DB. */
1040 svn_wc__db_pristine_cleanup(svn_wc__db_t *db,
1041 const char *wri_abspath,
1042 apr_pool_t *scratch_pool);
1045 /* Set *PRESENT to true if the pristine store for WRI_ABSPATH in DB contains
1046 a pristine text with SHA-1 checksum SHA1_CHECKSUM, and to false otherwise.
1049 svn_wc__db_pristine_check(svn_boolean_t *present,
1051 const char *wri_abspath,
1052 const svn_checksum_t *sha1_checksum,
1053 apr_pool_t *scratch_pool);
1055 /* @defgroup svn_wc__db_external External management
1058 /* Adds (or overwrites) a file external LOCAL_ABSPATH to the working copy
1059 identified by WRI_ABSPATH.
1061 It updates both EXTERNALS and NODES in one atomic step.
1064 svn_wc__db_external_add_file(svn_wc__db_t *db,
1065 const char *local_abspath,
1066 const char *wri_abspath,
1068 const char *repos_relpath,
1069 const char *repos_root_url,
1070 const char *repos_uuid,
1071 svn_revnum_t revision,
1073 const apr_hash_t *props,
1074 apr_array_header_t *iprops,
1076 svn_revnum_t changed_rev,
1077 apr_time_t changed_date,
1078 const char *changed_author,
1080 const svn_checksum_t *checksum,
1082 const apr_hash_t *dav_cache,
1084 const char *record_ancestor_abspath,
1085 const char *recorded_repos_relpath,
1086 svn_revnum_t recorded_peg_revision,
1087 svn_revnum_t recorded_revision,
1089 svn_boolean_t update_actual_props,
1090 apr_hash_t *new_actual_props,
1092 svn_boolean_t keep_recorded_info,
1093 const svn_skel_t *conflict,
1094 const svn_skel_t *work_items,
1095 apr_pool_t *scratch_pool);
1097 /* Adds (or overwrites) a symlink external LOCAL_ABSPATH to the working copy
1098 identified by WRI_ABSPATH.
1101 svn_wc__db_external_add_symlink(svn_wc__db_t *db,
1102 const char *local_abspath,
1103 const char *wri_abspath,
1105 const char *repos_relpath,
1106 const char *repos_root_url,
1107 const char *repos_uuid,
1108 svn_revnum_t revision,
1110 const apr_hash_t *props,
1112 svn_revnum_t changed_rev,
1113 apr_time_t changed_date,
1114 const char *changed_author,
1118 const apr_hash_t *dav_cache,
1120 const char *record_ancestor_abspath,
1121 const char *recorded_repos_relpath,
1122 svn_revnum_t recorded_peg_revision,
1123 svn_revnum_t recorded_revision,
1125 svn_boolean_t update_actual_props,
1126 apr_hash_t *new_actual_props,
1128 svn_boolean_t keep_recorded_info,
1129 const svn_skel_t *work_items,
1130 apr_pool_t *scratch_pool);
1132 /* Adds (or overwrites) a directory external LOCAL_ABSPATH to the working copy
1133 identified by WRI_ABSPATH.
1135 Directory externals are stored in their own working copy, so one should use
1136 the normal svn_wc__db functions to access the normal working copy
1140 svn_wc__db_external_add_dir(svn_wc__db_t *db,
1141 const char *local_abspath,
1142 const char *wri_abspath,
1144 const char *repos_root_url,
1145 const char *repos_uuid,
1147 const char *record_ancestor_abspath,
1148 const char *recorded_repos_relpath,
1149 svn_revnum_t recorded_peg_revision,
1150 svn_revnum_t recorded_revision,
1152 const svn_skel_t *work_items,
1153 apr_pool_t *scratch_pool);
1155 /* Remove a registered external LOCAL_ABSPATH from the working copy identified
1159 svn_wc__db_external_remove(svn_wc__db_t *db,
1160 const char *local_abspath,
1161 const char *wri_abspath,
1163 const svn_skel_t *work_items,
1164 apr_pool_t *scratch_pool);
1167 /* Reads information on the external LOCAL_ABSPATH as stored in the working
1168 copy identified with WRI_ABSPATH (If NULL the parent directory of
1169 LOCAL_ABSPATH is taken as WRI_ABSPATH).
1171 Return SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not an external in
1174 When STATUS is requested it has one of these values
1175 svn_wc__db_status_normal The external is available
1176 svn_wc__db_status_excluded The external is user excluded
1178 When KIND is requested then the value will be set to the kind of external.
1180 If DEFINING_ABSPATH is requested, then the value will be set to the
1181 absolute path of the directory which originally defined the external.
1182 (The path with the svn:externals property)
1184 If REPOS_ROOT_URL is requested, then the value will be set to the
1185 repository root of the external.
1187 If REPOS_UUID is requested, then the value will be set to the
1188 repository uuid of the external.
1190 If RECORDED_REPOS_RELPATH is requested, then the value will be set to the
1191 original repository relative path inside REPOS_ROOT_URL of the external.
1193 If RECORDED_PEG_REVISION is requested, then the value will be set to the
1194 original recorded operational (peg) revision of the external.
1196 If RECORDED_REVISION is requested, then the value will be set to the
1197 original recorded revision of the external.
1199 Allocate the result in RESULT_POOL and perform temporary allocations in
1203 svn_wc__db_external_read(svn_wc__db_status_t *status,
1204 svn_node_kind_t *kind,
1205 const char **defining_abspath,
1207 const char **repos_root_url,
1208 const char **repos_uuid,
1210 const char **recorded_repos_relpath,
1211 svn_revnum_t *recorded_peg_revision,
1212 svn_revnum_t *recorded_revision,
1215 const char *local_abspath,
1216 const char *wri_abspath,
1217 apr_pool_t *result_pool,
1218 apr_pool_t *scratch_pool);
1220 /* Return in *EXTERNALS a list of svn_wc__committable_external_info_t *
1221 * containing info on externals defined to be checked out below LOCAL_ABSPATH,
1222 * returning only those externals that are not fixed to a specific revision.
1224 * If IMMEDIATES_ONLY is TRUE, only those externals defined to be checked out
1225 * as immediate children of LOCAL_ABSPATH are returned (this is useful for
1226 * treating user requested depth < infinity).
1228 * If there are no externals to be returned, set *EXTERNALS to NULL. Otherwise
1229 * set *EXTERNALS to an APR array newly cleated in RESULT_POOL.
1231 * NOTE: This only returns the externals known by the immediate WC root for
1232 * LOCAL_ABSPATH; i.e.:
1233 * - If there is a further parent WC "above" the immediate WC root, and if
1234 * that parent WC defines externals to live somewhere within this WC, these
1235 * externals will appear to be foreign/unversioned and won't be picked up.
1236 * - Likewise, only the topmost level of externals nestings (externals
1237 * defined within a checked out external dir) is picked up by this function.
1238 * (For recursion, see svn_wc__committable_externals_below().)
1240 * ###TODO: Add a WRI_ABSPATH (wc root indicator) separate from LOCAL_ABSPATH,
1241 * to allow searching any wc-root for externals under LOCAL_ABSPATH, not only
1242 * LOCAL_ABSPATH's most immediate wc-root. */
1244 svn_wc__db_committable_externals_below(apr_array_header_t **externals,
1246 const char *local_abspath,
1247 svn_boolean_t immediates_only,
1248 apr_pool_t *result_pool,
1249 apr_pool_t *scratch_pool);
1251 /* Gets a mapping from const char * local abspaths of externals to the const
1252 char * local abspath of where they are defined for all externals defined
1253 at or below LOCAL_ABSPATH.
1255 ### Returns NULL in *EXTERNALS until we bumped to format 29.
1257 Allocate the result in RESULT_POOL and perform temporary allocations in
1260 svn_wc__db_externals_defined_below(apr_hash_t **externals,
1262 const char *local_abspath,
1263 apr_pool_t *result_pool,
1264 apr_pool_t *scratch_pool);
1266 /* Gather all svn:externals property values from the actual properties on
1267 directories below LOCAL_ABSPATH as a mapping of const char *local_abspath
1268 to const char * property values.
1270 If DEPTHS is not NULL, set *depths to an apr_hash_t* mapping the same
1271 local_abspaths to the const char * ambient depth of the node.
1273 Allocate the result in RESULT_POOL and perform temporary allocations in
1276 svn_wc__db_externals_gather_definitions(apr_hash_t **externals,
1277 apr_hash_t **depths,
1279 const char *local_abspath,
1280 apr_pool_t *result_pool,
1281 apr_pool_t *scratch_pool);
1285 /* @defgroup svn_wc__db_op Operations on WORKING tree
1289 /* Copy the node at SRC_ABSPATH (in NODES and ACTUAL_NODE tables) to
1290 * DST_ABSPATH, both in DB but not necessarily in the same WC. The parent
1291 * of DST_ABSPATH must be a versioned directory.
1293 * This copy is NOT recursive. It simply establishes this one node, plus
1294 * incomplete nodes for the children.
1296 * If IS_MOVE is TRUE, mark this copy operation as the copy-half of
1297 * a move. The delete-half of the move needs to be created separately
1298 * with svn_wc__db_op_delete().
1300 * Add WORK_ITEMS to the work queue. */
1302 svn_wc__db_op_copy(svn_wc__db_t *db,
1303 const char *src_abspath,
1304 const char *dst_abspath,
1305 const char *dst_op_root_abspath,
1306 svn_boolean_t is_move,
1307 const svn_skel_t *work_items,
1308 apr_pool_t *scratch_pool);
1310 /* Checks if LOCAL_ABSPATH represents a move back to its original location,
1311 * and if it is reverts the move while keeping local changes after it has been
1312 * moved from MOVED_FROM_ABSPATH.
1314 * If MOVED_BACK is not NULL, set *MOVED_BACK to TRUE when a move was reverted,
1315 * otherwise to FALSE.
1318 svn_wc__db_op_handle_move_back(svn_boolean_t *moved_back,
1320 const char *local_abspath,
1321 const char *moved_from_abspath,
1322 const svn_skel_t *work_items,
1323 apr_pool_t *scratch_pool);
1326 /* Copy the leaves of the op_depth layer directly shadowed by the operation
1327 * of SRC_ABSPATH (so SRC_ABSPATH must be an op_root) to dst_abspaths
1330 * This operation is recursive. It copies all the descendants at the lower
1331 * layer and adds base-deleted nodes on dst_abspath layer to mark these nodes
1334 * Usually this operation is directly followed by a call to svn_wc__db_op_copy
1335 * which performs the real copy from src_abspath to dst_abspath.
1338 svn_wc__db_op_copy_shadowed_layer(svn_wc__db_t *db,
1339 const char *src_abspath,
1340 const char *dst_abspath,
1341 svn_boolean_t is_move,
1342 apr_pool_t *scratch_pool);
1345 /* Record a copy at LOCAL_ABSPATH from a repository directory.
1347 This copy is NOT recursive. It simply establishes this one node.
1348 CHILDREN must be provided, and incomplete nodes will be constructed
1351 ### arguments docco. */
1353 svn_wc__db_op_copy_dir(svn_wc__db_t *db,
1354 const char *local_abspath,
1355 const apr_hash_t *props,
1356 svn_revnum_t changed_rev,
1357 apr_time_t changed_date,
1358 const char *changed_author,
1359 const char *original_repos_relpath,
1360 const char *original_root_url,
1361 const char *original_uuid,
1362 svn_revnum_t original_revision,
1363 const apr_array_header_t *children,
1364 svn_boolean_t is_move,
1366 const svn_skel_t *conflict,
1367 const svn_skel_t *work_items,
1368 apr_pool_t *scratch_pool);
1371 /* Record a copy at LOCAL_ABSPATH from a repository file.
1373 ### arguments docco. */
1375 svn_wc__db_op_copy_file(svn_wc__db_t *db,
1376 const char *local_abspath,
1377 const apr_hash_t *props,
1378 svn_revnum_t changed_rev,
1379 apr_time_t changed_date,
1380 const char *changed_author,
1381 const char *original_repos_relpath,
1382 const char *original_root_url,
1383 const char *original_uuid,
1384 svn_revnum_t original_revision,
1385 const svn_checksum_t *checksum,
1386 svn_boolean_t update_actual_props,
1387 const apr_hash_t *new_actual_props,
1388 svn_boolean_t is_move,
1389 const svn_skel_t *conflict,
1390 const svn_skel_t *work_items,
1391 apr_pool_t *scratch_pool);
1395 svn_wc__db_op_copy_symlink(svn_wc__db_t *db,
1396 const char *local_abspath,
1397 const apr_hash_t *props,
1398 svn_revnum_t changed_rev,
1399 apr_time_t changed_date,
1400 const char *changed_author,
1401 const char *original_repos_relpath,
1402 const char *original_root_url,
1403 const char *original_uuid,
1404 svn_revnum_t original_revision,
1406 const svn_skel_t *conflict,
1407 const svn_skel_t *work_items,
1408 apr_pool_t *scratch_pool);
1411 /* ### do we need svn_wc__db_op_copy_server_excluded() ?? */
1414 /* ### add a new versioned directory. a list of children is NOT passed
1415 ### since they are added in future, distinct calls to db_op_add_*.
1416 PROPS gives the properties; empty or NULL means none. */
1417 /* ### do we need a CONFLICTS param? */
1419 svn_wc__db_op_add_directory(svn_wc__db_t *db,
1420 const char *local_abspath,
1421 const apr_hash_t *props,
1422 const svn_skel_t *work_items,
1423 apr_pool_t *scratch_pool);
1427 PROPS gives the properties; empty or NULL means none.
1428 ### this file has no "pristine"
1429 ### contents, so a checksum [reference] is not required. */
1430 /* ### do we need a CONFLICTS param? */
1432 svn_wc__db_op_add_file(svn_wc__db_t *db,
1433 const char *local_abspath,
1434 const apr_hash_t *props,
1435 const svn_skel_t *work_items,
1436 apr_pool_t *scratch_pool);
1440 PROPS gives the properties; empty or NULL means none. */
1441 /* ### do we need a CONFLICTS param? */
1443 svn_wc__db_op_add_symlink(svn_wc__db_t *db,
1444 const char *local_abspath,
1446 const apr_hash_t *props,
1447 const svn_skel_t *work_items,
1448 apr_pool_t *scratch_pool);
1451 /* Set the properties of the node LOCAL_ABSPATH in the ACTUAL tree to
1454 PROPS maps "const char *" names to "const svn_string_t *" values.
1455 To specify no properties, PROPS must be an empty hash, not NULL.
1456 If the node is not present, return an error.
1458 If PROPS is NULL, set the properties to be the same as the pristine
1461 If CONFLICT is not NULL, it is used to register a conflict on this
1462 node at the same time the properties are changed.
1464 WORK_ITEMS are inserted into the work queue, as additional things that
1465 need to be completed before the working copy is stable.
1468 If CLEAR_RECORDED_INFO is true, the recorded information for the node
1469 is cleared. (commonly used when updating svn:* magic properties).
1471 NOTE: This will overwrite ALL working properties the node currently
1472 has. There is no db_op_set_prop() function. Callers must read all the
1473 properties, change one, and write all the properties.
1474 ### ugh. this has poor transaction semantics...
1477 NOTE: This will create an entry in the ACTUAL table for the node if it
1478 does not yet have one.
1481 svn_wc__db_op_set_props(svn_wc__db_t *db,
1482 const char *local_abspath,
1484 svn_boolean_t clear_recorded_info,
1485 const svn_skel_t *conflict,
1486 const svn_skel_t *work_items,
1487 apr_pool_t *scratch_pool);
1489 /* Mark LOCAL_ABSPATH, and all children, for deletion.
1491 * This function removes the file externals (and if DELETE_DIR_EXTERNALS is
1492 * TRUE also the directory externals) registered below LOCAL_ABSPATH.
1493 * (DELETE_DIR_EXTERNALS should be true if also removing unversioned nodes)
1495 * If MOVED_TO_ABSPATH is not NULL, mark the deletion of LOCAL_ABSPATH
1496 * as the delete-half of a move from LOCAL_ABSPATH to MOVED_TO_ABSPATH.
1498 * If NOTIFY_FUNC is not NULL, then it will be called (with NOTIFY_BATON)
1499 * for each node deleted. While this processing occurs, if CANCEL_FUNC is
1500 * not NULL, then it will be called (with CANCEL_BATON) to detect cancellation
1501 * during the processing.
1503 * Note: the notification (and cancellation) occur outside of a SQLite
1507 svn_wc__db_op_delete(svn_wc__db_t *db,
1508 const char *local_abspath,
1509 const char *moved_to_abspath,
1510 svn_boolean_t delete_dir_externals,
1511 svn_skel_t *conflict,
1512 svn_skel_t *work_items,
1513 svn_cancel_func_t cancel_func,
1515 svn_wc_notify_func2_t notify_func,
1517 apr_pool_t *scratch_pool);
1520 /* Mark all LOCAL_ABSPATH in the TARGETS array, and all of their children,
1523 * This function is more efficient than svn_wc__db_op_delete() because
1524 * only one sqlite transaction is used for all targets.
1525 * It currently lacks support for moves (though this could be changed,
1526 * at which point svn_wc__db_op_delete() becomes redundant).
1528 * This function removes the file externals (and if DELETE_DIR_EXTERNALS is
1529 * TRUE also the directory externals) registered below the targets.
1530 * (DELETE_DIR_EXTERNALS should be true if also removing unversioned nodes)
1532 * If NOTIFY_FUNC is not NULL, then it will be called (with NOTIFY_BATON)
1533 * for each node deleted. While this processing occurs, if CANCEL_FUNC is
1534 * not NULL, then it will be called (with CANCEL_BATON) to detect cancellation
1535 * during the processing.
1537 * Note: the notification (and cancellation) occur outside of a SQLite
1541 svn_wc__db_op_delete_many(svn_wc__db_t *db,
1542 apr_array_header_t *targets,
1543 svn_boolean_t delete_dir_externals,
1544 const svn_skel_t *conflict,
1545 svn_cancel_func_t cancel_func,
1547 svn_wc_notify_func2_t notify_func,
1549 apr_pool_t *scratch_pool);
1552 /* ### mark PATH as (possibly) modified. "svn edit" ... right API here? */
1554 svn_wc__db_op_modified(svn_wc__db_t *db,
1555 const char *local_abspath,
1556 apr_pool_t *scratch_pool);
1559 /* ### use NULL to remove from a changelist.
1561 ### NOTE: only depth=svn_depth_empty is supported right now.
1564 svn_wc__db_op_set_changelist(svn_wc__db_t *db,
1565 const char *local_abspath,
1566 const char *new_changelist,
1567 const apr_array_header_t *changelist_filter,
1569 /* ### flip to CANCEL, then NOTIFY. precedent. */
1570 svn_wc_notify_func2_t notify_func,
1572 svn_cancel_func_t cancel_func,
1574 apr_pool_t *scratch_pool);
1576 /* Record CONFLICT on LOCAL_ABSPATH, potentially replacing other conflicts
1577 recorded on LOCAL_ABSPATH.
1579 Users should in most cases pass CONFLICT to another WC_DB call instead of
1580 calling svn_wc__db_op_mark_conflict() directly outside a transaction, to
1581 allow recording atomically with the operation involved.
1583 Any work items that are necessary as part of marking this node conflicted
1584 can be passed in WORK_ITEMS.
1587 svn_wc__db_op_mark_conflict(svn_wc__db_t *db,
1588 const char *local_abspath,
1589 const svn_skel_t *conflict,
1590 const svn_skel_t *work_items,
1591 apr_pool_t *scratch_pool);
1594 /* ### caller maintains ACTUAL, and how the resolution occurred. we're just
1595 ### recording state.
1597 ### I'm not sure that these three values are the best way to do this,
1598 ### but they're handy for now. */
1600 svn_wc__db_op_mark_resolved(svn_wc__db_t *db,
1601 const char *local_abspath,
1602 svn_boolean_t resolved_text,
1603 svn_boolean_t resolved_props,
1604 svn_boolean_t resolved_tree,
1605 const svn_skel_t *work_items,
1606 apr_pool_t *scratch_pool);
1609 /* Revert all local changes which are being maintained in the database,
1610 * including conflict storage, properties and text modification status.
1612 * Returns SVN_ERR_WC_INVALID_OPERATION_DEPTH if the revert is not
1613 * possible, e.g. copy/delete but not a root, or a copy root with
1616 * At present only depth=empty and depth=infinity are supported.
1618 * This function populates the revert list that can be queried to
1619 * determine what was reverted.
1622 svn_wc__db_op_revert(svn_wc__db_t *db,
1623 const char *local_abspath,
1625 apr_pool_t *result_pool,
1626 apr_pool_t *scratch_pool);
1628 /* Query the revert list for LOCAL_ABSPATH and set *REVERTED if the
1629 * path was reverted. Set *MARKER_FILES to a const char *list of
1630 * marker files if any were recorded on LOCAL_ABSPATH.
1632 * Set *COPIED_HERE if the reverted node was copied here and is the
1633 * operation root of the copy.
1634 * Set *KIND to the node kind of the reverted node.
1636 * Removes the row for LOCAL_ABSPATH from the revert list.
1639 svn_wc__db_revert_list_read(svn_boolean_t *reverted,
1640 const apr_array_header_t **marker_files,
1641 svn_boolean_t *copied_here,
1642 svn_node_kind_t *kind,
1644 const char *local_abspath,
1645 apr_pool_t *result_pool,
1646 apr_pool_t *scratch_pool);
1648 /* The type of elements in the array returned by
1649 * svn_wc__db_revert_list_read_copied_children(). */
1650 typedef struct svn_wc__db_revert_list_copied_child_info_t {
1651 const char *abspath;
1652 svn_node_kind_t kind;
1653 } svn_wc__db_revert_list_copied_child_info_t ;
1655 /* Return in *CHILDREN a list of reverted copied nodes at or within
1656 * LOCAL_ABSPATH (which is a reverted file or a reverted directory).
1657 * Allocate *COPIED_CHILDREN and its elements in RESULT_POOL.
1658 * The elements are of type svn_wc__db_revert_list_copied_child_info_t. */
1660 svn_wc__db_revert_list_read_copied_children(const apr_array_header_t **children,
1662 const char *local_abspath,
1663 apr_pool_t *result_pool,
1664 apr_pool_t *scratch_pool);
1667 /* Make revert notifications for all paths in the revert list that are
1668 * equal to LOCAL_ABSPATH or below LOCAL_ABSPATH.
1670 * Removes all the corresponding rows from the revert list.
1672 * ### Pass in cancel_func?
1675 svn_wc__db_revert_list_notify(svn_wc_notify_func2_t notify_func,
1678 const char *local_abspath,
1679 apr_pool_t *scratch_pool);
1681 /* Clean up after svn_wc__db_op_revert by removing the revert list.
1684 svn_wc__db_revert_list_done(svn_wc__db_t *db,
1685 const char *local_abspath,
1686 apr_pool_t *scratch_pool);
1693 /* @defgroup svn_wc__db_read Read operations on the BASE/WORKING tree
1696 These functions query information about nodes in ACTUAL, and returns
1697 the requested information from the appropriate ACTUAL, WORKING, or
1700 For example, asking for the checksum of the pristine version will
1701 return the one recorded in WORKING, or if no WORKING node exists, then
1702 the checksum comes from BASE.
1705 /* Retrieve information about a node.
1707 For the node implied by LOCAL_ABSPATH from the local filesystem, return
1708 information in the provided OUT parameters. Each OUT parameter may be
1709 NULL, indicating that specific item is not requested.
1711 The information returned comes from the BASE tree, as possibly modified
1712 by the WORKING and ACTUAL trees.
1714 If there is no information about the node, then SVN_ERR_WC_PATH_NOT_FOUND
1717 The OUT parameters, and their "not available" values are:
1718 STATUS n/a (always available)
1719 KIND svn_node_unknown (For ACTUAL only nodes)
1720 REVISION SVN_INVALID_REVNUM
1724 CHANGED_REV SVN_INVALID_REVNUM
1727 DEPTH svn_depth_unknown
1731 ORIGINAL_REPOS_RELPATH NULL
1732 ORIGINAL_ROOT_URL NULL
1734 ORIGINAL_REVISION SVN_INVALID_REVNUM
1738 RECORDED_SIZE SVN_INVALID_FILESIZE
1749 HAVE_MORE_WORK FALSE
1752 When STATUS is requested, then it will be one of these values:
1754 svn_wc__db_status_normal
1755 A plain BASE node, with no local changes.
1757 svn_wc__db_status_added
1758 A node has been added/copied/moved to here. See HAVE_BASE to see
1759 if this change overwrites a BASE node. Use scan_addition() to resolve
1760 whether this has been added, copied, or moved, and the details of the
1761 operation (this function only looks at LOCAL_ABSPATH, but resolving
1762 the details requires scanning one or more ancestor nodes).
1764 svn_wc__db_status_deleted
1765 This node has been deleted or moved away. It may be a delete/move of
1766 a BASE node, or a child node of a subtree that was copied/moved to
1767 an ancestor location. Call scan_deletion() to determine the full
1768 details of the operations upon this node.
1770 svn_wc__db_status_server_excluded
1771 The node is versioned/known by the server, but the server has
1772 decided not to provide further information about the node. This
1773 is a BASE node (since changes are not allowed to this node).
1775 svn_wc__db_status_excluded
1776 The node has been excluded from the working copy tree. This may
1777 be an exclusion from the BASE tree, or an exclusion in the
1778 WORKING tree for a child node of a copied/moved parent.
1780 svn_wc__db_status_not_present
1781 This is a node from the BASE tree, has been marked as "not-present"
1782 within this mixed-revision working copy. This node is at a revision
1783 that is not in the tree, contrary to its inclusion in the parent
1786 svn_wc__db_status_incomplete
1787 The BASE is incomplete due to an interrupted operation. An
1788 incomplete WORKING node will be svn_wc__db_status_added.
1790 If REVISION is requested, it will be set to the revision of the
1791 unmodified (BASE) node, or to SVN_INVALID_REVNUM if any structural
1792 changes have been made to that node (that is, if the node has a row in
1795 If DEPTH is requested, and the node is NOT a directory, then
1796 the value will be set to svn_depth_unknown.
1798 If CHECKSUM is requested, and the node is NOT a file, then it will
1801 If TARGET is requested, and the node is NOT a symlink, then it will
1804 If TRANSLATED_SIZE is requested, and the node is NOT a file, then
1805 it will be set to SVN_INVALID_FILESIZE.
1807 If HAVE_WORK is TRUE, the returned information is from the highest WORKING
1808 layer. In that case HAVE_MORE_WORK and HAVE_BASE provide information about
1809 what other layers exist for this node.
1811 If HAVE_WORK is FALSE and HAVE_BASE is TRUE then the information is from
1814 If HAVE_WORK and HAVE_BASE are both FALSE and when retrieving CONFLICTED,
1815 then the node doesn't exist at all.
1817 If OP_ROOT is requested and the node has a WORKING layer, OP_ROOT will be
1818 set to true if this node is the op_root for this layer.
1820 If HAD_PROPS is requested and the node has pristine props, the value will
1823 If PROPS_MOD is requested and the node has property modification the value
1824 will be set to TRUE.
1826 ### add information about the need to scan upwards to get a complete
1827 ### picture of the state of this node.
1829 ### add some documentation about OUT parameter values based on STATUS ??
1831 ### the TEXT_MOD may become an enumerated value at some point to
1832 ### indicate different states of knowledge about text modifications.
1833 ### for example, an "svn edit" command in the future might set a
1834 ### flag indicating administratively-defined modification. and/or we
1835 ### might have a status indicating that we saw it was modified while
1836 ### performing a filesystem traversal.
1838 All returned data will be allocated in RESULT_POOL. All temporary
1839 allocations will be made in SCRATCH_POOL.
1841 /* ### old docco. needs to be incorporated as appropriate. there is
1842 ### some pending, potential changes to the definition of this API,
1843 ### so not worrying about it just yet.
1845 ### if the node has not been committed (after adding):
1846 ### revision will be SVN_INVALID_REVNUM
1847 ### repos_* will be NULL
1848 ### changed_rev will be SVN_INVALID_REVNUM
1849 ### changed_date will be 0
1850 ### changed_author will be NULL
1851 ### status will be svn_wc__db_status_added
1852 ### text_mod will be TRUE
1853 ### prop_mod will be TRUE if any props have been set
1854 ### base_shadowed will be FALSE
1856 ### if the node is not a copy, or a move destination:
1857 ### original_repos_path will be NULL
1858 ### original_root_url will be NULL
1859 ### original_uuid will be NULL
1860 ### original_revision will be SVN_INVALID_REVNUM
1862 ### note that @a base_shadowed can be derived. if the status specifies
1863 ### an add/copy/move *and* there is a corresponding node in BASE, then
1864 ### the BASE has been deleted to open the way for this node.
1867 svn_wc__db_read_info(svn_wc__db_status_t *status, /* ### derived */
1868 svn_node_kind_t *kind,
1869 svn_revnum_t *revision,
1870 const char **repos_relpath,
1871 const char **repos_root_url,
1872 const char **repos_uuid,
1873 svn_revnum_t *changed_rev,
1874 apr_time_t *changed_date,
1875 const char **changed_author,
1876 svn_depth_t *depth, /* dirs only */
1877 const svn_checksum_t **checksum, /* files only */
1878 const char **target, /* symlinks only */
1880 /* ### the following fields if copied/moved (history) */
1881 const char **original_repos_relpath,
1882 const char **original_root_url,
1883 const char **original_uuid,
1884 svn_revnum_t *original_revision,
1886 /* For BASE nodes */
1887 svn_wc__db_lock_t **lock,
1889 /* Recorded for files present in the working copy */
1890 svn_filesize_t *recorded_size,
1891 apr_time_t *recorded_time,
1894 const char **changelist,
1895 svn_boolean_t *conflicted,
1897 /* ### the followed are derived fields */
1898 svn_boolean_t *op_root,
1900 svn_boolean_t *had_props,
1901 svn_boolean_t *props_mod,
1903 svn_boolean_t *have_base,
1904 svn_boolean_t *have_more_work,
1905 svn_boolean_t *have_work,
1908 const char *local_abspath,
1909 apr_pool_t *result_pool,
1910 apr_pool_t *scratch_pool);
1912 /* Structure used as linked list in svn_wc__db_info_t to describe all nodes
1913 in this location that were moved to another location */
1914 struct svn_wc__db_moved_to_info_t
1916 const char *moved_to_abspath;
1917 const char *shadow_op_root_abspath;
1919 struct svn_wc__db_moved_to_info_t *next;
1922 /* Structure returned by svn_wc__db_read_children_info. Only has the
1923 fields needed by status. */
1924 struct svn_wc__db_info_t {
1925 svn_wc__db_status_t status;
1926 svn_node_kind_t kind;
1927 svn_revnum_t revnum;
1928 const char *repos_relpath;
1929 const char *repos_root_url;
1930 const char *repos_uuid;
1931 svn_revnum_t changed_rev;
1932 const char *changed_author;
1933 apr_time_t changed_date;
1936 svn_filesize_t recorded_size;
1937 apr_time_t recorded_time;
1939 const char *changelist;
1940 svn_boolean_t conflicted;
1942 svn_boolean_t special;
1944 svn_boolean_t op_root;
1946 svn_boolean_t has_checksum;
1947 svn_boolean_t copied;
1948 svn_boolean_t had_props;
1949 svn_boolean_t props_mod;
1951 svn_boolean_t have_base;
1952 svn_boolean_t have_more_work;
1954 svn_boolean_t locked; /* WC directory lock */
1955 svn_wc__db_lock_t *lock; /* Repository file lock */
1956 svn_boolean_t incomplete; /* TRUE if a working node is incomplete */
1958 struct svn_wc__db_moved_to_info_t *moved_to; /* A linked list of locations
1959 where nodes at this path
1960 are moved to. Highest layers
1962 svn_boolean_t moved_here; /* Only on op-roots. */
1964 svn_boolean_t file_external;
1967 /* Return in *NODES a hash mapping name->struct svn_wc__db_info_t for
1968 the children of DIR_ABSPATH, and in *CONFLICTS a hash of names in
1971 The results include any path that was a child of a deleted directory that
1972 existed at LOCAL_ABSPATH, even if that directory is now scheduled to be
1973 replaced by the working node at LOCAL_ABSPATH.
1976 svn_wc__db_read_children_info(apr_hash_t **nodes,
1977 apr_hash_t **conflicts,
1979 const char *dir_abspath,
1980 apr_pool_t *result_pool,
1981 apr_pool_t *scratch_pool);
1983 /* Like svn_wc__db_read_children_info, but only gets an info node for the root
1986 svn_wc__db_read_single_info(const struct svn_wc__db_info_t **info,
1988 const char *local_abspath,
1989 apr_pool_t *result_pool,
1990 apr_pool_t *scratch_pool);
1992 /* Structure returned by svn_wc__db_read_walker_info. Only has the
1993 fields needed by svn_wc__internal_walk_children(). */
1994 struct svn_wc__db_walker_info_t {
1995 svn_wc__db_status_t status;
1996 svn_node_kind_t kind;
1999 /* When a node is deleted in WORKING, some of its information is no longer
2000 available. But in some cases it might still be relevant to obtain this
2001 information even when the information isn't stored in the BASE tree.
2003 This function allows access to that specific information.
2005 When a node is not deleted, this node returns the same information
2006 as svn_wc__db_read_info().
2008 All output arguments are optional and behave in the same way as when
2009 calling svn_wc__db_read_info().
2011 (All other information (like original_*) can be obtained via other apis).
2013 *PROPS maps "const char *" names to "const svn_string_t *" values. If
2014 the pristine node is capable of having properties but has none, set
2015 *PROPS to an empty hash. If its status is such that it cannot have
2016 properties, set *PROPS to NULL.
2019 svn_wc__db_read_pristine_info(svn_wc__db_status_t *status,
2020 svn_node_kind_t *kind,
2021 svn_revnum_t *changed_rev,
2022 apr_time_t *changed_date,
2023 const char **changed_author,
2024 svn_depth_t *depth, /* dirs only */
2025 const svn_checksum_t **checksum, /* files only */
2026 const char **target, /* symlinks only */
2027 svn_boolean_t *had_props,
2030 const char *local_abspath,
2031 apr_pool_t *result_pool,
2032 apr_pool_t *scratch_pool);
2034 /* Gets the information required to install a pristine file to the working copy
2036 Set WCROOT_ABSPATH to the working copy root, SHA1_CHECKSUM to the
2037 checksum of the node (a valid reference into the pristine store)
2038 and PRISTINE_PROPS to the node's pristine properties (to use for
2039 installing the file).
2041 If WRI_ABSPATH is not NULL, check for information in the working copy
2042 identified by WRI_ABSPATH.
2045 svn_wc__db_read_node_install_info(const char **wcroot_abspath,
2046 const svn_checksum_t **sha1_checksum,
2047 apr_hash_t **pristine_props,
2048 apr_time_t *changed_date,
2050 const char *local_abspath,
2051 const char *wri_abspath,
2052 apr_pool_t *result_pool,
2053 apr_pool_t *scratch_pool);
2055 /* Return in *NODES a hash mapping name->struct svn_wc__db_walker_info_t for
2056 the children of DIR_ABSPATH. "name" is the child's name relative to
2057 DIR_ABSPATH, not an absolute path. */
2059 svn_wc__db_read_children_walker_info(apr_hash_t **nodes,
2061 const char *dir_abspath,
2062 apr_pool_t *result_pool,
2063 apr_pool_t *scratch_pool);
2067 * Set *URL to the corresponding url for LOCAL_ABSPATH.
2068 * If the node is added, return the url it will have in the repository.
2071 svn_wc__db_read_url(const char **url,
2073 const char *local_abspath,
2074 apr_pool_t *result_pool,
2075 apr_pool_t *scratch_pool);
2078 /* Set *PROPS to the properties of the node LOCAL_ABSPATH in the ACTUAL
2079 tree (looking through to the WORKING or BASE tree as required).
2081 ### *PROPS will be set to NULL in the following situations:
2084 PROPS maps "const char *" names to "const svn_string_t *" values.
2085 If the node has no properties, set *PROPS to an empty hash.
2086 If the node is not present, return an error.
2087 Allocate *PROPS and its keys and values in RESULT_POOL.
2090 svn_wc__db_read_props(apr_hash_t **props,
2092 const char *local_abspath,
2093 apr_pool_t *result_pool,
2094 apr_pool_t *scratch_pool);
2096 /* Call RECEIVER_FUNC, passing RECEIVER_BATON, an absolute path, and
2097 * a hash table mapping <tt>char *</tt> names onto svn_string_t *
2098 * values for any properties of child nodes of LOCAL_ABSPATH (up to DEPTH).
2100 * If PRISTINE is FALSE, read the properties from the WORKING layer (highest
2101 * op_depth); if PRISTINE is FALSE, local modifications will be visible.
2104 svn_wc__db_read_props_streamily(svn_wc__db_t *db,
2105 const char *local_abspath,
2107 svn_boolean_t pristine,
2108 const apr_array_header_t *changelists,
2109 svn_wc__proplist_receiver_t receiver_func,
2110 void *receiver_baton,
2111 svn_cancel_func_t cancel_func,
2113 apr_pool_t *scratch_pool);
2116 /* Set *PROPS to the properties of the node LOCAL_ABSPATH in the WORKING
2117 tree (looking through to the BASE tree as required).
2119 ### *PROPS will set set to NULL in the following situations:
2120 ### ... tbd. see props.c:svn_wc__get_pristine_props()
2122 *PROPS maps "const char *" names to "const svn_string_t *" values.
2123 If the node has no properties, set *PROPS to an empty hash.
2124 If the node is not present, return an error.
2125 Allocate *PROPS and its keys and values in RESULT_POOL.
2128 svn_wc__db_read_pristine_props(apr_hash_t **props,
2130 const char *local_abspath,
2131 apr_pool_t *result_pool,
2132 apr_pool_t *scratch_pool);
2136 * Set @a *iprops to a depth-first ordered array of
2137 * #svn_prop_inherited_item_t * structures representing the properties
2138 * inherited by @a local_abspath from the ACTUAL tree above
2139 * @a local_abspath (looking through to the WORKING or BASE tree as
2140 * required), up to and including the root of the working copy and
2141 * any cached inherited properties inherited by the root.
2143 * The #svn_prop_inherited_item_t->path_or_url members of the
2144 * #svn_prop_inherited_item_t * structures in @a *iprops are
2145 * paths relative to the repository root URL for cached inherited
2146 * properties and absolute working copy paths otherwise.
2148 * If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to the actual
2149 * properties stored on LOCAL_ABSPATH.
2151 * Allocate @a *iprops in @a result_pool. Use @a scratch_pool
2152 * for temporary allocations.
2155 svn_wc__db_read_inherited_props(apr_array_header_t **iprops,
2156 apr_hash_t **actual_props,
2158 const char *local_abspath,
2159 const char *propname,
2160 apr_pool_t *result_pool,
2161 apr_pool_t *scratch_pool);
2163 /* Read a BASE node's inherited property information.
2165 Set *IPROPS to to a depth-first ordered array of
2166 svn_prop_inherited_item_t * structures representing the cached
2167 inherited properties for the BASE node at LOCAL_ABSPATH.
2169 If no cached properties are found, then set *IPROPS to NULL.
2170 If LOCAL_ABSPATH represents the root of the repository, then set
2171 *IPROPS to an empty array.
2173 Allocate *IPROPS in RESULT_POOL, use SCRATCH_POOL for temporary
2176 svn_wc__db_read_cached_iprops(apr_array_header_t **iprops,
2178 const char *local_abspath,
2179 apr_pool_t *result_pool,
2180 apr_pool_t *scratch_pool);
2182 /* Find BASE nodes with cached inherited properties.
2184 Set *IPROPS_PATHS to a hash mapping const char * absolute working copy
2185 paths to the repos_relpath of the path for each path in the working copy
2186 at or below LOCAL_ABSPATH, limited by DEPTH, that has cached inherited
2187 properties for the BASE node of the path.
2189 Allocate *IPROP_PATHS in RESULT_POOL.
2190 Use SCRATCH_POOL for temporary allocations. */
2192 svn_wc__db_get_children_with_cached_iprops(apr_hash_t **iprop_paths,
2194 const char *local_abspath,
2196 apr_pool_t *result_pool,
2197 apr_pool_t *scratch_pool);
2199 /** Obtain a mapping of const char * local_abspaths to const svn_string_t*
2200 * property values in *VALUES, of all PROPNAME properties on LOCAL_ABSPATH
2201 * and its descendants.
2203 * Allocate the result in RESULT_POOL, and perform temporary allocations in
2207 svn_wc__db_prop_retrieve_recursive(apr_hash_t **values,
2209 const char *local_abspath,
2210 const char *propname,
2211 apr_pool_t *result_pool,
2212 apr_pool_t *scratch_pool);
2214 /* Set *CHILDREN to a new array of the (const char *) basenames of the
2215 immediate children of the working node at LOCAL_ABSPATH in DB.
2217 Return every path that refers to a child of the working node at
2218 LOCAL_ABSPATH. Do not include a path just because it was a child of a
2219 deleted directory that existed at LOCAL_ABSPATH if that directory is now
2220 scheduled to be replaced by the working node at LOCAL_ABSPATH.
2222 Allocate *CHILDREN in RESULT_POOL and do temporary allocations in
2225 ### return some basic info for each child? e.g. kind.
2226 ### maybe the data in _read_get_info should be a structure, and this
2227 ### can return a struct for each one.
2228 ### however: _read_get_info can say "not interested", which isn't the
2229 ### case with a struct. thus, a struct requires fetching and/or
2230 ### computing all info.
2233 svn_wc__db_read_children_of_working_node(const apr_array_header_t **children,
2235 const char *local_abspath,
2236 apr_pool_t *result_pool,
2237 apr_pool_t *scratch_pool);
2239 /* Like svn_wc__db_read_children_of_working_node(), except also include any
2240 path that was a child of a deleted directory that existed at
2241 LOCAL_ABSPATH, even if that directory is now scheduled to be replaced by
2242 the working node at LOCAL_ABSPATH.
2245 svn_wc__db_read_children(const apr_array_header_t **children,
2247 const char *local_abspath,
2248 apr_pool_t *result_pool,
2249 apr_pool_t *scratch_pool);
2251 /* Read into *VICTIMS the basenames of the immediate children of
2252 LOCAL_ABSPATH in DB that are conflicted.
2254 In case of tree conflicts a victim doesn't have to be in the
2257 Allocate *VICTIMS in RESULT_POOL and do temporary allocations in
2259 /* ### This function will probably be removed. */
2261 svn_wc__db_read_conflict_victims(const apr_array_header_t **victims,
2263 const char *local_abspath,
2264 apr_pool_t *result_pool,
2265 apr_pool_t *scratch_pool);
2267 /* Read into *MARKER_FILES the absolute paths of the marker files
2268 of conflicts stored on LOCAL_ABSPATH and its immediate children in DB.
2269 The on-disk files may have been deleted by the user.
2271 Allocate *MARKER_FILES in RESULT_POOL and do temporary allocations
2274 svn_wc__db_get_conflict_marker_files(apr_hash_t **markers,
2276 const char *local_abspath,
2277 apr_pool_t *result_pool,
2278 apr_pool_t *scratch_pool);
2280 /* Read the conflict information recorded on LOCAL_ABSPATH in *CONFLICT,
2281 an editable conflict skel.
2283 If the node exists, but does not have a conflict set *CONFLICT to NULL,
2284 otherwise return a SVN_ERR_WC_PATH_NOT_FOUND error.
2286 Allocate *CONFLICTS in RESULT_POOL and do temporary allocations in
2289 svn_wc__db_read_conflict(svn_skel_t **conflict,
2291 const char *local_abspath,
2292 apr_pool_t *result_pool,
2293 apr_pool_t *scratch_pool);
2296 /* Return the kind of the node in DB at LOCAL_ABSPATH. The WORKING tree will
2297 be examined first, then the BASE tree. If the node is not present in either
2298 tree and ALLOW_MISSING is TRUE, then svn_node_unknown is returned.
2299 If the node is missing and ALLOW_MISSING is FALSE, then it will return
2300 SVN_ERR_WC_PATH_NOT_FOUND.
2302 The SHOW_HIDDEN and SHOW_DELETED flags report certain states as kind none.
2304 When nodes have certain statee they are only reported when:
2305 svn_wc__db_status_not_present when show_hidden && show_deleted
2307 svn_wc__db_status_excluded when show_hidden
2308 svn_wc__db_status_server_excluded when show_hidden
2310 svn_wc__db_status_deleted when show_deleted
2312 In other cases these nodes are reported with *KIND as svn_node_none.
2313 (See also svn_wc_read_kind2()'s documentation)
2315 Uses SCRATCH_POOL for temporary allocations. */
2317 svn_wc__db_read_kind(svn_node_kind_t *kind,
2319 const char *local_abspath,
2320 svn_boolean_t allow_missing,
2321 svn_boolean_t show_deleted,
2322 svn_boolean_t show_hidden,
2323 apr_pool_t *scratch_pool);
2326 /* An analog to svn_wc__entry_is_hidden(). Set *HIDDEN to TRUE if
2327 LOCAL_ABSPATH in DB "is not present, and I haven't scheduled something
2328 over the top of it." */
2330 svn_wc__db_node_hidden(svn_boolean_t *hidden,
2332 const char *local_abspath,
2333 apr_pool_t *scratch_pool);
2335 /* Checks if a node replaces a node in a different layer. Also check if it
2336 replaces a BASE (op_depth 0) node or just a node in a higher layer (a copy).
2337 Finally check if this is the root of the replacement, or if the replacement
2338 is initiated by the parent node.
2340 IS_REPLACE_ROOT (if not NULL) is set to TRUE if the node is the root of a
2341 replacement; otherwise to FALSE.
2343 BASE_REPLACE (if not NULL) is set to TRUE if the node directly or indirectly
2344 replaces a node in the BASE tree; otherwise to FALSE.
2346 IS_REPLACE (if not NULL) is set to TRUE if the node directly replaces a node
2347 in a lower layer; otherwise to FALSE.
2350 svn_wc__db_node_check_replace(svn_boolean_t *is_replace_root,
2351 svn_boolean_t *base_replace,
2352 svn_boolean_t *is_replace,
2354 const char *local_abspath,
2355 apr_pool_t *scratch_pool);
2357 /* ### changelists. return an array, or an iterator interface? how big
2358 ### are these things? are we okay with an in-memory array? examine other
2359 ### changelist usage -- we may already assume the list fits in memory.
2362 /* The DB-private version of svn_wc__is_wcroot(), which see.
2365 svn_wc__db_is_wcroot(svn_boolean_t *is_wcroot,
2367 const char *local_abspath,
2368 apr_pool_t *scratch_pool);
2370 /* Check whether a node is a working copy root and/or switched.
2372 If LOCAL_ABSPATH is the root of a working copy, set *IS_WC_ROOT to TRUE,
2375 If LOCAL_ABSPATH is switched against its parent in the same working copy
2376 set *IS_SWITCHED to TRUE, otherwise to FALSE.
2378 If KIND is not null, set *KIND to the node type of LOCAL_ABSPATH.
2380 Any of the output arguments can be null to specify that the result is not
2381 interesting to the caller.
2383 Use SCRATCH_POOL for temporary allocations.
2386 svn_wc__db_is_switched(svn_boolean_t *is_wcroot,
2387 svn_boolean_t *is_switched,
2388 svn_node_kind_t *kind,
2390 const char *local_abspath,
2391 apr_pool_t *scratch_pool);
2397 /* @defgroup svn_wc__db_global Operations that alter multiple trees
2401 /* Associate LOCAL_DIR_ABSPATH, and all its children with the repository at
2402 at REPOS_ROOT_URL. The relative path to the repos root will not change,
2403 just the repository root. The repos uuid will also remain the same.
2404 This also updates any locks which may exist for the node, as well as any
2405 copyfrom repository information. Finally, the DAV cache (aka
2406 "wcprops") will be reset for affected entries.
2408 Use SCRATCH_POOL for any temporary allocations.
2410 ### local_dir_abspath "should be" the wcroot or a switch root. all URLs
2411 ### under this directory (depth=infinity) will be rewritten.
2413 ### This API had a depth parameter, which was removed, should it be
2414 ### resurrected? What's the purpose if we claim relocate is infinitely
2417 ### Assuming the future ability to copy across repositories, should we
2418 ### refrain from resetting the copyfrom information in this operation?
2421 svn_wc__db_global_relocate(svn_wc__db_t *db,
2422 const char *local_dir_abspath,
2423 const char *repos_root_url,
2424 apr_pool_t *scratch_pool);
2429 ### collapse the WORKING and ACTUAL tree changes down into BASE, called
2430 for each committed node.
2432 NEW_REVISION must be the revision number of the revision created by
2433 the commit. It will become the BASE node's 'revnum' and 'changed_rev'
2434 values in the BASE_NODE table.
2436 CHANGED_REVISION is the new 'last changed' revision. If the node is
2437 modified its value is equivalent to NEW_REVISION, but in case of a
2438 descendant of a copy/move it can be an older revision.
2440 CHANGED_DATE is the (server-side) date of CHANGED_REVISION. It may be 0 if
2441 the revprop is missing on the revision.
2443 CHANGED_AUTHOR is the (server-side) author of CHANGED_REVISION. It may be
2444 NULL if the revprop is missing on the revision.
2446 One or both of NEW_CHECKSUM and NEW_CHILDREN should be NULL. For new:
2447 files: NEW_CHILDREN should be NULL
2448 dirs: NEW_CHECKSUM should be NULL
2449 symlinks: both should be NULL
2451 WORK_ITEMS will be place into the work queue.
2454 svn_wc__db_global_commit(svn_wc__db_t *db,
2455 const char *local_abspath,
2456 svn_revnum_t new_revision,
2457 svn_revnum_t changed_revision,
2458 apr_time_t changed_date,
2459 const char *changed_author,
2460 const svn_checksum_t *new_checksum,
2461 const apr_array_header_t *new_children,
2462 apr_hash_t *new_dav_cache,
2463 svn_boolean_t keep_changelist,
2464 svn_boolean_t no_unlock,
2465 const svn_skel_t *work_items,
2466 apr_pool_t *scratch_pool);
2471 Perform an "update" operation at this node. It will create/modify a BASE
2472 node, and possibly update the ACTUAL tree's node (e.g put the node into
2473 a conflicted state).
2475 ### there may be cases where we need to tweak an existing WORKING node
2477 ### this operations on a single node, but may affect children
2479 ### the repository cannot be changed with this function, but a "switch"
2480 ### (aka changing repos_relpath) is possible
2482 ### one of NEW_CHILDREN, NEW_CHECKSUM, or NEW_TARGET must be provided.
2483 ### the other two values must be NULL.
2484 ### should this be broken out into an update_(directory|file|symlink) ?
2486 ### how does this differ from base_add_*? just the CONFLICT param.
2487 ### the WORK_ITEMS param is new here, but the base_add_* functions
2488 ### should probably grow that. should we instead just (re)use base_add
2489 ### rather than grow a new function?
2491 ### this does not allow a change of depth
2493 ### we do not update a file's TRANSLATED_SIZE here. at some future point,
2494 ### when the file is installed, then a TRANSLATED_SIZE will be set.
2497 svn_wc__db_global_update(svn_wc__db_t *db,
2498 const char *local_abspath,
2499 svn_node_kind_t new_kind,
2500 const char *new_repos_relpath,
2501 svn_revnum_t new_revision,
2502 const apr_hash_t *new_props,
2503 svn_revnum_t new_changed_rev,
2504 apr_time_t new_changed_date,
2505 const char *new_changed_author,
2506 const apr_array_header_t *new_children,
2507 const svn_checksum_t *new_checksum,
2508 const char *new_target,
2509 const apr_hash_t *new_dav_cache,
2510 const svn_skel_t *conflict,
2511 const svn_skel_t *work_items,
2512 apr_pool_t *scratch_pool);
2515 /* Modify the entry of working copy LOCAL_ABSPATH, presumably after an update
2516 of depth DEPTH completes. If LOCAL_ABSPATH doesn't exist, this routine
2519 Set the node's repository relpath, repository root, repository uuid and
2520 revision to NEW_REPOS_RELPATH, NEW_REPOS_ROOT and NEW_REPOS_UUID. If
2521 NEW_REPOS_RELPATH is null, the repository location is untouched; if
2522 NEW_REVISION in invalid, the working revision field is untouched.
2523 The modifications are mutually exclusive. If NEW_REPOS_ROOT is non-NULL,
2524 set the repository root of the entry to NEW_REPOS_ROOT.
2526 If LOCAL_ABSPATH is a directory, then, walk entries below LOCAL_ABSPATH
2527 according to DEPTH thusly:
2529 If DEPTH is svn_depth_infinity, perform the following actions on
2530 every entry below PATH; if svn_depth_immediates, svn_depth_files,
2531 or svn_depth_empty, perform them only on LOCAL_ABSPATH.
2533 If NEW_REVISION is valid, then tweak every entry to have this new
2534 working revision (excluding files that are scheduled for addition
2535 or replacement). Likewise, if BASE_URL is non-null, then rewrite
2536 all urls to be "telescoping" children of the base_url.
2538 EXCLUDE_RELPATHS is a hash containing const char *local_relpath. Nodes
2539 for pathnames contained in EXCLUDE_RELPATHS are not touched by this
2540 function. These pathnames should be paths relative to the wcroot.
2542 If WCROOT_IPROPS is not NULL it is a hash mapping const char * absolute
2543 working copy paths to depth-first ordered arrays of
2544 svn_prop_inherited_item_t * structures. If LOCAL_ABSPATH exists in
2545 WCROOT_IPROPS, then set the hashed value as the node's inherited
2549 svn_wc__db_op_bump_revisions_post_update(svn_wc__db_t *db,
2550 const char *local_abspath,
2552 const char *new_repos_relpath,
2553 const char *new_repos_root_url,
2554 const char *new_repos_uuid,
2555 svn_revnum_t new_revision,
2556 apr_hash_t *exclude_relpaths,
2557 apr_hash_t *wcroot_iprops,
2558 svn_wc_notify_func2_t notify_func,
2560 apr_pool_t *scratch_pool);
2563 /* Record the RECORDED_SIZE and RECORDED_TIME for a versioned node.
2565 This function will record the information within the WORKING node,
2566 if present, or within the BASE tree. If neither node is present, then
2567 SVN_ERR_WC_PATH_NOT_FOUND will be returned.
2569 RECORDED_SIZE may be SVN_INVALID_FILESIZE, which will be recorded
2570 as such, implying "unknown size".
2572 RECORDED_TIME may be 0, which will be recorded as such, implying
2573 "unknown last mod time".
2576 svn_wc__db_global_record_fileinfo(svn_wc__db_t *db,
2577 const char *local_abspath,
2578 svn_filesize_t recorded_size,
2579 apr_time_t recorded_time,
2580 apr_pool_t *scratch_pool);
2583 /* ### post-commit handling.
2584 ### maybe multiple phases?
2585 ### 1) mark a changelist as being-committed
2586 ### 2) collect ACTUAL content, store for future use as TEXTBASE
2587 ### 3) caller performs commit
2588 ### 4) post-commit, integrate changelist into BASE
2595 /* @defgroup svn_wc__db_lock Function to manage the LOCKS table.
2599 /* Add or replace LOCK for LOCAL_ABSPATH to DB. */
2601 svn_wc__db_lock_add(svn_wc__db_t *db,
2602 const char *local_abspath,
2603 const svn_wc__db_lock_t *lock,
2604 apr_pool_t *scratch_pool);
2607 /* Remove any lock for LOCAL_ABSPATH in DB. */
2609 svn_wc__db_lock_remove(svn_wc__db_t *db,
2610 const char *local_abspath,
2611 apr_pool_t *scratch_pool);
2617 /* @defgroup svn_wc__db_scan Functions to scan up a tree for further data.
2621 /* Read a BASE node's repository information.
2623 For the BASE node implied by LOCAL_ABSPATH, its location in the repository
2624 returned in *REPOS_ROOT_URL and *REPOS_UUID will be returned in
2625 *REPOS_RELPATH. Any of the OUT parameters may be NULL, indicating no
2626 interest in that piece of information.
2628 All returned data will be allocated in RESULT_POOL. All temporary
2629 allocations will be made in SCRATCH_POOL.
2631 ### Either delete this function and use _base_get_info instead, or
2632 ### add a 'revision' output to make a complete repository node location
2633 ### and rename to not say 'scan', because it doesn't.
2636 svn_wc__db_scan_base_repos(const char **repos_relpath,
2637 const char **repos_root_url,
2638 const char **repos_uuid,
2640 const char *local_abspath,
2641 apr_pool_t *result_pool,
2642 apr_pool_t *scratch_pool);
2645 /* Scan upwards for information about a known addition to the WORKING tree.
2647 IFF a node's status as returned by svn_wc__db_read_info() is
2648 svn_wc__db_status_added (NOT obstructed_add!), then this function
2649 returns a refined status in *STATUS, which is one of:
2651 svn_wc__db_status_added -- this NODE is a simple add without history.
2652 OP_ROOT_ABSPATH will be set to the topmost node in the added subtree
2653 (implying its parent will be an unshadowed BASE node). The REPOS_*
2654 values will be implied by that ancestor BASE node and this node's
2655 position in the added subtree. ORIGINAL_* will be set to their
2656 NULL values (and SVN_INVALID_REVNUM for ORIGINAL_REVISION).
2658 svn_wc__db_status_copied -- this NODE is the root or child of a copy.
2659 The root of the copy will be stored in OP_ROOT_ABSPATH. Note that
2660 the parent of the operation root could be another WORKING node (from
2661 an add, copy, or move). The REPOS_* values will be implied by the
2662 ancestor unshadowed BASE node. ORIGINAL_* will indicate the source
2665 svn_wc__db_status_incomplete -- this NODE is copied but incomplete.
2667 svn_wc__db_status_moved_here -- this NODE arrived as a result of a move.
2668 The root of the moved nodes will be stored in OP_ROOT_ABSPATH.
2669 Similar to the copied state, its parent may be a WORKING node or a
2670 BASE node. And again, the REPOS_* values are implied by this node's
2671 position in the subtree under the ancestor unshadowed BASE node.
2672 ORIGINAL_* will indicate the source of the move.
2674 All OUT parameters may be NULL to indicate a lack of interest in
2675 that piece of information.
2677 STATUS, OP_ROOT_ABSPATH, and REPOS_* will always be assigned a value
2678 if that information is requested (and assuming a successful return).
2680 ORIGINAL_REPOS_RELPATH will refer to the *root* of the operation. It
2681 does *not* correspond to the node given by LOCAL_ABSPATH. The caller
2682 can use the suffix on LOCAL_ABSPATH (relative to OP_ROOT_ABSPATH) in
2683 order to compute the source node which corresponds to LOCAL_ABSPATH.
2685 If the node given by LOCAL_ABSPATH does not have changes recorded in
2686 the WORKING tree, then SVN_ERR_WC_PATH_NOT_FOUND is returned. If it
2687 doesn't have an "added" status, then SVN_ERR_WC_PATH_UNEXPECTED_STATUS
2690 All returned data will be allocated in RESULT_POOL. All temporary
2691 allocations will be made in SCRATCH_POOL.
2694 svn_wc__db_scan_addition(svn_wc__db_status_t *status,
2695 const char **op_root_abspath,
2696 const char **repos_relpath,
2697 const char **repos_root_url,
2698 const char **repos_uuid,
2699 const char **original_repos_relpath,
2700 const char **original_root_url,
2701 const char **original_uuid,
2702 svn_revnum_t *original_revision,
2704 const char *local_abspath,
2705 apr_pool_t *result_pool,
2706 apr_pool_t *scratch_pool);
2708 /* Scan the working copy for move information of the node LOCAL_ABSPATH.
2709 * If LOCAL_ABSPATH return a SVN_ERR_WC_PATH_UNEXPECTED_STATUS error.
2711 * If not NULL *MOVED_FROM_ABSPATH will be set to the previous location
2712 * of LOCAL_ABSPATH, before it or an ancestror was moved.
2714 * If not NULL *OP_ROOT_ABSPATH will be set to the new location of the
2715 * path that was actually moved
2717 * If not NULL *OP_ROOT_MOVED_FROM_ABSPATH will be set to the old location
2718 * of the path that was actually moved.
2720 * If not NULL *MOVED_FROM_DELETE_ABSPATH will be set to the ancestor of the
2721 * moved from location that deletes the original location
2723 * Given a working copy
2728 * You can call this function on D and D/C. When called on D/C all output
2729 * MOVED_FROM_ABSPATH will be A/B/C
2730 * OP_ROOT_ABSPATH will be D
2731 * OP_ROOT_MOVED_FROM_ABSPATH will be A/B
2732 * MOVED_FROM_DELETE_ABSPATH will be A
2735 svn_wc__db_scan_moved(const char **moved_from_abspath,
2736 const char **op_root_abspath,
2737 const char **op_root_moved_from_abspath,
2738 const char **moved_from_delete_abspath,
2740 const char *local_abspath,
2741 apr_pool_t *result_pool,
2742 apr_pool_t *scratch_pool);
2744 /* Scan upwards for additional information about a deleted node.
2746 When a deleted node is discovered in the WORKING tree, the situation
2747 may be quite complex. This function will provide the information to
2748 resolve the circumstances of the deletion.
2750 For discussion purposes, we will start with the most complex example
2751 and then demonstrate simplified examples. Consider node B/W/D/N has been
2752 found as deleted. B is an unmodified directory (thus, only in BASE). W is
2753 "replacement" content that exists in WORKING, shadowing a similar B/W
2754 directory in BASE. D is a deleted subtree in the WORKING tree, and N is
2757 In this example, BASE_DEL_ABSPATH will bet set to B/W. That is the root of
2758 the BASE tree (implicitly) deleted by the replacement. WORK_DEL_ABSPATH
2759 will be set to the subtree deleted within the replacement; in this case,
2760 B/W/D. No move-away took place, so MOVED_TO_ABSPATH is set to NULL.
2762 In another scenario, B/W was moved-away before W was put into the WORKING
2763 tree through an add/copy/move-here. MOVED_TO_ABSPATH will indicate where
2764 B/W was moved to. Note that further operations may have been performed
2765 post-move, but that is not known or reported by this function.
2767 If BASE does not have a B/W, then the WORKING B/W is not a replacement,
2768 but a simple add/copy/move-here. BASE_DEL_ABSPATH will be set to NULL.
2770 If B/W/D does not exist in the WORKING tree (we're only talking about a
2771 deletion of nodes of the BASE tree), then deleting B/W/D would have marked
2772 the subtree for deletion. BASE_DEL_ABSPATH will refer to B/W/D,
2773 MOVED_TO_ABSPATH will be NULL, and WORK_DEL_ABSPATH will be NULL.
2775 If the BASE node B/W/D was moved instead of deleted, then MOVED_TO_ABSPATH
2776 would indicate the target location (and other OUT values as above).
2778 When the user deletes B/W/D from the WORKING tree, there are a few
2779 additional considerations. If B/W is a simple addition (not a copy or
2780 a move-here), then the deletion will simply remove the nodes from WORKING
2781 and possibly leave behind "base-delete" markers in the WORKING tree.
2782 If the source is a copy/moved-here, then the nodes are replaced with
2785 If the user moves-away B/W/D from the WORKING tree, then behavior is
2786 again dependent upon the origination of B/W. For a plain add, the nodes
2787 simply move to the destination; this means that B/W/D ceases to be a
2788 node and so cannot be scanned. For a copy, a deletion is made at B/W/D,
2789 and a new copy (of a subtree of the original source) is made at the
2790 destination. For a move-here, a deletion is made, and a copy is made at
2791 the destination (we do not track multiple moves; the source is moved to
2792 B/W, then B/W/D is deleted; then a copy is made at the destination;
2793 however, note the double-move could have been performed by moving the
2794 subtree first, then moving the source to B/W).
2796 There are three further considerations when resolving a deleted node:
2798 If the BASE B/W/D was deleted explicitly *and* B/W is a replacement,
2799 then the explicit deletion is subsumed by the implicit deletion that
2800 occurred with the B/W replacement. Thus, BASE_DEL_ABSPATH will point
2801 to B/W as the root of the BASE deletion. IOW, we can detect the
2802 explicit move-away, but not an explicit deletion.
2804 If B/W/D/N refers to a node present in the BASE tree, and B/W was
2805 replaced by a shallow subtree, then it is possible for N to be
2806 reported as deleted (from BASE) yet no deletions occurred in the
2807 WORKING tree above N. Thus, WORK_DEL_ABSPATH will be set to NULL.
2810 Summary of OUT parameters:
2812 BASE_DEL_ABSPATH will specify the nearest ancestor of the explicit or
2813 implicit deletion (if any) that applies to the BASE tree.
2815 WORK_DEL_ABSPATH will specify the root of a deleted subtree within
2816 the WORKING tree (note there is no concept of layered delete operations
2817 in WORKING, so there is only one deletion root in the ancestry).
2819 MOVED_TO_ABSPATH will specify the path where this node was moved to
2820 if the node has moved-away.
2822 If the node was moved-away, MOVED_TO_OP_ROOT_ABSPATH will specify the
2823 target path of the root of the move operation. If LOCAL_ABSPATH itself
2824 is the source path of the root of the move operation, then
2825 MOVED_TO_OP_ROOT_ABSPATH equals MOVED_TO_ABSPATH.
2827 All OUT parameters may be set to NULL to indicate a lack of interest in
2828 that piece of information.
2830 If the node given by LOCAL_ABSPATH does not exist, then
2831 SVN_ERR_WC_PATH_NOT_FOUND is returned. If it doesn't have a "deleted"
2832 status, then SVN_ERR_WC_PATH_UNEXPECTED_STATUS will be returned.
2834 All returned data will be allocated in RESULT_POOL. All temporary
2835 allocations will be made in SCRATCH_POOL.
2838 svn_wc__db_scan_deletion(const char **base_del_abspath,
2839 const char **moved_to_abspath,
2840 const char **work_del_abspath,
2841 const char **moved_to_op_root_abspath,
2843 const char *local_abspath,
2844 apr_pool_t *result_pool,
2845 apr_pool_t *scratch_pool);
2851 /* @defgroup svn_wc__db_upgrade Functions for upgrading a working copy.
2855 /* Installs or updates Sqlite schema statistics for the current (aka latest)
2856 working copy schema.
2858 This function should be called once on initializing the database and after
2859 an schema update completes */
2861 svn_wc__db_install_schema_statistics(svn_sqlite__db_t *sdb,
2862 apr_pool_t *scratch_pool);
2865 /* Create a new wc.db file for LOCAL_DIR_ABSPATH, which is going to be a
2866 working copy for the repository REPOS_ROOT_URL with uuid REPOS_UUID.
2867 Return the raw sqlite handle, repository id and working copy id
2868 and store the database in WC_DB.
2870 Perform temporary allocations in SCRATCH_POOL. */
2872 svn_wc__db_upgrade_begin(svn_sqlite__db_t **sdb,
2873 apr_int64_t *repos_id,
2875 svn_wc__db_t *wc_db,
2876 const char *local_dir_abspath,
2877 const char *repos_root_url,
2878 const char *repos_uuid,
2879 apr_pool_t *scratch_pool);
2883 svn_wc__db_upgrade_apply_dav_cache(svn_sqlite__db_t *sdb,
2884 const char *dir_relpath,
2885 apr_hash_t *cache_values,
2886 apr_pool_t *scratch_pool);
2889 /* ### need much more docco
2891 ### this function should be called within a sqlite transaction. it makes
2892 ### assumptions around this fact.
2894 Apply the various sets of properties to the database nodes based on
2895 their existence/presence, the current state of the node, and the original
2896 format of the working copy which provided these property sets.
2899 svn_wc__db_upgrade_apply_props(svn_sqlite__db_t *sdb,
2900 const char *dir_abspath,
2901 const char *local_relpath,
2902 apr_hash_t *base_props,
2903 apr_hash_t *revert_props,
2904 apr_hash_t *working_props,
2905 int original_format,
2907 apr_pool_t *scratch_pool);
2909 /* Simply insert (or replace) one row in the EXTERNALS table. */
2911 svn_wc__db_upgrade_insert_external(svn_wc__db_t *db,
2912 const char *local_abspath,
2913 svn_node_kind_t kind,
2914 const char *parent_abspath,
2915 const char *def_local_abspath,
2916 const char *repos_relpath,
2917 const char *repos_root_url,
2918 const char *repos_uuid,
2919 svn_revnum_t def_peg_revision,
2920 svn_revnum_t def_revision,
2921 apr_pool_t *scratch_pool);
2923 /* Get the repository identifier corresponding to REPOS_ROOT_URL from the
2924 database in SDB. The value is returned in *REPOS_ID. All allocations
2925 are allocated in SCRATCH_POOL.
2927 NOTE: the row in REPOSITORY must exist. If not, then SVN_ERR_WC_DB_ERROR
2930 ### unclear on whether/how this interface will stay/evolve. */
2932 svn_wc__db_upgrade_get_repos_id(apr_int64_t *repos_id,
2933 svn_sqlite__db_t *sdb,
2934 const char *repos_root_url,
2935 apr_pool_t *scratch_pool);
2937 /* Upgrade the metadata concerning the WC at WCROOT_ABSPATH, in DB,
2938 * to the SVN_WC__VERSION format.
2940 * This function is used for upgrading wc-ng working copies to a newer
2941 * wc-ng format. If a pre-1.7 working copy is found, this function
2942 * returns SVN_ERR_WC_UPGRADE_REQUIRED.
2944 * Upgrading subdirectories of a working copy is not supported.
2945 * If WCROOT_ABSPATH is not a working copy root SVN_ERR_WC_INVALID_OP_ON_CWD
2948 * If BUMPED_FORMAT is not NULL, set *BUMPED_FORMAT to TRUE if the format
2949 * was bumped or to FALSE if the wc was already at the resulting format.
2952 svn_wc__db_bump_format(int *result_format,
2953 svn_boolean_t *bumped_format,
2955 const char *wcroot_abspath,
2956 apr_pool_t *scratch_pool);
2961 /* @defgroup svn_wc__db_wq Work queue manipulation. see workqueue.h
2965 /* In the WCROOT associated with DB and WRI_ABSPATH, add WORK_ITEM to the
2966 wcroot's work queue. Use SCRATCH_POOL for all temporary allocations. */
2968 svn_wc__db_wq_add(svn_wc__db_t *db,
2969 const char *wri_abspath,
2970 const svn_skel_t *work_item,
2971 apr_pool_t *scratch_pool);
2974 /* In the WCROOT associated with DB and WRI_ABSPATH, fetch a work item that
2975 needs to be completed. Its identifier is returned in ID, and the data in
2978 Items are returned in the same order they were queued. This allows for
2979 (say) queueing work on a parent node to be handled before that of its
2982 If there are no work items to be completed, then ID will be set to zero,
2983 and WORK_ITEM to NULL.
2985 If COMPLETED_ID is not 0, the wq item COMPLETED_ID will be marked as
2986 completed before returning the next item.
2988 RESULT_POOL will be used to allocate WORK_ITEM, and SCRATCH_POOL
2989 will be used for all temporary allocations. */
2991 svn_wc__db_wq_fetch_next(apr_uint64_t *id,
2992 svn_skel_t **work_item,
2994 const char *wri_abspath,
2995 apr_uint64_t completed_id,
2996 apr_pool_t *result_pool,
2997 apr_pool_t *scratch_pool);
2999 /* Special variant of svn_wc__db_wq_fetch_next(), which in the same transaction
3000 also records timestamps and sizes for one or more nodes */
3002 svn_wc__db_wq_record_and_fetch_next(apr_uint64_t *id,
3003 svn_skel_t **work_item,
3005 const char *wri_abspath,
3006 apr_uint64_t completed_id,
3007 apr_hash_t *record_map,
3008 apr_pool_t *result_pool,
3009 apr_pool_t *scratch_pool);
3015 /* Note: LEVELS_TO_LOCK is here strictly for backward compat. The access
3016 batons still have the notion of 'levels to lock' and we need to ensure
3017 that they still function correctly, even in the new world. 'levels to
3018 lock' should not be exposed through the wc-ng APIs at all: users either
3019 get to lock the entire tree (rooted at some subdir, of course), or none.
3021 An infinite depth lock is obtained with LEVELS_TO_LOCK set to -1, but until
3022 we move to a single DB only depth 0 is supported.
3025 svn_wc__db_wclock_obtain(svn_wc__db_t *db,
3026 const char *local_abspath,
3028 svn_boolean_t steal_lock,
3029 apr_pool_t *scratch_pool);
3031 /* Set LOCK_ABSPATH to the path of the the directory that owns the
3032 lock on LOCAL_ABSPATH, or NULL, if LOCAL_ABSPATH is not locked. */
3034 svn_wc__db_wclock_find_root(const char **lock_abspath,
3036 const char *local_abspath,
3037 apr_pool_t *result_pool,
3038 apr_pool_t *scratch_pool);
3040 /* Check if somebody has a wclock on LOCAL_ABSPATH */
3042 svn_wc__db_wclocked(svn_boolean_t *locked,
3044 const char *local_abspath,
3045 apr_pool_t *scratch_pool);
3047 /* Release the previously obtained lock on LOCAL_ABSPATH */
3049 svn_wc__db_wclock_release(svn_wc__db_t *db,
3050 const char *local_abspath,
3051 apr_pool_t *scratch_pool);
3053 /* Checks whether DB currently owns a lock to operate on LOCAL_ABSPATH.
3054 If EXACT is TRUE only lock roots are checked. */
3056 svn_wc__db_wclock_owns_lock(svn_boolean_t *own_lock,
3058 const char *local_abspath,
3059 svn_boolean_t exact,
3060 apr_pool_t *scratch_pool);
3064 /* @defgroup svn_wc__db_temp Various temporary functions during transition
3066 ### These functions SHOULD be completely removed before 1.7
3071 /* Removes all references to LOCAL_ABSPATH from DB, while optionally leaving
3074 This operation always recursively removes all nodes at and below
3075 LOCAL_ABSPATH from NODES and ACTUAL.
3077 If NOT_PRESENT_REVISION specifies a valid revision, leave a not_present
3078 BASE node at local_abspath of the specified status and kind.
3079 (Requires an existing BASE node before removing)
3081 If DESTROY_WC is TRUE, this operation *installs* workqueue operations to
3082 update the local filesystem after the database operation. If DESTROY_CHANGES
3083 is FALSE, modified and unversioned files are left after running this
3084 operation (and the WQ). If DESTROY_CHANGES and DESTROY_WC are TRUE,
3085 LOCAL_ABSPATH and everything below it will be removed by the WQ.
3088 Note: Unlike many similar functions it is a valid scenario for this
3089 function to be called on a wcroot! In this case it will just leave the root
3093 svn_wc__db_op_remove_node(svn_boolean_t *left_changes,
3095 const char *local_abspath,
3096 svn_boolean_t destroy_wc,
3097 svn_boolean_t destroy_changes,
3098 svn_revnum_t not_present_revision,
3099 svn_wc__db_status_t not_present_status,
3100 svn_node_kind_t not_present_kind,
3101 const svn_skel_t *conflict,
3102 const svn_skel_t *work_items,
3103 svn_cancel_func_t cancel_func,
3105 apr_pool_t *scratch_pool);
3107 /* Sets the depth of LOCAL_ABSPATH in its working copy to DEPTH using DB.
3109 Returns SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not a BASE directory
3112 svn_wc__db_op_set_base_depth(svn_wc__db_t *db,
3113 const char *local_abspath,
3115 apr_pool_t *scratch_pool);
3117 /* ### temp function. return the FORMAT for the directory LOCAL_ABSPATH. */
3119 svn_wc__db_temp_get_format(int *format,
3121 const char *local_dir_abspath,
3122 apr_pool_t *scratch_pool);
3124 /* ### temp functions to manage/store access batons within the DB. */
3125 svn_wc_adm_access_t *
3126 svn_wc__db_temp_get_access(svn_wc__db_t *db,
3127 const char *local_dir_abspath,
3128 apr_pool_t *scratch_pool);
3130 svn_wc__db_temp_set_access(svn_wc__db_t *db,
3131 const char *local_dir_abspath,
3132 svn_wc_adm_access_t *adm_access,
3133 apr_pool_t *scratch_pool);
3135 svn_wc__db_temp_close_access(svn_wc__db_t *db,
3136 const char *local_dir_abspath,
3137 svn_wc_adm_access_t *adm_access,
3138 apr_pool_t *scratch_pool);
3140 svn_wc__db_temp_clear_access(svn_wc__db_t *db,
3141 const char *local_dir_abspath,
3142 apr_pool_t *scratch_pool);
3144 /* ### shallow hash: abspath -> svn_wc_adm_access_t * */
3146 svn_wc__db_temp_get_all_access(svn_wc__db_t *db,
3147 apr_pool_t *result_pool);
3149 /* ### temp function to open the sqlite database to the appropriate location,
3150 ### then borrow it for a bit.
3151 ### The *only* reason for this function is because entries.c still
3152 ### manually hacks the sqlite database.
3154 ### No matter how tempted you may be DO NOT USE THIS FUNCTION!
3155 ### (if you do, gstein will hunt you down and burn your knee caps off
3156 ### in the middle of the night)
3157 ### "Bet on it." --gstein
3160 svn_wc__db_temp_borrow_sdb(svn_sqlite__db_t **sdb,
3162 const char *local_dir_abspath,
3163 apr_pool_t *scratch_pool);
3166 /* Return a directory in *TEMP_DIR_ABSPATH that is suitable for temporary
3167 files which may need to be moved (atomically and same-device) into the
3168 working copy indicated by WRI_ABSPATH. */
3170 svn_wc__db_temp_wcroot_tempdir(const char **temp_dir_abspath,
3172 const char *wri_abspath,
3173 apr_pool_t *result_pool,
3174 apr_pool_t *scratch_pool);
3176 /* Update the BASE_NODE of directory LOCAL_ABSPATH to be NEW_REPOS_RELPATH
3177 at revision NEW_REV with status incomplete. */
3179 svn_wc__db_temp_op_start_directory_update(svn_wc__db_t *db,
3180 const char *local_abspath,
3181 const char *new_repos_relpath,
3182 svn_revnum_t new_rev,
3183 apr_pool_t *scratch_pool);
3185 /* Marks a directory update started with
3186 svn_wc__db_temp_op_start_directory_update as completed, by removing
3187 the incomplete status */
3189 svn_wc__db_temp_op_end_directory_update(svn_wc__db_t *db,
3190 const char *local_dir_abspath,
3191 apr_pool_t *scratch_pool);
3194 /* Copy the base tree at LOCAL_ABSPATH into the working tree as copy,
3195 leaving any subtree additions and copies as-is. This allows the
3196 base node tree to be removed. */
3198 svn_wc__db_op_make_copy(svn_wc__db_t *db,
3199 const char *local_abspath,
3200 const svn_skel_t *conflicts,
3201 const svn_skel_t *work_items,
3202 apr_pool_t *scratch_pool);
3204 /* Close the wc root LOCAL_ABSPATH and remove any per-directory
3205 handles associated with it. */
3207 svn_wc__db_drop_root(svn_wc__db_t *db,
3208 const char *local_abspath,
3209 apr_pool_t *scratch_pool);
3211 /* Return the OP_DEPTH for LOCAL_RELPATH. */
3213 svn_wc__db_op_depth_for_upgrade(const char *local_relpath);
3215 /* Set *HAVE_WORK TRUE if there is a working layer below the top layer and
3216 *HAVE_BASE if there is a base layer. Set *STATUS to the status of the
3217 highest layer below WORKING */
3219 svn_wc__db_info_below_working(svn_boolean_t *have_base,
3220 svn_boolean_t *have_work,
3221 svn_wc__db_status_t *status,
3223 const char *local_abspath,
3224 apr_pool_t *scratch_pool);
3227 /* Gets an array of const char *local_relpaths of descendants of LOCAL_ABSPATH,
3228 * which itself must be the op root of an addition, copy or move.
3229 * The descendants returned are at the same op_depth, but are to be deleted
3230 * by the commit processing because they are not present in the local copy.
3233 svn_wc__db_get_not_present_descendants(const apr_array_header_t **descendants,
3235 const char *local_abspath,
3236 apr_pool_t *result_pool,
3237 apr_pool_t *scratch_pool);
3239 /* Gather revision status information about a working copy using DB.
3241 * Set *MIN_REVISION and *MAX_REVISION to the lowest and highest revision
3242 * numbers found within LOCAL_ABSPATH.
3243 * Only nodes with op_depth zero and presence 'normal' or 'incomplete'
3244 * are considered, so that added, deleted or excluded nodes do not affect
3245 * the result. If COMMITTED is TRUE, set *MIN_REVISION and *MAX_REVISION
3246 * to the lowest and highest committed (i.e. "last changed") revision numbers,
3249 * Indicate in *IS_SPARSE_CHECKOUT whether any of the nodes within
3250 * LOCAL_ABSPATH is sparse.
3251 * Indicate in *IS_MODIFIED whether the working copy has local modifications.
3253 * Indicate in *IS_SWITCHED whether any node beneath LOCAL_ABSPATH
3254 * is switched. If TRAIL_URL is non-NULL, use it to determine if LOCAL_ABSPATH
3255 * itself is switched. It should be any trailing portion of LOCAL_ABSPATH's
3256 * expected URL, long enough to include any parts that the caller considers
3257 * might be changed by a switch. If it does not match the end of WC_PATH's
3258 * actual URL, then report a "switched" status.
3260 * See also the functions below which provide a subset of this functionality.
3263 svn_wc__db_revision_status(svn_revnum_t *min_revision,
3264 svn_revnum_t *max_revision,
3265 svn_boolean_t *is_sparse_checkout,
3266 svn_boolean_t *is_modified,
3267 svn_boolean_t *is_switched,
3269 const char *local_abspath,
3270 const char *trail_url,
3271 svn_boolean_t committed,
3272 svn_cancel_func_t cancel_func,
3274 apr_pool_t *scratch_pool);
3276 /* Set *MIN_REVISION and *MAX_REVISION to the lowest and highest revision
3277 * numbers found within LOCAL_ABSPATH in the working copy using DB.
3278 * Only nodes with op_depth zero and presence 'normal' or 'incomplete'
3279 * are considered, so that added, deleted or excluded nodes do not affect
3280 * the result. If COMMITTED is TRUE, set *MIN_REVISION and *MAX_REVISION
3281 * to the lowest and highest committed (i.e. "last changed") revision numbers,
3282 * respectively. Use SCRATCH_POOL for temporary allocations.
3284 * Either of MIN_REVISION and MAX_REVISION may be passed as NULL if
3285 * the caller doesn't care about that return value.
3287 * This function provides a subset of the functionality of
3288 * svn_wc__db_revision_status() and is more efficient if the caller
3289 * doesn't need all information returned by svn_wc__db_revision_status(). */
3291 svn_wc__db_min_max_revisions(svn_revnum_t *min_revision,
3292 svn_revnum_t *max_revision,
3294 const char *local_abspath,
3295 svn_boolean_t committed,
3296 apr_pool_t *scratch_pool);
3298 /* Indicate in *IS_SWITCHED whether any node beneath LOCAL_ABSPATH
3299 * is switched, using DB. Use SCRATCH_POOL for temporary allocations.
3301 * If TRAIL_URL is non-NULL, use it to determine if LOCAL_ABSPATH itself
3302 * is switched. It should be any trailing portion of LOCAL_ABSPATH's
3303 * expected URL, long enough to include any parts that the caller considers
3304 * might be changed by a switch. If it does not match the end of WC_PATH's
3305 * actual URL, then report a "switched" status.
3307 * This function provides a subset of the functionality of
3308 * svn_wc__db_revision_status() and is more efficient if the caller
3309 * doesn't need all information returned by svn_wc__db_revision_status(). */
3311 svn_wc__db_has_switched_subtrees(svn_boolean_t *is_switched,
3313 const char *local_abspath,
3314 const char *trail_url,
3315 apr_pool_t *scratch_pool);
3317 /* Set @a *excluded_subtrees to a hash mapping <tt>const char *</tt>
3318 * local absolute paths to <tt>const char *</tt> local absolute paths for
3319 * every path under @a local_abspath in @a db which are excluded by
3320 * the server (e.g. due to authz), or user. If no such paths are found then
3321 * @a *server_excluded_subtrees is set to @c NULL.
3322 * Allocate the hash and all items therein from @a result_pool.
3325 svn_wc__db_get_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
3327 const char *local_abspath,
3328 apr_pool_t *result_pool,
3329 apr_pool_t *scratch_pool);
3331 /* Indicate in *IS_MODIFIED whether the working copy has local modifications,
3332 * using DB. Use SCRATCH_POOL for temporary allocations.
3334 * This function provides a subset of the functionality of
3335 * svn_wc__db_revision_status() and is more efficient if the caller
3336 * doesn't need all information returned by svn_wc__db_revision_status(). */
3338 svn_wc__db_has_local_mods(svn_boolean_t *is_modified,
3340 const char *local_abspath,
3341 svn_cancel_func_t cancel_func,
3343 apr_pool_t *scratch_pool);
3346 /* Verify the consistency of metadata concerning the WC that contains
3347 * WRI_ABSPATH, in DB. Return an error if any problem is found. */
3349 svn_wc__db_verify(svn_wc__db_t *db,
3350 const char *wri_abspath,
3351 apr_pool_t *scratch_pool);
3354 /* Possibly need two structures, one with relpaths and with abspaths?
3355 * Only exposed for testing at present. */
3356 struct svn_wc__db_moved_to_t {
3357 const char *local_relpath; /* moved-to destination */
3358 int op_depth; /* op-root of source */
3361 /* Set *FINAL_ABSPATH to an array of svn_wc__db_moved_to_t for
3362 * LOCAL_ABSPATH after following any and all nested moves.
3363 * Only exposed for testing at present. */
3365 svn_wc__db_follow_moved_to(apr_array_header_t **moved_tos,
3367 const char *local_abspath,
3368 apr_pool_t *result_pool,
3369 apr_pool_t *scratch_pool);
3371 /* Update a moved-away tree conflict victim at VICTIM_ABSPATH with changes
3372 * brought in by the update operation which flagged the tree conflict. */
3374 svn_wc__db_update_moved_away_conflict_victim(svn_wc__db_t *db,
3375 const char *victim_abspath,
3376 svn_wc_notify_func2_t notify_func,
3378 svn_cancel_func_t cancel_func,
3380 apr_pool_t *scratch_pool);
3382 /* LOCAL_ABSPATH is moved to MOVE_DST_ABSPATH. MOVE_SRC_ROOT_ABSPATH
3383 * is the root of the move to MOVE_DST_OP_ROOT_ABSPATH.
3384 * MOVE_SRC_OP_ROOT_ABSPATH is the op-root of the move; it's the same
3385 * as MOVE_SRC_ROOT_ABSPATH except for moves inside deletes when it is
3386 * the op-root of the delete. */
3388 svn_wc__db_base_moved_to(const char **move_dst_abspath,
3389 const char **move_dst_op_root_abspath,
3390 const char **move_src_root_abspath,
3391 const char **move_src_op_root_abspath,
3393 const char *local_abspath,
3394 apr_pool_t *result_pool,
3395 apr_pool_t *scratch_pool);
3397 /* Recover space from the database file for LOCAL_ABSPATH by running
3398 * the "vacuum" command. */
3400 svn_wc__db_vacuum(svn_wc__db_t *db,
3401 const char *local_abspath,
3402 apr_pool_t *scratch_pool);
3404 /* This raises move-edit tree-conflicts on any moves inside the
3405 delete-edit conflict on LOCAL_ABSPATH. This is experimental: see
3406 comment in resolve_conflict_on_node about combining with another
3409 svn_wc__db_resolve_delete_raise_moved_away(svn_wc__db_t *db,
3410 const char *local_abspath,
3411 svn_wc_notify_func2_t notify_func,
3413 apr_pool_t *scratch_pool);
3415 /* Like svn_wc__db_resolve_delete_raise_moved_away this should be
3418 ### LOCAL_ABSPATH specifies the move origin, but the move origin
3419 ### is not necessary unique enough. This function needs an op_root_abspath
3420 ### argument to differentiate between different origins.
3422 ### See move_tests.py: move_many_update_delete for an example case.
3425 svn_wc__db_resolve_break_moved_away(svn_wc__db_t *db,
3426 const char *local_abspath,
3427 svn_wc_notify_func2_t notify_func,
3429 apr_pool_t *scratch_pool);
3431 /* Break moves for all moved-away children of LOCAL_ABSPATH, within
3432 * a single transaction.
3434 * ### Like svn_wc__db_resolve_delete_raise_moved_away this should be
3437 svn_wc__db_resolve_break_moved_away_children(svn_wc__db_t *db,
3438 const char *local_abspath,
3439 svn_wc_notify_func2_t notify_func,
3441 apr_pool_t *scratch_pool);
3443 /* Set *REQUIRED_ABSPATH to the path that should be locked to ensure
3444 * that the lock covers all paths affected by resolving the conflicts
3445 * in the tree LOCAL_ABSPATH. */
3447 svn_wc__required_lock_for_resolve(const char **required_abspath,
3449 const char *local_abspath,
3450 apr_pool_t *result_pool,
3451 apr_pool_t *scratch_pool);
3457 #endif /* __cplusplus */
3459 #endif /* SVN_WC_DB_H */