128
128
typedef struct svn_wc__db_t svn_wc__db_t;
131
/* Enum indicating what kind of versioned object we're talking about.
133
### KFF: That is, my understanding is that this is *not* an enum
134
### indicating what kind of storage the DB is using, even though
135
### one might think that from its name. Rather, the "svn_wc__db_"
136
### is a generic prefix, and this "_kind_t" type indicates the kind
137
### of something that's being stored in the DB.
139
### KFF: Does this overlap too much with what svn_node_kind_t does?
141
### gjs: possibly. but that doesn't have a symlink kind. and that
142
### cannot simply be added. it would surprise too much code.
143
### (we could probably create svn_node_kind2_t though)
145
typedef enum svn_wc__db_kind_t {
146
/* The node is a directory. */
149
/* The node is a file. */
150
svn_wc__db_kind_file,
152
/* The node is a symbolic link. */
153
svn_wc__db_kind_symlink,
155
/* The type of the node is not known, due to its absence, exclusion,
156
deletion, or incomplete status. */
157
svn_wc__db_kind_unknown
162
131
/* Enumerated values describing the state of a node. */
163
132
typedef enum svn_wc__db_status_t {
164
133
/* The node is present and has no known modifications applied to it. */
165
134
svn_wc__db_status_normal,
167
136
/* The node has been added (potentially obscuring a delete or move of
168
the BASE node; see HAVE_BASE param). The text will be marked as
137
the BASE node; see HAVE_BASE param [### What param? This is an enum
138
not a function.] ). The text will be marked as
169
139
modified, and if properties exist, they will be marked as modified.
171
141
In many cases svn_wc__db_status_added means any of added, moved-here
259
229
the administrative operation. It should live at least as long as the
260
230
RESULT_POOL parameter.
262
When AUTO_UPGRADE is TRUE, then the working copy databases will be
263
upgraded when possible (when an old database is found/detected during
264
the operation of a wc_db API). If it is detected that a manual upgrade is
265
required, then SVN_ERR_WC_UPGRADE_REQUIRED will be returned from that API.
266
Passing FALSE will allow a bare minimum of APIs to function (most notably,
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,
267
238
the temp_get_format() function will always return a value) since most of
268
239
these APIs expect a current-format database to be present.
340
311
The LOCAL_RELPATH should ONLY be used for persisting paths to disk.
341
Those patsh should not be an abspath, otherwise the working copy cannot
312
Those paths should not be abspaths, otherwise the working copy cannot
342
313
be moved. The working copy library should not make these paths visible
343
314
in its API (which should all be abspaths), and it should not be using
344
315
relpaths for other processing.
346
317
LOCAL_RELPATH will be allocated in RESULT_POOL. All other (temporary)
347
318
allocations will be made in SCRATCH_POOL.
320
This function is available when DB is opened with the OPEN_WITHOUT_UPGRADE
350
324
svn_wc__db_to_relpath(const char **local_relpath,
463
447
const svn_skel_t *conflict,
464
448
svn_boolean_t update_actual_props,
465
449
apr_hash_t *new_actual_props,
450
apr_array_header_t *new_iprops,
466
451
const svn_skel_t *work_items,
467
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);
470
474
/* Add or replace a file in the BASE tree.
515
519
const char *changed_author,
516
520
const svn_checksum_t *checksum,
517
521
apr_hash_t *dav_cache,
518
const svn_skel_t *conflict,
522
svn_boolean_t delete_working,
519
523
svn_boolean_t update_actual_props,
520
524
apr_hash_t *new_actual_props,
525
apr_array_header_t *new_iprops,
521
526
svn_boolean_t keep_recorded_info,
522
527
svn_boolean_t insert_base_deleted,
528
const svn_skel_t *conflict,
523
529
const svn_skel_t *work_items,
524
530
apr_pool_t *scratch_pool);
596
602
const char *changed_author,
597
603
const char *target,
598
604
apr_hash_t *dav_cache,
599
const svn_skel_t *conflict,
605
svn_boolean_t delete_working,
600
606
svn_boolean_t update_actual_props,
601
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,
602
612
const svn_skel_t *work_items,
603
613
apr_pool_t *scratch_pool);
661
671
const char *repos_root_url,
662
672
const char *repos_uuid,
663
673
svn_revnum_t revision,
664
svn_wc__db_kind_t kind,
674
svn_node_kind_t kind,
665
675
const svn_skel_t *conflict,
666
676
const svn_skel_t *work_items,
667
677
apr_pool_t *scratch_pool);
670
/* Remove a node from the BASE tree.
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
672
684
The node to remove is indicated by LOCAL_ABSPATH from the local
675
Note that no changes are made to the local filesystem; LOCAL_ABSPATH
676
is merely the key to figure out which BASE node to remove.
687
This operation *installs* workqueue operations to update the local
688
filesystem after the database operation.
678
690
To maintain a consistent database this function will also remove
679
691
any working node that marks LOCAL_ABSPATH as base-deleted. If this
681
693
actual node will be removed if the actual node does not mark a
684
Note the caller is responsible for removing base node
685
children before calling this function (this may change).
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
688
717
svn_wc__db_base_remove(svn_wc__db_t *db,
689
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,
690
725
apr_pool_t *scratch_pool);
974
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);
977
1028
/* Remove the pristine text with SHA-1 checksum SHA1_CHECKSUM from the
978
1029
* pristine store, iff it is not referenced by any of the (other) WC DB
1164
1217
apr_pool_t *result_pool,
1165
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);
1167
1251
/* Gets a mapping from const char * local abspaths of externals to the const
1168
1252
char * local abspath of where they are defined for all externals defined
1169
1253
at or below LOCAL_ABSPATH.
1209
1293
* This copy is NOT recursive. It simply establishes this one node, plus
1210
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().
1212
1300
* Add WORK_ITEMS to the work queue. */
1214
1302
svn_wc__db_op_copy(svn_wc__db_t *db,
1215
1303
const char *src_abspath,
1216
1304
const char *dst_abspath,
1217
1305
const char *dst_op_root_abspath,
1306
svn_boolean_t is_move,
1218
1307
const svn_skel_t *work_items,
1219
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);
1221
1326
/* Copy the leaves of the op_depth layer directly shadowed by the operation
1222
1327
* of SRC_ABSPATH (so SRC_ABSPATH must be an op_root) to dst_abspaths
1223
1328
* parents layer.
1225
* This operation is recursive. It copies all the descandants at the lower
1330
* This operation is recursive. It copies all the descendants at the lower
1226
1331
* layer and adds base-deleted nodes on dst_abspath layer to mark these nodes
1227
1332
* properly deleted.
1298
1408
apr_pool_t *scratch_pool);
1301
/* ### do we need svn_wc__db_op_copy_absent() ?? */
1411
/* ### do we need svn_wc__db_op_copy_server_excluded() ?? */
1304
1414
/* ### add a new versioned directory. a list of children is NOT passed
1305
1415
### since they are added in future, distinct calls to db_op_add_*.
1306
### this is freshly added, so it has no properties. */
1416
PROPS gives the properties; empty or NULL means none. */
1307
1417
/* ### do we need a CONFLICTS param? */
1309
1419
svn_wc__db_op_add_directory(svn_wc__db_t *db,
1310
1420
const char *local_abspath,
1421
const apr_hash_t *props,
1311
1422
const svn_skel_t *work_items,
1312
1423
apr_pool_t *scratch_pool);
1315
/* ### as a new file, there are no properties. this file has no "pristine"
1427
PROPS gives the properties; empty or NULL means none.
1428
### this file has no "pristine"
1316
1429
### contents, so a checksum [reference] is not required. */
1317
1430
/* ### do we need a CONFLICTS param? */
1319
1432
svn_wc__db_op_add_file(svn_wc__db_t *db,
1320
1433
const char *local_abspath,
1434
const apr_hash_t *props,
1321
1435
const svn_skel_t *work_items,
1322
1436
apr_pool_t *scratch_pool);
1325
/* ### newly added symlinks have no properties. */
1440
PROPS gives the properties; empty or NULL means none. */
1326
1441
/* ### do we need a CONFLICTS param? */
1328
1443
svn_wc__db_op_add_symlink(svn_wc__db_t *db,
1329
1444
const char *local_abspath,
1330
1445
const char *target,
1446
const apr_hash_t *props,
1331
1447
const svn_skel_t *work_items,
1332
1448
apr_pool_t *scratch_pool);
1370
1486
const svn_skel_t *work_items,
1371
1487
apr_pool_t *scratch_pool);
1374
#ifdef SVN__SUPPORT_BASE_MERGE
1375
/* ### Set the properties of the node LOCAL_ABSPATH in the BASE tree to PROPS.
1377
### This function should not exist because properties should be stored
1378
### onto the BASE node at construction time, in a single atomic operation.
1380
### PROPS maps "const char *" names to "const svn_string_t *" values.
1381
### To specify no properties, PROPS must be an empty hash, not NULL.
1382
### If the node is not present, SVN_ERR_WC_PATH_NOT_FOUND is returned.
1385
svn_wc__db_temp_base_set_props(svn_wc__db_t *db,
1386
const char *local_abspath,
1387
const apr_hash_t *props,
1388
apr_pool_t *scratch_pool);
1391
/* ### Set the properties of the node LOCAL_ABSPATH in the WORKING tree
1394
### This function should not exist because properties should be stored
1395
### onto the WORKING node at construction time, in a single atomic
1398
### PROPS maps "const char *" names to "const svn_string_t *" values.
1399
### To specify no properties, PROPS must be an empty hash, not NULL.
1400
### If the node is not present, SVN_ERR_WC_PATH_NOT_FOUND is returned.
1403
svn_wc__db_temp_working_set_props(svn_wc__db_t *db,
1404
const char *local_abspath,
1405
const apr_hash_t *props,
1406
apr_pool_t *scratch_pool);
1409
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.
1411
1498
* If NOTIFY_FUNC is not NULL, then it will be called (with NOTIFY_BATON)
1412
1499
* for each node deleted. While this processing occurs, if CANCEL_FUNC is
1413
1500
* not NULL, then it will be called (with CANCEL_BATON) to detect cancellation
1420
1507
svn_wc__db_op_delete(svn_wc__db_t *db,
1421
1508
const char *local_abspath,
1422
/* ### flip to CANCEL, then NOTIFY. precedent. */
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,
1423
1515
svn_wc_notify_func2_t notify_func,
1424
1516
void *notify_baton,
1425
svn_cancel_func_t cancel_func,
1427
1517
apr_pool_t *scratch_pool);
1430
/* ### KFF: Would like to know behavior when dst_path already exists
1431
### and is a) a dir or b) a non-dir. */
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
1433
svn_wc__db_op_move(svn_wc__db_t *db,
1434
const char *src_abspath,
1435
const char *dst_abspath,
1436
apr_pool_t *scratch_pool);
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);
1439
1552
/* ### mark PATH as (possibly) modified. "svn edit" ... right API here? */
1460
1573
void *cancel_baton,
1461
1574
apr_pool_t *scratch_pool);
1464
/* ### caller maintains ACTUAL. we're just recording state. */
1465
/* ### we probably need to record details of the conflict. how? */
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.
1467
1587
svn_wc__db_op_mark_conflict(svn_wc__db_t *db,
1468
1588
const char *local_abspath,
1589
const svn_skel_t *conflict,
1590
const svn_skel_t *work_items,
1469
1591
apr_pool_t *scratch_pool);
1566
1685
const char *local_abspath,
1567
1686
apr_pool_t *scratch_pool);
1570
/* Return a hash @a *tree_conflicts of all the children of @a
1571
* local_abspath that are in tree conflicts. The hash maps local
1572
* basenames to pointers to svn_wc_conflict_description2_t, all
1573
* allocated in result pool.
1575
/* ### this is not an OPERATION. remove the _op_. */
1577
svn_wc__db_op_read_all_tree_conflicts(apr_hash_t **tree_conflicts,
1579
const char *local_abspath,
1580
apr_pool_t *result_pool,
1581
apr_pool_t *scratch_pool);
1583
/* Get any tree conflict associated with LOCAL_ABSPATH in DB, and put it
1584
in *TREE_CONFLICT, allocated in RESULT_POOL.
1586
Use SCRATCH_POOL for any temporary allocations.
1588
/* ### this is not an OPERATION. remove the _op_. */
1590
svn_wc__db_op_read_tree_conflict(
1591
const svn_wc_conflict_description2_t **tree_conflict,
1593
const char *local_abspath,
1594
apr_pool_t *result_pool,
1595
apr_pool_t *scratch_pool);
1598
/* Set the tree conflict on LOCAL_ABSPATH in DB to TREE_CONFLICT. Use
1599
NULL to remove a tree conflict.
1601
Use SCRATCH_POOL for any temporary allocations.
1603
/* ### can this also record text/prop conflicts? drop "tree"? */
1604
/* ### dunno if it can, but it definitely should be able to. */
1605
/* ### gjs: also ref: db_op_mark_conflict() */
1607
svn_wc__db_op_set_tree_conflict(svn_wc__db_t *db,
1608
const char *local_abspath,
1609
const svn_wc_conflict_description2_t *tree_conflict,
1610
apr_pool_t *scratch_pool);
1613
1688
/* ### status */
1907
1988
calling svn_wc__db_read_info().
1909
1990
(All other information (like original_*) can be obtained via other apis).
1992
*PROPS maps "const char *" names to "const svn_string_t *" values. If
1993
the pristine node is capable of having properties but has none, set
1994
*PROPS to an empty hash. If its status is such that it cannot have
1995
properties, set *PROPS to NULL.
1912
1998
svn_wc__db_read_pristine_info(svn_wc__db_status_t *status,
1913
svn_wc__db_kind_t *kind,
1999
svn_node_kind_t *kind,
1914
2000
svn_revnum_t *changed_rev,
1915
2001
apr_time_t *changed_date,
1916
2002
const char **changed_author,
1989
2076
* a hash table mapping <tt>char *</tt> names onto svn_string_t *
1990
2077
* values for any properties of child nodes of LOCAL_ABSPATH (up to DEPTH).
1992
* If BASE_PROPS is TRUE, read the properties from the BASE layer (op_depth=0),
1993
* without local modifications.
1995
* If BASE_PROPS is FALSE, read the properties from the WORKING layer (highest
1998
* If BASE_PROPS is FALSE and, PRISTINE is TRUE, the local modifications will
1999
* be suppressed. If PRISTINE is FALSE, local modifications will be visible.
2079
* If PRISTINE is FALSE, read the properties from the WORKING layer (highest
2080
* op_depth); if PRISTINE is FALSE, local modifications will be visible.
2002
2083
svn_wc__db_read_props_streamily(svn_wc__db_t *db,
2003
2084
const char *local_abspath,
2004
2085
svn_depth_t depth,
2005
svn_boolean_t base_props,
2006
2086
svn_boolean_t pristine,
2007
2087
const apr_array_header_t *changelists,
2008
2088
svn_wc__proplist_receiver_t receiver_func,
2030
2110
apr_pool_t *result_pool,
2031
2111
apr_pool_t *scratch_pool);
2115
* Set @a *iprops to a depth-first ordered array of
2116
* #svn_prop_inherited_item_t * structures representing the properties
2117
* inherited by @a local_abspath from the ACTUAL tree above
2118
* @a local_abspath (looking through to the WORKING or BASE tree as
2119
* required), up to and including the root of the working copy and
2120
* any cached inherited properties inherited by the root.
2122
* The #svn_prop_inherited_item_t->path_or_url members of the
2123
* #svn_prop_inherited_item_t * structures in @a *iprops are
2124
* paths relative to the repository root URL for cached inherited
2125
* properties and absolute working copy paths otherwise.
2127
* If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to the actual
2128
* properties stored on LOCAL_ABSPATH.
2130
* Allocate @a *iprops in @a result_pool. Use @a scratch_pool
2131
* for temporary allocations.
2134
svn_wc__db_read_inherited_props(apr_array_header_t **iprops,
2135
apr_hash_t **actual_props,
2137
const char *local_abspath,
2138
const char *propname,
2139
apr_pool_t *result_pool,
2140
apr_pool_t *scratch_pool);
2142
/* Read a BASE node's inherited property information.
2144
Set *IPROPS to to a depth-first ordered array of
2145
svn_prop_inherited_item_t * structures representing the cached
2146
inherited properties for the BASE node at LOCAL_ABSPATH.
2148
If no cached properties are found, then set *IPROPS to NULL.
2149
If LOCAL_ABSPATH represents the root of the repository, then set
2150
*IPROPS to an empty array.
2152
Allocate *IPROPS in RESULT_POOL, use SCRATCH_POOL for temporary
2155
svn_wc__db_read_cached_iprops(apr_array_header_t **iprops,
2157
const char *local_abspath,
2158
apr_pool_t *result_pool,
2159
apr_pool_t *scratch_pool);
2161
/* Find BASE nodes with cached inherited properties.
2163
Set *IPROPS_PATHS to a hash mapping const char * absolute working copy
2164
paths to the repos_relpath of the path for each path in the working copy
2165
at or below LOCAL_ABSPATH, limited by DEPTH, that has cached inherited
2166
properties for the BASE node of the path.
2168
Allocate *IPROP_PATHS in RESULT_POOL.
2169
Use SCRATCH_POOL for temporary allocations. */
2171
svn_wc__db_get_children_with_cached_iprops(apr_hash_t **iprop_paths,
2173
const char *local_abspath,
2175
apr_pool_t *result_pool,
2176
apr_pool_t *scratch_pool);
2178
/** Obtain a mapping of const char * local_abspaths to const svn_string_t*
2179
* property values in *VALUES, of all PROPNAME properties on LOCAL_ABSPATH
2180
* and its descendants.
2182
* Allocate the result in RESULT_POOL, and perform temporary allocations in
2186
svn_wc__db_prop_retrieve_recursive(apr_hash_t **values,
2188
const char *local_abspath,
2189
const char *propname,
2190
apr_pool_t *result_pool,
2191
apr_pool_t *scratch_pool);
2033
2193
/* Set *CHILDREN to a new array of the (const char *) basenames of the
2034
2194
immediate children of the working node at LOCAL_ABSPATH in DB.
2036
2196
Return every path that refers to a child of the working node at
2037
2197
LOCAL_ABSPATH. Do not include a path just because it was a child of a
2038
2198
deleted directory that existed at LOCAL_ABSPATH if that directory is now
2039
sheduled to be replaced by the working node at LOCAL_ABSPATH.
2199
scheduled to be replaced by the working node at LOCAL_ABSPATH.
2041
2201
Allocate *CHILDREN in RESULT_POOL and do temporary allocations in
2097
2256
apr_pool_t *result_pool,
2098
2257
apr_pool_t *scratch_pool);
2100
/* Read into CONFLICTS svn_wc_conflict_description2_t* structs
2101
for all conflicts that have LOCAL_ABSPATH as victim.
2259
/* Read the conflict information recorded on LOCAL_ABSPATH in *CONFLICT,
2260
an editable conflict skel.
2103
Victim must be versioned or be part of a tree conflict.
2262
If the node exists, but does not have a conflict set *CONFLICT to NULL,
2263
otherwise return a SVN_ERR_WC_PATH_NOT_FOUND error.
2105
2265
Allocate *CONFLICTS in RESULT_POOL and do temporary allocations in
2106
2266
SCRATCH_POOL */
2107
/* ### Currently there can be just one property conflict recorded
2109
/* ### This function will probably be removed. */
2111
svn_wc__db_read_conflicts(const apr_array_header_t **conflicts,
2113
const char *local_abspath,
2114
apr_pool_t *result_pool,
2115
apr_pool_t *scratch_pool);
2268
svn_wc__db_read_conflict(svn_skel_t **conflict,
2270
const char *local_abspath,
2271
apr_pool_t *result_pool,
2272
apr_pool_t *scratch_pool);
2118
2275
/* Return the kind of the node in DB at LOCAL_ABSPATH. The WORKING tree will
2119
2276
be examined first, then the BASE tree. If the node is not present in either
2120
tree and ALLOW_MISSING is TRUE, then svn_wc__db_kind_unknown is returned.
2277
tree and ALLOW_MISSING is TRUE, then svn_node_unknown is returned.
2121
2278
If the node is missing and ALLOW_MISSING is FALSE, then it will return
2122
2279
SVN_ERR_WC_PATH_NOT_FOUND.
2281
The SHOW_HIDDEN and SHOW_DELETED flags report certain states as kind none.
2283
When nodes have certain statee they are only reported when:
2284
svn_wc__db_status_not_present when show_hidden && show_deleted
2286
svn_wc__db_status_excluded when show_hidden
2287
svn_wc__db_status_server_excluded when show_hidden
2289
svn_wc__db_status_deleted when show_deleted
2291
In other cases these nodes are reported with *KIND as svn_node_none.
2292
(See also svn_wc_read_kind2()'s documentation)
2124
2294
Uses SCRATCH_POOL for temporary allocations. */
2126
svn_wc__db_read_kind(svn_wc__db_kind_t *kind,
2296
svn_wc__db_read_kind(svn_node_kind_t *kind,
2127
2297
svn_wc__db_t *db,
2128
2298
const char *local_abspath,
2129
2299
svn_boolean_t allow_missing,
2300
svn_boolean_t show_deleted,
2301
svn_boolean_t show_hidden,
2130
2302
apr_pool_t *scratch_pool);
2166
2338
### changelist usage -- we may already assume the list fits in memory.
2169
/* Checks if LOCAL_ABSPATH has a parent directory that knows about its
2170
* existance. Set *IS_ROOT to FALSE if a parent is found, and to TRUE
2171
* if there is no such parent.
2341
/* The DB-private version of svn_wc__is_wcroot(), which see.
2174
svn_wc__db_is_wcroot(svn_boolean_t *is_root,
2344
svn_wc__db_is_wcroot(svn_boolean_t *is_wcroot,
2175
2345
svn_wc__db_t *db,
2176
2346
const char *local_abspath,
2177
2347
apr_pool_t *scratch_pool);
2349
/* Check whether a node is a working copy root and/or switched.
2351
If LOCAL_ABSPATH is the root of a working copy, set *IS_WC_ROOT to TRUE,
2354
If LOCAL_ABSPATH is switched against its parent in the same working copy
2355
set *IS_SWITCHED to TRUE, otherwise to FALSE.
2357
If KIND is not null, set *KIND to the node type of LOCAL_ABSPATH.
2359
Any of the output arguments can be null to specify that the result is not
2360
interesting to the caller.
2362
Use SCRATCH_POOL for temporary allocations.
2365
svn_wc__db_is_switched(svn_boolean_t *is_wcroot,
2366
svn_boolean_t *is_switched,
2367
svn_node_kind_t *kind,
2369
const char *local_abspath,
2370
apr_pool_t *scratch_pool);
2335
2533
const char *new_repos_uuid,
2336
2534
svn_revnum_t new_revision,
2337
2535
apr_hash_t *exclude_relpaths,
2536
apr_hash_t *wcroot_iprops,
2537
svn_wc_notify_func2_t notify_func,
2338
2539
apr_pool_t *scratch_pool);
2341
/* Record the TRANSLATED_SIZE and LAST_MOD_TIME for a versioned node.
2542
/* Record the RECORDED_SIZE and RECORDED_TIME for a versioned node.
2343
2544
This function will record the information within the WORKING node,
2344
2545
if present, or within the BASE tree. If neither node is present, then
2345
2546
SVN_ERR_WC_PATH_NOT_FOUND will be returned.
2347
TRANSLATED_SIZE may be SVN_INVALID_FILESIZE, which will be recorded
2548
RECORDED_SIZE may be SVN_INVALID_FILESIZE, which will be recorded
2348
2549
as such, implying "unknown size".
2350
LAST_MOD_TIME may be 0, which will be recorded as such, implying
2551
RECORDED_TIME may be 0, which will be recorded as such, implying
2351
2552
"unknown last mod time".
2354
2555
svn_wc__db_global_record_fileinfo(svn_wc__db_t *db,
2355
2556
const char *local_abspath,
2356
svn_filesize_t translated_size,
2357
apr_time_t last_mod_time,
2557
svn_filesize_t recorded_size,
2558
apr_time_t recorded_time,
2358
2559
apr_pool_t *scratch_pool);
2479
2684
apr_pool_t *result_pool,
2480
2685
apr_pool_t *scratch_pool);
2687
/* Scan the working copy for move information of the node LOCAL_ABSPATH.
2688
* If LOCAL_ABSPATH return a SVN_ERR_WC_PATH_UNEXPECTED_STATUS error.
2690
* If not NULL *MOVED_FROM_ABSPATH will be set to the previous location
2691
* of LOCAL_ABSPATH, before it or an ancestror was moved.
2693
* If not NULL *OP_ROOT_ABSPATH will be set to the new location of the
2694
* path that was actually moved
2696
* If not NULL *OP_ROOT_MOVED_FROM_ABSPATH will be set to the old location
2697
* of the path that was actually moved.
2699
* If not NULL *MOVED_FROM_DELETE_ABSPATH will be set to the ancestor of the
2700
* moved from location that deletes the original location
2702
* Given a working copy
2707
* You can call this function on D and D/C. When called on D/C all output
2708
* MOVED_FROM_ABSPATH will be A/B/C
2709
* OP_ROOT_ABSPATH will be D
2710
* OP_ROOT_MOVED_FROM_ABSPATH will be A/B
2711
* MOVED_FROM_DELETE_ABSPATH will be A
2714
svn_wc__db_scan_moved(const char **moved_from_abspath,
2715
const char **op_root_abspath,
2716
const char **op_root_moved_from_abspath,
2717
const char **moved_from_delete_abspath,
2719
const char *local_abspath,
2720
apr_pool_t *result_pool,
2721
apr_pool_t *scratch_pool);
2483
2723
/* Scan upwards for additional information about a deleted node.
2524
2764
If the user moves-away B/W/D from the WORKING tree, then behavior is
2525
2765
again dependent upon the origination of B/W. For a plain add, the nodes
2526
simply move to the destination. For a copy, a deletion is made at B/W/D,
2766
simply move to the destination; this means that B/W/D ceases to be a
2767
node and so cannot be scanned. For a copy, a deletion is made at B/W/D,
2527
2768
and a new copy (of a subtree of the original source) is made at the
2528
2769
destination. For a move-here, a deletion is made, and a copy is made at
2529
2770
the destination (we do not track multiple moves; the source is moved to
2534
2775
There are three further considerations when resolving a deleted node:
2536
If the BASE B/W/D was moved-away, then BASE_DEL_ABSPATH will specify
2537
B/W/D as the root of the BASE deletion (not necessarily B/W as an
2538
implicit delete caused by a replacement; only the closest ancestor is
2539
reported). The other parameters will operate as normal, based on what
2540
is happening in the WORKING tree. Also note that ancestors of B/W/D
2541
may report additional, explicit moved-away status.
2543
2777
If the BASE B/W/D was deleted explicitly *and* B/W is a replacement,
2544
2778
then the explicit deletion is subsumed by the implicit deletion that
2545
2779
occurred with the B/W replacement. Thus, BASE_DEL_ABSPATH will point
2557
2791
BASE_DEL_ABSPATH will specify the nearest ancestor of the explicit or
2558
2792
implicit deletion (if any) that applies to the BASE tree.
2560
MOVED_TO_ABSPATH will specify the nearest ancestor that has moved-away,
2561
if any. If no ancestors have been moved-away, then this is set to NULL.
2563
2794
WORK_DEL_ABSPATH will specify the root of a deleted subtree within
2564
2795
the WORKING tree (note there is no concept of layered delete operations
2565
2796
in WORKING, so there is only one deletion root in the ancestry).
2798
MOVED_TO_ABSPATH will specify the path where this node was moved to
2799
if the node has moved-away.
2801
If the node was moved-away, MOVED_TO_OP_ROOT_ABSPATH will specify the
2802
target path of the root of the move operation. If LOCAL_ABSPATH itself
2803
is the source path of the root of the move operation, then
2804
MOVED_TO_OP_ROOT_ABSPATH equals MOVED_TO_ABSPATH.
2567
2806
All OUT parameters may be set to NULL to indicate a lack of interest in
2568
2807
that piece of information.
2663
2903
const char *repos_root_url,
2664
2904
apr_pool_t *scratch_pool);
2906
/* Upgrade the metadata concerning the WC at WCROOT_ABSPATH, in DB,
2907
* to the SVN_WC__VERSION format.
2909
* This function is used for upgrading wc-ng working copies to a newer
2910
* wc-ng format. If a pre-1.7 working copy is found, this function
2911
* returns SVN_ERR_WC_UPGRADE_REQUIRED.
2913
* Upgrading subdirectories of a working copy is not supported.
2914
* If WCROOT_ABSPATH is not a working copy root SVN_ERR_WC_INVALID_OP_ON_CWD
2917
* If BUMPED_FORMAT is not NULL, set *BUMPED_FORMAT to TRUE if the format
2918
* was bumped or to FALSE if the wc was already at the resulting format.
2921
svn_wc__db_bump_format(int *result_format,
2922
svn_boolean_t *bumped_format,
2924
const char *wcroot_abspath,
2925
apr_pool_t *scratch_pool);
2757
3040
/* Removes all references to LOCAL_ABSPATH from DB, while optionally leaving
2758
tree conflicts and/or a not present node.
2760
3043
This operation always recursively removes all nodes at and below
2761
3044
LOCAL_ABSPATH from NODES and ACTUAL.
2763
3046
If NOT_PRESENT_REVISION specifies a valid revision, leave a not_present
2764
BASE node at local_abspath. (Requires an existing BASE node before removing)
3047
BASE node at local_abspath of the specified status and kind.
3048
(Requires an existing BASE node before removing)
3050
If DESTROY_WC is TRUE, this operation *installs* workqueue operations to
3051
update the local filesystem after the database operation. If DESTROY_CHANGES
3052
is FALSE, modified and unversioned files are left after running this
3053
operation (and the WQ). If DESTROY_CHANGES and DESTROY_WC are TRUE,
3054
LOCAL_ABSPATH and everything below it will be removed by the WQ.
3057
Note: Unlike many similar functions it is a valid scenario for this
3058
function to be called on a wcroot! In this case it will just leave the root
2767
svn_wc__db_op_remove_node(svn_wc__db_t *db,
3062
svn_wc__db_op_remove_node(svn_boolean_t *left_changes,
2768
3064
const char *local_abspath,
3065
svn_boolean_t destroy_wc,
3066
svn_boolean_t destroy_changes,
2769
3067
svn_revnum_t not_present_revision,
2770
svn_wc__db_kind_t not_present_kind,
3068
svn_wc__db_status_t not_present_status,
3069
svn_node_kind_t not_present_kind,
3070
const svn_skel_t *conflict,
3071
const svn_skel_t *work_items,
3072
svn_cancel_func_t cancel_func,
2771
3074
apr_pool_t *scratch_pool);
2773
/* Remove the WORKING_NODE row of LOCAL_ABSPATH in DB. */
2775
svn_wc__db_temp_op_remove_working(svn_wc__db_t *db,
2776
const char *local_abspath,
2777
apr_pool_t *scratch_pool);
2779
3076
/* Sets the depth of LOCAL_ABSPATH in its working copy to DEPTH using DB.
2781
3078
Returns SVN_ERR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not a BASE directory
2867
3164
leaving any subtree additions and copies as-is. This allows the
2868
3165
base node tree to be removed. */
2870
svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
2871
const char *local_abspath,
2872
apr_pool_t *scratch_pool);
2875
/* Set the conflict marker information on LOCAL_ABSPATH to the specified
2878
svn_wc__db_temp_op_set_text_conflict_marker_files(svn_wc__db_t *db,
2879
const char *local_abspath,
2880
const char *old_abspath,
2881
const char *new_abspath,
2882
const char *wrk_abspath,
2883
apr_pool_t *scratch_pool);
2885
/* Set the conflict marker information on LOCAL_ABSPATH to the specified
2888
svn_wc__db_temp_op_set_property_conflict_marker_file(svn_wc__db_t *db,
2889
const char *local_abspath,
2890
const char *prej_abspath,
2891
apr_pool_t *scratch_pool);
2893
/* Add a new directory in BASE, whether WORKING nodes exist or not. Mark it
2894
as incomplete and with revision REVISION. If REPOS_RELPATH is not NULL,
2895
apply REPOS_RELPATH, REPOS_ROOT_URL and REPOS_UUID.
2896
Perform all temporary allocations in SCRATCH_POOL.
2899
svn_wc__db_temp_op_set_new_dir_to_incomplete(svn_wc__db_t *db,
2900
const char *local_abspath,
2901
const char *repos_relpath,
2902
const char *repos_root_url,
2903
const char *repos_uuid,
2904
svn_revnum_t revision,
2906
apr_pool_t *scratch_pool);
3167
svn_wc__db_op_make_copy(svn_wc__db_t *db,
3168
const char *local_abspath,
3169
const svn_skel_t *conflicts,
3170
const svn_skel_t *work_items,
3171
apr_pool_t *scratch_pool);
2908
3173
/* Close the wc root LOCAL_ABSPATH and remove any per-directory
2909
3174
handles associated with it. */
2998
3264
svn_boolean_t committed,
2999
3265
apr_pool_t *scratch_pool);
3001
/* Indicate in *IS_SPARSE_CHECKOUT whether any of the nodes within
3002
* LOCAL_ABSPATH is sparse, using DB.
3003
* Use SCRATCH_POOL for temporary allocations.
3005
* This function provides a subset of the functionality of
3006
* svn_wc__db_revision_status() and is more efficient if the caller
3007
* doesn't need all information returned by svn_wc__db_revision_status(). */
3009
svn_wc__db_is_sparse_checkout(svn_boolean_t *is_sparse_checkout,
3011
const char *local_abspath,
3012
apr_pool_t *scratch_pool);
3014
3267
/* Indicate in *IS_SWITCHED whether any node beneath LOCAL_ABSPATH
3015
3268
* is switched, using DB. Use SCRATCH_POOL for temporary allocations.
3030
3283
const char *trail_url,
3031
3284
apr_pool_t *scratch_pool);
3033
/* Set @a *server_excluded_subtrees to a hash mapping <tt>const char *</tt>
3286
/* Set @a *excluded_subtrees to a hash mapping <tt>const char *</tt>
3034
3287
* local absolute paths to <tt>const char *</tt> local absolute paths for
3035
* every path at or under @a local_abspath in @a db which are excluded by
3036
* the server (e.g. due to authz). If no such paths are found then
3288
* every path under @a local_abspath in @a db which are excluded by
3289
* the server (e.g. due to authz), or user. If no such paths are found then
3037
3290
* @a *server_excluded_subtrees is set to @c NULL.
3038
3291
* Allocate the hash and all items therein from @a result_pool.
3041
svn_wc__db_get_server_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
3043
const char *local_abspath,
3044
apr_pool_t *result_pool,
3045
apr_pool_t *scratch_pool);
3294
svn_wc__db_get_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
3296
const char *local_abspath,
3297
apr_pool_t *result_pool,
3298
apr_pool_t *scratch_pool);
3047
3300
/* Indicate in *IS_MODIFIED whether the working copy has local modifications,
3048
3301
* using DB. Use SCRATCH_POOL for temporary allocations.
3067
3320
apr_pool_t *scratch_pool);
3323
/* Possibly need two structures, one with relpaths and with abspaths?
3324
* Only exposed for testing at present. */
3325
struct svn_wc__db_moved_to_t {
3326
const char *local_relpath; /* moved-to destination */
3327
int op_depth; /* op-root of source */
3330
/* Set *FINAL_ABSPATH to an array of svn_wc__db_moved_to_t for
3331
* LOCAL_ABSPATH after following any and all nested moves.
3332
* Only exposed for testing at present. */
3334
svn_wc__db_follow_moved_to(apr_array_header_t **moved_tos,
3336
const char *local_abspath,
3337
apr_pool_t *result_pool,
3338
apr_pool_t *scratch_pool);
3340
/* Update a moved-away tree conflict victim at VICTIM_ABSPATH with changes
3341
* brought in by the update operation which flagged the tree conflict. */
3343
svn_wc__db_update_moved_away_conflict_victim(svn_wc__db_t *db,
3344
const char *victim_abspath,
3345
svn_wc_notify_func2_t notify_func,
3347
svn_cancel_func_t cancel_func,
3349
apr_pool_t *scratch_pool);
3351
/* LOCAL_ABSPATH is moved to MOVE_DST_ABSPATH. MOVE_SRC_ROOT_ABSPATH
3352
* is the root of the move to MOVE_DST_OP_ROOT_ABSPATH.
3353
* MOVE_SRC_OP_ROOT_ABSPATH is the op-root of the move; it's the same
3354
* as MOVE_SRC_ROOT_ABSPATH except for moves inside deletes when it is
3355
* the op-root of the delete. */
3357
svn_wc__db_base_moved_to(const char **move_dst_abspath,
3358
const char **move_dst_op_root_abspath,
3359
const char **move_src_root_abspath,
3360
const char **move_src_op_root_abspath,
3362
const char *local_abspath,
3363
apr_pool_t *result_pool,
3364
apr_pool_t *scratch_pool);
3366
/* Recover space from the database file for LOCAL_ABSPATH by running
3367
* the "vacuum" command. */
3369
svn_wc__db_vacuum(svn_wc__db_t *db,
3370
const char *local_abspath,
3371
apr_pool_t *scratch_pool);
3373
/* This raises move-edit tree-conflicts on any moves inside the
3374
delete-edit conflict on LOCAL_ABSPATH. This is experimental: see
3375
comment in resolve_conflict_on_node about combining with another
3378
svn_wc__db_resolve_delete_raise_moved_away(svn_wc__db_t *db,
3379
const char *local_abspath,
3380
svn_wc_notify_func2_t notify_func,
3382
apr_pool_t *scratch_pool);
3384
/* Like svn_wc__db_resolve_delete_raise_moved_away this should be
3387
### LOCAL_ABSPATH specifies the move origin, but the move origin
3388
### is not necessary unique enough. This function needs an op_root_abspath
3389
### argument to differentiate between different origins.
3391
### See move_tests.py: move_many_update_delete for an example case.
3394
svn_wc__db_resolve_break_moved_away(svn_wc__db_t *db,
3395
const char *local_abspath,
3396
svn_wc_notify_func2_t notify_func,
3398
apr_pool_t *scratch_pool);
3400
/* Break moves for all moved-away children of LOCAL_ABSPATH, within
3401
* a single transaction.
3403
* ### Like svn_wc__db_resolve_delete_raise_moved_away this should be
3406
svn_wc__db_resolve_break_moved_away_children(svn_wc__db_t *db,
3407
const char *local_abspath,
3408
svn_wc_notify_func2_t notify_func,
3410
apr_pool_t *scratch_pool);
3412
/* Set *REQUIRED_ABSPATH to the path that should be locked to ensure
3413
* that the lock covers all paths affected by resolving the conflicts
3414
* in the tree LOCAL_ABSPATH. */
3416
svn_wc__required_lock_for_resolve(const char **required_abspath,
3418
const char *local_abspath,
3419
apr_pool_t *result_pool,
3420
apr_pool_t *scratch_pool);