~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/libsvn_wc/wc_db.h

  • Committer: Package Import Robot
  • Author(s): James McCoy, Peter Samuelson, James McCoy
  • Date: 2014-01-12 19:48:33 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140112194833-w3axfwksn296jn5x
Tags: 1.8.5-1
[ Peter Samuelson ]
* New upstream release.  (Closes: #725787) Rediff patches:
  - Remove apr-abi1 (applied upstream), rename apr-abi2 to apr-abi
  - Remove loosen-sqlite-version-check (shouldn't be needed)
  - Remove java-osgi-metadata (applied upstream)
  - svnmucc prompts for a changelog if none is provided. (Closes: #507430)
  - Remove fix-bdb-version-detection, upstream uses "apu-config --dbm-libs"
  - Remove ruby-test-wc (applied upstream)
  - Fix “svn diff -r N file” when file has svn:mime-type set.
    (Closes: #734163)
  - Support specifying an encoding for mod_dav_svn's environment in which
    hooks are run.  (Closes: #601544)
  - Fix ordering of “svnadmin dump” paths with certain APR versions.
    (Closes: #687291)
  - Provide a better error message when authentication fails with an
    svn+ssh:// URL.  (Closes: #273874)
  - Updated Polish translations.  (Closes: #690815)

[ James McCoy ]
* Remove all traces of libneon, replaced by libserf.
* patches/sqlite_3.8.x_workaround: Upstream fix for wc-queries-test test
  failurse.
* Run configure with --with-apache-libexecdir, which allows removing part of
  patches/rpath.
* Re-enable auth-test as upstream has fixed the problem of picking up
  libraries from the environment rather than the build tree.
  (Closes: #654172)
* Point LD_LIBRARY_PATH at the built auth libraries when running the svn
  command during the build.  (Closes: #678224)
* Add a NEWS entry describing how to configure mod_dav_svn to understand
  UTF-8.  (Closes: #566148)
* Remove ancient transitional package, libsvn-ruby.
* Enable compatibility with Sqlite3 versions back to Wheezy.
* Enable hardening flags.  (Closes: #734918)
* patches/build-fixes: Enable verbose build logs.
* Build against the default ruby version.  (Closes: #722393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
   The pool that DB is allocated within (the "state" pool) is only used
75
75
   for a few, limited allocations to track each of the working copy roots
76
76
   that the DB is asked to operate upon. The memory usage on this pool
77
 
   os O(# wcroots), which should normally be one or a few. Custom clients
 
77
   is O(# wcroots), which should normally be one or a few. Custom clients
78
78
   which hold open structures over a significant period of time should
79
79
   pay particular attention to the number of roots touched, and the
80
80
   resulting impact on memory consumption (which should still be minimal).
128
128
typedef struct svn_wc__db_t svn_wc__db_t;
129
129
 
130
130
 
131
 
/* Enum indicating what kind of versioned object we're talking about.
132
 
 
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.
138
 
 
139
 
   ### KFF: Does this overlap too much with what svn_node_kind_t does?
140
 
 
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)
144
 
*/
145
 
typedef enum svn_wc__db_kind_t {
146
 
    /* The node is a directory. */
147
 
    svn_wc__db_kind_dir,
148
 
 
149
 
    /* The node is a file. */
150
 
    svn_wc__db_kind_file,
151
 
 
152
 
    /* The node is a symbolic link. */
153
 
    svn_wc__db_kind_symlink,
154
 
 
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
158
 
 
159
 
} svn_wc__db_kind_t;
160
 
 
161
 
 
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,
166
135
 
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.
170
140
 
171
141
       In many cases svn_wc__db_status_added means any of added, moved-here
243
213
 
244
214
 
245
215
/*
246
 
  @defgroup svn_wc__db_admin  General administractive functions
 
216
  @defgroup svn_wc__db_admin  General administrative functions
247
217
  @{
248
218
*/
249
219
 
259
229
   the administrative operation. It should live at least as long as the
260
230
   RESULT_POOL parameter.
261
231
 
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
 
236
   from that API.
 
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.
269
240
 
286
257
*/
287
258
svn_error_t *
288
259
svn_wc__db_open(svn_wc__db_t **db,
289
 
                const svn_config_t *config,
290
 
                svn_boolean_t auto_upgrade,
 
260
                svn_config_t *config,
 
261
                svn_boolean_t open_without_upgrade,
291
262
                svn_boolean_t enforce_empty_wq,
292
263
                apr_pool_t *result_pool,
293
264
                apr_pool_t *scratch_pool);
338
309
   be returned.
339
310
 
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.
345
316
 
346
317
   LOCAL_RELPATH will be allocated in RESULT_POOL. All other (temporary)
347
318
   allocations will be made in SCRATCH_POOL.
 
319
 
 
320
   This function is available when DB is opened with the OPEN_WITHOUT_UPGRADE
 
321
   option.
348
322
*/
349
323
svn_error_t *
350
324
svn_wc__db_to_relpath(const char **local_relpath,
363
337
 
364
338
   LOCAL_ABSPATH will be allocated in RESULT_POOL. All other (temporary)
365
339
   allocations will be made in SCRATCH_POOL.
366
 
*/
 
340
 
 
341
   This function is available when DB is opened with the OPEN_WITHOUT_UPGRADE
 
342
   option.
 
343
 */
367
344
svn_error_t *
368
345
svn_wc__db_from_relpath(const char **local_abspath,
369
346
                        svn_wc__db_t *db,
373
350
                        apr_pool_t *scratch_pool);
374
351
 
375
352
/* Compute the working copy root WCROOT_ABSPATH for WRI_ABSPATH using DB.
 
353
 
 
354
   This function is available when DB is opened with the OPEN_WITHOUT_UPGRADE
 
355
   option.
376
356
 */
377
357
svn_error_t *
378
358
svn_wc__db_get_wcroot(const char **wcroot_abspath,
401
381
   In the BASE tree, each node corresponds to a particular node-rev in the
402
382
   repository.  It can be a mixed-revision tree.  Each node holds either a
403
383
   copy of the node-rev as it exists in the repository (if presence =
404
 
   'normal'), or a place-holder (if presence = 'absent' or 'excluded' or
 
384
   'normal'), or a place-holder (if presence = 'server-excluded' or 'excluded' or
405
385
   'not-present').
406
386
 
407
387
   @{
440
420
   when the value of NEW_ACTUAL_PROPS matches NEW_PROPS, store NULL in
441
421
   ACTUAL, to mark the properties unmodified.
442
422
 
 
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.
 
426
 
443
427
   Any work items that are necessary as part of this node construction may
444
428
   be passed in WORK_ITEMS.
445
429
 
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);
468
453
 
 
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.
 
458
   */
 
459
svn_error_t *
 
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,
 
466
                                         svn_depth_t depth,
 
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);
 
472
 
469
473
 
470
474
/* Add or replace a file in the BASE tree.
471
475
 
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);
525
531
 
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);
604
614
 
630
640
                                  const char *repos_root_url,
631
641
                                  const char *repos_uuid,
632
642
                                  svn_revnum_t revision,
633
 
                                  svn_wc__db_kind_t kind,
 
643
                                  svn_node_kind_t kind,
634
644
                                  svn_wc__db_status_t status,
635
645
                                  const svn_skel_t *conflict,
636
646
                                  const svn_skel_t *work_items,
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);
668
678
 
669
679
 
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
 
682
   scenarios.
671
683
 
672
684
   The node to remove is indicated by LOCAL_ABSPATH from the local
673
685
   filesystem.
674
686
 
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.
677
689
 
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
682
694
   conflict.
683
695
 
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.
 
698
 
 
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)
 
704
 
 
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.
 
707
 
 
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
 
710
   deleting.
 
711
 
 
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
 
714
   itself.
686
715
*/
687
716
svn_error_t *
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);
691
726
 
692
727
 
715
750
     LOCK               NULL
716
751
 
717
752
     HAD_PROPS          FALSE
 
753
     PROPS              NULL
718
754
 
719
755
     UPDATE_ROOT        FALSE
720
756
 
721
 
   If the STATUS is normal, and the REPOS_* values are NULL, then the
722
 
   caller should use svn_wc__db_scan_base_repos() to scan up the BASE
723
 
   tree for the repository information.
 
757
   If the STATUS is normal, the REPOS_* values will be non-NULL.
724
758
 
725
759
   If DEPTH is requested, and the node is NOT a directory, then the
726
760
   value will be set to svn_depth_unknown. If LOCAL_ABSPATH is a link,
732
766
   If TARGET is requested, and the node is NOT a symlink, then it will
733
767
   be set to NULL.
734
768
 
 
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.
 
773
 
735
774
   If UPDATE_ROOT is requested, set it to TRUE if the node should only
736
775
   be updated when it is the root of an update (e.g. file externals).
737
776
 
740
779
*/
741
780
svn_error_t *
742
781
svn_wc__db_base_get_info(svn_wc__db_status_t *status,
743
 
                         svn_wc__db_kind_t *kind,
 
782
                         svn_node_kind_t *kind,
744
783
                         svn_revnum_t *revision,
745
784
                         const char **repos_relpath,
746
785
                         const char **repos_root_url,
753
792
                         const char **target,
754
793
                         svn_wc__db_lock_t **lock,
755
794
                         svn_boolean_t *had_props,
 
795
                         apr_hash_t **props,
756
796
                         svn_boolean_t *update_root,
757
797
                         svn_wc__db_t *db,
758
798
                         const char *local_abspath,
763
803
   fields needed by the adm crawler. */
764
804
struct svn_wc__db_base_info_t {
765
805
  svn_wc__db_status_t status;
766
 
  svn_wc__db_kind_t kind;
 
806
  svn_node_kind_t kind;
767
807
  svn_revnum_t revnum;
768
808
  const char *repos_relpath;
769
809
  const char *repos_root_url;
788
828
   *PROPS maps "const char *" names to "const svn_string_t *" values.
789
829
   If the node has no properties, set *PROPS to an empty hash.
790
830
   *PROPS will never be set to NULL.
791
 
   If the node is not present in the BASE tree, return an error.
 
831
   If the node is not present in the BASE tree (with presence 'normal'
 
832
   or 'incomplete'), return an error.
792
833
   Allocate *PROPS and its keys and values in RESULT_POOL.
793
834
*/
794
835
svn_error_t *
974
1015
                             apr_pool_t *scratch_pool);
975
1016
 
976
1017
 
 
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. */
 
1020
svn_error_t *
 
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,
 
1025
                             void *cancel_baton,
 
1026
                             apr_pool_t *scratch_pool);
 
1027
 
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
979
1030
 * tables. */
1020
1071
                             svn_revnum_t revision,
1021
1072
 
1022
1073
                             const apr_hash_t *props,
 
1074
                             apr_array_header_t *iprops,
1023
1075
 
1024
1076
                             svn_revnum_t changed_rev,
1025
1077
                             apr_time_t changed_date,
1038
1090
                             apr_hash_t *new_actual_props,
1039
1091
 
1040
1092
                             svn_boolean_t keep_recorded_info,
 
1093
                             const svn_skel_t *conflict,
1041
1094
                             const svn_skel_t *work_items,
1042
1095
                             apr_pool_t *scratch_pool);
1043
1096
 
1124
1177
 
1125
1178
   When KIND is requested then the value will be set to the kind of external.
1126
1179
 
1127
 
   If DEFININING_ABSPATH is requested, then the value will be set to the
 
1180
   If DEFINING_ABSPATH is requested, then the value will be set to the
1128
1181
   absolute path of the directory which originally defined the external.
1129
1182
   (The path with the svn:externals property)
1130
1183
 
1148
1201
 */
1149
1202
svn_error_t *
1150
1203
svn_wc__db_external_read(svn_wc__db_status_t *status,
1151
 
                         svn_wc__db_kind_t *kind,
 
1204
                         svn_node_kind_t *kind,
1152
1205
                         const char **defining_abspath,
1153
1206
 
1154
1207
                         const char **repos_root_url,
1164
1217
                         apr_pool_t *result_pool,
1165
1218
                         apr_pool_t *scratch_pool);
1166
1219
 
 
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.
 
1223
 *
 
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).
 
1227
 *
 
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.
 
1230
 *
 
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().)
 
1239
 *
 
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. */
 
1243
svn_error_t *
 
1244
svn_wc__db_committable_externals_below(apr_array_header_t **externals,
 
1245
                                       svn_wc__db_t *db,
 
1246
                                       const char *local_abspath,
 
1247
                                       svn_boolean_t immediates_only,
 
1248
                                       apr_pool_t *result_pool,
 
1249
                                       apr_pool_t *scratch_pool);
 
1250
 
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.
1211
1295
 *
 
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().
 
1299
 *
1212
1300
 * Add WORK_ITEMS to the work queue. */
1213
1301
svn_error_t *
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);
1220
1309
 
 
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.
 
1313
 *
 
1314
 * If MOVED_BACK is not NULL, set *MOVED_BACK to TRUE when a move was reverted,
 
1315
 * otherwise to FALSE.
 
1316
 */
 
1317
svn_error_t *
 
1318
svn_wc__db_op_handle_move_back(svn_boolean_t *moved_back,
 
1319
                               svn_wc__db_t *db,
 
1320
                               const char *local_abspath,
 
1321
                               const char *moved_from_abspath,
 
1322
                               const svn_skel_t *work_items,
 
1323
                               apr_pool_t *scratch_pool);
 
1324
 
 
1325
 
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.
1224
1329
 *
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.
1228
1333
 *
1233
1338
svn_wc__db_op_copy_shadowed_layer(svn_wc__db_t *db,
1234
1339
                                  const char *src_abspath,
1235
1340
                                  const char *dst_abspath,
 
1341
                                  svn_boolean_t is_move,
1236
1342
                                  apr_pool_t *scratch_pool);
1237
1343
 
1238
1344
 
1255
1361
                       const char *original_uuid,
1256
1362
                       svn_revnum_t original_revision,
1257
1363
                       const apr_array_header_t *children,
 
1364
                       svn_boolean_t is_move,
1258
1365
                       svn_depth_t depth,
1259
1366
                       const svn_skel_t *conflict,
1260
1367
                       const svn_skel_t *work_items,
1276
1383
                        const char *original_uuid,
1277
1384
                        svn_revnum_t original_revision,
1278
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,
1279
1389
                        const svn_skel_t *conflict,
1280
1390
                        const svn_skel_t *work_items,
1281
1391
                        apr_pool_t *scratch_pool);
1298
1408
                           apr_pool_t *scratch_pool);
1299
1409
 
1300
1410
 
1301
 
/* ### do we need svn_wc__db_op_copy_absent() ??  */
 
1411
/* ### do we need svn_wc__db_op_copy_server_excluded() ??  */
1302
1412
 
1303
1413
 
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?  */
1308
1418
svn_error_t *
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);
1313
1424
 
1314
1425
 
1315
 
/* ### as a new file, there are no properties. this file has no "pristine"
 
1426
/* Add a file.
 
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?  */
1318
1431
svn_error_t *
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);
1323
1437
 
1324
1438
 
1325
 
/* ### newly added symlinks have no properties.  */
 
1439
/* Add a symlink.
 
1440
   PROPS gives the properties; empty or NULL means none. */
1326
1441
/* ### do we need a CONFLICTS param?  */
1327
1442
svn_error_t *
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);
1333
1449
 
1342
1458
   If PROPS is NULL, set the properties to be the same as the pristine
1343
1459
   properties.
1344
1460
 
1345
 
   CONFLICT is used to register a conflict on this node at the same time
1346
 
   the properties are changed.
 
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.
1347
1463
 
1348
1464
   WORK_ITEMS are inserted into the work queue, as additional things that
1349
1465
   need to be completed before the working copy is stable.
1370
1486
                        const svn_skel_t *work_items,
1371
1487
                        apr_pool_t *scratch_pool);
1372
1488
 
1373
 
/* See props.h  */
1374
 
#ifdef SVN__SUPPORT_BASE_MERGE
1375
 
/* ### Set the properties of the node LOCAL_ABSPATH in the BASE tree to PROPS.
1376
 
   ###
1377
 
   ### This function should not exist because properties should be stored
1378
 
   ### onto the BASE node at construction time, in a single atomic operation.
1379
 
   ###
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.
1383
 
*/
1384
 
svn_error_t *
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);
1389
 
 
1390
 
 
1391
 
/* ### Set the properties of the node LOCAL_ABSPATH in the WORKING tree
1392
 
   ### to PROPS.
1393
 
   ###
1394
 
   ### This function should not exist because properties should be stored
1395
 
   ### onto the WORKING node at construction time, in a single atomic
1396
 
   ### operation.
1397
 
   ###
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.
1401
 
*/
1402
 
svn_error_t *
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);
1407
 
#endif
1408
 
 
1409
1489
/* Mark LOCAL_ABSPATH, and all children, for deletion.
1410
1490
 *
 
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)
 
1494
 *
 
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.
 
1497
 *
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
1419
1506
svn_error_t *
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,
 
1514
                     void *cancel_baton,
1423
1515
                     svn_wc_notify_func2_t notify_func,
1424
1516
                     void *notify_baton,
1425
 
                     svn_cancel_func_t cancel_func,
1426
 
                     void *cancel_baton,
1427
1517
                     apr_pool_t *scratch_pool);
1428
1518
 
1429
1519
 
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,
 
1521
 * for deletion.
 
1522
 *
 
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).
 
1527
 *
 
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)
 
1531
 *
 
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.
 
1536
 *
 
1537
 * Note: the notification (and cancellation) occur outside of a SQLite
 
1538
 * transaction.
 
1539
 */
1432
1540
svn_error_t *
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,
 
1546
                          void *cancel_baton,
 
1547
                          svn_wc_notify_func2_t notify_func,
 
1548
                          void *notify_baton,
 
1549
                          apr_pool_t *scratch_pool);
1437
1550
 
1438
1551
 
1439
1552
/* ### mark PATH as (possibly) modified. "svn edit" ... right API here? */
1460
1573
                             void *cancel_baton,
1461
1574
                             apr_pool_t *scratch_pool);
1462
1575
 
1463
 
 
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.
 
1578
 
 
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.
 
1582
 
 
1583
   Any work items that are necessary as part of marking this node conflicted
 
1584
   can be passed in WORK_ITEMS.
 
1585
 */
1466
1586
svn_error_t *
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);
1470
1592
 
1471
1593
 
1480
1602
                            svn_boolean_t resolved_text,
1481
1603
                            svn_boolean_t resolved_props,
1482
1604
                            svn_boolean_t resolved_tree,
 
1605
                            const svn_skel_t *work_items,
1483
1606
                            apr_pool_t *scratch_pool);
1484
1607
 
1485
1608
 
1503
1626
                     apr_pool_t *scratch_pool);
1504
1627
 
1505
1628
/* Query the revert list for LOCAL_ABSPATH and set *REVERTED if the
1506
 
 * path was reverted.  Set *CONFLICT_OLD, *CONFLICT_NEW,
1507
 
 * *CONFLICT_WORKING and *PROP_REJECT to the names of the conflict
1508
 
 * files, or NULL if the names are not stored.
1509
 
 * 
 
1629
 * path was reverted.  Set *MARKER_FILES to a const char *list of
 
1630
 * marker files if any were recorded on LOCAL_ABSPATH.
 
1631
 *
1510
1632
 * Set *COPIED_HERE if the reverted node was copied here and is the
1511
1633
 * operation root of the copy.
1512
1634
 * Set *KIND to the node kind of the reverted node.
1515
1637
 */
1516
1638
svn_error_t *
1517
1639
svn_wc__db_revert_list_read(svn_boolean_t *reverted,
1518
 
                            const char **conflict_old,
1519
 
                            const char **conflict_new,
1520
 
                            const char **conflict_working,
1521
 
                            const char **prop_reject,
 
1640
                            const apr_array_header_t **marker_files,
1522
1641
                            svn_boolean_t *copied_here,
1523
 
                            svn_wc__db_kind_t *kind,
 
1642
                            svn_node_kind_t *kind,
1524
1643
                            svn_wc__db_t *db,
1525
1644
                            const char *local_abspath,
1526
1645
                            apr_pool_t *result_pool,
1530
1649
 * svn_wc__db_revert_list_read_copied_children(). */
1531
1650
typedef struct svn_wc__db_revert_list_copied_child_info_t {
1532
1651
  const char *abspath;
1533
 
  svn_wc__db_kind_t kind;
 
1652
  svn_node_kind_t kind;
1534
1653
} svn_wc__db_revert_list_copied_child_info_t ;
1535
1654
 
1536
1655
/* Return in *CHILDREN a list of reverted copied nodes at or within
1566
1685
                            const char *local_abspath,
1567
1686
                            apr_pool_t *scratch_pool);
1568
1687
 
1569
 
 
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.
1574
 
 */
1575
 
/* ### this is not an OPERATION. remove the _op_.  */
1576
 
svn_error_t *
1577
 
svn_wc__db_op_read_all_tree_conflicts(apr_hash_t **tree_conflicts,
1578
 
                                      svn_wc__db_t *db,
1579
 
                                      const char *local_abspath,
1580
 
                                      apr_pool_t *result_pool,
1581
 
                                      apr_pool_t *scratch_pool);
1582
 
 
1583
 
/* Get any tree conflict associated with LOCAL_ABSPATH in DB, and put it
1584
 
   in *TREE_CONFLICT, allocated in RESULT_POOL.
1585
 
 
1586
 
   Use SCRATCH_POOL for any temporary allocations.
1587
 
*/
1588
 
/* ### this is not an OPERATION. remove the _op_.  */
1589
 
svn_error_t *
1590
 
svn_wc__db_op_read_tree_conflict(
1591
 
                     const svn_wc_conflict_description2_t **tree_conflict,
1592
 
                     svn_wc__db_t *db,
1593
 
                     const char *local_abspath,
1594
 
                     apr_pool_t *result_pool,
1595
 
                     apr_pool_t *scratch_pool);
1596
 
 
1597
 
 
1598
 
/* Set the tree conflict on LOCAL_ABSPATH in DB to TREE_CONFLICT.  Use
1599
 
   NULL to remove a tree conflict.
1600
 
 
1601
 
   Use SCRATCH_POOL for any temporary allocations.
1602
 
*/
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()  */
1606
 
svn_error_t *
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);
1611
 
 
1612
 
 
1613
1688
/* ### status */
1614
1689
 
1615
1690
 
1641
1716
 
1642
1717
   The OUT parameters, and their "not available" values are:
1643
1718
     STATUS                  n/a (always available)
1644
 
     KIND                    svn_wc__db_kind_unknown   (For ACTUAL only nodes)
 
1719
     KIND                    svn_node_unknown   (For ACTUAL only nodes)
1645
1720
     REVISION                SVN_INVALID_REVNUM
1646
1721
     REPOS_RELPATH           NULL
1647
1722
     REPOS_ROOT_URL          NULL
1661
1736
     LOCK                    NULL
1662
1737
 
1663
1738
     RECORDED_SIZE           SVN_INVALID_FILESIZE
1664
 
     RECORDED_MOD_TIME       0
 
1739
     RECORDED_TIME       0
1665
1740
 
1666
1741
     CHANGELIST              NULL
1667
1742
     CONFLICTED              FALSE
1745
1820
   If HAD_PROPS is requested and the node has pristine props, the value will
1746
1821
   be set to TRUE.
1747
1822
 
1748
 
   If PROP_MODS is requested and the node has property modification the value
 
1823
   If PROPS_MOD is requested and the node has property modification the value
1749
1824
   will be set to TRUE.
1750
1825
 
1751
1826
   ### add information about the need to scan upwards to get a complete
1756
1831
   ### the TEXT_MOD may become an enumerated value at some point to
1757
1832
   ### indicate different states of knowledge about text modifications.
1758
1833
   ### for example, an "svn edit" command in the future might set a
1759
 
   ### flag indicating adminstratively-defined modification. and/or we
 
1834
   ### flag indicating administratively-defined modification. and/or we
1760
1835
   ### might have a status indicating that we saw it was modified while
1761
1836
   ### performing a filesystem traversal.
1762
1837
 
1790
1865
*/
1791
1866
svn_error_t *
1792
1867
svn_wc__db_read_info(svn_wc__db_status_t *status,  /* ### derived */
1793
 
                     svn_wc__db_kind_t *kind,
 
1868
                     svn_node_kind_t *kind,
1794
1869
                     svn_revnum_t *revision,
1795
1870
                     const char **repos_relpath,
1796
1871
                     const char **repos_root_url,
1813
1888
 
1814
1889
                     /* Recorded for files present in the working copy */
1815
1890
                     svn_filesize_t *recorded_size,
1816
 
                     apr_time_t *recorded_mod_time,
 
1891
                     apr_time_t *recorded_time,
1817
1892
 
1818
1893
                     /* From ACTUAL */
1819
1894
                     const char **changelist,
1838
1913
   fields needed by status. */
1839
1914
struct svn_wc__db_info_t {
1840
1915
  svn_wc__db_status_t status;
1841
 
  svn_wc__db_kind_t kind;
 
1916
  svn_node_kind_t kind;
1842
1917
  svn_revnum_t revnum;
1843
1918
  const char *repos_relpath;
1844
1919
  const char *repos_root_url;
1849
1924
  svn_depth_t depth;
1850
1925
 
1851
1926
  svn_filesize_t recorded_size;
1852
 
  apr_time_t recorded_mod_time;
 
1927
  apr_time_t recorded_time;
1853
1928
 
1854
1929
  const char *changelist;
1855
1930
  svn_boolean_t conflicted;
1859
1934
  svn_boolean_t op_root;
1860
1935
 
1861
1936
  svn_boolean_t has_checksum;
 
1937
  svn_boolean_t copied;
1862
1938
  svn_boolean_t had_props;
1863
1939
  svn_boolean_t props_mod;
1864
1940
 
1868
1944
  svn_boolean_t locked;     /* WC directory lock */
1869
1945
  svn_wc__db_lock_t *lock;  /* Repository file lock */
1870
1946
  svn_boolean_t incomplete; /* TRUE if a working node is incomplete */
 
1947
 
 
1948
  const char *moved_to_abspath; /* Only on op-roots. See svn_wc_status3_t. */
 
1949
  svn_boolean_t moved_here;     /* Only on op-roots. */
 
1950
 
 
1951
  svn_boolean_t file_external;
1871
1952
};
1872
1953
 
1873
1954
/* Return in *NODES a hash mapping name->struct svn_wc__db_info_t for
1891
1972
   fields needed by svn_wc__internal_walk_children(). */
1892
1973
struct svn_wc__db_walker_info_t {
1893
1974
  svn_wc__db_status_t status;
1894
 
  svn_wc__db_kind_t kind;
 
1975
  svn_node_kind_t kind;
1895
1976
};
1896
1977
 
1897
1978
/* When a node is deleted in WORKING, some of its information is no longer
1907
1988
   calling svn_wc__db_read_info().
1908
1989
 
1909
1990
   (All other information (like original_*) can be obtained via other apis).
 
1991
 
 
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.
1910
1996
 */
1911
1997
svn_error_t *
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,
1918
2004
                              const svn_checksum_t **checksum, /* files only */
1919
2005
                              const char **target, /* symlinks only */
1920
2006
                              svn_boolean_t *had_props,
 
2007
                              apr_hash_t **props,
1921
2008
                              svn_wc__db_t *db,
1922
2009
                              const char *local_abspath,
1923
2010
                              apr_pool_t *result_pool,
1945
2032
                                  apr_pool_t *scratch_pool);
1946
2033
 
1947
2034
/* Return in *NODES a hash mapping name->struct svn_wc__db_walker_info_t for
1948
 
   the children of DIR_ABSPATH. "name" is the child's name relatve to
 
2035
   the children of DIR_ABSPATH. "name" is the child's name relative to
1949
2036
   DIR_ABSPATH, not an absolute path. */
1950
2037
svn_error_t *
1951
2038
svn_wc__db_read_children_walker_info(apr_hash_t **nodes,
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).
1991
2078
 *
1992
 
 * If BASE_PROPS is TRUE, read the properties from the BASE layer (op_depth=0),
1993
 
 * without local modifications.
1994
 
 *
1995
 
 * If BASE_PROPS is FALSE, read the properties from the WORKING layer (highest
1996
 
 * op_depth).
1997
 
 *
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.
2000
2081
 */
2001
2082
svn_error_t *
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);
2032
2112
 
 
2113
 
 
2114
/**
 
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.
 
2121
 *
 
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.
 
2126
 *
 
2127
 * If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to the actual
 
2128
 * properties stored on LOCAL_ABSPATH.
 
2129
 *
 
2130
 * Allocate @a *iprops in @a result_pool.  Use @a scratch_pool
 
2131
 * for temporary allocations.
 
2132
 */
 
2133
svn_error_t *
 
2134
svn_wc__db_read_inherited_props(apr_array_header_t **iprops,
 
2135
                                apr_hash_t **actual_props,
 
2136
                                svn_wc__db_t *db,
 
2137
                                const char *local_abspath,
 
2138
                                const char *propname,
 
2139
                                apr_pool_t *result_pool,
 
2140
                                apr_pool_t *scratch_pool);
 
2141
 
 
2142
/* Read a BASE node's inherited property information.
 
2143
 
 
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.
 
2147
 
 
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.
 
2151
 
 
2152
   Allocate *IPROPS in RESULT_POOL, use SCRATCH_POOL for temporary
 
2153
   allocations. */
 
2154
svn_error_t *
 
2155
svn_wc__db_read_cached_iprops(apr_array_header_t **iprops,
 
2156
                              svn_wc__db_t *db,
 
2157
                              const char *local_abspath,
 
2158
                              apr_pool_t *result_pool,
 
2159
                              apr_pool_t *scratch_pool);
 
2160
 
 
2161
/* Find BASE nodes with cached inherited properties.
 
2162
 
 
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.
 
2167
 
 
2168
   Allocate *IPROP_PATHS in RESULT_POOL.
 
2169
   Use SCRATCH_POOL for temporary allocations. */
 
2170
svn_error_t *
 
2171
svn_wc__db_get_children_with_cached_iprops(apr_hash_t **iprop_paths,
 
2172
                                           svn_depth_t depth,
 
2173
                                           const char *local_abspath,
 
2174
                                           svn_wc__db_t *db,
 
2175
                                           apr_pool_t *result_pool,
 
2176
                                           apr_pool_t *scratch_pool);
 
2177
 
 
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.
 
2181
 *
 
2182
 * Allocate the result in RESULT_POOL, and perform temporary allocations in
 
2183
 * SCRATCH_POOL.
 
2184
 */
 
2185
svn_error_t *
 
2186
svn_wc__db_prop_retrieve_recursive(apr_hash_t **values,
 
2187
                                   svn_wc__db_t *db,
 
2188
                                   const char *local_abspath,
 
2189
                                   const char *propname,
 
2190
                                   apr_pool_t *result_pool,
 
2191
                                   apr_pool_t *scratch_pool);
 
2192
 
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.
2035
2195
 
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.
2040
2200
 
2041
2201
   Allocate *CHILDREN in RESULT_POOL and do temporary allocations in
2042
2202
   SCRATCH_POOL.
2083
2243
                                 apr_pool_t *result_pool,
2084
2244
                                 apr_pool_t *scratch_pool);
2085
2245
 
2086
 
/* Read into *MARKER_FILES the basenames of the immediate children of
2087
 
   LOCAL_ABSPATH in DB that are unversioned marker files for text or
2088
 
   property conflicts.  The files may have been deleted by the user.
 
2246
/* Read into *MARKER_FILES the absolute paths of the marker files
 
2247
   of conflicts stored on LOCAL_ABSPATH and its immediate children in DB.
 
2248
   The on-disk files may have been deleted by the user.
2089
2249
 
2090
2250
   Allocate *MARKER_FILES in RESULT_POOL and do temporary allocations
2091
2251
   in SCRATCH_POOL */
2092
 
/* ### This function will probably be removed. */
2093
2252
svn_error_t *
2094
2253
svn_wc__db_get_conflict_marker_files(apr_hash_t **markers,
2095
2254
                                     svn_wc__db_t *db,
2097
2256
                                     apr_pool_t *result_pool,
2098
2257
                                     apr_pool_t *scratch_pool);
2099
2258
 
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.
2102
2261
 
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.
2104
2264
 
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
2108
 
       per victim */
2109
 
/*  ### This function will probably be removed. */
2110
2267
svn_error_t *
2111
 
svn_wc__db_read_conflicts(const apr_array_header_t **conflicts,
2112
 
                          svn_wc__db_t *db,
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,
 
2269
                         svn_wc__db_t *db,
 
2270
                         const char *local_abspath,
 
2271
                         apr_pool_t *result_pool,
 
2272
                         apr_pool_t *scratch_pool);
2116
2273
 
2117
2274
 
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.
2123
2280
 
 
2281
   The SHOW_HIDDEN and SHOW_DELETED flags report certain states as kind none.
 
2282
 
 
2283
   When nodes have certain statee they are only reported when:
 
2284
      svn_wc__db_status_not_present         when show_hidden && show_deleted
 
2285
 
 
2286
      svn_wc__db_status_excluded            when show_hidden
 
2287
      svn_wc__db_status_server_excluded     when show_hidden
 
2288
 
 
2289
      svn_wc__db_status_deleted             when show_deleted
 
2290
 
 
2291
   In other cases these nodes are reported with *KIND as svn_node_none.
 
2292
   (See also svn_wc_read_kind2()'s documentation)
 
2293
 
2124
2294
   Uses SCRATCH_POOL for temporary allocations.  */
2125
2295
svn_error_t *
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);
2131
2303
 
2132
2304
 
2166
2338
   ### changelist usage -- we may already assume the list fits in memory.
2167
2339
*/
2168
2340
 
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.
2172
2342
 */
2173
2343
svn_error_t *
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);
2178
2348
 
 
2349
/* Check whether a node is a working copy root and/or switched.
 
2350
 
 
2351
   If LOCAL_ABSPATH is the root of a working copy, set *IS_WC_ROOT to TRUE,
 
2352
   otherwise to FALSE.
 
2353
 
 
2354
   If LOCAL_ABSPATH is switched against its parent in the same working copy
 
2355
   set *IS_SWITCHED to TRUE, otherwise to FALSE.
 
2356
 
 
2357
   If KIND is not null, set *KIND to the node type of LOCAL_ABSPATH.
 
2358
 
 
2359
   Any of the output arguments can be null to specify that the result is not
 
2360
   interesting to the caller.
 
2361
 
 
2362
   Use SCRATCH_POOL for temporary allocations.
 
2363
 */
 
2364
svn_error_t *
 
2365
svn_wc__db_is_switched(svn_boolean_t *is_wcroot,
 
2366
                       svn_boolean_t *is_switched,
 
2367
                       svn_node_kind_t *kind,
 
2368
                       svn_wc__db_t *db,
 
2369
                       const char *local_abspath,
 
2370
                       apr_pool_t *scratch_pool);
2179
2371
 
2180
2372
 
2181
2373
/* @} */
2220
2412
   the commit. It will become the BASE node's 'revnum' and 'changed_rev'
2221
2413
   values in the BASE_NODE table.
2222
2414
 
2223
 
   CHANGED_REVISION is the the new 'last changed' revision. If the node is
 
2415
   CHANGED_REVISION is the new 'last changed' revision. If the node is
2224
2416
   modified its value is equivalent to NEW_REVISION, but in case of a
2225
 
   decendant of a copy/move it can be an older revision.
 
2417
   descendant of a copy/move it can be an older revision.
2226
2418
 
2227
2419
   CHANGED_DATE is the (server-side) date of CHANGED_REVISION. It may be 0 if
2228
2420
   the revprop is missing on the revision.
2283
2475
svn_error_t *
2284
2476
svn_wc__db_global_update(svn_wc__db_t *db,
2285
2477
                         const char *local_abspath,
2286
 
                         svn_wc__db_kind_t new_kind,
 
2478
                         svn_node_kind_t new_kind,
2287
2479
                         const char *new_repos_relpath,
2288
2480
                         svn_revnum_t new_revision,
2289
2481
                         const apr_hash_t *new_props,
2325
2517
   EXCLUDE_RELPATHS is a hash containing const char *local_relpath.  Nodes
2326
2518
   for pathnames contained in EXCLUDE_RELPATHS are not touched by this
2327
2519
   function.  These pathnames should be paths relative to the wcroot.
 
2520
 
 
2521
   If WCROOT_IPROPS is not NULL it is a hash mapping const char * absolute
 
2522
   working copy paths to depth-first ordered arrays of
 
2523
   svn_prop_inherited_item_t * structures.  If LOCAL_ABSPATH exists in
 
2524
   WCROOT_IPROPS, then set the hashed value as the node's inherited
 
2525
   properties.
2328
2526
*/
2329
2527
svn_error_t *
2330
2528
svn_wc__db_op_bump_revisions_post_update(svn_wc__db_t *db,
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,
 
2538
                                         void *notify_baton,
2338
2539
                                         apr_pool_t *scratch_pool);
2339
2540
 
2340
2541
 
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.
2342
2543
 
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.
2346
2547
 
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".
2349
2550
 
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".
2352
2553
*/
2353
2554
svn_error_t *
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);
2359
2560
 
2360
2561
 
2405
2606
 
2406
2607
   All returned data will be allocated in RESULT_POOL. All temporary
2407
2608
   allocations will be made in SCRATCH_POOL.
 
2609
 
 
2610
   ### Either delete this function and use _base_get_info instead, or
 
2611
   ### add a 'revision' output to make a complete repository node location
 
2612
   ### and rename to not say 'scan', because it doesn't.
2408
2613
*/
2409
2614
svn_error_t *
2410
2615
svn_wc__db_scan_base_repos(const char **repos_relpath,
2479
2684
                         apr_pool_t *result_pool,
2480
2685
                         apr_pool_t *scratch_pool);
2481
2686
 
 
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.
 
2689
 *
 
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.
 
2692
 *
 
2693
 * If not NULL *OP_ROOT_ABSPATH will be set to the new location of the
 
2694
 * path that was actually moved
 
2695
 *
 
2696
 * If not NULL *OP_ROOT_MOVED_FROM_ABSPATH will be set to the old location
 
2697
 * of the path that was actually moved.
 
2698
 *
 
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
 
2701
 *
 
2702
 * Given a working copy
 
2703
 * A/B/C
 
2704
 * svn mv A/B D
 
2705
 * svn rm A
 
2706
 *
 
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
 
2712
 */
 
2713
svn_error_t *
 
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,
 
2718
                      svn_wc__db_t *db,
 
2719
                      const char *local_abspath,
 
2720
                      apr_pool_t *result_pool,
 
2721
                      apr_pool_t *scratch_pool);
2482
2722
 
2483
2723
/* Scan upwards for additional information about a deleted node.
2484
2724
 
2523
2763
 
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
2533
2774
 
2534
2775
   There are three further considerations when resolving a deleted node:
2535
2776
 
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.
2542
 
 
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.
2559
2793
 
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.
2562
 
 
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).
2566
2797
 
 
2798
   MOVED_TO_ABSPATH will specify the path where this node was moved to
 
2799
   if the node has moved-away.
 
2800
 
 
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.
 
2805
 
2567
2806
   All OUT parameters may be set to NULL to indicate a lack of interest in
2568
2807
   that piece of information.
2569
2808
 
2578
2817
svn_wc__db_scan_deletion(const char **base_del_abspath,
2579
2818
                         const char **moved_to_abspath,
2580
2819
                         const char **work_del_abspath,
 
2820
                         const char **moved_to_op_root_abspath,
2581
2821
                         svn_wc__db_t *db,
2582
2822
                         const char *local_abspath,
2583
2823
                         apr_pool_t *result_pool,
2639
2879
svn_error_t *
2640
2880
svn_wc__db_upgrade_insert_external(svn_wc__db_t *db,
2641
2881
                                   const char *local_abspath,
2642
 
                                   svn_wc__db_kind_t kind,
 
2882
                                   svn_node_kind_t kind,
2643
2883
                                   const char *parent_abspath,
2644
2884
                                   const char *def_local_abspath,
2645
2885
                                   const char *repos_relpath,
2663
2903
                                const char *repos_root_url,
2664
2904
                                apr_pool_t *scratch_pool);
2665
2905
 
 
2906
/* Upgrade the metadata concerning the WC at WCROOT_ABSPATH, in DB,
 
2907
 * to the SVN_WC__VERSION format.
 
2908
 *
 
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.
 
2912
 *
 
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
 
2915
 * is returned.
 
2916
 *
 
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.
 
2919
 */
 
2920
svn_error_t *
 
2921
svn_wc__db_bump_format(int *result_format,
 
2922
                       svn_boolean_t *bumped_format,
 
2923
                       svn_wc__db_t *db,
 
2924
                       const char *wcroot_abspath,
 
2925
                       apr_pool_t *scratch_pool);
 
2926
 
2666
2927
/* @} */
2667
2928
 
2668
2929
 
2704
2965
                         apr_pool_t *result_pool,
2705
2966
                         apr_pool_t *scratch_pool);
2706
2967
 
 
2968
/* Special variant of svn_wc__db_wq_fetch_next(), which in the same transaction
 
2969
   also records timestamps and sizes for one or more nodes */
 
2970
svn_error_t *
 
2971
svn_wc__db_wq_record_and_fetch_next(apr_uint64_t *id,
 
2972
                                    svn_skel_t **work_item,
 
2973
                                    svn_wc__db_t *db,
 
2974
                                    const char *wri_abspath,
 
2975
                                    apr_uint64_t completed_id,
 
2976
                                    apr_hash_t *record_map,
 
2977
                                    apr_pool_t *result_pool,
 
2978
                                    apr_pool_t *scratch_pool);
 
2979
 
 
2980
 
2707
2981
/* @} */
2708
2982
 
2709
2983
 
2723
2997
                         svn_boolean_t steal_lock,
2724
2998
                         apr_pool_t *scratch_pool);
2725
2999
 
 
3000
/* Set LOCK_ABSPATH to the path of the the directory that owns the
 
3001
   lock on LOCAL_ABSPATH, or NULL, if LOCAL_ABSPATH is not locked. */
 
3002
svn_error_t*
 
3003
svn_wc__db_wclock_find_root(const char **lock_abspath,
 
3004
                            svn_wc__db_t *db,
 
3005
                            const char *local_abspath,
 
3006
                            apr_pool_t *result_pool,
 
3007
                            apr_pool_t *scratch_pool);
 
3008
 
2726
3009
/* Check if somebody has a wclock on LOCAL_ABSPATH */
2727
3010
svn_error_t *
2728
3011
svn_wc__db_wclocked(svn_boolean_t *locked,
2755
3038
*/
2756
3039
 
2757
3040
/* Removes all references to LOCAL_ABSPATH from DB, while optionally leaving
2758
 
   tree conflicts and/or a not present node.
 
3041
   a not present node.
2759
3042
 
2760
3043
   This operation always recursively removes all nodes at and below
2761
3044
   LOCAL_ABSPATH from NODES and ACTUAL.
2762
3045
 
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)
 
3049
 
 
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.
 
3055
 
 
3056
 
 
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
 
3059
   record in BASE
2765
3060
 */
2766
3061
svn_error_t *
2767
 
svn_wc__db_op_remove_node(svn_wc__db_t *db,
 
3062
svn_wc__db_op_remove_node(svn_boolean_t *left_changes,
 
3063
                          svn_wc__db_t *db,
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,
 
3073
                          void *cancel_baton,
2771
3074
                          apr_pool_t *scratch_pool);
2772
3075
 
2773
 
/* Remove the WORKING_NODE row of LOCAL_ABSPATH in DB. */
2774
 
svn_error_t *
2775
 
svn_wc__db_temp_op_remove_working(svn_wc__db_t *db,
2776
 
                                  const char *local_abspath,
2777
 
                                  apr_pool_t *scratch_pool);
2778
 
 
2779
3076
/* Sets the depth of LOCAL_ABSPATH in its working copy to DEPTH using DB.
2780
3077
 
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. */
2869
3166
svn_error_t *
2870
 
svn_wc__db_temp_op_make_copy(svn_wc__db_t *db,
2871
 
                             const char *local_abspath,
2872
 
                             apr_pool_t *scratch_pool);
2873
 
 
2874
 
 
2875
 
/* Set the conflict marker information on LOCAL_ABSPATH to the specified
2876
 
   values */
2877
 
svn_error_t *
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);
2884
 
 
2885
 
/* Set the conflict marker information on LOCAL_ABSPATH to the specified
2886
 
   values */
2887
 
svn_error_t *
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);
2892
 
 
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.
2897
 
   */
2898
 
svn_error_t *
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,
2905
 
                                             svn_depth_t depth,
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);
2907
3172
 
2908
3173
/* Close the wc root LOCAL_ABSPATH and remove any per-directory
2909
3174
   handles associated with it. */
2913
3178
                     apr_pool_t *scratch_pool);
2914
3179
 
2915
3180
/* Return the OP_DEPTH for LOCAL_RELPATH. */
2916
 
apr_int64_t svn_wc__db_op_depth_for_upgrade(const char *local_relpath);
 
3181
int
 
3182
svn_wc__db_op_depth_for_upgrade(const char *local_relpath);
2917
3183
 
2918
3184
/* Set *HAVE_WORK TRUE if there is a working layer below the top layer and
2919
3185
   *HAVE_BASE if there is a base layer. Set *STATUS to the status of the
2946
3212
 * Only nodes with op_depth zero and presence 'normal' or 'incomplete'
2947
3213
 * are considered, so that added, deleted or excluded nodes do not affect
2948
3214
 * the result.  If COMMITTED is TRUE, set *MIN_REVISION and *MAX_REVISION
2949
 
 * to the lowest and highest comitted (i.e. "last changed") revision numbers,
 
3215
 * to the lowest and highest committed (i.e. "last changed") revision numbers,
2950
3216
 * respectively.
2951
3217
 *
2952
3218
 * Indicate in *IS_SPARSE_CHECKOUT whether any of the nodes within
2981
3247
 * Only nodes with op_depth zero and presence 'normal' or 'incomplete'
2982
3248
 * are considered, so that added, deleted or excluded nodes do not affect
2983
3249
 * the result.  If COMMITTED is TRUE, set *MIN_REVISION and *MAX_REVISION
2984
 
 * to the lowest and highest comitted (i.e. "last changed") revision numbers,
 
3250
 * to the lowest and highest committed (i.e. "last changed") revision numbers,
2985
3251
 * respectively. Use SCRATCH_POOL for temporary allocations.
2986
3252
 *
2987
3253
 * Either of MIN_REVISION and MAX_REVISION may be passed as NULL if
2998
3264
                             svn_boolean_t committed,
2999
3265
                             apr_pool_t *scratch_pool);
3000
3266
 
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.
3004
 
 *
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(). */
3008
 
svn_error_t *
3009
 
svn_wc__db_is_sparse_checkout(svn_boolean_t *is_sparse_checkout,
3010
 
                              svn_wc__db_t *db,
3011
 
                              const char *local_abspath,
3012
 
                              apr_pool_t *scratch_pool);
3013
 
 
3014
3267
/* Indicate in *IS_SWITCHED whether any node beneath LOCAL_ABSPATH
3015
3268
 * is switched, using DB. Use SCRATCH_POOL for temporary allocations.
3016
3269
 *
3030
3283
                                 const char *trail_url,
3031
3284
                                 apr_pool_t *scratch_pool);
3032
3285
 
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.
3039
3292
 */
3040
3293
svn_error_t *
3041
 
svn_wc__db_get_server_excluded_subtrees(apr_hash_t **server_excluded_subtrees,
3042
 
                                        svn_wc__db_t *db,
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,
 
3295
                                 svn_wc__db_t *db,
 
3296
                                 const char *local_abspath,
 
3297
                                 apr_pool_t *result_pool,
 
3298
                                 apr_pool_t *scratch_pool);
3046
3299
 
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);
3068
3321
 
3069
3322
 
 
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 */
 
3328
};
 
3329
 
 
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. */
 
3333
svn_error_t *
 
3334
svn_wc__db_follow_moved_to(apr_array_header_t **moved_tos,
 
3335
                           svn_wc__db_t *db,
 
3336
                           const char *local_abspath,
 
3337
                           apr_pool_t *result_pool,
 
3338
                           apr_pool_t *scratch_pool);
 
3339
 
 
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. */
 
3342
svn_error_t *
 
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,
 
3346
                                             void *notify_baton,
 
3347
                                             svn_cancel_func_t cancel_func,
 
3348
                                             void *cancel_baton,
 
3349
                                             apr_pool_t *scratch_pool);
 
3350
 
 
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. */
 
3356
svn_error_t *
 
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,
 
3361
                         svn_wc__db_t *db,
 
3362
                         const char *local_abspath,
 
3363
                         apr_pool_t *result_pool,
 
3364
                         apr_pool_t *scratch_pool);
 
3365
 
 
3366
/* Recover space from the database file for LOCAL_ABSPATH by running
 
3367
 * the "vacuum" command. */
 
3368
svn_error_t *
 
3369
svn_wc__db_vacuum(svn_wc__db_t *db,
 
3370
                  const char *local_abspath,
 
3371
                  apr_pool_t *scratch_pool);
 
3372
 
 
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
 
3376
   function. */
 
3377
svn_error_t *
 
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,
 
3381
                                           void *notify_baton,
 
3382
                                           apr_pool_t *scratch_pool);
 
3383
 
 
3384
/* Like svn_wc__db_resolve_delete_raise_moved_away this should be
 
3385
   combined.
 
3386
   
 
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.
 
3390
 
 
3391
   ### See move_tests.py: move_many_update_delete for an example case.
 
3392
   */
 
3393
svn_error_t *
 
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,
 
3397
                                    void *notify_baton,
 
3398
                                    apr_pool_t *scratch_pool);
 
3399
 
 
3400
/* Break moves for all moved-away children of LOCAL_ABSPATH, within
 
3401
 * a single transaction.
 
3402
 *
 
3403
 * ### Like svn_wc__db_resolve_delete_raise_moved_away this should be
 
3404
 * combined. */
 
3405
svn_error_t *
 
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,
 
3409
                                             void *notify_baton,
 
3410
                                             apr_pool_t *scratch_pool);
 
3411
 
 
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. */
 
3415
svn_error_t *
 
3416
svn_wc__required_lock_for_resolve(const char **required_abspath,
 
3417
                                  svn_wc__db_t *db,
 
3418
                                  const char *local_abspath,
 
3419
                                  apr_pool_t *result_pool,
 
3420
                                  apr_pool_t *scratch_pool);
3070
3421
/* @} */
3071
3422
 
3072
3423