]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/subversion/subversion/libsvn_wc/wc.h
Upgrade Unbound to 1.6.4. More to follow.
[FreeBSD/FreeBSD.git] / contrib / subversion / subversion / libsvn_wc / wc.h
1 /*
2  * wc.h :  shared stuff internal to the svn_wc library.
3  *
4  * ====================================================================
5  *    Licensed to the Apache Software Foundation (ASF) under one
6  *    or more contributor license agreements.  See the NOTICE file
7  *    distributed with this work for additional information
8  *    regarding copyright ownership.  The ASF licenses this file
9  *    to you under the Apache License, Version 2.0 (the
10  *    "License"); you may not use this file except in compliance
11  *    with the License.  You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  *    Unless required by applicable law or agreed to in writing,
16  *    software distributed under the License is distributed on an
17  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  *    KIND, either express or implied.  See the License for the
19  *    specific language governing permissions and limitations
20  *    under the License.
21  * ====================================================================
22  */
23
24 \f
25 #ifndef SVN_LIBSVN_WC_H
26 #define SVN_LIBSVN_WC_H
27
28 #include <apr_pools.h>
29 #include <apr_hash.h>
30
31 #include "svn_types.h"
32 #include "svn_error.h"
33 #include "svn_wc.h"
34
35 #include "private/svn_sqlite.h"
36 #include "private/svn_wc_private.h"
37 #include "private/svn_skel.h"
38
39 #include "wc_db.h"
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif /* __cplusplus */
44
45
46 #define SVN_WC__PROP_REJ_EXT  ".prej"
47 \f
48 /* We can handle this format or anything lower, and we (should) error
49  * on anything higher.
50  *
51  * There is no format version 0; we started with 1.
52  *
53  * The bump to 2 introduced the ".svn-work" extension. For example,
54  *   ".svn/props/foo" became ".svn/props/foo.svn-work".
55  *
56  * The bump to 3 introduced the entry attribute
57  *   old-and-busted.c::ENTRIES_ATTR_ABSENT.
58  *
59  * The bump to 4 renamed the magic "svn:this_dir" entry name to "".
60  *
61  * == 1.0.x shipped with format 4
62  * == 1.1.x shipped with format 4
63  * == 1.2.x shipped with format 4
64  * == 1.3.x shipped with format 4
65  *
66  * The bump to 5 added support for replacing files with history (the
67  *   "revert base"). This was introduced in 1.4.0, but buggy until 1.4.6.
68  *
69  * The bump to 6 introduced caching of property modification state and
70  *   certain properties in the entries file.
71  *
72  * The bump to 7 changed the entries file format from XML to a custom
73  *   text-based format.
74  *
75  * The bump to 8 placed wcprops in one file per directory (named
76  *   upgrade.c::WCPROPS_ALL_DATA)
77  *
78  * == 1.4.x shipped with format 8
79  *
80  * The bump to 9 added changelists, keep-local, and sticky depth (for
81  *   selective/sparse checkouts) to each entry.
82  *
83  * == 1.5.x shipped with format 9
84  *
85  * The bump to 10 added tree-conflicts, file externals and a different
86  *   canonicalization of urls.
87  *
88  * == 1.6.x shipped with format 10
89  *
90  * The bump to 11 cleared the has_props, has_prop_mods, cachable_props,
91  *   and present_props values in the entries file. Older clients expect
92  *   proper values for these fields.
93  *
94  * The bump to 12 switched from 'entries' to the SQLite database 'wc.db'.
95  *
96  * The bump to 13 added the WORK_QUEUE table into 'wc.db', moved the
97  *   wcprops into the 'dav_cache' column in BASE_NODE, and stopped using
98  *   the 'incomplete_children' column of BASE_NODE.
99  *
100  * The bump to 14 added the WCLOCKS table (and migrated locks from the
101  *   filesystem into wc.db), and some columns to ACTUAL_NODE for future
102  *   use.
103  *
104  * The bump to 15 switched from depth='exclude' on directories to using
105  *   presence='exclude' within the BASE_NODE and WORKING_NODE tables.
106  *   This change also enabled exclude support on files and symlinks.
107  *
108  * The bump to 16 added 'locked_levels' to WC_LOCK, setting any existing
109  *   locks to a level of 0. The 'md5_checksum' column was added to PRISTINE
110  *   for future use.
111  *
112  * The bump to 17 added a '.svn/pristine' dir and moved the text bases into
113  *   the Pristine Store (the PRISTINE table and '.svn/pristine' dir), and
114  *   removed the '/.svn/text-base' dir.
115  *
116  * The bump to 18 moved the properties from separate files in the props and
117  *   prop-base directory (and .svn for the dir itself) into the wc.db file,
118  *   and then removed the props and prop-base dir.
119  *
120  * The bump to 19 introduced the 'single DB' per working copy. All metadata
121  *   is held in a single '.svn/wc.db' in the root directory of the working
122  *   copy. Bumped in r991236.
123  *
124  * The bump to 20 introduced NODES and drops BASE_NODE and WORKING_NODE,
125  *   op_depth is always 0 or 2. Bumped in r1005388.
126  *
127  * The bump to 21 moved tree conflict storage from the parent to the
128  *   conflicted node. Bumped in r1034436.
129  *
130  * The bump to 22 moved tree conflict storage from conflict_data column
131  *   to the tree_conflict_data column. Bumped in r1040255.
132  *
133  * The bump to 23 introduced multi-layer op_depth processing for NODES.
134  *   Bumped in r1044384.
135  *
136  * The bump to 24 started using the 'refcount' column of the PRISTINE table
137  *   correctly, instead of always setting it to '1'. Bumped in r1058523.
138  *
139  * The bump to 25 introduced the NODES_CURRENT view. Bumped in r1071283.
140  *
141  * The bump to 26 introduced the NODES_BASE view. Bumped in r1076617.
142  *
143  * The bump to 27 stored conflict files as relpaths rather than basenames.
144  *   Bumped in r1089593.
145  *
146  * The bump to 28 converted any remaining references to MD5 checksums
147  *   to SHA1 checksums. Bumped in r1095214.
148  *
149  * The bump to 29 renamed the pristine files from '<SHA1>' to '<SHA1>.svn-base'
150  * and introduced the EXTERNALS store. Bumped in r1129286.
151  *
152  * == 1.7.x shipped with format 29
153  *
154  * The bump to 30 switched the conflict storage to a skel inside conflict_data.
155  * Also clears some known invalid state. Bumped in r1387742.
156  *
157  * The bump to 31 added the inherited_props column in the NODES table.
158  * Bumped in r1395109.
159  *
160  * == 1.8.x shipped with format 31
161  * == 1.9.x shipped with format 31
162  * == 1.10.x shipped with format 31
163  *
164  * Please document any further format changes here.
165  */
166
167 #define SVN_WC__VERSION 31
168
169
170 /* Formats <= this have no concept of "revert text-base/props".  */
171 #define SVN_WC__NO_REVERT_FILES 4
172
173 /* A version <= this has wcprops stored in one file per entry. */
174 #define SVN_WC__WCPROPS_MANY_FILES_VERSION 7
175
176 /* A version < this can have urls that aren't canonical according to the new
177    rules. See issue #2475. */
178 #define SVN_WC__CHANGED_CANONICAL_URLS 10
179
180 /* The format number written to wc-ng working copies so that old clients
181    can recognize them as "newer Subversion"'s working copies. */
182 #define SVN_WC__NON_ENTRIES 12
183 #define SVN_WC__NON_ENTRIES_STRING "12\n"
184
185 /* A version < this uses the old 'entries' file mechanism.  */
186 #define SVN_WC__WC_NG_VERSION 12
187
188 /* In this version, the wcprops are "lost" between files and wc.db. We want
189    to ignore them in upgrades.  */
190 #define SVN_WC__WCPROPS_LOST 12
191
192 /* A version < this has no work queue (see workqueue.h).  */
193 #define SVN_WC__HAS_WORK_QUEUE 13
194
195 /* While we still have this DB version we should verify if there is
196    sqlite_stat1 table on opening */
197 #define SVN_WC__ENSURE_STAT1_TABLE 31
198
199 /* Return a string indicating the released version (or versions) of
200  * Subversion that used WC format number WC_FORMAT, or some other
201  * suitable string if no released version used WC_FORMAT.
202  *
203  * ### It's not ideal to encode this sort of knowledge in this low-level
204  * library.  On the other hand, it doesn't need to be updated often and
205  * should be easily found when it does need to be updated.  */
206 const char *
207 svn_wc__version_string_from_format(int wc_format);
208
209 /* Return true iff error E indicates an "is not a working copy" type
210    of error, either because something wasn't a working copy at all, or
211    because it's a working copy from a previous version (in need of
212    upgrade). */
213 #define SVN_WC__ERR_IS_NOT_CURRENT_WC(e) \
214             ((e->apr_err == SVN_ERR_WC_NOT_WORKING_COPY) || \
215              (e->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED))
216
217
218 \f
219 /*** Context handling ***/
220 struct svn_wc_context_t
221 {
222   /* The wc_db handle for this working copy. */
223   svn_wc__db_t *db;
224
225   /* Close the DB when we destroy this context?
226      (This is used inside backward compat wrappers, and should only be
227       modified by the proper create() functions. */
228   svn_boolean_t close_db_on_destroy;
229
230   /* The state pool for this context. */
231   apr_pool_t *state_pool;
232 };
233
234 /**
235  * Just like svn_wc_context_create(), only use the provided DB to construct
236  * the context.
237  *
238  * Even though DB is not allocated from the same pool at *WC_CTX, it is
239  * expected to remain open throughout the life of *WC_CTX.
240  */
241 svn_error_t *
242 svn_wc__context_create_with_db(svn_wc_context_t **wc_ctx,
243                                svn_config_t *config,
244                                svn_wc__db_t *db,
245                                apr_pool_t *result_pool);
246
247 \f
248 /*** Committed Queue ***/
249
250 /**
251  * Return the pool associated with QUEUE.  (This so we can keep some
252  * deprecated functions that need to peek inside the QUEUE struct in
253  * deprecated.c).
254  */
255 apr_pool_t *
256 svn_wc__get_committed_queue_pool(const struct svn_wc_committed_queue_t *queue);
257
258 \f
259 /*** Update traversals. ***/
260
261 struct svn_wc_traversal_info_t
262 {
263   /* The pool in which this structure and everything inside it is
264      allocated. */
265   apr_pool_t *pool;
266
267   /* The before and after values of the SVN_PROP_EXTERNALS property,
268    * for each directory on which that property changed.  These have
269    * the same layout as those returned by svn_wc_edited_externals().
270    *
271    * The hashes, their keys, and their values are allocated in the
272    * above pool.
273    */
274   apr_hash_t *externals_old;
275   apr_hash_t *externals_new;
276
277   /* The ambient depths of the working copy directories.  The keys are
278      working copy paths (as for svn_wc_edited_externals()), the values
279      are the result of svn_depth_to_word(depth_of_each_dir). */
280   apr_hash_t *depths;
281 };
282
283
284 /*** Names and file/dir operations in the administrative area. ***/
285
286 /** The files within the administrative subdir. **/
287 #define SVN_WC__ADM_FORMAT              "format"
288 #define SVN_WC__ADM_ENTRIES             "entries"
289 #define SVN_WC__ADM_TMP                 "tmp"
290 #define SVN_WC__ADM_PRISTINE            "pristine"
291 #define SVN_WC__ADM_NONEXISTENT_PATH    "nonexistent-path"
292
293 /* The basename of the ".prej" file, if a directory ever has property
294    conflicts.  This .prej file will appear *within* the conflicted
295    directory.  */
296 #define SVN_WC__THIS_DIR_PREJ           "dir_conflicts"
297
298 \f
299 /* A few declarations for stuff in util.c.
300  * If this section gets big, move it all out into a new util.h file. */
301
302 /* Ensure that DIR exists. */
303 svn_error_t *svn_wc__ensure_directory(const char *path, apr_pool_t *pool);
304
305
306 /* Return a hash keyed by 'const char *' property names and with
307    'svn_string_t *' values built from PROPS (which is an array of
308    pointers to svn_prop_t's) or to NULL if PROPS is NULL or empty.
309    PROPS items which lack a value will be ignored.  If PROPS contains
310    multiple properties with the same name, each successive such item
311    reached in a walk from the beginning to the end of the array will
312    overwrite the previous in the returned hash.
313
314    NOTE: While the returned hash will be allocated in RESULT_POOL, the
315    items it holds will share storage with those in PROPS.
316
317    ### This is rather the reverse of svn_prop_hash_to_array(), except
318    ### that function's arrays contains svn_prop_t's, whereas this
319    ### one's contains *pointers* to svn_prop_t's.  So much for
320    ### consistency.  */
321 apr_hash_t *
322 svn_wc__prop_array_to_hash(const apr_array_header_t *props,
323                            apr_pool_t *result_pool);
324
325 \f
326 /* Set *MODIFIED_P to non-zero if LOCAL_ABSPATH's text is modified with
327  * regard to the base revision, else set *MODIFIED_P to zero.
328  *
329  * If EXACT_COMPARISON is FALSE, translate LOCAL_ABSPATH's EOL
330  * style and keywords to repository-normal form according to its properties,
331  * and compare the result with the text base.
332  * Usually, EXACT_COMPARISON should be FALSE.
333  *
334  * If LOCAL_ABSPATH does not exist, consider it unmodified.  If it exists
335  * but is not under revision control (not even scheduled for
336  * addition), return the error SVN_WC_PATH_NOT_FOUND.
337  *
338  * If the text is unmodified and a write-lock is held this function
339  * will ensure that the last-known-unmodified timestamp and
340  * filesize of the file as recorded in DB matches the corresponding
341  * attributes of the actual file.  (This is often referred to as
342  * "timestamp repair", and serves to help future unforced is-modified
343  * checks return quickly if the file remains untouched.)
344  */
345 svn_error_t *
346 svn_wc__internal_file_modified_p(svn_boolean_t *modified_p,
347                                  svn_wc__db_t *db,
348                                  const char *local_abspath,
349                                  svn_boolean_t exact_comparison,
350                                  apr_pool_t *scratch_pool);
351
352
353 /* Prepare to merge a file content change into the working copy.
354
355    This does not merge properties; see svn_wc__merge_props() for that.
356    This does not necessarily change the file TARGET_ABSPATH on disk; it
357    may instead return work items that will replace the file on disk when
358    they are run.  ### Can we be more consistent about this?
359
360    Merge the difference between LEFT_ABSPATH and RIGHT_ABSPATH into
361    TARGET_ABSPATH.
362
363    Set *WORK_ITEMS to the appropriate work queue operations.
364
365    If there are any conflicts, append a conflict description to
366    *CONFLICT_SKEL.  (First allocate *CONFLICT_SKEL from RESULT_POOL if
367    it is initially NULL.  CONFLICT_SKEL itself must not be NULL.)
368    Also, unless it is considered to be a 'binary' file, mark any
369    conflicts in the text of the file TARGET_ABSPATH using LEFT_LABEL,
370    RIGHT_LABEL and TARGET_LABEL.
371
372    Set *MERGE_OUTCOME to indicate the result.
373
374    When DRY_RUN is true, no actual changes are made to the working copy.
375
376    If DIFF3_CMD is specified, the given external diff3 tool will
377    be used instead of our built in diff3 routines.
378
379    When MERGE_OPTIONS are specified, they are used by the internal
380    diff3 routines, or passed to the external diff3 tool.
381
382    WRI_ABSPATH describes in which working copy information should be
383    retrieved. (Interesting for merging file externals).
384
385    OLD_ACTUAL_PROPS is the set of actual properties before merging; used for
386    detranslating the file before merging.  This is necessary because, in
387    the case of updating, the update can have sent new properties, so we
388    cannot simply fetch and use the current actual properties.
389
390      ### Is OLD_ACTUAL_PROPS still necessary, now that we first prepare the
391          content change and property change and then apply them both to
392          the WC together?
393
394    Property changes sent by the update are provided in PROP_DIFF.
395
396    For a complete description, see svn_wc_merge5() for which this is
397    the (loggy) implementation.
398
399    *WORK_ITEMS will be allocated in RESULT_POOL. All temporary allocations
400    will be performed in SCRATCH_POOL.
401 */
402 svn_error_t *
403 svn_wc__internal_merge(svn_skel_t **work_items,
404                        svn_skel_t **conflict_skel,
405                        enum svn_wc_merge_outcome_t *merge_outcome,
406                        svn_wc__db_t *db,
407                        const char *left_abspath,
408                        const char *right_abspath,
409                        const char *target_abspath,
410                        const char *wri_abspath,
411                        const char *left_label,
412                        const char *right_label,
413                        const char *target_label,
414                        apr_hash_t *old_actual_props,
415                        svn_boolean_t dry_run,
416                        const char *diff3_cmd,
417                        const apr_array_header_t *merge_options,
418                        const apr_array_header_t *prop_diff,
419                        svn_cancel_func_t cancel_func,
420                        void *cancel_baton,
421                        apr_pool_t *result_pool,
422                        apr_pool_t *scratch_pool);
423
424 /* A default error handler for svn_wc_walk_entries3().  Returns ERR in
425    all cases. */
426 svn_error_t *
427 svn_wc__walker_default_error_handler(const char *path,
428                                      svn_error_t *err,
429                                      void *walk_baton,
430                                      apr_pool_t *pool);
431
432 /* Set *EDITOR and *EDIT_BATON to an ambient-depth-based filtering
433  * editor that wraps WRAPPED_EDITOR and WRAPPED_BATON.  This is only
434  * required for operations where the requested depth is @c
435  * svn_depth_unknown and the server's editor driver doesn't understand
436  * depth.  It is safe for *EDITOR and *EDIT_BATON to start as
437  * WRAPPED_EDITOR and WRAPPED_BATON.
438  *
439  * ANCHOR, TARGET, and DB are as in svn_wc_get_update_editor3.
440  *
441  * @a requested_depth must be one of the following depth values:
442  * @c svn_depth_infinity, @c svn_depth_empty, @c svn_depth_files,
443  * @c svn_depth_immediates, or @c svn_depth_unknown.
444  *
445  * Allocations are done in POOL.
446  */
447 svn_error_t *
448 svn_wc__ambient_depth_filter_editor(const svn_delta_editor_t **editor,
449                                     void **edit_baton,
450                                     svn_wc__db_t *db,
451                                     const char *anchor_abspath,
452                                     const char *target,
453                                     const svn_delta_editor_t *wrapped_editor,
454                                     void *wrapped_edit_baton,
455                                     apr_pool_t *result_pool);
456
457
458 /* Similar to svn_wc_conflicted_p3(), but with a wc_db parameter in place of
459  * a wc_context. */
460 svn_error_t *
461 svn_wc__internal_conflicted_p(svn_boolean_t *text_conflicted_p,
462                               svn_boolean_t *prop_conflicted_p,
463                               svn_boolean_t *tree_conflicted_p,
464                               svn_wc__db_t *db,
465                               const char *local_abspath,
466                               apr_pool_t *scratch_pool);
467
468 /* Similar to svn_wc__internal_conflicted_p(), but ignores
469  * moved-away-edit tree conflicts.  If CONFLICT_IGNORED_P is not NULL
470  * then sets *CONFLICT_IGNORED_P TRUE if a tree-conflict is ignored
471  * and FALSE otherwise. Also ignores text and property conflicts if
472  * TREE_ONLY is TRUE */
473 svn_error_t *
474 svn_wc__conflicted_for_update_p(svn_boolean_t *conflicted_p,
475                                 svn_boolean_t *conflict_ignored_p,
476                                 svn_wc__db_t *db,
477                                 const char *local_abspath,
478                                 svn_boolean_t tree_only,
479                                 apr_pool_t *scratch_pool);
480
481
482 /* Internal version of svn_wc_transmit_text_deltas3(). */
483 svn_error_t *
484 svn_wc__internal_transmit_text_deltas(svn_stream_t *tempstream,
485                                       const svn_checksum_t **new_text_base_md5_checksum,
486                                       const svn_checksum_t **new_text_base_sha1_checksum,
487                                       svn_wc__db_t *db,
488                                       const char *local_abspath,
489                                       svn_boolean_t fulltext,
490                                       const svn_delta_editor_t *editor,
491                                       void *file_baton,
492                                       apr_pool_t *result_pool,
493                                       apr_pool_t *scratch_pool);
494
495 /* Internal version of svn_wc_transmit_prop_deltas2(). */
496 svn_error_t *
497 svn_wc__internal_transmit_prop_deltas(svn_wc__db_t *db,
498                                      const char *local_abspath,
499                                      const svn_delta_editor_t *editor,
500                                      void *baton,
501                                      apr_pool_t *scratch_pool);
502
503 /* Library-internal version of svn_wc_ensure_adm4(). */
504 svn_error_t *
505 svn_wc__internal_ensure_adm(svn_wc__db_t *db,
506                             const char *local_abspath,
507                             const char *url,
508                             const char *repos_root_url,
509                             const char *repos_uuid,
510                             svn_revnum_t revision,
511                             svn_depth_t depth,
512                             apr_pool_t *scratch_pool);
513
514
515 /* Library-internal version of svn_wc__changelist_match(). */
516 svn_boolean_t
517 svn_wc__internal_changelist_match(svn_wc__db_t *db,
518                                   const char *local_abspath,
519                                   const apr_hash_t *clhash,
520                                   apr_pool_t *scratch_pool);
521
522 /* Library-internal version of svn_wc_walk_status(), which see. */
523 svn_error_t *
524 svn_wc__internal_walk_status(svn_wc__db_t *db,
525                              const char *local_abspath,
526                              svn_depth_t depth,
527                              svn_boolean_t get_all,
528                              svn_boolean_t no_ignore,
529                              svn_boolean_t ignore_text_mods,
530                              const apr_array_header_t *ignore_patterns,
531                              svn_wc_status_func4_t status_func,
532                              void *status_baton,
533                              svn_cancel_func_t cancel_func,
534                              void *cancel_baton,
535                              apr_pool_t *scratch_pool);
536
537 /** A callback invoked by the generic node-walker function.  */
538 typedef svn_error_t *(*svn_wc__node_found_func_t)(const char *local_abspath,
539                                                   svn_node_kind_t kind,
540                                                   void *walk_baton,
541                                                   apr_pool_t *scratch_pool);
542
543 /* Call @a walk_callback with @a walk_baton for @a local_abspath and all
544    nodes underneath it, restricted by @a walk_depth, and possibly
545    @a changelists.
546
547    If @a show_hidden is true, include hidden nodes, else ignore them.
548    If CHANGELISTS is non-NULL and non-empty, filter thereon. */
549 svn_error_t *
550 svn_wc__internal_walk_children(svn_wc__db_t *db,
551                                const char *local_abspath,
552                                svn_boolean_t show_hidden,
553                                const apr_array_header_t *changelists,
554                                svn_wc__node_found_func_t walk_callback,
555                                void *walk_baton,
556                                svn_depth_t walk_depth,
557                                svn_cancel_func_t cancel_func,
558                                void *cancel_baton,
559                                apr_pool_t *scratch_pool);
560
561 /* Library-internal version of svn_wc_remove_from_revision_control2,
562    which see.*/
563 svn_error_t *
564 svn_wc__internal_remove_from_revision_control(svn_wc__db_t *db,
565                                               const char *local_abspath,
566                                               svn_boolean_t destroy_wf,
567                                               svn_cancel_func_t cancel_func,
568                                               void *cancel_baton,
569                                               apr_pool_t *scratch_pool);
570
571 /* Internal version of svn_wc__node_get_origin() */
572 svn_error_t *
573 svn_wc__internal_get_origin(svn_boolean_t *is_copy,
574                             svn_revnum_t *revision,
575                             const char **repos_relpath,
576                             const char **repos_root_url,
577                             const char **repos_uuid,
578                             svn_depth_t *depth,
579                             const char **copy_root_abspath,
580                             svn_wc__db_t *db,
581                             const char *local_abspath,
582                             svn_boolean_t scan_deleted,
583                             apr_pool_t *result_pool,
584                             apr_pool_t *scratch_pool);
585
586 /* Upgrade the wc sqlite database given in SDB for the wc located at
587    WCROOT_ABSPATH. It's current/starting format is given by START_FORMAT.
588    After the upgrade is complete (to as far as the automatic upgrade will
589    perform), the resulting format is RESULT_FORMAT. All allocations are
590    performed in SCRATCH_POOL.  */
591 svn_error_t *
592 svn_wc__upgrade_sdb(int *result_format,
593                     const char *wcroot_abspath,
594                     svn_sqlite__db_t *sdb,
595                     int start_format,
596                     apr_pool_t *scratch_pool);
597
598 /* Create a conflict skel from the old separated data */
599 svn_error_t *
600 svn_wc__upgrade_conflict_skel_from_raw(svn_skel_t **conflicts,
601                                        svn_wc__db_t *db,
602                                        const char *wri_abspath,
603                                        const char *local_relpath,
604                                        const char *conflict_old,
605                                        const char *conflict_wrk,
606                                        const char *conflict_new,
607                                        const char *prej_file,
608                                        const char *tree_conflict_data,
609                                        apr_size_t tree_conflict_len,
610                                        apr_pool_t *result_pool,
611                                        apr_pool_t *scratch_pool);
612
613 svn_error_t *
614 svn_wc__wipe_postupgrade(const char *dir_abspath,
615                          svn_boolean_t whole_admin,
616                          svn_cancel_func_t cancel_func,
617                          void *cancel_baton,
618                          apr_pool_t *scratch_pool);
619
620 /* Ensure LOCAL_ABSPATH is still locked in DB.  Returns the error
621  * SVN_ERR_WC_NOT_LOCKED if this is not the case.
622  */
623 svn_error_t *
624 svn_wc__write_check(svn_wc__db_t *db,
625                     const char *local_abspath,
626                     apr_pool_t *scratch_pool);
627
628 /* Read into CONFLICTS svn_wc_conflict_description2_t* structs
629  * for all conflicts that have LOCAL_ABSPATH as victim.
630  *
631  * Victim must be versioned or be part of a tree conflict.
632  *
633  * If CREATE_TEMPFILES is TRUE, create temporary files for property conflicts.
634  *
635  * Allocate *CONFLICTS in RESULT_POOL and do temporary allocations in
636  * SCRATCH_POOL
637  */
638 svn_error_t *
639 svn_wc__read_conflicts(const apr_array_header_t **conflicts,
640                        svn_skel_t **conflict_skel,
641                        svn_wc__db_t *db,
642                        const char *local_abspath,
643                        svn_boolean_t create_tempfiles,
644                        svn_boolean_t only_tree_conflict,
645                        apr_pool_t *result_pool,
646                        apr_pool_t *scratch_pool);
647
648
649 /* Perform the actual merge of file changes between an original file,
650    identified by ORIGINAL_CHECKSUM (an empty file if NULL) to a new file
651    identified by NEW_CHECKSUM in the working copy identified by WRI_ABSPATH.
652
653    Merge the result into LOCAL_ABSPATH, which is part of the working copy
654    identified by WRI_ABSPATH. Use OLD_REVISION and TARGET_REVISION for naming
655    the intermediate files.
656
657    Set *FOUND_TEXT_CONFLICT to TRUE when the merge encountered a conflict,
658    otherwise to FALSE.
659
660    The rest of the arguments are passed to svn_wc__internal_merge.
661  */
662 svn_error_t *
663 svn_wc__perform_file_merge(svn_skel_t **work_items,
664                            svn_skel_t **conflict_skel,
665                            svn_boolean_t *found_conflict,
666                            svn_wc__db_t *db,
667                            const char *local_abspath,
668                            const char *wri_abspath,
669                            const svn_checksum_t *new_checksum,
670                            const svn_checksum_t *original_checksum,
671                            apr_hash_t *old_actual_props,
672                            const apr_array_header_t *ext_patterns,
673                            svn_revnum_t old_revision,
674                            svn_revnum_t target_revision,
675                            const apr_array_header_t *propchanges,
676                            const char *diff3_cmd,
677                            svn_cancel_func_t cancel_func,
678                            void *cancel_baton,
679                            apr_pool_t *result_pool,
680                            apr_pool_t *scratch_pool);
681
682
683 /* Couple of random helpers for the Ev2 shims.
684    ### These will eventually be obsoleted and removed. */
685 struct svn_wc__shim_fetch_baton_t
686 {
687   svn_wc__db_t *db;
688   const char *base_abspath;
689   svn_boolean_t fetch_base;
690 };
691
692 /* Using a BATON of struct shim_fetch_baton, return KIND for PATH. */
693 svn_error_t *
694 svn_wc__fetch_kind_func(svn_node_kind_t *kind,
695                         void *baton,
696                         const char *path,
697                         svn_revnum_t base_revision,
698                         apr_pool_t *scratch_pool);
699
700 /* Using a BATON of struct shim_fetch_baton, return PROPS for PATH. */
701 svn_error_t *
702 svn_wc__fetch_props_func(apr_hash_t **props,
703                          void *baton,
704                          const char *path,
705                          svn_revnum_t base_revision,
706                          apr_pool_t *result_pool,
707                          apr_pool_t *scratch_pool);
708
709 /* Using a BATON of struct shim_fetch_baton, return a delta base for PATH. */
710 svn_error_t *
711 svn_wc__fetch_base_func(const char **filename,
712                         void *baton,
713                         const char *path,
714                         svn_revnum_t base_revision,
715                         apr_pool_t *result_pool,
716                         apr_pool_t *scratch_pool);
717
718 /* Find duplicate targets in *EXTERNALS, a list of svn_wc_external_item2_t*
719  * elements, and store each target string in *DUPLICATE_TARGETS as const
720  * char * elements. *DUPLICATE_TARGETS will be NULL if no duplicates were
721  * found. */
722 svn_error_t *
723 svn_wc__externals_find_target_dups(apr_array_header_t **duplicate_targets,
724                                    apr_array_header_t *externals,
725                                    apr_pool_t *pool,
726                                    apr_pool_t *scratch_pool);
727
728 svn_error_t *
729 svn_wc__node_has_local_mods(svn_boolean_t *modified,
730                             svn_boolean_t *all_edits_are_deletes,
731                             svn_wc__db_t *db,
732                             const char *local_abspath,
733                             svn_boolean_t ignore_unversioned,
734                             svn_cancel_func_t cancel_func,
735                             void *cancel_baton,
736                             apr_pool_t *scratch_pool);
737
738 #ifdef __cplusplus
739 }
740 #endif /* __cplusplus */
741
742 #endif /* SVN_LIBSVN_WC_H */