]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/subversion/subversion/include/svn_wc.h
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / contrib / subversion / subversion / include / svn_wc.h
1 /**
2  * @copyright
3  * ====================================================================
4  *    Licensed to the Apache Software Foundation (ASF) under one
5  *    or more contributor license agreements.  See the NOTICE file
6  *    distributed with this work for additional information
7  *    regarding copyright ownership.  The ASF licenses this file
8  *    to you under the Apache License, Version 2.0 (the
9  *    "License"); you may not use this file except in compliance
10  *    with the License.  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *    Unless required by applicable law or agreed to in writing,
15  *    software distributed under the License is distributed on an
16  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  *    KIND, either express or implied.  See the License for the
18  *    specific language governing permissions and limitations
19  *    under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_wc.h
24  * @brief Subversion's working copy library
25  *
26  * Requires:
27  *            - A working copy
28  *
29  * Provides:
30  *            - Ability to manipulate working copy's versioned data.
31  *            - Ability to manipulate working copy's administrative files.
32  *
33  * Used By:
34  *            - Clients.
35  *
36  * Notes:
37  *            The 'path' parameters to most of the older functions can be
38  *            absolute or relative (relative to current working
39  *            directory).  If there are any cases where they are
40  *            relative to the path associated with the
41  *            'svn_wc_adm_access_t *adm_access' baton passed along with the
42  *            path, those cases should be explicitly documented, and if they
43  *            are not, please fix it. All new functions introduced since
44  *            Subversion 1.7 require absolute paths, unless explicitly
45  *            documented otherwise.
46  *
47  *            Starting with Subversion 1.7, several arguments are re-ordered
48  *            to be more consistent through the api. The common ordering used
49  *            is:
50  *
51  *            Firsts:
52  *              - Output arguments
53  *            Then:
54  *              - Working copy context
55  *              - Local abspath
56  *            Followed by:
57  *              - Function specific arguments
58  *              - Specific callbacks with their batons
59  *            Finally:
60  *              - Generic callbacks (with baton) from directly functional to
61  *                just observing:
62  *                  - svn_wc_conflict_resolver_func2_t
63  *                  - svn_wc_external_update_t
64  *                  - svn_cancel_func_t
65  *                  - svn_wc_notify_func2_t
66  *              - Result pool
67  *              - Scratch pool.
68  */
69
70 #ifndef SVN_WC_H
71 #define SVN_WC_H
72
73 #include <apr.h>
74 #include <apr_pools.h>
75 #include <apr_tables.h>
76 #include <apr_hash.h>
77 #include <apr_time.h>
78 #include <apr_file_io.h>
79
80 #include "svn_types.h"
81 #include "svn_string.h"
82 #include "svn_checksum.h"
83 #include "svn_io.h"
84 #include "svn_delta.h"     /* for svn_stream_t */
85 #include "svn_opt.h"
86 #include "svn_ra.h"        /* for svn_ra_reporter_t type */
87
88 #ifdef __cplusplus
89 extern "C" {
90 #endif /* __cplusplus */
91
92 \f
93 /**
94  * Get libsvn_wc version information.
95  *
96  * @since New in 1.1.
97  */
98 const svn_version_t *
99 svn_wc_version(void);
100
101
102 /**
103  * @defgroup svn_wc  Working copy management
104  * @{
105  */
106
107
108 /** Flags for use with svn_wc_translated_file2() and svn_wc_translated_stream().
109  *
110  * @defgroup translate_flags Translation flags
111  * @{
112  */
113
114   /** Translate from Normal Form.
115    *
116    * The working copy text bases and repository files are stored
117    * in normal form.  Some files' contents - or ever representation -
118    * differs between the working copy and the normal form.  This flag
119    * specifies to take the latter form as input and transform it
120    * to the former.
121    *
122    * Either this flag or #SVN_WC_TRANSLATE_TO_NF should be specified,
123    * but not both.
124    */
125 #define SVN_WC_TRANSLATE_FROM_NF                 0x00000000
126
127   /** Translate to Normal Form.
128    *
129    * Either this flag or #SVN_WC_TRANSLATE_FROM_NF should be specified,
130    * but not both.
131    */
132 #define SVN_WC_TRANSLATE_TO_NF                   0x00000001
133
134   /** Force repair of eol styles, making sure the output file consistently
135    * contains the one eol style as specified by the svn:eol-style
136    * property and the required translation direction.
137    *
138    */
139 #define SVN_WC_TRANSLATE_FORCE_EOL_REPAIR        0x00000002
140
141   /** Don't register a pool cleanup to delete the output file */
142 #define SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP       0x00000004
143
144   /** Guarantee a new file is created on successful return.
145    * The default shortcuts translation by returning the path
146    * of the untranslated file when no translation is required.
147    */
148 #define SVN_WC_TRANSLATE_FORCE_COPY              0x00000008
149
150   /** Use a non-wc-local tmp directory for creating output files,
151    * instead of in the working copy admin tmp area which is the default.
152    *
153    * @since New in 1.4.
154    */
155 #define SVN_WC_TRANSLATE_USE_GLOBAL_TMP          0x00000010
156
157 /** @} */
158
159
160 /**
161  * @defgroup svn_wc_context  Working copy context
162  * @{
163  */
164
165 /** The context for all working copy interactions.
166  *
167  * This is the client-facing datastructure API consumers are required
168  * to create and use when interacting with a working copy.  Multiple
169  * contexts can be created for the same working copy simultaneously, within
170  * the same process or different processes.  Context mutexing will be handled
171  * internally by the working copy library.
172  *
173  * @note: #svn_wc_context_t should be passed by non-const pointer in all
174  * APIs, even for read-only operations, as it contains mutable data (caching,
175  * etc.).
176  *
177  * @since New in 1.7.
178  */
179 typedef struct svn_wc_context_t svn_wc_context_t;
180
181 /** Create a context for the working copy, and return it in @a *wc_ctx.  This
182  * context is not associated with a particular working copy, but as operations
183  * are performed, will load the appropriate working copy information.
184  *
185  * @a config should hold the various configuration options that may apply to
186  * this context.  It should live at least as long as @a result_pool.  It may
187  * be @c NULL.
188  *
189  * The context will be allocated in @a result_pool, and will use @a
190  * result_pool for any internal allocations requiring the same longevity as
191  * the context.  The context will be automatically destroyed, and its
192  * resources released, when @a result_pool is cleared, or it may be manually
193  * destroyed by invoking svn_wc_context_destroy().
194  *
195  * Use @a scratch_pool for temporary allocations.  It may be cleared
196  * immediately upon returning from this function.
197  *
198  * @since New in 1.7.
199  */
200 svn_error_t *
201 svn_wc_context_create(svn_wc_context_t **wc_ctx,
202                       const svn_config_t *config,
203                       apr_pool_t *result_pool,
204                       apr_pool_t *scratch_pool);
205
206
207 /** Destroy the working copy context described by @a wc_ctx, releasing any
208  * acquired resources.
209  *
210  * @since New in 1.7.
211  */
212 svn_error_t *
213 svn_wc_context_destroy(svn_wc_context_t *wc_ctx);
214
215
216 /** @} */
217
218
219 /**
220  * Locking/Opening/Closing using adm access batons.
221  *
222  * @defgroup svn_wc_adm_access Adm access batons (deprecated)
223  * @{
224  */
225
226 /** Baton for access to a working copy administrative area.
227  *
228  * Access batons can be grouped into sets, by passing an existing open
229  * baton when opening a new baton.  Given one baton in a set, other batons
230  * may be retrieved.  This allows an entire hierarchy to be locked, and
231  * then the set of batons can be passed around by passing a single baton.
232  *
233  * @deprecated Provided for backward compatibility with the 1.6 API.
234  *    New code should use a #svn_wc_context_t object to access the working
235  *    copy.
236  */
237 typedef struct svn_wc_adm_access_t svn_wc_adm_access_t;
238
239
240 /**
241  * Return, in @a *adm_access, a pointer to a new access baton for the working
242  * copy administrative area associated with the directory @a path.  If
243  * @a write_lock is TRUE the baton will include a write lock, otherwise the
244  * baton can only be used for read access.  If @a path refers to a directory
245  * that is already write locked then the error #SVN_ERR_WC_LOCKED will be
246  * returned.  The error #SVN_ERR_WC_NOT_DIRECTORY will be returned if
247  * @a path is not a versioned directory.
248  *
249  * If @a associated is an open access baton then @a adm_access will be added
250  * to the set containing @a associated.  @a associated can be @c NULL, in
251  * which case @a adm_access is the start of a new set.
252  *
253  * @a levels_to_lock specifies how far to lock.  Zero means just the specified
254  * directory.  Any negative value means to lock the entire working copy
255  * directory hierarchy under @a path.  A positive value indicates the number of
256  * levels of directories to lock -- 1 means just immediate subdirectories, 2
257  * means immediate subdirectories and their subdirectories, etc.  All the
258  * access batons will become part of the set containing @a adm_access.  This
259  * is an all-or-nothing option, if it is not possible to lock all the
260  * requested directories then an error will be returned and @a adm_access will
261  * be invalid, with the exception that subdirectories of @a path that are
262  * missing from the physical filesystem will not be locked and will not cause
263  * an error.  The error #SVN_ERR_WC_LOCKED will be returned if a
264  * subdirectory of @a path is already write locked.
265  *
266  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
267  * if the client has canceled the operation.
268  *
269  * @a pool will be used to allocate memory for the baton and any subsequently
270  * cached items.  If @a adm_access has not been closed when the pool is
271  * cleared, it will be closed automatically at that point, and removed from
272  * its set.  A baton closed in this way will not remove physical locks from
273  * the working copy if cleanup is required.
274  *
275  * The first baton in a set, with @a associated passed as @c NULL, must have
276  * the longest lifetime of all the batons in the set.  This implies it must be
277  * the root of the hierarchy.
278  *
279  * @since New in 1.2.
280  * @deprecated Provided for backward compatibility with the 1.6 API.
281  *    Callers should use a #svn_wc_context_t object to access the working
282  *    copy.
283  */
284 SVN_DEPRECATED
285 svn_error_t *
286 svn_wc_adm_open3(svn_wc_adm_access_t **adm_access,
287                  svn_wc_adm_access_t *associated,
288                  const char *path,
289                  svn_boolean_t write_lock,
290                  int levels_to_lock,
291                  svn_cancel_func_t cancel_func,
292                  void *cancel_baton,
293                  apr_pool_t *pool);
294
295 /**
296  * Similar to svn_wc_adm_open3(), but without cancellation support.
297  *
298  * @deprecated Provided for backward compatibility with the 1.1 API.
299  */
300 SVN_DEPRECATED
301 svn_error_t *
302 svn_wc_adm_open2(svn_wc_adm_access_t **adm_access,
303                  svn_wc_adm_access_t *associated,
304                  const char *path,
305                  svn_boolean_t write_lock,
306                  int levels_to_lock,
307                  apr_pool_t *pool);
308
309 /**
310  * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of
311  * @a levels_to_lock.  @a levels_to_lock is set to -1 if @a tree_lock
312  * is @c TRUE, else 0.
313  *
314  * @deprecated Provided for backward compatibility with the 1.0 API.
315  */
316 SVN_DEPRECATED
317 svn_error_t *
318 svn_wc_adm_open(svn_wc_adm_access_t **adm_access,
319                 svn_wc_adm_access_t *associated,
320                 const char *path,
321                 svn_boolean_t write_lock,
322                 svn_boolean_t tree_lock,
323                 apr_pool_t *pool);
324
325 /**
326  * Checks the working copy to determine the node type of @a path.  If
327  * @a path is a versioned directory then the behaviour is like that of
328  * svn_wc_adm_open3(), otherwise, if @a path is a file or does not
329  * exist, then the behaviour is like that of svn_wc_adm_open3() with
330  * @a path replaced by the parent directory of @a path.  If @a path is
331  * an unversioned directory, the behaviour is also like that of
332  * svn_wc_adm_open3() on the parent, except that if the open fails,
333  * then the returned #SVN_ERR_WC_NOT_DIRECTORY error refers to @a path,
334  * not to @a path's parent.
335  *
336  * @since New in 1.2.
337  * @deprecated Provided for backward compatibility with the 1.6 API.
338  *    Callers should use a #svn_wc_context_t object to access the working
339  *    copy.
340  */
341 SVN_DEPRECATED
342 svn_error_t *
343 svn_wc_adm_probe_open3(svn_wc_adm_access_t **adm_access,
344                        svn_wc_adm_access_t *associated,
345                        const char *path,
346                        svn_boolean_t write_lock,
347                        int levels_to_lock,
348                        svn_cancel_func_t cancel_func,
349                        void *cancel_baton,
350                        apr_pool_t *pool);
351
352 /**
353  * Similar to svn_wc_adm_probe_open3() without the cancel
354  * functionality.
355  *
356  * @deprecated Provided for backward compatibility with the 1.1 API.
357  */
358 SVN_DEPRECATED
359 svn_error_t *
360 svn_wc_adm_probe_open2(svn_wc_adm_access_t **adm_access,
361                        svn_wc_adm_access_t *associated,
362                        const char *path,
363                        svn_boolean_t write_lock,
364                        int levels_to_lock,
365                        apr_pool_t *pool);
366
367 /**
368  * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of
369  * @a levels_to_lock.  @a levels_to_lock is set to -1 if @a tree_lock
370  * is @c TRUE, else 0.
371  *
372  * @deprecated Provided for backward compatibility with the 1.0 API.
373  */
374 SVN_DEPRECATED
375 svn_error_t *
376 svn_wc_adm_probe_open(svn_wc_adm_access_t **adm_access,
377                       svn_wc_adm_access_t *associated,
378                       const char *path,
379                       svn_boolean_t write_lock,
380                       svn_boolean_t tree_lock,
381                       apr_pool_t *pool);
382
383 /**
384  * Open access batons for @a path and return in @a *anchor_access and
385  * @a *target the anchor and target required to drive an editor.  Return
386  * in @a *target_access the access baton for the target, which may be the
387  * same as @a *anchor_access (in which case @a *target is the empty
388  * string, never NULL).  All the access batons will be in the
389  * @a *anchor_access set.
390  *
391  * @a levels_to_lock determines the levels_to_lock used when opening
392  * @a path if @a path is a versioned directory, @a levels_to_lock is
393  * ignored otherwise.  If @a write_lock is @c TRUE the access batons
394  * will hold write locks.
395  *
396  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
397  * if the client has canceled the operation.
398  *
399  * This function is essentially a combination of svn_wc_adm_open3() and
400  * svn_wc_get_actual_target(), with the emphasis on reducing physical IO.
401  *
402  * @since New in 1.2.
403  * @deprecated Provided for backward compatibility with the 1.6 API.
404  *    Callers should use a #svn_wc_context_t object to access the working
405  *    copy.
406  */
407 SVN_DEPRECATED
408 svn_error_t *
409 svn_wc_adm_open_anchor(svn_wc_adm_access_t **anchor_access,
410                        svn_wc_adm_access_t **target_access,
411                        const char **target,
412                        const char *path,
413                        svn_boolean_t write_lock,
414                        int levels_to_lock,
415                        svn_cancel_func_t cancel_func,
416                        void *cancel_baton,
417                        apr_pool_t *pool);
418
419 /** Return, in @a *adm_access, a pointer to an existing access baton associated
420  * with @a path.  @a path must be a directory that is locked as part of the
421  * set containing the @a associated access baton.
422  *
423  * If the requested access baton is marked as missing in, or is simply
424  * absent from, @a associated, return #SVN_ERR_WC_NOT_LOCKED.
425  *
426  * @a pool is used only for local processing, it is not used for the batons.
427  *
428  * @deprecated Provided for backward compatibility with the 1.6 API.
429  */
430 SVN_DEPRECATED
431 svn_error_t *
432 svn_wc_adm_retrieve(svn_wc_adm_access_t **adm_access,
433                     svn_wc_adm_access_t *associated,
434                     const char *path,
435                     apr_pool_t *pool);
436
437 /** Check the working copy to determine the node type of @a path.  If
438  * @a path is a versioned directory then the behaviour is like that of
439  * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned
440  * directory, or does not exist, then the behaviour is like that of
441  * svn_wc_adm_retrieve() with @a path replaced by the parent directory of
442  * @a path.
443  *
444  * @deprecated Provided for backward compatibility with the 1.6 API.
445  */
446 SVN_DEPRECATED
447 svn_error_t *
448 svn_wc_adm_probe_retrieve(svn_wc_adm_access_t **adm_access,
449                           svn_wc_adm_access_t *associated,
450                           const char *path,
451                           apr_pool_t *pool);
452
453 /**
454  * Try various ways to obtain an access baton for @a path.
455  *
456  * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(),
457  * but if this fails because @a associated can't give a baton for
458  * @a path or @a path's parent, then try svn_wc_adm_probe_open3(),
459  * this time passing @a write_lock and @a levels_to_lock.  If there is
460  * still no access because @a path is not a versioned directory, then
461  * just set @a *adm_access to NULL and return success.  But if it is
462  * because @a path is locked, then return the error #SVN_ERR_WC_LOCKED,
463  * and the effect on @a *adm_access is undefined.  (Or if the attempt
464  * fails for any other reason, return the corresponding error, and the
465  * effect on @a *adm_access is also undefined.)
466  *
467  * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to
468  * @a associated.
469  *
470  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
471  * if the client has canceled the operation.
472  *
473  * Use @a pool only for local processing, not to allocate @a *adm_access.
474  *
475  * @since New in 1.2.
476  * @deprecated Provided for backward compatibility with the 1.6 API.
477  */
478 SVN_DEPRECATED
479 svn_error_t *
480 svn_wc_adm_probe_try3(svn_wc_adm_access_t **adm_access,
481                       svn_wc_adm_access_t *associated,
482                       const char *path,
483                       svn_boolean_t write_lock,
484                       int levels_to_lock,
485                       svn_cancel_func_t cancel_func,
486                       void *cancel_baton,
487                       apr_pool_t *pool);
488
489 /**
490  * Similar to svn_wc_adm_probe_try3() without the cancel
491  * functionality.
492  *
493  * @deprecated Provided for backward compatibility with the 1.1 API.
494  */
495 SVN_DEPRECATED
496 svn_error_t *
497 svn_wc_adm_probe_try2(svn_wc_adm_access_t **adm_access,
498                       svn_wc_adm_access_t *associated,
499                       const char *path,
500                       svn_boolean_t write_lock,
501                       int levels_to_lock,
502                       apr_pool_t *pool);
503
504 /**
505  * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of
506  * @a levels_to_lock.  @a levels_to_lock is set to -1 if @a tree_lock
507  * is @c TRUE, else 0.
508  *
509  * @deprecated Provided for backward compatibility with the 1.0 API.
510  */
511 SVN_DEPRECATED
512 svn_error_t *
513 svn_wc_adm_probe_try(svn_wc_adm_access_t **adm_access,
514                      svn_wc_adm_access_t *associated,
515                      const char *path,
516                      svn_boolean_t write_lock,
517                      svn_boolean_t tree_lock,
518                      apr_pool_t *pool);
519
520
521 /** Give up the access baton @a adm_access, and its lock if any. This will
522  * recursively close any batons in the same set that are direct
523  * subdirectories of @a adm_access.  Any physical locks will be removed from
524  * the working copy.  Lock removal is unconditional, there is no check to
525  * determine if cleanup is required.
526  *
527  * Any temporary allocations are performed using @a scratch_pool.
528  *
529  * @since New in 1.6
530  * @deprecated Provided for backward compatibility with the 1.6 API.
531  */
532 SVN_DEPRECATED
533 svn_error_t *
534 svn_wc_adm_close2(svn_wc_adm_access_t *adm_access,
535                   apr_pool_t *scratch_pool);
536
537 /**
538  * Similar to svn_wc_adm_close2(), but with the internal pool of @a adm_access
539  * used for temporary allocations.
540  *
541  * @deprecated Provided for backward compatibility with the 1.5 API.
542  */
543 SVN_DEPRECATED
544 svn_error_t *
545 svn_wc_adm_close(svn_wc_adm_access_t *adm_access);
546
547 /** Return the path used to open the access baton @a adm_access.
548  *
549  * @deprecated Provided for backward compatibility with the 1.6 API.
550  */
551 SVN_DEPRECATED
552 const char *
553 svn_wc_adm_access_path(const svn_wc_adm_access_t *adm_access);
554
555 /** Return the pool used by access baton @a adm_access.
556  *
557  * @deprecated Provided for backward compatibility with the 1.6 API.
558  */
559 SVN_DEPRECATED
560 apr_pool_t *
561 svn_wc_adm_access_pool(const svn_wc_adm_access_t *adm_access);
562
563 /** Return @c TRUE is the access baton @a adm_access has a write lock,
564  * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast
565  * function that doesn't access the filesystem.
566  *
567  * @deprecated Provided for backward compatibility with the 1.6 API.
568  * New code should use svn_wc_locked2() instead.
569  */
570 SVN_DEPRECATED
571 svn_boolean_t
572 svn_wc_adm_locked(const svn_wc_adm_access_t *adm_access);
573
574 /** @} */
575
576
577 /** Gets up to two booleans indicating whether a path is locked for
578  * writing.
579  *
580  * @a locked_here is set to TRUE when a write lock on @a local_abspath
581  * exists in @a wc_ctx. @a locked is set to TRUE when there is a
582  * write_lock on @a local_abspath
583  *
584  * @a locked_here and/or @a locked can be NULL when you are not
585  * interested in a specific value
586  *
587  * @since New in 1.7.
588  */
589 svn_error_t *
590 svn_wc_locked2(svn_boolean_t *locked_here,
591                svn_boolean_t *locked,
592                svn_wc_context_t *wc_ctx,
593                const char *local_abspath,
594                apr_pool_t *scratch_pool);
595
596 /** Set @a *locked to non-zero if @a path is locked, else set it to zero.
597  *
598  * New code should use svn_wc_locked2() instead.
599  *
600  * @deprecated Provided for backward compatibility with the 1.6 API.
601  */
602 SVN_DEPRECATED
603 svn_error_t *
604 svn_wc_locked(svn_boolean_t *locked,
605               const char *path,
606               apr_pool_t *pool);
607
608
609 /**
610  * @defgroup svn_wc_adm_dir_name Name of Subversion's admin dir
611  * @{
612  */
613
614 /** The default name of the administrative subdirectory.
615  *
616  * Ideally, this would be completely private to wc internals (in fact,
617  * it used to be that adm_subdir() in adm_files.c was the only function
618  * who knew the adm subdir's name).  However, import wants to protect
619  * against importing administrative subdirs, so now the name is a
620  * matter of public record.
621  *
622  * @deprecated Provided for backward compatibility with the 1.2 API.
623  */
624 #define SVN_WC_ADM_DIR_NAME   ".svn"
625
626
627 /**
628  * Return @c TRUE if @a name is the name of the WC administrative
629  * directory.  Use @a pool for any temporary allocations.  Only works
630  * with base directory names, not paths or URIs.
631  *
632  * For compatibility, the default name (.svn) will always be treated
633  * as an admin dir name, even if the working copy is actually using an
634  * alternative name.
635  *
636  * @since New in 1.3.
637  */
638 svn_boolean_t
639 svn_wc_is_adm_dir(const char *name, apr_pool_t *pool);
640
641
642 /**
643  * Return the name of the administrative directory.
644  * Use @a pool for any temporary allocations.
645  *
646  * The returned pointer will refer to either a statically allocated
647  * string, or to a string allocated in @a pool.
648  *
649  * @since New in 1.3.
650  */
651 const char *
652 svn_wc_get_adm_dir(apr_pool_t *pool);
653
654
655 /**
656  * Use @a name for the administrative directory in the working copy.
657  * Use @a pool for any temporary allocations.
658  *
659  * The list of valid names is limited.  Currently only ".svn" (the
660  * default) and "_svn" are allowed.
661  *
662  * @note This function changes global (per-process) state and must be
663  * called in a single-threaded context during the initialization of a
664  * Subversion client.
665  *
666  * @since New in 1.3.
667  */
668 svn_error_t *
669 svn_wc_set_adm_dir(const char *name,
670                    apr_pool_t *pool);
671
672 /** @} */
673
674
675 /**
676  * @defgroup svn_wc_externals Externals
677  * @{
678  */
679
680 /** Callback for external definitions updates
681  *
682  * @a local_abspath is the path on which the external definition was found.
683  * @a old_val and @a new_val are the before and after values of the
684  * SVN_PROP_EXTERNALS property.  @a depth is the ambient depth of the
685  * working copy directory at @a local_abspath.
686  *
687  * @since New in 1.7. */
688 typedef svn_error_t *(*svn_wc_external_update_t)(void *baton,
689                                                  const char *local_abspath,
690                                                  const svn_string_t *old_val,
691                                                  const svn_string_t *new_val,
692                                                  svn_depth_t depth,
693                                                  apr_pool_t *scratch_pool);
694
695 /** Traversal information is information gathered by a working copy
696  * crawl or update.  For example, the before and after values of the
697  * svn:externals property are important after an update, and since
698  * we're traversing the working tree anyway (a complete traversal
699  * during the initial crawl, and a traversal of changed paths during
700  * the checkout/update/switch), it makes sense to gather the
701  * property's values then instead of making a second pass.
702  *
703  * New code should use the svn_wc_external_update_t callback instead.
704  *
705  * @deprecated Provided for backward compatibility with the 1.6 API.
706  */
707 typedef struct svn_wc_traversal_info_t svn_wc_traversal_info_t;
708
709
710 /** Return a new, empty traversal info object, allocated in @a pool.
711  *
712  * New code should use the svn_wc_external_update_t callback instead.
713  *
714  * @deprecated Provided for backward compatibility with the 1.6 API.
715  */
716 SVN_DEPRECATED
717 svn_wc_traversal_info_t *
718 svn_wc_init_traversal_info(apr_pool_t *pool);
719
720 /** Set @a *externals_old and @a *externals_new to hash tables representing
721  * changes to values of the svn:externals property on directories
722  * traversed by @a traversal_info.
723  *
724  * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
725  * only useful after it has been passed through another function, such
726  * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
727  * svn_wc_get_switch_editor(), etc.
728  *
729  * Each hash maps <tt>const char *</tt> directory names onto
730  * <tt>const char *</tt> values of the externals property for that directory.
731  * The dir names are full paths -- that is, anchor plus target, not target
732  * alone. The values are not parsed, they are simply copied raw, and are
733  * never NULL: directories that acquired or lost the property are
734  * simply omitted from the appropriate table.  Directories whose value
735  * of the property did not change show the same value in each hash.
736  *
737  * The hashes, keys, and values have the same lifetime as @a traversal_info.
738  *
739  * New code should use the svn_wc_external_update_t callback instead.
740  *
741  * @deprecated Provided for backward compatibility with the 1.6 API.
742  */
743 SVN_DEPRECATED
744 void
745 svn_wc_edited_externals(apr_hash_t **externals_old,
746                         apr_hash_t **externals_new,
747                         svn_wc_traversal_info_t *traversal_info);
748
749
750 /** Set @a *depths to a hash table mapping <tt>const char *</tt>
751  * directory names (directories traversed by @a traversal_info) to
752  * <tt>const char *</tt> values (the depths of those directories, as
753  * converted by svn_depth_to_word()).
754  *
755  * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
756  * only useful after it has been passed through another function, such
757  * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
758  * svn_wc_get_switch_editor(), etc.
759  *
760  * The dir names are full paths -- that is, anchor plus target, not target
761  * alone.  The values are not allocated, they are static constant strings.
762  * Although the values are never NULL, not all directories traversed
763  * are necessarily listed.  For example, directories which did not
764  * have an svn:externals property set or modified are not included.
765  *
766  * The hashes and keys have the same lifetime as @a traversal_info.
767  *
768  * New code should use the svn_wc_external_update_t callback instead.
769  *
770  * @since New in 1.5.
771  * @deprecated Provided for backward compatibility with the 1.6 API.
772  */
773 SVN_DEPRECATED
774 void
775 svn_wc_traversed_depths(apr_hash_t **depths,
776                         svn_wc_traversal_info_t *traversal_info);
777
778
779 /** One external item.  This usually represents one line from an
780  * svn:externals description but with the path and URL
781  * canonicalized.
782  *
783  * In order to avoid backwards compatibility problems clients should use
784  * svn_wc_external_item2_create() to allocate and initialize this structure
785  * instead of doing so themselves.
786  *
787  * @since New in 1.5.
788  */
789 typedef struct svn_wc_external_item2_t
790 {
791   /** The name of the subdirectory into which this external should be
792       checked out.  This is relative to the parent directory that
793       holds this external item.  (Note that these structs are often
794       stored in hash tables with the target dirs as keys, so this
795       field will often be redundant.) */
796   const char *target_dir;
797
798   /** Where to check out from. This is possibly a relative external URL, as
799    * allowed in externals definitions, but without the peg revision. */
800   const char *url;
801
802   /** What revision to check out.  The only valid kinds for this are
803       svn_opt_revision_number, svn_opt_revision_date, and
804       svn_opt_revision_head. */
805   svn_opt_revision_t revision;
806
807   /** The peg revision to use when checking out.  The only valid kinds are
808       svn_opt_revision_number, svn_opt_revision_date, and
809       svn_opt_revision_head. */
810   svn_opt_revision_t peg_revision;
811
812 } svn_wc_external_item2_t;
813
814 /**
815  * Initialize an external item.
816  * Set @a *item to an external item object, allocated in @a pool.
817  *
818  * In order to avoid backwards compatibility problems, this function
819  * is used to initialize and allocate the #svn_wc_external_item2_t
820  * structure rather than doing so explicitly, as the size of this
821  * structure may change in the future.
822  *
823  * The current implementation never returns error, but callers should
824  * still check for error, for compatibility with future versions.
825  *
826  * @since New in 1.8.
827  */
828 svn_error_t *
829 svn_wc_external_item2_create(svn_wc_external_item2_t **item,
830                              apr_pool_t *pool);
831
832 /** Same as svn_wc_external_item2_create() except the pointer to the new
833  * empty item is 'const' which is stupid since the next thing you need to do
834  * is fill in its fields.
835  *
836  * @deprecated Provided for backward compatibility with the 1.7 API.
837  * @since New in 1.5.
838  */
839 SVN_DEPRECATED
840 svn_error_t *
841 svn_wc_external_item_create(const svn_wc_external_item2_t **item,
842                             apr_pool_t *pool);
843
844 /**
845  * Return a duplicate of @a item, allocated in @a pool.  No part of the new
846  * item will be shared with @a item.
847  *
848  * @since New in 1.5.
849  */
850 svn_wc_external_item2_t *
851 svn_wc_external_item2_dup(const svn_wc_external_item2_t *item,
852                           apr_pool_t *pool);
853
854 /**
855  * One external item.  Similar to svn_wc_external_item2_t, except
856  * @a revision is interpreted as both the operational revision and the
857  * peg revision.
858  *
859  * @deprecated Provided for backward compatibility with the 1.4 API.
860  */
861 typedef struct svn_wc_external_item_t
862 {
863   /** Same as #svn_wc_external_item2_t.target_dir */
864   const char *target_dir;
865
866   /** Same as #svn_wc_external_item2_t.url */
867   const char *url;
868
869   /** Same as #svn_wc_external_item2_t.revision */
870   svn_opt_revision_t revision;
871
872 } svn_wc_external_item_t;
873
874 /**
875  * Return a duplicate of @a item, allocated in @a pool.  No part of the new
876  * item will be shared with @a item.
877  *
878  * @since New in 1.3.
879  *
880  * @deprecated Provided for backward compatibility with the 1.4 API.
881  */
882 SVN_DEPRECATED
883 svn_wc_external_item_t *
884 svn_wc_external_item_dup(const svn_wc_external_item_t *item,
885                          apr_pool_t *pool);
886
887 /**
888  * If @a externals_p is non-NULL, set @a *externals_p to an array of
889  * #svn_wc_external_item2_t * objects based on @a desc.
890  *
891  * If the format of @a desc is invalid, don't touch @a *externals_p and
892  * return #SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION.  Thus, if
893  * you just want to check the validity of an externals description,
894  * and don't care about the parsed result, pass NULL for @a externals_p.
895  *
896  * The format of @a desc is the same as for values of the directory
897  * property #SVN_PROP_EXTERNALS.  Look there for more details.
898  *
899  * If @a canonicalize_url is @c TRUE, canonicalize the @a url member
900  * of those objects.  If the @a url member refers to an absolute URL,
901  * it will be canonicalized as URL consistent with the way URLs are
902  * canonicalized throughout the Subversion API.  If, however, the
903  * @a url member makes use of the recognized (SVN-specific) relative
904  * URL syntax for svn:externals, "canonicalization" is an ill-defined
905  * concept which may even result in munging the relative URL syntax
906  * beyond recognition.  You've been warned.
907  *
908  * Allocate the table, keys, and values in @a pool.
909  *
910  * Use @a parent_directory only in constructing error strings.
911  *
912  * @since New in 1.5.
913  */
914 svn_error_t *
915 svn_wc_parse_externals_description3(apr_array_header_t **externals_p,
916                                     const char *parent_directory,
917                                     const char *desc,
918                                     svn_boolean_t canonicalize_url,
919                                     apr_pool_t *pool);
920
921 /**
922  * Similar to svn_wc_parse_externals_description3() with @a
923  * canonicalize_url set to @c TRUE, but returns an array of
924  * #svn_wc_external_item_t * objects instead of
925  * #svn_wc_external_item2_t * objects
926  *
927  * @since New in 1.1.
928  *
929  * @deprecated Provided for backward compatibility with the 1.4 API.
930  */
931 SVN_DEPRECATED
932 svn_error_t *
933 svn_wc_parse_externals_description2(apr_array_header_t **externals_p,
934                                     const char *parent_directory,
935                                     const char *desc,
936                                     apr_pool_t *pool);
937
938 /**
939  * Similar to svn_wc_parse_externals_description2(), but returns the
940  * parsed externals in a hash instead of an array.  This function
941  * should not be used, as storing the externals in a hash causes their
942  * order of evaluation to be not easily identifiable.
943  *
944  * @deprecated Provided for backward compatibility with the 1.0 API.
945  */
946 SVN_DEPRECATED
947 svn_error_t *
948 svn_wc_parse_externals_description(apr_hash_t **externals_p,
949                                    const char *parent_directory,
950                                    const char *desc,
951                                    apr_pool_t *pool);
952
953 /** @} */
954 \f
955
956 /**
957  * @defgroup svn_wc_notifications Notification callback handling
958  * @{
959  *
960  * In many cases, the WC library will scan a working copy and make
961  * changes. The caller usually wants to know when each of these changes
962  * has been made, so that it can display some kind of notification to
963  * the user.
964  *
965  * These notifications have a standard callback function type, which
966  * takes the path of the file that was affected, and a caller-
967  * supplied baton.
968  *
969  * @note The callback is a 'void' return -- this is a simple
970  * reporting mechanism, rather than an opportunity for the caller to
971  * alter the operation of the WC library.
972  *
973  * @note Some of the actions are used across several
974  * different Subversion commands.  For example, the update actions are
975  * also used for checkouts, switches, and merges.
976  */
977
978 /** The type of action occurring. */
979 typedef enum svn_wc_notify_action_t
980 {
981   /** Adding a path to revision control. */
982   svn_wc_notify_add = 0,
983
984   /** Copying a versioned path. */
985   svn_wc_notify_copy,
986
987   /** Deleting a versioned path. */
988   svn_wc_notify_delete,
989
990   /** Restoring a missing path from the pristine text-base. */
991   svn_wc_notify_restore,
992
993   /** Reverting a modified path. */
994   svn_wc_notify_revert,
995
996   /** A revert operation has failed. */
997   svn_wc_notify_failed_revert,
998
999   /** Resolving a conflict. */
1000   svn_wc_notify_resolved,
1001
1002   /** Skipping a path. */
1003   svn_wc_notify_skip,
1004
1005   /** Got a delete in an update. */
1006   svn_wc_notify_update_delete,
1007
1008   /** Got an add in an update. */
1009   svn_wc_notify_update_add,
1010
1011   /** Got any other action in an update. */
1012   svn_wc_notify_update_update,
1013
1014   /** The last notification in an update (including updates of externals). */
1015   svn_wc_notify_update_completed,
1016
1017   /** Updating an external module. */
1018   svn_wc_notify_update_external,
1019
1020   /** The last notification in a status (including status on externals). */
1021   svn_wc_notify_status_completed,
1022
1023   /** Running status on an external module. */
1024   svn_wc_notify_status_external,
1025
1026   /** Committing a modification. */
1027   svn_wc_notify_commit_modified,
1028
1029   /** Committing an addition. */
1030   svn_wc_notify_commit_added,
1031
1032   /** Committing a deletion. */
1033   svn_wc_notify_commit_deleted,
1034
1035   /** Committing a replacement. */
1036   svn_wc_notify_commit_replaced,
1037
1038   /** Transmitting post-fix text-delta data for a file. */
1039   svn_wc_notify_commit_postfix_txdelta,
1040
1041   /** Processed a single revision's blame. */
1042   svn_wc_notify_blame_revision,
1043
1044   /** Locking a path. @since New in 1.2. */
1045   svn_wc_notify_locked,
1046
1047   /** Unlocking a path. @since New in 1.2. */
1048   svn_wc_notify_unlocked,
1049
1050   /** Failed to lock a path. @since New in 1.2. */
1051   svn_wc_notify_failed_lock,
1052
1053   /** Failed to unlock a path. @since New in 1.2. */
1054   svn_wc_notify_failed_unlock,
1055
1056   /** Tried adding a path that already exists. @since New in 1.5. */
1057   svn_wc_notify_exists,
1058
1059   /** Changelist name set. @since New in 1.5. */
1060   svn_wc_notify_changelist_set,
1061
1062   /** Changelist name cleared. @since New in 1.5. */
1063   svn_wc_notify_changelist_clear,
1064
1065   /** Warn user that a path has moved from one changelist to another.
1066       @since New in 1.5.
1067       @deprecated As of 1.7, separate clear and set notifications are sent. */
1068   svn_wc_notify_changelist_moved,
1069
1070   /** A merge operation (to path) has begun.  See #svn_wc_notify_t.merge_range.
1071       @since New in 1.5. */
1072   svn_wc_notify_merge_begin,
1073
1074   /** A merge operation (to path) from a foreign repository has begun.
1075       See #svn_wc_notify_t.merge_range.  @since New in 1.5. */
1076   svn_wc_notify_foreign_merge_begin,
1077
1078   /** Replace notification. @since New in 1.5. */
1079   svn_wc_notify_update_replace,
1080
1081   /** Property added. @since New in 1.6. */
1082   svn_wc_notify_property_added,
1083
1084   /** Property updated. @since New in 1.6. */
1085   svn_wc_notify_property_modified,
1086
1087   /** Property deleted. @since New in 1.6. */
1088   svn_wc_notify_property_deleted,
1089
1090   /** Nonexistent property deleted. @since New in 1.6. */
1091   svn_wc_notify_property_deleted_nonexistent,
1092
1093   /** Revprop set. @since New in 1.6. */
1094   svn_wc_notify_revprop_set,
1095
1096   /** Revprop deleted. @since New in 1.6. */
1097   svn_wc_notify_revprop_deleted,
1098
1099   /** The last notification in a merge. @since New in 1.6. */
1100   svn_wc_notify_merge_completed,
1101
1102   /** The path is a tree-conflict victim of the intended action (*not*
1103    * a persistent tree-conflict from an earlier operation, but *this*
1104    * operation caused the tree-conflict). @since New in 1.6. */
1105   svn_wc_notify_tree_conflict,
1106
1107   /** The path is a subdirectory referenced in an externals definition
1108    * which is unable to be operated on.  @since New in 1.6. */
1109   svn_wc_notify_failed_external,
1110
1111   /** Starting an update operation.  @since New in 1.7. */
1112   svn_wc_notify_update_started,
1113
1114   /** An update tried to add a file or directory at a path where
1115    * a separate working copy was found.  @since New in 1.7. */
1116   svn_wc_notify_update_skip_obstruction,
1117
1118   /** An explicit update tried to update a file or directory that
1119    * doesn't live in the repository and can't be brought in.
1120    * @since New in 1.7. */
1121   svn_wc_notify_update_skip_working_only,
1122
1123   /** An update tried to update a file or directory to which access could
1124    * not be obtained. @since New in 1.7. */
1125   svn_wc_notify_update_skip_access_denied,
1126
1127   /** An update operation removed an external working copy.
1128    * @since New in 1.7. */
1129   svn_wc_notify_update_external_removed,
1130
1131   /** A node below an existing node was added during update.
1132    * @since New in 1.7. */
1133   svn_wc_notify_update_shadowed_add,
1134
1135   /** A node below an existing node was updated during update.
1136    * @since New in 1.7. */
1137   svn_wc_notify_update_shadowed_update,
1138
1139   /** A node below an existing node was deleted during update.
1140    * @since New in 1.7. */
1141   svn_wc_notify_update_shadowed_delete,
1142
1143   /** The mergeinfo on path was updated.  @since New in 1.7. */
1144   svn_wc_notify_merge_record_info,
1145
1146   /** A working copy directory was upgraded to the latest format.
1147    * @since New in 1.7. */
1148   svn_wc_notify_upgraded_path,
1149
1150   /** Mergeinfo describing a merge was recorded.
1151    * @since New in 1.7. */
1152   svn_wc_notify_merge_record_info_begin,
1153
1154   /** Mergeinfo was removed due to elision.
1155    * @since New in 1.7. */
1156   svn_wc_notify_merge_elide_info,
1157
1158   /** A file in the working copy was patched.
1159    * @since New in 1.7. */
1160   svn_wc_notify_patch,
1161
1162   /** A hunk from a patch was applied.
1163    * @since New in 1.7. */
1164   svn_wc_notify_patch_applied_hunk,
1165
1166   /** A hunk from a patch was rejected.
1167    * @since New in 1.7. */
1168   svn_wc_notify_patch_rejected_hunk,
1169
1170   /** A hunk from a patch was found to already be applied.
1171    * @since New in 1.7. */
1172   svn_wc_notify_patch_hunk_already_applied,
1173
1174   /** Committing a non-overwriting copy (path is the target of the
1175    * copy, not the source).
1176    * @since New in 1.7. */
1177   svn_wc_notify_commit_copied,
1178
1179   /** Committing an overwriting (replace) copy (path is the target of
1180    * the copy, not the source).
1181    * @since New in 1.7. */
1182   svn_wc_notify_commit_copied_replaced,
1183
1184   /** The server has instructed the client to follow a URL
1185    * redirection.
1186    * @since New in 1.7. */
1187   svn_wc_notify_url_redirect,
1188
1189   /** The operation was attempted on a path which doesn't exist.
1190    * @since New in 1.7. */
1191   svn_wc_notify_path_nonexistent,
1192
1193   /** Removing a path by excluding it.
1194    * @since New in 1.7. */
1195   svn_wc_notify_exclude,
1196
1197   /** Operation failed because the node remains in conflict
1198    * @since New in 1.7. */
1199   svn_wc_notify_failed_conflict,
1200
1201   /** Operation failed because an added node is missing
1202    * @since New in 1.7. */
1203   svn_wc_notify_failed_missing,
1204
1205   /** Operation failed because a node is out of date
1206    * @since New in 1.7. */
1207   svn_wc_notify_failed_out_of_date,
1208
1209   /** Operation failed because an added parent is not selected
1210    * @since New in 1.7. */
1211   svn_wc_notify_failed_no_parent,
1212
1213   /** Operation failed because a node is locked by another user and/or
1214    * working copy.  @since New in 1.7. */
1215   svn_wc_notify_failed_locked,
1216
1217   /** Operation failed because the operation was forbidden by the server.
1218    * @since New in 1.7. */
1219   svn_wc_notify_failed_forbidden_by_server,
1220
1221   /** The operation skipped the path because it was conflicted.
1222    * @since New in 1.7. */
1223   svn_wc_notify_skip_conflicted,
1224
1225   /** Just the lock on a file was removed during update.
1226    * @since New in 1.8. */
1227   svn_wc_notify_update_broken_lock,
1228
1229   /** Operation failed because a node is obstructed.
1230    * @since New in 1.8. */
1231   svn_wc_notify_failed_obstruction,
1232
1233   /** Conflict resolver is starting.
1234    * This can be used by clients to detect when to display conflict summary
1235    * information, for example.
1236    * @since New in 1.8. */
1237   svn_wc_notify_conflict_resolver_starting,
1238
1239   /** Conflict resolver is done.
1240    * This can be used by clients to detect when to display conflict summary
1241    * information, for example.
1242    * @since New in 1.8. */
1243   svn_wc_notify_conflict_resolver_done,
1244
1245   /** The current operation left local changes of something that was deleted
1246    * The changes are available on (and below) the notified path
1247    * @since New in 1.8. */
1248   svn_wc_notify_left_local_modifications,
1249
1250   /** A copy from a foreign repository has started
1251    * @since New in 1.8. */
1252   svn_wc_notify_foreign_copy_begin,
1253
1254   /** A move in the working copy has been broken, i.e. degraded into a
1255    * copy + delete. The notified path is the move source (the deleted path).
1256    * ### TODO: Provide path to move destination as well?
1257    * @since New in 1.8. */
1258   svn_wc_notify_move_broken
1259
1260 } svn_wc_notify_action_t;
1261
1262
1263 /** The type of notification that is occurring. */
1264 typedef enum svn_wc_notify_state_t
1265 {
1266   svn_wc_notify_state_inapplicable = 0,
1267
1268   /** Notifier doesn't know or isn't saying. */
1269   svn_wc_notify_state_unknown,
1270
1271   /** The state did not change. */
1272   svn_wc_notify_state_unchanged,
1273
1274   /** The item wasn't present. */
1275   svn_wc_notify_state_missing,
1276
1277   /** An unversioned item obstructed work. */
1278   svn_wc_notify_state_obstructed,
1279
1280   /** Pristine state was modified. */
1281   svn_wc_notify_state_changed,
1282
1283   /** Modified state had mods merged in. */
1284   svn_wc_notify_state_merged,
1285
1286   /** Modified state got conflicting mods. */
1287   svn_wc_notify_state_conflicted,
1288
1289   /** The source to copy the file from is missing. */
1290   svn_wc_notify_state_source_missing
1291
1292 } svn_wc_notify_state_t;
1293
1294 /**
1295  * What happened to a lock during an operation.
1296  *
1297  * @since New in 1.2.
1298  */
1299 typedef enum svn_wc_notify_lock_state_t
1300 {
1301   svn_wc_notify_lock_state_inapplicable = 0,
1302
1303   svn_wc_notify_lock_state_unknown,
1304
1305   /** The lock wasn't changed. */
1306   svn_wc_notify_lock_state_unchanged,
1307
1308   /** The item was locked. */
1309   svn_wc_notify_lock_state_locked,
1310
1311   /** The item was unlocked. */
1312   svn_wc_notify_lock_state_unlocked
1313
1314 } svn_wc_notify_lock_state_t;
1315
1316 /**
1317  * Structure used in the #svn_wc_notify_func2_t function.
1318  *
1319  * @c kind, @c content_state, @c prop_state and @c lock_state are from
1320  * after @c action, not before.
1321  *
1322  * @note If @c action is #svn_wc_notify_update_completed, then @c path has
1323  * already been installed, so it is legitimate for an implementation of
1324  * #svn_wc_notify_func2_t to examine @c path in the working copy.
1325  *
1326  * @note The purpose of the @c kind, @c mime_type, @c content_state, and
1327  * @c prop_state fields is to provide "for free" information that an
1328  * implementation is likely to want, and which it would otherwise be
1329  * forced to deduce via expensive operations such as reading entries
1330  * and properties.  However, if the caller does not have this
1331  * information, it will simply pass the corresponding `*_unknown'
1332  * values, and it is up to the implementation how to handle that
1333  * (i.e., whether to attempt deduction, or just to punt and
1334  * give a less informative notification).
1335  *
1336  * @note Callers of notification functions should use svn_wc_create_notify()
1337  * or svn_wc_create_notify_url() to create structures of this type to allow
1338  * for extensibility.
1339  *
1340  * @since New in 1.2.
1341  */
1342 typedef struct svn_wc_notify_t {
1343
1344   /** Path, either absolute or relative to the current working directory
1345    * (i.e., not relative to an anchor).  @c path is "." or another valid path
1346    * value for compatibility reasons when the real target is a url that
1347    * is available in @c url. */
1348   const char *path;
1349
1350   /** Action that describes what happened to #svn_wc_notify_t.path. */
1351   svn_wc_notify_action_t action;
1352
1353   /** Node kind of @c path. */
1354   svn_node_kind_t kind;
1355
1356   /** If non-NULL, indicates the mime-type of @c path.
1357    * It is always @c NULL for directories. */
1358   const char *mime_type;
1359
1360   /** Points to the lock structure received from the repository when
1361    * @c action is #svn_wc_notify_locked.  For other actions, it is
1362    * @c NULL. */
1363   const svn_lock_t *lock;
1364
1365   /** Points to an error describing the reason for the failure when @c
1366    * action is one of the following: #svn_wc_notify_failed_lock,
1367    * #svn_wc_notify_failed_unlock, #svn_wc_notify_failed_external.
1368    * Is @c NULL otherwise. */
1369   svn_error_t *err;
1370
1371   /** The type of notification that is occurring about node content. */
1372   svn_wc_notify_state_t content_state;
1373
1374   /** The type of notification that is occurring about node properties. */
1375   svn_wc_notify_state_t prop_state;
1376
1377   /** Reflects the addition or removal of a lock token in the working copy. */
1378   svn_wc_notify_lock_state_t lock_state;
1379
1380   /** When @c action is #svn_wc_notify_update_completed, target revision
1381    * of the update, or #SVN_INVALID_REVNUM if not available; when @c
1382    * action is #svn_wc_notify_blame_revision, processed revision; Since
1383    * Subversion 1.7 when action is #svn_wc_notify_update_update or
1384    * #svn_wc_notify_update_add, the target revision.
1385    * In all other cases, it is #SVN_INVALID_REVNUM.
1386    */
1387   svn_revnum_t revision;
1388
1389   /** If @c action pertains to a changelist, this is the changelist name.
1390    * In all other cases, it is @c NULL.  @since New in 1.5 */
1391   const char *changelist_name;
1392
1393   /** When @c action is #svn_wc_notify_merge_begin or
1394    * #svn_wc_notify_foreign_merge_begin or
1395    * #svn_wc_notify_merge_record_info_begin, and both the
1396    * left and right sides of the merge are from the same URL.  In all
1397    * other cases, it is @c NULL.  @since New in 1.5 */
1398   svn_merge_range_t *merge_range;
1399
1400   /** Similar to @c path, but if non-NULL the notification is about a url.
1401    * @since New in 1.6 */
1402   const char *url;
1403
1404   /** If non-NULL, specifies an absolute path prefix that can be subtracted
1405    * from the start of the absolute path in @c path or @c url.  Its purpose
1406    * is to allow notification to remove a common prefix from all the paths
1407    * displayed for an operation.  @since New in 1.6 */
1408   const char *path_prefix;
1409
1410   /** If @c action relates to properties, specifies the name of the property.
1411    * @since New in 1.6 */
1412   const char *prop_name;
1413
1414   /** If @c action is #svn_wc_notify_blame_revision, contains a list of
1415    * revision properties for the specified revision
1416    * @since New in 1.6 */
1417   apr_hash_t *rev_props;
1418
1419   /** If @c action is #svn_wc_notify_update_update or
1420    * #svn_wc_notify_update_add, contains the revision before the update.
1421    * In all other cases, it is #SVN_INVALID_REVNUM.
1422    * @since New in 1.7 */
1423   svn_revnum_t old_revision;
1424
1425   /** These fields are used by svn patch to identify the
1426    * hunk the notification is for. They are line-based
1427    * offsets and lengths parsed from the unidiff hunk header.
1428    * @since New in 1.7. */
1429   /* @{ */
1430   svn_linenum_t hunk_original_start;
1431   svn_linenum_t hunk_original_length;
1432   svn_linenum_t hunk_modified_start;
1433   svn_linenum_t hunk_modified_length;
1434   /* @} */
1435
1436   /** The line at which a hunk was matched (and applied).
1437    * @since New in 1.7. */
1438   svn_linenum_t hunk_matched_line;
1439
1440   /** The fuzz factor the hunk was applied with.
1441    * @since New in 1.7 */
1442   svn_linenum_t hunk_fuzz;
1443
1444   /* NOTE: Add new fields at the end to preserve binary compatibility.
1445      Also, if you add fields here, you have to update svn_wc_create_notify
1446      and svn_wc_dup_notify. */
1447 } svn_wc_notify_t;
1448
1449 /**
1450  * Allocate an #svn_wc_notify_t structure in @a pool, initialize and return
1451  * it.
1452  *
1453  * Set the @c path field of the created struct to @a path, and @c action to
1454  * @a action.  Set all other fields to their @c _unknown, @c NULL or
1455  * invalid value, respectively. Make only a shallow copy of the pointer
1456  * @a path.
1457  *
1458  * @since New in 1.2.
1459  */
1460 svn_wc_notify_t *
1461 svn_wc_create_notify(const char *path,
1462                      svn_wc_notify_action_t action,
1463                      apr_pool_t *pool);
1464
1465 /**
1466  * Allocate an #svn_wc_notify_t structure in @a pool, initialize and return
1467  * it.
1468  *
1469  * Set the @c url field of the created struct to @a url, @c path to "." and @c
1470  * action to @a action.  Set all other fields to their @c _unknown, @c NULL or
1471  * invalid value, respectively. Make only a shallow copy of the pointer
1472  * @a url.
1473  *
1474  * @since New in 1.6.
1475  */
1476 svn_wc_notify_t *
1477 svn_wc_create_notify_url(const char *url,
1478                          svn_wc_notify_action_t action,
1479                          apr_pool_t *pool);
1480
1481 /**
1482  * Return a deep copy of @a notify, allocated in @a pool.
1483  *
1484  * @since New in 1.2.
1485  */
1486 svn_wc_notify_t *
1487 svn_wc_dup_notify(const svn_wc_notify_t *notify,
1488                   apr_pool_t *pool);
1489
1490 /**
1491  * Notify the world that @a notify->action has happened to @a notify->path.
1492  *
1493  * Recommendation: callers of #svn_wc_notify_func2_t should avoid
1494  * invoking it multiple times on the same path within a given
1495  * operation, and implementations should not bother checking for such
1496  * duplicate calls.  For example, in an update, the caller should not
1497  * invoke the notify func on receiving a prop change and then again
1498  * on receiving a text change.  Instead, wait until all changes have
1499  * been received, and then invoke the notify func once (from within
1500  * an #svn_delta_editor_t's close_file(), for example), passing
1501  * the appropriate @a notify->content_state and @a notify->prop_state flags.
1502  *
1503  * @since New in 1.2.
1504  */
1505 typedef void (*svn_wc_notify_func2_t)(void *baton,
1506                                       const svn_wc_notify_t *notify,
1507                                       apr_pool_t *pool);
1508
1509 /**
1510  * Similar to #svn_wc_notify_func2_t, but takes the information as arguments
1511  * instead of struct fields.
1512  *
1513  * @deprecated Provided for backward compatibility with the 1.1 API.
1514  */
1515 typedef void (*svn_wc_notify_func_t)(void *baton,
1516                                      const char *path,
1517                                      svn_wc_notify_action_t action,
1518                                      svn_node_kind_t kind,
1519                                      const char *mime_type,
1520                                      svn_wc_notify_state_t content_state,
1521                                      svn_wc_notify_state_t prop_state,
1522                                      svn_revnum_t revision);
1523
1524 /** @} */
1525
1526 \f
1527 /**
1528  * Interactive conflict handling
1529  *
1530  * @defgroup svn_wc_conflict Conflict callback functionality
1531  * @{
1532  *
1533  * This API gives a Subversion client application the opportunity to
1534  * define a callback that allows the user to resolve conflicts
1535  * interactively during updates and merges.
1536  *
1537  * If a conflict is discovered, libsvn_wc invokes the callback with an
1538  * #svn_wc_conflict_description_t.  This structure describes the
1539  * path in conflict, whether it's a text or property conflict, and may
1540  * also present up to three files that can be used to resolve the
1541  * conflict (perhaps by launching an editor or 3rd-party merging
1542  * tool).  The structure also provides a possible fourth file (@c
1543  * merged_file) which, if not NULL, represents libsvn_wc's attempt to
1544  * contextually merge the first three files.  (Note that libsvn_wc
1545  * will not attempt to merge a file that it believes is binary, and it
1546  * will only attempt to merge property values it believes to be a
1547  * series of multi-line text.)
1548  *
1549  * When the callback is finished interacting with the user, it
1550  * responds by returning a #svn_wc_conflict_result_t.  This
1551  * structure indicates whether the user wants to postpone the conflict
1552  * for later (allowing libsvn_wc to mark the path "conflicted" as
1553  * usual), or whether the user wants libsvn_wc to use one of the four
1554  * files as the "final" state for resolving the conflict immediately.
1555  *
1556  * Note that the callback is at liberty (and encouraged) to merge the
1557  * three files itself.  If it does so, it signals this to libsvn_wc by
1558  * returning a choice of #svn_wc_conflict_choose_merged.  To return
1559  * the 'final' merged file to libsvn_wc, the callback has the option of
1560  * either:
1561  *
1562  *    - editing the original @c merged_file in-place
1563  *
1564  *        or, if libsvn_wc never supplied a merged_file in the
1565  *        description structure (i.e. passed NULL for that field),
1566  *
1567  *    - return the merged file in the #svn_wc_conflict_result_t.
1568  *
1569  */
1570
1571 /** The type of action being attempted on an object.
1572  *
1573  * @since New in 1.5.
1574  */
1575 typedef enum svn_wc_conflict_action_t
1576 {
1577   svn_wc_conflict_action_edit,    /**< attempting to change text or props */
1578   svn_wc_conflict_action_add,     /**< attempting to add object */
1579   svn_wc_conflict_action_delete,  /**< attempting to delete object */
1580   svn_wc_conflict_action_replace  /**< attempting to replace object,
1581                                        @since New in 1.7 */
1582 } svn_wc_conflict_action_t;
1583
1584
1585 /** The pre-existing condition which is causing a state of conflict.
1586  *
1587  * @since New in 1.5.
1588  */
1589 typedef enum svn_wc_conflict_reason_t
1590 {
1591   /** Local edits are already present */
1592   svn_wc_conflict_reason_edited,
1593   /** Another object is in the way */
1594   svn_wc_conflict_reason_obstructed,
1595   /** Object is already schedule-delete */
1596   svn_wc_conflict_reason_deleted,
1597   /** Object is unknown or missing */
1598   svn_wc_conflict_reason_missing,
1599   /** Object is unversioned */
1600   svn_wc_conflict_reason_unversioned,
1601   /** Object is already added or schedule-add. @since New in 1.6. */
1602   svn_wc_conflict_reason_added,
1603   /** Object is already replaced. @since New in 1.7. */
1604   svn_wc_conflict_reason_replaced,
1605   /** Object is moved away. @since New in 1.8. */
1606   svn_wc_conflict_reason_moved_away,
1607   /** Object is moved here. @since New in 1.8. */
1608   svn_wc_conflict_reason_moved_here
1609
1610 } svn_wc_conflict_reason_t;
1611
1612
1613 /** The type of conflict being described by an
1614  * #svn_wc_conflict_description2_t (see below).
1615  *
1616  * @since New in 1.5.
1617  */
1618 typedef enum svn_wc_conflict_kind_t
1619 {
1620   /** textual conflict (on a file) */
1621   svn_wc_conflict_kind_text,
1622   /** property conflict (on a file or dir) */
1623   svn_wc_conflict_kind_property,
1624   /** tree conflict (on a dir) @since New in 1.6. */
1625   svn_wc_conflict_kind_tree
1626 } svn_wc_conflict_kind_t;
1627
1628
1629 /** The user operation that exposed a conflict.
1630  *
1631  * @since New in 1.6.
1632  */
1633 typedef enum svn_wc_operation_t
1634 {
1635   svn_wc_operation_none = 0,
1636   svn_wc_operation_update,
1637   svn_wc_operation_switch,
1638   svn_wc_operation_merge
1639
1640 } svn_wc_operation_t;
1641
1642
1643 /** Info about one of the conflicting versions of a node. Each field may
1644  * have its respective null/invalid/unknown value if the corresponding
1645  * information is not relevant or not available.
1646  *
1647  * @todo Consider making some or all of the info mandatory, to reduce
1648  * complexity.
1649  *
1650  * @note Fields may be added to the end of this structure in future
1651  * versions.  Therefore, to preserve binary compatibility, users
1652  * should not directly allocate structures of this type.
1653  *
1654  * @see svn_wc_conflict_version_create()
1655  * @see svn_wc_conflict_version_dup()
1656  *
1657  * @since New in 1.6.
1658 */
1659 typedef struct svn_wc_conflict_version_t
1660 {
1661   /** @name Where to find this node version in a repository */
1662   /**@{*/
1663
1664   /** URL of repository root */
1665   const char *repos_url;
1666
1667   /** revision at which to look up path_in_repos */
1668   svn_revnum_t peg_rev;
1669
1670   /** path within repos; must not start with '/' */
1671    /* ### should have been called repos_relpath, but we can't change this. */
1672   const char *path_in_repos;
1673   /** @} */
1674
1675   /** The node kind.  Can be any kind, including 'none' or 'unknown'. */
1676   svn_node_kind_t node_kind;
1677
1678   /** UUID of the repository (or NULL if unknown.)
1679    * @since New in 1.8. */
1680   const char *repos_uuid;
1681
1682   /* @todo Add metadata about a local copy of the node, if and when
1683    * we store one. */
1684
1685   /* Remember to update svn_wc_conflict_version_create() and
1686    * svn_wc_conflict_version_dup() in case you add fields to this struct. */
1687 } svn_wc_conflict_version_t;
1688
1689 /**
1690  * Allocate an #svn_wc_conflict_version_t structure in @a pool,
1691  * initialize to contain a conflict origin, and return it.
1692  *
1693  * Set the @c repos_url field of the created struct to @a repos_root_url,
1694  * the @c path_in_repos field to @a repos_relpath, the @c peg_rev field to
1695  * @a revision and the @c node_kind to @a kind. Make only shallow
1696  * copies of the pointer arguments.
1697  *
1698  * @a repos_root_url, @a repos_relpath and @a revision must be valid,
1699  * non-null values. @a repos_uuid should be a valid UUID, but can be
1700  * NULL if unknown. @a kind can be any kind, even 'none' or 'unknown'.
1701  *
1702  * @since New in 1.8.
1703  */
1704 svn_wc_conflict_version_t *
1705 svn_wc_conflict_version_create2(const char *repos_root_url,
1706                                 const char *repos_uuid,
1707                                 const char *repos_relpath,
1708                                 svn_revnum_t revision,
1709                                 svn_node_kind_t kind,
1710                                 apr_pool_t *result_pool);
1711
1712 /** Similar to svn_wc_conflict_version_create2(), but doesn't set all
1713  * required values.
1714  *
1715  * @since New in 1.6.
1716  * @deprecated Provided for backward compatibility with the 1.7 API.
1717  */
1718 SVN_DEPRECATED
1719 svn_wc_conflict_version_t *
1720 svn_wc_conflict_version_create(const char *repos_url,
1721                                const char *path_in_repos,
1722                                svn_revnum_t peg_rev,
1723                                svn_node_kind_t node_kind,
1724                                apr_pool_t *pool);
1725
1726 /** Return a duplicate of @a version, allocated in @a pool.
1727  * No part of the new version will be shared with @a version.
1728  *
1729  * @since New in 1.6.
1730  */
1731 svn_wc_conflict_version_t *
1732 svn_wc_conflict_version_dup(const svn_wc_conflict_version_t *version,
1733                             apr_pool_t *pool);
1734
1735 /** A struct that describes a conflict that has occurred in the
1736  * working copy.
1737  *
1738  * The conflict described by this structure is one of:
1739  *   - a conflict on the content of the file node @a local_abspath
1740  *   - a conflict on the property @a property_name of @a local_abspath
1741  *   - a tree conflict, of which @a local_abspath is the victim
1742  * Be aware that the victim of a tree conflict can be a non-existent node.
1743  * The three kinds of conflict are distinguished by @a kind.
1744  *
1745  * @note Fields may be added to the end of this structure in future
1746  * versions.  Therefore, to preserve binary compatibility, users
1747  * should not directly allocate structures of this type but should use
1748  * svn_wc_conflict_description_create_text2() or
1749  * svn_wc_conflict_description_create_prop2() or
1750  * svn_wc_conflict_description_create_tree2() instead.
1751  *
1752  * @since New in 1.7.
1753  */
1754 typedef struct svn_wc_conflict_description2_t
1755 {
1756   /** The path that is in conflict (for a tree conflict, it is the victim) */
1757   const char *local_abspath;
1758
1759   /** The node type of the path being operated on (for a tree conflict,
1760    *  ### which version?) */
1761   svn_node_kind_t node_kind;
1762
1763   /** What sort of conflict are we describing? */
1764   svn_wc_conflict_kind_t kind;
1765
1766   /** The name of the property whose conflict is being described.
1767    *  (Only if @a kind is 'property'; else undefined.) */
1768   const char *property_name;
1769
1770   /** Whether svn thinks ('my' version of) @c path is a 'binary' file.
1771    *  (Only if @c kind is 'text', else undefined.) */
1772   svn_boolean_t is_binary;
1773
1774   /** The svn:mime-type property of ('my' version of) @c path, if available,
1775    *  else NULL.
1776    *  (Only if @c kind is 'text', else undefined.) */
1777   const char *mime_type;
1778
1779   /** The action being attempted on the conflicted node or property.
1780    *  (When @c kind is 'text', this action must be 'edit'.) */
1781   svn_wc_conflict_action_t action;
1782
1783   /** The state of the target node or property, relative to its merge-left
1784    *  source, that is the reason for the conflict.
1785    *  (When @c kind is 'text', this reason must be 'edited'.) */
1786   svn_wc_conflict_reason_t reason;
1787
1788   /** If this is text-conflict and involves the merging of two files
1789    * descended from a common ancestor, here are the paths of up to
1790    * four fulltext files that can be used to interactively resolve the
1791    * conflict.
1792    *
1793    * @a base_abspath, @a their_abspath and @a my_abspath are absolute
1794    * paths.
1795    *
1796    * ### Is @a merged_file relative to some directory, or absolute?
1797    *
1798    * All four files will be in repository-normal form -- LF
1799    * line endings and contracted keywords.  (If any of these files are
1800    * not available, they default to NULL.)
1801    *
1802    * On the other hand, if this is a property-conflict, then these
1803    * paths represent temporary files that contain the three different
1804    * property-values in conflict.  The fourth path (@c merged_file)
1805    * may or may not be NULL;  if set, it represents libsvn_wc's
1806    * attempt to merge the property values together.  (Remember that
1807    * property values are technically binary values, and thus can't
1808    * always be merged.)
1809    */
1810   const char *base_abspath;  /* common ancestor of the two files being merged */
1811
1812   /** their version of the file */
1813   /* ### BH: For properties this field contains the reference to
1814              the property rejection (.prej) file */
1815   const char *their_abspath;
1816
1817   /** my locally-edited version of the file */
1818   const char *my_abspath;
1819
1820   /** merged version; may contain conflict markers */
1821   const char *merged_file;
1822
1823   /** The operation that exposed the conflict.
1824    * Used only for tree conflicts.
1825    */
1826   svn_wc_operation_t operation;
1827
1828   /** Info on the "merge-left source" or "older" version of incoming change. */
1829   const svn_wc_conflict_version_t *src_left_version;
1830
1831   /** Info on the "merge-right source" or "their" version of incoming change. */
1832   const svn_wc_conflict_version_t *src_right_version;
1833
1834   /* Remember to adjust svn_wc__conflict_description2_dup()
1835    * if you add new fields to this struct. */
1836 } svn_wc_conflict_description2_t;
1837
1838
1839 /** Similar to #svn_wc_conflict_description2_t, but with relative paths and
1840  * adm_access batons.  Passed to #svn_wc_conflict_resolver_func_t.
1841  *
1842  * @since New in 1.5.
1843  * @deprecated Provided for backward compatibility with the 1.6 API.
1844  */
1845 typedef struct svn_wc_conflict_description_t
1846 {
1847   /** The path that is in conflict (for a tree conflict, it is the victim) */
1848   const char *path;
1849
1850   /** The node type of the path being operated on (for a tree conflict,
1851    *  ### which version?) */
1852   svn_node_kind_t node_kind;
1853
1854   /** What sort of conflict are we describing? */
1855   svn_wc_conflict_kind_t kind;
1856
1857   /** The name of the property whose conflict is being described.
1858    *  (Only if @a kind is 'property'; else undefined.) */
1859   const char *property_name;
1860
1861   /** Whether svn thinks ('my' version of) @c path is a 'binary' file.
1862    *  (Only if @c kind is 'text', else undefined.) */
1863   svn_boolean_t is_binary;
1864
1865   /** The svn:mime-type property of ('my' version of) @c path, if available,
1866    *  else NULL.
1867    *  (Only if @c kind is 'text', else undefined.) */
1868   const char *mime_type;
1869
1870   /** If not NULL, an open working copy access baton to either the
1871    *  path itself (if @c path is a directory), or to the parent
1872    *  directory (if @c path is a file.)
1873    *  For a tree conflict, this will always be an access baton
1874    *  to the parent directory of the path, even if the path is
1875    *  a directory. */
1876   svn_wc_adm_access_t *access;
1877
1878   /** The action being attempted on the conflicted node or property.
1879    *  (When @c kind is 'text', this action must be 'edit'.) */
1880   svn_wc_conflict_action_t action;
1881
1882   /** The state of the target node or property, relative to its merge-left
1883    *  source, that is the reason for the conflict.
1884    *  (When @c kind is 'text', this reason must be 'edited'.) */
1885   svn_wc_conflict_reason_t reason;
1886
1887   /** If this is text-conflict and involves the merging of two files
1888    * descended from a common ancestor, here are the paths of up to
1889    * four fulltext files that can be used to interactively resolve the
1890    * conflict.  All four files will be in repository-normal form -- LF
1891    * line endings and contracted keywords.  (If any of these files are
1892    * not available, they default to NULL.)
1893    *
1894    * On the other hand, if this is a property-conflict, then these
1895    * paths represent temporary files that contain the three different
1896    * property-values in conflict.  The fourth path (@c merged_file)
1897    * may or may not be NULL;  if set, it represents libsvn_wc's
1898    * attempt to merge the property values together.  (Remember that
1899    * property values are technically binary values, and thus can't
1900    * always be merged.)
1901    */
1902   const char *base_file;     /* common ancestor of the two files being merged */
1903
1904   /** their version of the file */
1905   const char *their_file;
1906
1907   /** my locally-edited version of the file */
1908   const char *my_file;
1909
1910   /** merged version; may contain conflict markers */
1911   const char *merged_file;
1912
1913   /** The operation that exposed the conflict.
1914    * Used only for tree conflicts.
1915    *
1916    * @since New in 1.6.
1917    */
1918   svn_wc_operation_t operation;
1919
1920   /** Info on the "merge-left source" or "older" version of incoming change.
1921    * @since New in 1.6. */
1922   svn_wc_conflict_version_t *src_left_version;
1923
1924   /** Info on the "merge-right source" or "their" version of incoming change.
1925    * @since New in 1.6. */
1926   svn_wc_conflict_version_t *src_right_version;
1927
1928 } svn_wc_conflict_description_t;
1929
1930 /**
1931  * Allocate an #svn_wc_conflict_description_t structure in @a result_pool,
1932  * initialize to represent a text conflict, and return it.
1933  *
1934  * Set the @c local_abspath field of the created struct to @a local_abspath
1935  * (which must be an absolute path), the @c kind field to
1936  * #svn_wc_conflict_kind_text, the @c node_kind to #svn_node_file,
1937  * the @c action to #svn_wc_conflict_action_edit, and the @c reason to
1938  * #svn_wc_conflict_reason_edited.
1939  *
1940  * @note It is the caller's responsibility to set the other required fields
1941  * (such as the four file names and @c mime_type and @c is_binary).
1942  *
1943  * @since New in 1.7.
1944  */
1945 svn_wc_conflict_description2_t *
1946 svn_wc_conflict_description_create_text2(const char *local_abspath,
1947                                          apr_pool_t *result_pool);
1948
1949
1950 /** Similar to svn_wc_conflict_description_create_text2(), but returns
1951  * a #svn_wc_conflict_description_t *.
1952  *
1953  * @since New in 1.6.
1954  * @deprecated Provided for backward compatibility with the 1.6 API.
1955  */
1956 SVN_DEPRECATED
1957 svn_wc_conflict_description_t *
1958 svn_wc_conflict_description_create_text(const char *path,
1959                                         svn_wc_adm_access_t *adm_access,
1960                                         apr_pool_t *pool);
1961
1962 /**
1963  * Allocate an #svn_wc_conflict_description_t structure in @a result_pool,
1964  * initialize to represent a property conflict, and return it.
1965  *
1966  * Set the @c local_abspath field of the created struct to @a local_abspath
1967  * (which must be an absolute path), the @c kind field
1968  * to #svn_wc_conflict_kind_property, the @c node_kind to @a node_kind, and
1969  * the @c property_name to @a property_name.
1970  *
1971  * @note: It is the caller's responsibility to set the other required fields
1972  * (such as the four file names and @c action and @c reason).
1973  *
1974  * @since New in 1.7.
1975  */
1976 svn_wc_conflict_description2_t *
1977 svn_wc_conflict_description_create_prop2(const char *local_abspath,
1978                                          svn_node_kind_t node_kind,
1979                                          const char *property_name,
1980                                          apr_pool_t *result_pool);
1981
1982 /** Similar to svn_wc_conflict_descriptor_create_prop(), but returns
1983  * a #svn_wc_conflict_description_t *.
1984  *
1985  * @since New in 1.6.
1986  * @deprecated Provided for backward compatibility with the 1.6 API.
1987  */
1988 SVN_DEPRECATED
1989 svn_wc_conflict_description_t *
1990 svn_wc_conflict_description_create_prop(const char *path,
1991                                         svn_wc_adm_access_t *adm_access,
1992                                         svn_node_kind_t node_kind,
1993                                         const char *property_name,
1994                                         apr_pool_t *pool);
1995
1996 /**
1997  * Allocate an #svn_wc_conflict_description_t structure in @a pool,
1998  * initialize to represent a tree conflict, and return it.
1999  *
2000  * Set the @c local_abspath field of the created struct to @a local_abspath
2001  * (which must be an absolute path), the @c kind field to
2002  * #svn_wc_conflict_kind_tree, the @c node_kind to @a node_kind, the @c
2003  * operation to @a operation, the @c src_left_version field to
2004  * @a src_left_version, and the @c src_right_version field to
2005  * @a src_right_version.
2006  *
2007  * @note: It is the caller's responsibility to set the other required fields
2008  * (such as the four file names and @c action and @c reason).
2009  *
2010  * @since New in 1.7.
2011  */
2012 svn_wc_conflict_description2_t *
2013 svn_wc_conflict_description_create_tree2(
2014   const char *local_abspath,
2015   svn_node_kind_t node_kind,
2016   svn_wc_operation_t operation,
2017   const svn_wc_conflict_version_t *src_left_version,
2018   const svn_wc_conflict_version_t *src_right_version,
2019   apr_pool_t *result_pool);
2020
2021
2022 /** Similar to svn_wc_conflict_description_create_tree(), but returns
2023  * a #svn_wc_conflict_description_t *.
2024  *
2025  * @since New in 1.6.
2026  * @deprecated Provided for backward compatibility with the 1.6 API.
2027  */
2028 SVN_DEPRECATED
2029 svn_wc_conflict_description_t *
2030 svn_wc_conflict_description_create_tree(
2031   const char *path,
2032   svn_wc_adm_access_t *adm_access,
2033   svn_node_kind_t node_kind,
2034   svn_wc_operation_t operation,
2035   /* non-const */ svn_wc_conflict_version_t *src_left_version,
2036   /* non-const */ svn_wc_conflict_version_t *src_right_version,
2037   apr_pool_t *pool);
2038
2039
2040 /** Return a duplicate of @a conflict, allocated in @a result_pool.
2041  * A deep copy of all members will be made.
2042  *
2043  * @since New in 1.7.
2044  */
2045 svn_wc_conflict_description2_t *
2046 svn_wc__conflict_description2_dup(
2047   const svn_wc_conflict_description2_t *conflict,
2048   apr_pool_t *result_pool);
2049
2050
2051 /** The way in which the conflict callback chooses a course of action.
2052  *
2053  * @since New in 1.5.
2054  */
2055 typedef enum svn_wc_conflict_choice_t
2056 {
2057   /** Don't resolve the conflict now.  Let libsvn_wc mark the path
2058      'conflicted', so user can run 'svn resolved' later. */
2059   svn_wc_conflict_choose_postpone,
2060
2061   /** If there were files to choose from, select one as a way of
2062      resolving the conflict here and now.  libsvn_wc will then do the
2063      work of "installing" the chosen file.
2064   */
2065   svn_wc_conflict_choose_base,            /**< original version */
2066   svn_wc_conflict_choose_theirs_full,     /**< incoming version */
2067   svn_wc_conflict_choose_mine_full,       /**< own version */
2068   svn_wc_conflict_choose_theirs_conflict, /**< incoming (for conflicted hunks) */
2069   svn_wc_conflict_choose_mine_conflict,   /**< own (for conflicted hunks) */
2070   svn_wc_conflict_choose_merged,          /**< merged version */
2071
2072   /* @since New in 1.8. */
2073   svn_wc_conflict_choose_unspecified      /**< undecided */
2074
2075 } svn_wc_conflict_choice_t;
2076
2077
2078 /** The final result returned by #svn_wc_conflict_resolver_func_t.
2079  *
2080  * @note Fields may be added to the end of this structure in future
2081  * versions.  Therefore, to preserve binary compatibility, users
2082  * should not directly allocate structures of this type.  Instead,
2083  * construct this structure using svn_wc_create_conflict_result()
2084  * below.
2085  *
2086  * @since New in 1.5.
2087  */
2088 typedef struct svn_wc_conflict_result_t
2089 {
2090   /** A choice to either delay the conflict resolution or select a
2091       particular file to resolve the conflict. */
2092   svn_wc_conflict_choice_t choice;
2093
2094   /** If not NULL, this is a path to a file which contains the client's
2095       (or more likely, the user's) merging of the three values in
2096       conflict.  libsvn_wc accepts this file if (and only if) @c choice
2097       is set to #svn_wc_conflict_choose_merged.*/
2098   const char *merged_file;
2099
2100   /** If true, save a backup copy of merged_file (or the original
2101       merged_file from the conflict description, if merged_file is
2102       NULL) in the user's working copy. */
2103   svn_boolean_t save_merged;
2104
2105 } svn_wc_conflict_result_t;
2106
2107
2108 /**
2109  * Allocate an #svn_wc_conflict_result_t structure in @a pool,
2110  * initialize and return it.
2111  *
2112  * Set the @c choice field of the structure to @a choice, and @c
2113  * merged_file to @a merged_file.  Set all other fields to their @c
2114  * _unknown, @c NULL or invalid value, respectively. Make only a shallow
2115  * copy of the pointer argument @a merged_file.
2116  *
2117  * @since New in 1.5.
2118  */
2119 svn_wc_conflict_result_t *
2120 svn_wc_create_conflict_result(svn_wc_conflict_choice_t choice,
2121                               const char *merged_file,
2122                               apr_pool_t *pool);
2123
2124
2125 /** A callback used in merge, update and switch for resolving conflicts
2126  * during the application of a tree delta to a working copy.
2127  *
2128  * @a description describes the exact nature of the conflict, and
2129  * provides information to help resolve it.  @a baton is a closure
2130  * object; it should be provided by the implementation, and passed by
2131  * the caller.  When finished, the callback signals its resolution by
2132  * returning a structure in @a *result, which should be allocated in
2133  * @a result_pool.  (See #svn_wc_conflict_result_t.)  @a scratch_pool
2134  * should be used for any temporary allocations.
2135  *
2136  * The values #svn_wc_conflict_choose_mine_conflict and
2137  * #svn_wc_conflict_choose_theirs_conflict are not legal for conflicts
2138  * in binary files or binary properties.
2139  *
2140  * Implementations of this callback are free to present the conflict
2141  * using any user interface.  This may include simple contextual
2142  * conflicts in a file's text or properties, or more complex
2143  * 'tree'-based conflicts related to obstructed additions, deletions,
2144  * and edits.  The callback implementation is free to decide which
2145  * sorts of conflicts to handle; it's also free to decide which types
2146  * of conflicts are automatically resolvable and which require user
2147  * interaction.
2148  *
2149  * @since New in 1.7.
2150  */
2151 typedef svn_error_t *(*svn_wc_conflict_resolver_func2_t)(
2152   svn_wc_conflict_result_t **result,
2153   const svn_wc_conflict_description2_t *description,
2154   void *baton,
2155   apr_pool_t *result_pool,
2156   apr_pool_t *scratch_pool);
2157
2158
2159 /** Similar to #svn_wc_conflict_resolver_func2_t, but using
2160  * #svn_wc_conflict_description_t instead of
2161  * #svn_wc_conflict_description2_t
2162  *
2163  * @since New in 1.5.
2164  * @deprecated Provided for backward compatibility with the 1.6 API.
2165  */
2166 typedef svn_error_t *(*svn_wc_conflict_resolver_func_t)(
2167   svn_wc_conflict_result_t **result,
2168   const svn_wc_conflict_description_t *description,
2169   void *baton,
2170   apr_pool_t *pool);
2171
2172 /** @} */
2173
2174
2175 \f
2176 /**
2177  * A callback vtable invoked by our diff-editors, as they receive diffs
2178  * from the server. 'svn diff' and 'svn merge' implement their own versions
2179  * of this vtable.
2180  *
2181  * Common parameters:
2182  *
2183  * If @a state is non-NULL, set @a *state to the state of the item
2184  * after the operation has been performed.  (In practice, this is only
2185  * useful with merge, not diff; diff callbacks will probably set
2186  * @a *state to #svn_wc_notify_state_unknown, since they do not change
2187  * the state and therefore do not bother to know the state after the
2188  * operation.)  By default, @a state refers to the item's content
2189  * state.  Functions concerned with property state have separate
2190  * @a contentstate and @a propstate arguments.
2191  *
2192  * If @a tree_conflicted is non-NULL, set @a *tree_conflicted to true if
2193  * this operation caused a tree conflict, else to false. (Like with @a
2194  * state, this is only useful with merge, not diff; diff callbacks
2195  * should set this to false.)
2196  *
2197  * @since New in 1.7.
2198  */
2199 typedef struct svn_wc_diff_callbacks4_t
2200 {
2201   /**
2202    * This function is called before @a file_changed to allow callbacks to
2203    * skip the most expensive processing of retrieving the file data.
2204    *
2205    */
2206   svn_error_t *(*file_opened)(svn_boolean_t *tree_conflicted,
2207                               svn_boolean_t *skip,
2208                               const char *path,
2209                               svn_revnum_t rev,
2210                               void *diff_baton,
2211                               apr_pool_t *scratch_pool);
2212
2213   /**
2214    * A file @a path has changed.  If @a tmpfile2 is non-NULL, the
2215    * contents have changed and those changes can be seen by comparing
2216    * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
2217    * the file, respectively.
2218    *
2219    * If known, the @c svn:mime-type value of each file is passed into
2220    * @a mimetype1 and @a mimetype2;  either or both of the values can
2221    * be NULL.  The implementor can use this information to decide if
2222    * (or how) to generate differences.
2223    *
2224    * @a propchanges is an array of (#svn_prop_t) structures. If it contains
2225    * any elements, the original list of properties is provided in
2226    * @a originalprops, which is a hash of #svn_string_t values, keyed on the
2227    * property name.
2228    *
2229    */
2230   svn_error_t *(*file_changed)(svn_wc_notify_state_t *contentstate,
2231                                svn_wc_notify_state_t *propstate,
2232                                svn_boolean_t *tree_conflicted,
2233                                const char *path,
2234                                const char *tmpfile1,
2235                                const char *tmpfile2,
2236                                svn_revnum_t rev1,
2237                                svn_revnum_t rev2,
2238                                const char *mimetype1,
2239                                const char *mimetype2,
2240                                const apr_array_header_t *propchanges,
2241                                apr_hash_t *originalprops,
2242                                void *diff_baton,
2243                                apr_pool_t *scratch_pool);
2244
2245   /**
2246    * A file @a path was added.  The contents can be seen by comparing
2247    * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
2248    * of the file, respectively.  (If either file is empty, the rev
2249    * will be 0.)
2250    *
2251    * If known, the @c svn:mime-type value of each file is passed into
2252    * @a mimetype1 and @a mimetype2;  either or both of the values can
2253    * be NULL.  The implementor can use this information to decide if
2254    * (or how) to generate differences.
2255    *
2256    * @a propchanges is an array of (#svn_prop_t) structures.  If it contains
2257    * any elements, the original list of properties is provided in
2258    * @a originalprops, which is a hash of #svn_string_t values, keyed on the
2259    * property name.
2260    * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a
2261    * copy), and the origin of the copy may be recorded as
2262    * @a copyfrom_path under @a copyfrom_revision.
2263    */
2264   svn_error_t *(*file_added)(svn_wc_notify_state_t *contentstate,
2265                              svn_wc_notify_state_t *propstate,
2266                              svn_boolean_t *tree_conflicted,
2267                              const char *path,
2268                              const char *tmpfile1,
2269                              const char *tmpfile2,
2270                              svn_revnum_t rev1,
2271                              svn_revnum_t rev2,
2272                              const char *mimetype1,
2273                              const char *mimetype2,
2274                              const char *copyfrom_path,
2275                              svn_revnum_t copyfrom_revision,
2276                              const apr_array_header_t *propchanges,
2277                              apr_hash_t *originalprops,
2278                              void *diff_baton,
2279                              apr_pool_t *scratch_pool);
2280
2281   /**
2282    * A file @a path was deleted.  The [loss of] contents can be seen by
2283    * comparing @a tmpfile1 and @a tmpfile2.  @a originalprops provides
2284    * the properties of the file.
2285    * ### Some existing callers include WC "entry props" in @a originalprops.
2286    *
2287    * If known, the @c svn:mime-type value of each file is passed into
2288    * @a mimetype1 and @a mimetype2;  either or both of the values can
2289    * be NULL.  The implementor can use this information to decide if
2290    * (or how) to generate differences.
2291    */
2292   svn_error_t *(*file_deleted)(svn_wc_notify_state_t *state,
2293                                svn_boolean_t *tree_conflicted,
2294                                const char *path,
2295                                const char *tmpfile1,
2296                                const char *tmpfile2,
2297                                const char *mimetype1,
2298                                const char *mimetype2,
2299                                apr_hash_t *originalprops,
2300                                void *diff_baton,
2301                                apr_pool_t *scratch_pool);
2302
2303   /**
2304    * A directory @a path was deleted.
2305    */
2306   svn_error_t *(*dir_deleted)(svn_wc_notify_state_t *state,
2307                               svn_boolean_t *tree_conflicted,
2308                               const char *path,
2309                               void *diff_baton,
2310                               apr_pool_t *scratch_pool);
2311   /**
2312    * A directory @a path has been opened.  @a rev is the revision that the
2313    * directory came from.
2314    *
2315    * This function is called for any existing directory @a path before any
2316    * of the callbacks are called for a child of @a path.
2317    *
2318    * If the callback returns @c TRUE in @a *skip_children, children
2319    * of this directory will be skipped.
2320    */
2321   svn_error_t *(*dir_opened)(svn_boolean_t *tree_conflicted,
2322                              svn_boolean_t *skip,
2323                              svn_boolean_t *skip_children,
2324                              const char *path,
2325                              svn_revnum_t rev,
2326                              void *diff_baton,
2327                              apr_pool_t *scratch_pool);
2328
2329   /**
2330    * A directory @a path was added.  @a rev is the revision that the
2331    * directory came from.
2332    *
2333    * This function is called for any new directory @a path before any
2334    * of the callbacks are called for a child of @a path.
2335    *
2336    * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a
2337    * copy), and the origin of the copy may be recorded as
2338    * @a copyfrom_path under @a copyfrom_revision.
2339    */
2340   svn_error_t *(*dir_added)(svn_wc_notify_state_t *state,
2341                             svn_boolean_t *tree_conflicted,
2342                             svn_boolean_t *skip,
2343                             svn_boolean_t *skip_children,
2344                             const char *path,
2345                             svn_revnum_t rev,
2346                             const char *copyfrom_path,
2347                             svn_revnum_t copyfrom_revision,
2348                             void *diff_baton,
2349                             apr_pool_t *scratch_pool);
2350
2351   /**
2352    * A list of property changes (@a propchanges) was applied to the
2353    * directory @a path.
2354    *
2355    * The array is a list of (#svn_prop_t) structures.
2356    *
2357    * @a dir_was_added is set to #TRUE if the directory was added, and
2358    * to #FALSE if the directory pre-existed.
2359    */
2360   svn_error_t *(*dir_props_changed)(svn_wc_notify_state_t *propstate,
2361                                     svn_boolean_t *tree_conflicted,
2362                                     const char *path,
2363                                     svn_boolean_t dir_was_added,
2364                                     const apr_array_header_t *propchanges,
2365                                     apr_hash_t *original_props,
2366                                     void *diff_baton,
2367                                     apr_pool_t *scratch_pool);
2368
2369   /**
2370    * A directory @a path which has been opened with @a dir_opened or @a
2371    * dir_added has been closed.
2372    *
2373    * @a dir_was_added is set to #TRUE if the directory was added, and
2374    * to #FALSE if the directory pre-existed.
2375    */
2376   svn_error_t *(*dir_closed)(svn_wc_notify_state_t *contentstate,
2377                              svn_wc_notify_state_t *propstate,
2378                              svn_boolean_t *tree_conflicted,
2379                              const char *path,
2380                              svn_boolean_t dir_was_added,
2381                              void *diff_baton,
2382                              apr_pool_t *scratch_pool);
2383
2384 } svn_wc_diff_callbacks4_t;
2385
2386
2387 /**
2388  * Similar to #svn_wc_diff_callbacks4_t, but without @a copyfrom_path and
2389  * @a copyfrom_revision arguments to @c file_added and @c dir_added functions.
2390  *
2391  * @since New in 1.6.
2392  * @deprecated Provided for backward compatibility with the 1.6 API.
2393  */
2394 typedef struct svn_wc_diff_callbacks3_t
2395 {
2396   /** The same as #svn_wc_diff_callbacks4_t.file_changed. */
2397   svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
2398                                svn_wc_notify_state_t *contentstate,
2399                                svn_wc_notify_state_t *propstate,
2400                                svn_boolean_t *tree_conflicted,
2401                                const char *path,
2402                                const char *tmpfile1,
2403                                const char *tmpfile2,
2404                                svn_revnum_t rev1,
2405                                svn_revnum_t rev2,
2406                                const char *mimetype1,
2407                                const char *mimetype2,
2408                                const apr_array_header_t *propchanges,
2409                                apr_hash_t *originalprops,
2410                                void *diff_baton);
2411
2412   /** Similar to #svn_wc_diff_callbacks4_t.file_added but without
2413    * @a copyfrom_path and @a copyfrom_revision arguments. */
2414   svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
2415                              svn_wc_notify_state_t *contentstate,
2416                              svn_wc_notify_state_t *propstate,
2417                              svn_boolean_t *tree_conflicted,
2418                              const char *path,
2419                              const char *tmpfile1,
2420                              const char *tmpfile2,
2421                              svn_revnum_t rev1,
2422                              svn_revnum_t rev2,
2423                              const char *mimetype1,
2424                              const char *mimetype2,
2425                              const apr_array_header_t *propchanges,
2426                              apr_hash_t *originalprops,
2427                              void *diff_baton);
2428
2429   /** The same as #svn_wc_diff_callbacks4_t.file_deleted. */
2430   svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
2431                                svn_wc_notify_state_t *state,
2432                                svn_boolean_t *tree_conflicted,
2433                                const char *path,
2434                                const char *tmpfile1,
2435                                const char *tmpfile2,
2436                                const char *mimetype1,
2437                                const char *mimetype2,
2438                                apr_hash_t *originalprops,
2439                                void *diff_baton);
2440
2441   /** Similar to #svn_wc_diff_callbacks4_t.dir_added but without
2442    * @a copyfrom_path and @a copyfrom_revision arguments. */
2443   svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
2444                             svn_wc_notify_state_t *state,
2445                             svn_boolean_t *tree_conflicted,
2446                             const char *path,
2447                             svn_revnum_t rev,
2448                             void *diff_baton);
2449
2450   /** The same as #svn_wc_diff_callbacks4_t.dir_deleted. */
2451   svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
2452                               svn_wc_notify_state_t *state,
2453                               svn_boolean_t *tree_conflicted,
2454                               const char *path,
2455                               void *diff_baton);
2456
2457   /** The same as #svn_wc_diff_callbacks4_t.dir_props_changed. */
2458   svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access,
2459                                     svn_wc_notify_state_t *propstate,
2460                                     svn_boolean_t *tree_conflicted,
2461                                     const char *path,
2462                                     const apr_array_header_t *propchanges,
2463                                     apr_hash_t *original_props,
2464                                     void *diff_baton);
2465
2466   /** The same as #svn_wc_diff_callbacks4_t.dir_opened. */
2467   svn_error_t *(*dir_opened)(svn_wc_adm_access_t *adm_access,
2468                              svn_boolean_t *tree_conflicted,
2469                              const char *path,
2470                              svn_revnum_t rev,
2471                              void *diff_baton);
2472
2473   /** The same as #svn_wc_diff_callbacks4_t.dir_closed. */
2474   svn_error_t *(*dir_closed)(svn_wc_adm_access_t *adm_access,
2475                              svn_wc_notify_state_t *contentstate,
2476                              svn_wc_notify_state_t *propstate,
2477                              svn_boolean_t *tree_conflicted,
2478                              const char *path,
2479                              void *diff_baton);
2480
2481 } svn_wc_diff_callbacks3_t;
2482
2483 /**
2484  * Similar to #svn_wc_diff_callbacks3_t, but without the @c dir_opened
2485  * and @c dir_closed functions, and without the @a tree_conflicted argument
2486  * to the functions.
2487  *
2488  * @deprecated Provided for backward compatibility with the 1.2 API.
2489  */
2490 typedef struct svn_wc_diff_callbacks2_t
2491 {
2492   /** The same as @c file_changed in #svn_wc_diff_callbacks3_t. */
2493   svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
2494                                svn_wc_notify_state_t *contentstate,
2495                                svn_wc_notify_state_t *propstate,
2496                                const char *path,
2497                                const char *tmpfile1,
2498                                const char *tmpfile2,
2499                                svn_revnum_t rev1,
2500                                svn_revnum_t rev2,
2501                                const char *mimetype1,
2502                                const char *mimetype2,
2503                                const apr_array_header_t *propchanges,
2504                                apr_hash_t *originalprops,
2505                                void *diff_baton);
2506
2507   /** The same as @c file_added in #svn_wc_diff_callbacks3_t. */
2508   svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
2509                              svn_wc_notify_state_t *contentstate,
2510                              svn_wc_notify_state_t *propstate,
2511                              const char *path,
2512                              const char *tmpfile1,
2513                              const char *tmpfile2,
2514                              svn_revnum_t rev1,
2515                              svn_revnum_t rev2,
2516                              const char *mimetype1,
2517                              const char *mimetype2,
2518                              const apr_array_header_t *propchanges,
2519                              apr_hash_t *originalprops,
2520                              void *diff_baton);
2521
2522   /** The same as @c file_deleted in #svn_wc_diff_callbacks3_t. */
2523   svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
2524                                svn_wc_notify_state_t *state,
2525                                const char *path,
2526                                const char *tmpfile1,
2527                                const char *tmpfile2,
2528                                const char *mimetype1,
2529                                const char *mimetype2,
2530                                apr_hash_t *originalprops,
2531                                void *diff_baton);
2532
2533   /** The same as @c dir_added in #svn_wc_diff_callbacks3_t. */
2534   svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
2535                             svn_wc_notify_state_t *state,
2536                             const char *path,
2537                             svn_revnum_t rev,
2538                             void *diff_baton);
2539
2540   /** The same as @c dir_deleted in #svn_wc_diff_callbacks3_t. */
2541   svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
2542                               svn_wc_notify_state_t *state,
2543                               const char *path,
2544                               void *diff_baton);
2545
2546   /** The same as @c dir_props_changed in #svn_wc_diff_callbacks3_t. */
2547   svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access,
2548                                     svn_wc_notify_state_t *state,
2549                                     const char *path,
2550                                     const apr_array_header_t *propchanges,
2551                                     apr_hash_t *original_props,
2552                                     void *diff_baton);
2553
2554 } svn_wc_diff_callbacks2_t;
2555
2556 /**
2557  * Similar to #svn_wc_diff_callbacks2_t, but with file additions/content
2558  * changes and property changes split into different functions.
2559  *
2560  * @deprecated Provided for backward compatibility with the 1.1 API.
2561  */
2562 typedef struct svn_wc_diff_callbacks_t
2563 {
2564   /** Similar to @c file_changed in #svn_wc_diff_callbacks2_t, but without
2565    * property change information.  @a tmpfile2 is never NULL. @a state applies
2566    * to the file contents. */
2567   svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
2568                                svn_wc_notify_state_t *state,
2569                                const char *path,
2570                                const char *tmpfile1,
2571                                const char *tmpfile2,
2572                                svn_revnum_t rev1,
2573                                svn_revnum_t rev2,
2574                                const char *mimetype1,
2575                                const char *mimetype2,
2576                                void *diff_baton);
2577
2578   /** Similar to @c file_added in #svn_wc_diff_callbacks2_t, but without
2579    * property change information.  @a *state applies to the file contents. */
2580   svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
2581                              svn_wc_notify_state_t *state,
2582                              const char *path,
2583                              const char *tmpfile1,
2584                              const char *tmpfile2,
2585                              svn_revnum_t rev1,
2586                              svn_revnum_t rev2,
2587                              const char *mimetype1,
2588                              const char *mimetype2,
2589                              void *diff_baton);
2590
2591   /** Similar to @c file_deleted in #svn_wc_diff_callbacks2_t, but without
2592    * the properties. */
2593   svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
2594                                svn_wc_notify_state_t *state,
2595                                const char *path,
2596                                const char *tmpfile1,
2597                                const char *tmpfile2,
2598                                const char *mimetype1,
2599                                const char *mimetype2,
2600                                void *diff_baton);
2601
2602   /** The same as @c dir_added in #svn_wc_diff_callbacks2_t. */
2603   svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
2604                             svn_wc_notify_state_t *state,
2605                             const char *path,
2606                             svn_revnum_t rev,
2607                             void *diff_baton);
2608
2609   /** The same as @c dir_deleted in #svn_wc_diff_callbacks2_t. */
2610   svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
2611                               svn_wc_notify_state_t *state,
2612                               const char *path,
2613                               void *diff_baton);
2614
2615   /** Similar to @c dir_props_changed in #svn_wc_diff_callbacks2_t, but this
2616    * function is called for files as well as directories. */
2617   svn_error_t *(*props_changed)(svn_wc_adm_access_t *adm_access,
2618                                 svn_wc_notify_state_t *state,
2619                                 const char *path,
2620                                 const apr_array_header_t *propchanges,
2621                                 apr_hash_t *original_props,
2622                                 void *diff_baton);
2623
2624 } svn_wc_diff_callbacks_t;
2625
2626 \f
2627 /* Asking questions about a working copy. */
2628
2629 /** Set @a *wc_format to @a local_abspath's working copy format version
2630  * number if @a local_abspath is a valid working copy directory, else set it
2631  * to 0.
2632  *
2633  * Return error @c APR_ENOENT if @a local_abspath does not exist at all.
2634  *
2635  * @since New in 1.7.
2636  */
2637 svn_error_t *
2638 svn_wc_check_wc2(int *wc_format,
2639                  svn_wc_context_t *wc_ctx,
2640                  const char *local_abspath,
2641                  apr_pool_t *scratch_pool);
2642
2643 /**
2644  * Similar to svn_wc_check_wc2(), but with a relative path and no supplied
2645  * working copy context.
2646  *
2647  * @deprecated Provided for backward compatibility with the 1.6 API.
2648  */
2649 SVN_DEPRECATED
2650 svn_error_t *
2651 svn_wc_check_wc(const char *path,
2652                 int *wc_format,
2653                 apr_pool_t *pool);
2654
2655
2656 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked
2657  * with a property indicating that it is non-text (in other words, binary).
2658  * @a adm_access is an access baton set that contains @a path.
2659  *
2660  * @deprecated Provided for backward compatibility with the 1.6 API. As a
2661  * replacement for this functionality, @see svn_mime_type_is_binary and
2662  * #SVN_PROP_MIME_TYPE.
2663  */
2664 SVN_DEPRECATED
2665 svn_error_t *
2666 svn_wc_has_binary_prop(svn_boolean_t *has_binary_prop,
2667                        const char *path,
2668                        svn_wc_adm_access_t *adm_access,
2669                        apr_pool_t *pool);
2670
2671 \f
2672 /* Detecting modification. */
2673
2674 /** Set @a *modified_p to non-zero if @a local_abspath's text is modified
2675  * with regard to the base revision, else set @a *modified_p to zero.
2676  * @a local_abspath is the absolute path to the file.
2677  *
2678  * This function uses some heuristics to avoid byte-by-byte comparisons
2679  * against the base text (eg. file size and its modification time).
2680  *
2681  * If @a local_abspath does not exist, consider it unmodified.  If it exists
2682  * but is not under revision control (not even scheduled for
2683  * addition), return the error #SVN_ERR_ENTRY_NOT_FOUND.
2684  *
2685  * @a unused is ignored.
2686  *
2687  * @since New in 1.7.
2688  */
2689 svn_error_t *
2690 svn_wc_text_modified_p2(svn_boolean_t *modified_p,
2691                         svn_wc_context_t *wc_ctx,
2692                         const char *local_abspath,
2693                         svn_boolean_t unused,
2694                         apr_pool_t *scratch_pool);
2695
2696 /** Similar to svn_wc_text_modified_p2(), but with a relative path and
2697  * adm_access baton?
2698  *
2699  * @deprecated Provided for backward compatibility with the 1.6 API.
2700  */
2701 SVN_DEPRECATED
2702 svn_error_t *
2703 svn_wc_text_modified_p(svn_boolean_t *modified_p,
2704                        const char *filename,
2705                        svn_boolean_t force_comparison,
2706                        svn_wc_adm_access_t *adm_access,
2707                        apr_pool_t *pool);
2708
2709 /** Set @a *modified_p to non-zero if @a path's properties are modified
2710  * with regard to the base revision, else set @a modified_p to zero.
2711  * @a adm_access must be an access baton for @a path.
2712  *
2713  * @since New in 1.7.
2714  */
2715 svn_error_t *
2716 svn_wc_props_modified_p2(svn_boolean_t *modified_p,
2717                          svn_wc_context_t *wc_ctx,
2718                          const char *local_abspath,
2719                          apr_pool_t *scratch_pool);
2720
2721 /** Similar to svn_wc_props_modified_p2(), but with a relative path and
2722  * adm_access baton.
2723  *
2724  * @deprecated Provided for backward compatibility with the 1.6 API.
2725  */
2726 SVN_DEPRECATED
2727 svn_error_t *
2728 svn_wc_props_modified_p(svn_boolean_t *modified_p,
2729                         const char *path,
2730                         svn_wc_adm_access_t *adm_access,
2731                         apr_pool_t *pool);
2732
2733
2734 /**
2735 \f* @defgroup svn_wc_entries Entries and status (deprecated)
2736  * @{
2737  */
2738
2739 /** The schedule states an entry can be in.
2740  * @deprecated Provided for backward compatibility with the 1.6 API. */
2741 typedef enum svn_wc_schedule_t
2742 {
2743   /** Nothing special here */
2744   svn_wc_schedule_normal,
2745
2746   /** Slated for addition */
2747   svn_wc_schedule_add,
2748
2749   /** Slated for deletion */
2750   svn_wc_schedule_delete,
2751
2752   /** Slated for replacement (delete + add) */
2753   svn_wc_schedule_replace
2754
2755 } svn_wc_schedule_t;
2756
2757
2758 /**
2759  * Values for the working_size field in svn_wc_entry_t
2760  * when it isn't set to the actual size value of the unchanged
2761  * working file.
2762  *
2763  *  The value of the working size is unknown (hasn't been
2764  *  calculated and stored in the past for whatever reason).
2765  *
2766  * @since New in 1.5
2767  * @deprecated Provided for backward compatibility with the 1.6 API.
2768  */
2769 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN (-1)
2770
2771 /** A working copy entry -- that is, revision control information about
2772  * one versioned entity.
2773  *
2774  * @deprecated Provided for backward compatibility with the 1.6 API.
2775  */
2776 /* SVN_DEPRECATED */
2777 typedef struct svn_wc_entry_t
2778 {
2779   /* IMPORTANT: If you extend this structure, add new fields to the end. */
2780
2781   /* General Attributes */
2782
2783   /** entry's name */
2784   const char *name;
2785
2786   /** base revision */
2787   svn_revnum_t revision;
2788
2789   /** url in repository */
2790   const char *url;
2791
2792   /** canonical repository URL or NULL if not known */
2793   const char *repos;
2794
2795   /** repository uuid */
2796   const char *uuid;
2797
2798   /** node kind (file, dir, ...) */
2799   svn_node_kind_t kind;
2800
2801   /* State information */
2802
2803   /** scheduling (add, delete, replace ...) */
2804   svn_wc_schedule_t schedule;
2805
2806   /** in a copied state (possibly because the entry is a child of a
2807    *  path that is #svn_wc_schedule_add or #svn_wc_schedule_replace,
2808    *  when the entry itself is #svn_wc_schedule_normal).
2809    *  COPIED is true for nodes under a directory that was copied, but
2810    *  COPYFROM_URL is null there. They are both set for the root
2811    *  destination of the copy.
2812    */
2813   svn_boolean_t copied;
2814
2815   /** The directory containing this entry had a versioned child of this
2816    * name, but this entry represents a different revision or a switched
2817    * path at which no item exists in the repository. This typically
2818    * arises from committing or updating to a deletion of this entry
2819    * without committing or updating the parent directory.
2820    *
2821    * The schedule can be 'normal' or 'add'. */
2822   svn_boolean_t deleted;
2823
2824   /** absent -- we know an entry of this name exists, but that's all
2825       (usually this happens because of authz restrictions)  */
2826   svn_boolean_t absent;
2827
2828   /** for THIS_DIR entry, implies whole entries file is incomplete */
2829   svn_boolean_t incomplete;
2830
2831   /** copyfrom location */
2832   const char *copyfrom_url;
2833
2834   /** copyfrom revision */
2835   svn_revnum_t copyfrom_rev;
2836
2837   /** old version of conflicted file. A file basename, relative to the
2838    * user's directory that the THIS_DIR entry refers to. */
2839   const char *conflict_old;
2840
2841   /** new version of conflicted file. A file basename, relative to the
2842    * user's directory that the THIS_DIR entry refers to. */
2843   const char *conflict_new;
2844
2845   /** working version of conflicted file. A file basename, relative to the
2846    * user's directory that the THIS_DIR entry refers to. */
2847   const char *conflict_wrk;
2848
2849   /** property reject file. A file basename, relative to the user's
2850    * directory that the THIS_DIR entry refers to. */
2851   const char *prejfile;
2852
2853   /** last up-to-date time for text contents (0 means no information available)
2854    */
2855   apr_time_t text_time;
2856
2857   /** last up-to-date time for properties (0 means no information available)
2858    *
2859    * @deprecated This value will always be 0 in version 1.4 and later.
2860    */
2861   apr_time_t prop_time;
2862
2863   /** Hex MD5 checksum for the untranslated text base file,
2864    * can be @c NULL for backwards compatibility.
2865    */
2866   const char *checksum;
2867
2868   /* "Entry props" */
2869
2870   /** last revision this was changed */
2871   svn_revnum_t cmt_rev;
2872
2873   /** last date this was changed */
2874   apr_time_t cmt_date;
2875
2876   /** last commit author of this item */
2877   const char *cmt_author;
2878
2879   /** lock token or NULL if path not locked in this WC
2880    * @since New in 1.2.
2881    */
2882   const char *lock_token;
2883
2884   /** lock owner, or NULL if not locked in this WC
2885    * @since New in 1.2.
2886    */
2887   const char *lock_owner;
2888
2889   /** lock comment or NULL if not locked in this WC or no comment
2890    * @since New in 1.2.
2891    */
2892   const char *lock_comment;
2893
2894   /** Lock creation date or 0 if not locked in this WC
2895    * @since New in 1.2.
2896    */
2897   apr_time_t lock_creation_date;
2898
2899   /** Whether this entry has any working properties.
2900    * False if this information is not stored in the entry.
2901    *
2902    * @since New in 1.4. */
2903   svn_boolean_t has_props;
2904
2905   /** Whether this entry has property modifications.
2906    *
2907    * @note For working copies in older formats, this flag is not valid.
2908    *
2909    * @see svn_wc_props_modified_p().
2910    *
2911    * @since New in 1.4. */
2912   svn_boolean_t has_prop_mods;
2913
2914   /** A space-separated list of all properties whose presence/absence is cached
2915    * in this entry.
2916    *
2917    * @see @c present_props.
2918    *
2919    * @since New in 1.4.
2920    * @deprecated This value will always be "" in version 1.7 and later. */
2921   const char *cachable_props;
2922
2923   /** Cached property existence for this entry.
2924    * This is a space-separated list of property names.  If a name exists in
2925    * @c cachable_props but not in this list, this entry does not have that
2926    * property.  If a name exists in both lists, the property is present on this
2927    * entry.
2928    *
2929    * @since New in 1.4.
2930    * @deprecated This value will always be "" in version 1.7 and later. */
2931   const char *present_props;
2932
2933   /** which changelist this item is part of, or NULL if not part of any.
2934    * @since New in 1.5.
2935    */
2936   const char *changelist;
2937
2938   /** Size of the file after being translated into local
2939    * representation, or #SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if
2940    * unknown.
2941    *
2942    * @since New in 1.5.
2943    */
2944   apr_off_t working_size;
2945
2946   /** Whether a local copy of this entry should be kept in the working copy
2947    * after a deletion has been committed,  Only valid for the this-dir entry
2948    * when it is scheduled for deletion.
2949    *
2950    * @since New in 1.5. */
2951   svn_boolean_t keep_local;
2952
2953   /** The depth of this entry.
2954    *
2955    * ### It's a bit annoying that we only use this on this_dir
2956    * ### entries, yet it will exist (with value svn_depth_infinity) on
2957    * ### all entries.  Maybe some future extensibility would make this
2958    * ### field meaningful on entries besides this_dir.
2959    *
2960    * @since New in 1.5. */
2961   svn_depth_t depth;
2962
2963   /** Serialized data for all of the tree conflicts detected in this_dir.
2964    *
2965    * @since New in 1.6. */
2966   const char *tree_conflict_data;
2967
2968   /** The entry is a intra-repository file external and this is the
2969    * repository root relative path to the file specified in the
2970    * externals definition, otherwise NULL if the entry is not a file
2971    * external.
2972    *
2973    * @since New in 1.6. */
2974   const char *file_external_path;
2975
2976   /** The entry is a intra-repository file external and this is the
2977    * peg revision number specified in the externals definition.  This
2978    * field is only valid when the file_external_path field is
2979    * non-NULL.  The only permissible values are
2980    * svn_opt_revision_unspecified if the entry is not an external,
2981    * svn_opt_revision_head if the external revision is unspecified or
2982    * specified with -r HEAD or svn_opt_revision_number for a specific
2983    * revision number.
2984    *
2985    * @since New in 1.6. */
2986   svn_opt_revision_t file_external_peg_rev;
2987
2988   /** The entry is an intra-repository file external and this is the
2989    * operative revision number specified in the externals definition.
2990    * This field is only valid when the file_external_path field is
2991    * non-NULL.  The only permissible values are
2992    * svn_opt_revision_unspecified if the entry is not an external,
2993    * svn_opt_revision_head if the external revision is unspecified or
2994    * specified with -r HEAD or svn_opt_revision_number for a specific
2995    * revision number.
2996    *
2997    * @since New in 1.6. */
2998   svn_opt_revision_t file_external_rev;
2999
3000   /* IMPORTANT: If you extend this structure, check the following functions in
3001    * subversion/libsvn_wc/entries.c, to see if you need to extend them as well.
3002    *
3003    * svn_wc__atts_to_entry()
3004    * svn_wc_entry_dup()
3005    * alloc_entry()
3006    * read_entry()
3007    * write_entry()
3008    * fold_entry()
3009    */
3010 } svn_wc_entry_t;
3011
3012
3013 /** How an entries file's owner dir is named in the entries file.
3014  * @deprecated Provided for backward compatibility with the 1.6 API. */
3015 #define SVN_WC_ENTRY_THIS_DIR  ""
3016
3017
3018 /** Set @a *entry to an entry for @a path, allocated in the access baton pool.
3019  * If @a show_hidden is TRUE, return the entry even if it's in 'excluded',
3020  * 'deleted' or 'absent' state. Excluded entries are those with their depth
3021  * set to #svn_depth_exclude. If @a path is not under revision control, or
3022  * if entry is hidden, not scheduled for re-addition, and @a show_hidden is @c
3023  * FALSE, then set @a *entry to @c NULL.
3024  *
3025  * @a *entry should not be modified, since doing so modifies the entries
3026  * cache in @a adm_access without changing the entries file on disk.
3027  *
3028  * If @a path is not a directory then @a adm_access must be an access baton
3029  * for the parent directory of @a path.  To avoid needing to know whether
3030  * @a path is a directory or not, if @a path is a directory @a adm_access
3031  * can still be an access baton for the parent of @a path so long as the
3032  * access baton for @a path itself is in the same access baton set.
3033  *
3034  * @a path can be relative or absolute but must share the same base used
3035  * to open @a adm_access.
3036  *
3037  * Note that it is possible for @a path to be absent from disk but still
3038  * under revision control; and conversely, it is possible for @a path to
3039  * be present, but not under revision control.
3040  *
3041  * Use @a pool only for local processing.
3042  *
3043  * @deprecated Provided for backward compatibility with the 1.6 API.
3044  */
3045 SVN_DEPRECATED
3046 svn_error_t *
3047 svn_wc_entry(const svn_wc_entry_t **entry,
3048              const char *path,
3049              svn_wc_adm_access_t *adm_access,
3050              svn_boolean_t show_hidden,
3051              apr_pool_t *pool);
3052
3053
3054 /** Parse the `entries' file for @a adm_access and return a hash @a entries,
3055  * whose keys are (<tt>const char *</tt>) entry names and values are
3056  * (<tt>svn_wc_entry_t *</tt>).  The hash @a entries, and its keys and
3057  * values, are allocated from the pool used to open the @a adm_access
3058  * baton (that's how the entries caching works).  @a pool is used for
3059  * transient allocations.
3060  *
3061  * Entries that are in a 'excluded', 'deleted' or 'absent' state (and not
3062  * scheduled for re-addition) are not returned in the hash, unless
3063  * @a show_hidden is TRUE. Excluded entries are those with their depth set to
3064  * #svn_depth_exclude.
3065  *
3066  * @par Important:
3067  * The @a entries hash is the entries cache in @a adm_access
3068  * and so usually the hash itself, the keys and the values should be treated
3069  * as read-only.  If any of these are modified then it is the caller's
3070  * responsibility to ensure that the entries file on disk is updated.  Treat
3071  * the hash values as type (<tt>const svn_wc_entry_t *</tt>) if you wish to
3072  * avoid accidental modification.  Modifying the schedule member is a
3073  * particularly bad idea, as the entries writing process relies on having
3074  * access to the original schedule.  Use a duplicate entry to modify the
3075  * schedule.
3076  *
3077  * @par Important:
3078  * Only the entry structures representing files and
3079  * #SVN_WC_ENTRY_THIS_DIR contain complete information.  The entry
3080  * structures representing subdirs have only the `kind' and `state'
3081  * fields filled in.  If you want info on a subdir, you must use this
3082  * routine to open its @a path and read the #SVN_WC_ENTRY_THIS_DIR
3083  * structure, or call svn_wc_entry() on its @a path.
3084  *
3085  * @deprecated Provided for backward compatibility with the 1.6 API.
3086  */
3087 SVN_DEPRECATED
3088 svn_error_t *
3089 svn_wc_entries_read(apr_hash_t **entries,
3090                     svn_wc_adm_access_t *adm_access,
3091                     svn_boolean_t show_hidden,
3092                     apr_pool_t *pool);
3093
3094
3095 /** Return a duplicate of @a entry, allocated in @a pool.  No part of the new
3096  * entry will be shared with @a entry.
3097  *
3098  * @deprecated Provided for backward compatibility with the 1.6 API.
3099  */
3100 SVN_DEPRECATED
3101 svn_wc_entry_t *
3102 svn_wc_entry_dup(const svn_wc_entry_t *entry,
3103                  apr_pool_t *pool);
3104
3105 /** @} */
3106
3107
3108 /**
3109  * This struct contains information about a working copy node.
3110  *
3111  * @note Fields may be added to the end of this structure in future
3112  * versions.  Therefore, users shouldn't allocate structures of this
3113  * type, to preserve binary compatibility.
3114  *
3115  * @since New in 1.7.
3116  */
3117 typedef struct svn_wc_info_t
3118 {
3119   /** The schedule of this item
3120    * ### Do we still need schedule? */
3121   svn_wc_schedule_t schedule;
3122
3123   /** If copied, the URL from which the copy was made, else @c NULL. */
3124   const char *copyfrom_url;
3125
3126   /** If copied, the revision from which the copy was made,
3127    * else #SVN_INVALID_REVNUM. */
3128   svn_revnum_t copyfrom_rev;
3129
3130   /** The checksum of the node, if it is a file. */
3131   const svn_checksum_t *checksum;
3132
3133   /** A changelist the item is in, @c NULL if this node is not in a
3134    * changelist. */
3135   const char *changelist;
3136
3137   /** The depth of the item, see #svn_depth_t */
3138   svn_depth_t depth;
3139
3140   /**
3141    * The size of the file after being translated into its local
3142    * representation, or #SVN_INVALID_FILESIZE if unknown.
3143    * Not applicable for directories.
3144    */
3145   svn_filesize_t recorded_size;
3146
3147   /**
3148    * The time at which the file had the recorded size recorded_size and was
3149    * considered unmodified. */
3150   apr_time_t recorded_time;
3151
3152   /** Array of const svn_wc_conflict_description2_t * which contains info
3153    * on any conflict of which this node is a victim. Otherwise NULL.  */
3154   const apr_array_header_t *conflicts;
3155
3156   /** The local absolute path of the working copy root.  */
3157   const char *wcroot_abspath;
3158
3159   /** The path the node was moved from, if it was moved here. Else NULL.
3160    * @since New in 1.8. */
3161   const char *moved_from_abspath;
3162
3163   /** The path the node was moved to, if it was moved away. Else NULL.
3164    * @since New in 1.8. */
3165   const char *moved_to_abspath;
3166 } svn_wc_info_t;
3167
3168 /**
3169  * Return a duplicate of @a info, allocated in @a pool. No part of the new
3170  * structure will be shared with @a info.
3171  *
3172  * @since New in 1.7.
3173  */
3174 svn_wc_info_t *
3175 svn_wc_info_dup(const svn_wc_info_t *info,
3176                 apr_pool_t *pool);
3177
3178
3179 /** Given @a local_abspath in a dir under version control, decide if it is
3180  * in a state of conflict; return the answers in @a *text_conflicted_p, @a
3181  * *prop_conflicted_p, and @a *tree_conflicted_p.  If one or two of the
3182  * answers are uninteresting, simply pass @c NULL pointers for those.
3183  *
3184  * If @a local_abspath is unversioned or does not exist, return
3185  * #SVN_ERR_WC_PATH_NOT_FOUND.
3186  *
3187  * If the @a local_abspath has corresponding text conflict files (with suffix
3188  * .mine, .theirs, etc.) that cannot be found, assume that the text conflict
3189  * has been resolved by the user and return @c FALSE in @a
3190  * *text_conflicted_p.
3191  *
3192  * Similarly, if a property conflicts file (.prej suffix) is said to exist,
3193  * but it cannot be found, assume that the property conflicts have been
3194  * resolved by the user and return @c FALSE in @a *prop_conflicted_p.
3195  *
3196  * @a *tree_conflicted_p can't be auto-resolved in this fashion.  An
3197  * explicit `resolved' is needed.
3198  *
3199  * @since New in 1.7.
3200  */
3201 svn_error_t *
3202 svn_wc_conflicted_p3(svn_boolean_t *text_conflicted_p,
3203                      svn_boolean_t *prop_conflicted_p,
3204                      svn_boolean_t *tree_conflicted_p,
3205                      svn_wc_context_t *wc_ctx,
3206                      const char *local_abspath,
3207                      apr_pool_t *scratch_pool);
3208
3209 /** Similar to svn_wc_conflicted_p3(), but with a path/adm_access parameter
3210  * pair in place of a wc_ctx/local_abspath pair.
3211  *
3212  * @since New in 1.6.
3213  * @deprecated Provided for backward compatibility with the 1.6 API.
3214  */
3215 SVN_DEPRECATED
3216 svn_error_t *
3217 svn_wc_conflicted_p2(svn_boolean_t *text_conflicted_p,
3218                      svn_boolean_t *prop_conflicted_p,
3219                      svn_boolean_t *tree_conflicted_p,
3220                      const char *path,
3221                      svn_wc_adm_access_t *adm_access,
3222                      apr_pool_t *pool);
3223
3224 /** Given a @a dir_path under version control, decide if one of its entries
3225  * (@a entry) is in a state of conflict; return the answers in @a
3226  * text_conflicted_p and @a prop_conflicted_p. These pointers must not be
3227  * null.
3228  *
3229  * If the @a entry mentions that text conflict files (with suffix .mine,
3230  * .theirs, etc.) exist, but they cannot be found, assume the text conflict
3231  * has been resolved by the user and return FALSE in @a *text_conflicted_p.
3232  *
3233  * Similarly, if the @a entry mentions that a property conflicts file (.prej
3234  * suffix) exists, but it cannot be found, assume the property conflicts
3235  * have been resolved by the user and return FALSE in @a *prop_conflicted_p.
3236  *
3237  * The @a entry is not updated.
3238  *
3239  * @deprecated Provided for backward compatibility with the 1.5 API.
3240  */
3241 SVN_DEPRECATED
3242 svn_error_t *
3243 svn_wc_conflicted_p(svn_boolean_t *text_conflicted_p,
3244                     svn_boolean_t *prop_conflicted_p,
3245                     const char *dir_path,
3246                     const svn_wc_entry_t *entry,
3247                     apr_pool_t *pool);
3248
3249
3250 /** Set @a *url and @a *rev to the ancestor URL and revision for @a path,
3251  * allocating in @a pool.  @a adm_access must be an access baton for @a path.
3252  *
3253  * If @a url or @a rev is NULL, then ignore it (just don't return the
3254  * corresponding information).
3255  *
3256  * @deprecated Provided for backward compatibility with the 1.6 API.
3257  */
3258 SVN_DEPRECATED
3259 svn_error_t *
3260 svn_wc_get_ancestry(char **url,
3261                     svn_revnum_t *rev,
3262                     const char *path,
3263                     svn_wc_adm_access_t *adm_access,
3264                     apr_pool_t *pool);
3265
3266
3267 /** A callback vtable invoked by the generic entry-walker function.
3268  * @since New in 1.5.
3269  */
3270 typedef struct svn_wc_entry_callbacks2_t
3271 {
3272   /** An @a entry was found at @a path. */
3273   svn_error_t *(*found_entry)(const char *path,
3274                               const svn_wc_entry_t *entry,
3275                               void *walk_baton,
3276                               apr_pool_t *pool);
3277
3278   /** Handle the error @a err encountered while processing @a path.
3279    * Wrap or squelch @a err as desired, and return an #svn_error_t
3280    * *, or #SVN_NO_ERROR.
3281    */
3282   svn_error_t *(*handle_error)(const char *path,
3283                                svn_error_t *err,
3284                                void *walk_baton,
3285                                apr_pool_t *pool);
3286
3287 } svn_wc_entry_callbacks2_t;
3288
3289 /** @deprecated Provided for backward compatibility with the 1.4 API. */
3290 typedef struct svn_wc_entry_callbacks_t
3291 {
3292   /** An @a entry was found at @a path. */
3293   svn_error_t *(*found_entry)(const char *path,
3294                               const svn_wc_entry_t *entry,
3295                               void *walk_baton,
3296                               apr_pool_t *pool);
3297
3298 } svn_wc_entry_callbacks_t;
3299
3300 /**
3301  * A generic entry-walker.
3302  *
3303  * Do a potentially recursive depth-first entry-walk beginning on
3304  * @a path, which can be a file or dir.  Call callbacks in
3305  * @a walk_callbacks, passing @a walk_baton to each.  Use @a pool for
3306  * looping, recursion, and to allocate all entries returned.
3307  * @a adm_access must be an access baton for @a path.  The pool
3308  * passed to @a walk_callbacks is a temporary subpool of @a pool.
3309  *
3310  * If @a depth is #svn_depth_empty, invoke the callbacks on @a path
3311  * and return without recursing further.  If #svn_depth_files, do
3312  * the same and invoke the callbacks on file children (if any) of
3313  * @a path, then return.  If #svn_depth_immediates, do the preceding
3314  * but also invoke callbacks on immediate subdirectories, then return.
3315  * If #svn_depth_infinity, recurse fully starting from @a path.
3316  *
3317  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
3318  * if the client has canceled the operation.
3319  *
3320  * Like our other entries interfaces, entries that are in a 'excluded',
3321  * 'deleted' or 'absent' state (and not scheduled for re-addition) are not
3322  * discovered, unless @a show_hidden is TRUE. Excluded entries are those with
3323  * their depth set to #svn_depth_exclude.
3324  *
3325  * When a new directory is entered, #SVN_WC_ENTRY_THIS_DIR will always
3326  * be returned first.
3327  *
3328  * @note Callers should be aware that each directory will be
3329  * returned *twice*:  first as an entry within its parent, and
3330  * subsequently as the '.' entry within itself.  The two calls can be
3331  * distinguished by looking for #SVN_WC_ENTRY_THIS_DIR in the 'name'
3332  * field of the entry.
3333  *
3334  * @since New in 1.5.
3335  * @deprecated Provided for backward compatibility with the 1.6 API.
3336  */
3337 SVN_DEPRECATED
3338 svn_error_t *
3339 svn_wc_walk_entries3(const char *path,
3340                      svn_wc_adm_access_t *adm_access,
3341                      const svn_wc_entry_callbacks2_t *walk_callbacks,
3342                      void *walk_baton,
3343                      svn_depth_t depth,
3344                      svn_boolean_t show_hidden,
3345                      svn_cancel_func_t cancel_func,
3346                      void *cancel_baton,
3347                      apr_pool_t *pool);
3348
3349 /**
3350  * Similar to svn_wc_walk_entries3(), but without cancellation support
3351  * or error handling from @a walk_callbacks, and with @a depth always
3352  * set to #svn_depth_infinity.
3353  *
3354  * @since New in 1.2.
3355  * @deprecated Provided for backward compatibility with the 1.4 API.
3356  */
3357 SVN_DEPRECATED
3358 svn_error_t *
3359 svn_wc_walk_entries2(const char *path,
3360                      svn_wc_adm_access_t *adm_access,
3361                      const svn_wc_entry_callbacks_t *walk_callbacks,
3362                      void *walk_baton,
3363                      svn_boolean_t show_hidden,
3364                      svn_cancel_func_t cancel_func,
3365                      void *cancel_baton,
3366                      apr_pool_t *pool);
3367
3368 /**
3369  * Similar to svn_wc_walk_entries2(), but without cancellation support.
3370  *
3371  * @deprecated Provided for backward compatibility with the 1.1 API.
3372  */
3373 SVN_DEPRECATED
3374 svn_error_t *
3375 svn_wc_walk_entries(const char *path,
3376                     svn_wc_adm_access_t *adm_access,
3377                     const svn_wc_entry_callbacks_t *walk_callbacks,
3378                     void *walk_baton,
3379                     svn_boolean_t show_hidden,
3380                     apr_pool_t *pool);
3381
3382
3383 /** Mark missing @a path as 'deleted' in its @a parent's list of
3384  * entries.  @a path should be a directory that is both deleted (via
3385  * svn_wc_delete4) and removed (via a system call).  This function
3386  * should only be called during post-commit processing following a
3387  * successful commit editor drive.
3388  *
3389  * Return #SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing.
3390  *
3391  * @deprecated Provided for backward compatibility with the 1.6 API.
3392  */
3393 SVN_DEPRECATED
3394 svn_error_t *
3395 svn_wc_mark_missing_deleted(const char *path,
3396                             svn_wc_adm_access_t *parent,
3397                             apr_pool_t *pool);
3398
3399
3400 /** Ensure that an administrative area exists for @a local_abspath, so
3401  * that @a local_abspath is a working copy subdir based on @a url at @a
3402  * revision, with depth @a depth, and with repository UUID @a repos_uuid
3403  * and repository root URL @a repos_root_url.
3404  *
3405  * @a depth must be a definite depth, it cannot be #svn_depth_unknown.
3406  * @a repos_uuid and @a repos_root_url MUST NOT be @c NULL, and
3407  * @a repos_root_url must be a prefix of @a url.
3408  *
3409  * If the administrative area does not exist, then create it and
3410  * initialize it to an unlocked state.
3411  *
3412  * If the administrative area already exists then the given @a url
3413  * must match the URL in the administrative area and the given
3414  * @a revision must match the BASE of the working copy dir unless
3415  * the admin directory is scheduled for deletion or the
3416  * #SVN_ERR_WC_OBSTRUCTED_UPDATE error will be returned.
3417  *
3418  * Do not ensure existence of @a local_abspath itself; if @a local_abspath
3419  * does not exist, return error.
3420  *
3421  * Use @a scratch_pool for temporary allocations.
3422  *
3423  * @since New in 1.7.
3424  */
3425 svn_error_t *
3426 svn_wc_ensure_adm4(svn_wc_context_t *wc_ctx,
3427                    const char *local_abspath,
3428                    const char *url,
3429                    const char *repos_root_url,
3430                    const char *repos_uuid,
3431                    svn_revnum_t revision,
3432                    svn_depth_t depth,
3433                    apr_pool_t *scratch_pool);
3434
3435 /**
3436  * Similar to svn_wc_ensure_adm4(), but without the wc context parameter.
3437  *
3438  * @note the @a uuid and @a repos parameters were documented as allowing
3439  * @c NULL to be passed. Beginning with 1.7, this will return an error,
3440  * contrary to prior documented behavior: see 'notes/api-errata/1.7/wc005.txt'.
3441  *
3442  * @since New in 1.5.
3443  * @deprecated Provided for backwards compatibility with the 1.6 API.
3444  */
3445 SVN_DEPRECATED
3446 svn_error_t *
3447 svn_wc_ensure_adm3(const char *path,
3448                    const char *uuid,
3449                    const char *url,
3450                    const char *repos,
3451                    svn_revnum_t revision,
3452                    svn_depth_t depth,
3453                    apr_pool_t *pool);
3454
3455
3456 /**
3457  * Similar to svn_wc_ensure_adm3(), but with @a depth set to
3458  * #svn_depth_infinity.
3459  *
3460  * See the note on svn_wc_ensure_adm3() regarding the @a repos and @a uuid
3461  * parameters.
3462  *
3463  * @since New in 1.3.
3464  * @deprecated Provided for backwards compatibility with the 1.4 API.
3465  */
3466 SVN_DEPRECATED
3467 svn_error_t *
3468 svn_wc_ensure_adm2(const char *path,
3469                    const char *uuid,
3470                    const char *url,
3471                    const char *repos,
3472                    svn_revnum_t revision,
3473                    apr_pool_t *pool);
3474
3475
3476 /**
3477  * Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL.
3478  *
3479  * @note as of 1.7, this function always returns #SVN_ERR_BAD_URL since
3480  * the @a repos parameter may not be @c NULL.
3481  *
3482  * @deprecated Provided for backwards compatibility with the 1.2 API.
3483  */
3484 SVN_DEPRECATED
3485 svn_error_t *
3486 svn_wc_ensure_adm(const char *path,
3487                   const char *uuid,
3488                   const char *url,
3489                   svn_revnum_t revision,
3490                   apr_pool_t *pool);
3491
3492
3493 /** Set the repository root URL of @a path to @a repos, if possible.
3494  *
3495  * Before Subversion 1.7 there could be working copy directories that
3496  * didn't have a stored repository root in some specific circumstances.
3497  * This function allowed setting this root later.
3498  *
3499  * Since Subversion 1.7 this function just returns #SVN_NO_ERROR.
3500  *
3501  * @since New in 1.3.
3502  * @deprecated Provided for backwards compatibility with the 1.6 API.
3503  */
3504 SVN_DEPRECATED
3505 svn_error_t *
3506 svn_wc_maybe_set_repos_root(svn_wc_adm_access_t *adm_access,
3507                             const char *path,
3508                             const char *repos,
3509                             apr_pool_t *pool);
3510
3511 \f
3512 /**
3513  * @defgroup svn_wc_status Working copy status.
3514  * @{
3515  *
3516  * We have three functions for getting working copy status: one function
3517  * for getting the status of exactly one thing, another for
3518  * getting the statuses of (potentially) multiple things and a third for
3519  * getting the working copy out-of-dateness with respect to the repository.
3520  *
3521  * Why do we have two different functions for getting working copy status?
3522  * The concept of depth, as explained in the documentation for
3523  * svn_depth_t, may be useful in understanding this.  Suppose we're
3524  * getting the status of directory D:
3525  *
3526  * To offer all three levels, we could have one unified function,
3527  * taking a `depth' parameter.  Unfortunately, because this function
3528  * would have to handle multiple return values as well as the single
3529  * return value case, getting the status of just one entity would
3530  * become cumbersome: you'd have to roll through a hash to find one
3531  * lone status.
3532  *
3533  * So we have svn_wc_status3() for depth-empty (just D itself), and
3534  * svn_wc_walk_status() for depth-immediates and depth-infinity,
3535  * since the latter two involve multiple return values. And for
3536  * out-of-dateness information we have svn_wc_get_status_editor5().
3537  */
3538
3539 /** The type of status for the working copy. */
3540 enum svn_wc_status_kind
3541 {
3542     /** does not exist */
3543     svn_wc_status_none = 1,
3544
3545     /** is not a versioned thing in this wc */
3546     svn_wc_status_unversioned,
3547
3548     /** exists, but uninteresting */
3549     svn_wc_status_normal,
3550
3551     /** is scheduled for addition */
3552     svn_wc_status_added,
3553
3554     /** under v.c., but is missing */
3555     svn_wc_status_missing,
3556
3557     /** scheduled for deletion */
3558     svn_wc_status_deleted,
3559
3560     /** was deleted and then re-added */
3561     svn_wc_status_replaced,
3562
3563     /** text or props have been modified */
3564     svn_wc_status_modified,
3565
3566     /** local mods received repos mods (### unused) */
3567     svn_wc_status_merged,
3568
3569     /** local mods received conflicting repos mods */
3570     svn_wc_status_conflicted,
3571
3572     /** is unversioned but configured to be ignored */
3573     svn_wc_status_ignored,
3574
3575     /** an unversioned resource is in the way of the versioned resource */
3576     svn_wc_status_obstructed,
3577
3578     /** an unversioned directory path populated by an svn:externals
3579         property; this status is not used for file externals */
3580     svn_wc_status_external,
3581
3582     /** a directory doesn't contain a complete entries list */
3583     svn_wc_status_incomplete
3584 };
3585
3586 /**
3587  * Structure for holding the "status" of a working copy item.
3588  *
3589  * @note Fields may be added to the end of this structure in future
3590  * versions.  Therefore, to preserve binary compatibility, users
3591  * should not directly allocate structures of this type.
3592  *
3593  * @since New in 1.7.
3594  */
3595 typedef struct svn_wc_status3_t
3596 {
3597   /** The kind of node as recorded in the working copy */
3598   svn_node_kind_t kind;
3599
3600   /** The depth of the node as recorded in the working copy
3601    * (#svn_depth_unknown for files or when no depth is set) */
3602   svn_depth_t depth;
3603
3604   /** The actual size of the working file on disk, or SVN_INVALID_FILESIZE
3605    * if unknown (or if the item isn't a file at all). */
3606   svn_filesize_t filesize;
3607
3608   /** If the path is under version control, versioned is TRUE, otherwise
3609    * FALSE. */
3610   svn_boolean_t versioned;
3611
3612   /** Set to TRUE if the item is the victim of a conflict. */
3613   svn_boolean_t conflicted;
3614
3615   /** The status of the node itself. In order of precedence: Obstructions,
3616    * structural changes, text changes. */
3617   enum svn_wc_status_kind node_status;
3618
3619   /** The status of the entry's text. */
3620   enum svn_wc_status_kind text_status;
3621
3622   /** The status of the entry's properties. */
3623   enum svn_wc_status_kind prop_status;
3624
3625   /** a file or directory can be 'copied' if it's scheduled for
3626    * addition-with-history (or part of a subtree that is scheduled as such.).
3627    */
3628   svn_boolean_t copied;
3629
3630   /** Base revision. */
3631   svn_revnum_t revision;
3632
3633   /** Last revision this was changed */
3634   svn_revnum_t changed_rev;
3635
3636   /** Date of last commit. */
3637   apr_time_t changed_date;
3638
3639   /** Last commit author of this item */
3640   const char *changed_author;
3641
3642   /** The URL of the repository */
3643   const char *repos_root_url;
3644
3645   /** The UUID of the repository */
3646   const char *repos_uuid;
3647
3648   /** The in-repository path relative to the repository root. */
3649   const char *repos_relpath;
3650
3651   /** a file or directory can be 'switched' if the switch command has been
3652    * used.  If this is TRUE, then file_external will be FALSE.
3653    */
3654   svn_boolean_t switched;
3655
3656   /** This directory has a working copy lock */
3657   svn_boolean_t locked;
3658
3659   /** The repository file lock. (Values of path, token, owner, comment
3660    * and are available if a lock is present) */
3661   const svn_lock_t *lock;
3662
3663   /** Which changelist this item is part of, or NULL if not part of any. */
3664   const char *changelist;
3665
3666   /**
3667    * @defgroup svn_wc_status_ood WC out-of-date info from the repository
3668    * @{
3669    *
3670    * When the working copy item is out-of-date compared to the
3671    * repository, the following fields represent the state of the
3672    * youngest revision of the item in the repository.  If the working
3673    * copy is not out of date, the fields are initialized as described
3674    * below.
3675    */
3676
3677   /** Set to the node kind of the youngest commit, or #svn_node_none
3678    * if not out of date. */
3679   svn_node_kind_t ood_kind;
3680
3681   /** The status of the node, based on the text status if the node has no
3682    * restructuring changes */
3683   enum svn_wc_status_kind repos_node_status;
3684
3685   /** The entry's text status in the repository. */
3686   enum svn_wc_status_kind repos_text_status;
3687
3688   /** The entry's property status in the repository. */
3689   enum svn_wc_status_kind repos_prop_status;
3690
3691   /** The entry's lock in the repository, if any. */
3692   const svn_lock_t *repos_lock;
3693
3694   /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM
3695    * if not out of date. */
3696   svn_revnum_t ood_changed_rev;
3697
3698   /** Set to the most recent commit date, or @c 0 if not out of date. */
3699   apr_time_t ood_changed_date;
3700
3701   /** Set to the user name of the youngest commit, or @c NULL if not
3702    * out of date or non-existent.  Because a non-existent @c
3703    * svn:author property has the same behavior as an out-of-date
3704    * working copy, examine @c ood_last_cmt_rev to determine whether
3705    * the working copy is out of date. */
3706   const char *ood_changed_author;
3707
3708   /** @} */
3709
3710   /** Set to the local absolute path that this node was moved from, if this
3711    * file or directory has been moved here locally and is the root of that
3712    * move. Otherwise set to NULL.
3713    *
3714    * This will be NULL for moved-here nodes that are just part of a subtree
3715    * that was moved along (and are not themselves a root of a different move
3716    * operation).
3717    *
3718    * @since New in 1.8. */
3719   const char *moved_from_abspath;
3720
3721   /** Set to the local absolute path that this node was moved to, if this file
3722    * or directory has been moved away locally and corresponds to the root
3723    * of the destination side of the move. Otherwise set to NULL.
3724    *
3725    * Note: Saying just "root" here could be misleading. For example:
3726    *   svn mv A AA;
3727    *   svn mv AA/B BB;
3728    * creates a situation where A/B is moved-to BB, but one could argue that
3729    * the move source's root actually was AA/B. Note that, as far as the
3730    * working copy is concerned, above case is exactly identical to:
3731    *   svn mv A/B BB;
3732    *   svn mv A AA;
3733    * In both situations, @a moved_to_abspath would be set for nodes A (moved
3734    * to AA) and A/B (moved to BB), only.
3735    *
3736    * This will be NULL for moved-away nodes that were just part of a subtree
3737    * that was moved along (and are not themselves a root of a different move
3738    * operation).
3739    *
3740    * @since New in 1.8. */
3741   const char *moved_to_abspath;
3742
3743   /** @c TRUE iff the item is a file brought in by an svn:externals definition.
3744    * @since New in 1.8. */
3745   svn_boolean_t file_external;
3746
3747   /* NOTE! Please update svn_wc_dup_status3() when adding new fields here. */
3748 } svn_wc_status3_t;
3749
3750 /**
3751  * ### All diffs are not yet known.
3752  * Same as svn_wc_status3_t, but without the #svn_boolean_t 'versioned'
3753  * field. Instead an item that is not versioned has the 'entry' field set to
3754  * @c NULL.
3755  *
3756  * @since New in 1.2.
3757  * @deprecated Provided for backward compatibility with the 1.6 API.
3758  */
3759 typedef struct svn_wc_status2_t
3760 {
3761   /** Can be @c NULL if not under version control. */
3762   const svn_wc_entry_t *entry;
3763
3764   /** The status of the entry itself, including its text if it is a file. */
3765   enum svn_wc_status_kind text_status;
3766
3767   /** The status of the entry's properties. */
3768   enum svn_wc_status_kind prop_status;
3769
3770   /** a directory can be 'locked' if a working copy update was interrupted. */
3771   svn_boolean_t locked;
3772
3773   /** a file or directory can be 'copied' if it's scheduled for
3774    * addition-with-history (or part of a subtree that is scheduled as such.).
3775    */
3776   svn_boolean_t copied;
3777
3778   /** a file or directory can be 'switched' if the switch command has been
3779    * used.  If this is TRUE, then file_external will be FALSE.
3780    */
3781   svn_boolean_t switched;
3782
3783   /** The entry's text status in the repository. */
3784   enum svn_wc_status_kind repos_text_status;
3785
3786   /** The entry's property status in the repository. */
3787   enum svn_wc_status_kind repos_prop_status;
3788
3789   /** The entry's lock in the repository, if any. */
3790   svn_lock_t *repos_lock;
3791
3792   /** Set to the URI (actual or expected) of the item.
3793    * @since New in 1.3
3794    */
3795   const char *url;
3796
3797   /**
3798    * @defgroup svn_wc_status_ood WC out-of-date info from the repository
3799    * @{
3800    *
3801    * When the working copy item is out-of-date compared to the
3802    * repository, the following fields represent the state of the
3803    * youngest revision of the item in the repository.  If the working
3804    * copy is not out of date, the fields are initialized as described
3805    * below.
3806    */
3807
3808   /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM
3809    * if not out of date.
3810    * @since New in 1.3
3811    */
3812   svn_revnum_t ood_last_cmt_rev;
3813
3814   /** Set to the most recent commit date, or @c 0 if not out of date.
3815    * @since New in 1.3
3816    */
3817   apr_time_t ood_last_cmt_date;
3818
3819   /** Set to the node kind of the youngest commit, or #svn_node_none
3820    * if not out of date.
3821    * @since New in 1.3
3822    */
3823   svn_node_kind_t ood_kind;
3824
3825   /** Set to the user name of the youngest commit, or @c NULL if not
3826    * out of date or non-existent.  Because a non-existent @c
3827    * svn:author property has the same behavior as an out-of-date
3828    * working copy, examine @c ood_last_cmt_rev to determine whether
3829    * the working copy is out of date.
3830    * @since New in 1.3
3831    */
3832   const char *ood_last_cmt_author;
3833
3834   /** @} */
3835
3836   /** Non-NULL if the entry is the victim of a tree conflict.
3837    * @since New in 1.6
3838    */
3839   svn_wc_conflict_description_t *tree_conflict;
3840
3841   /** If the item is a file that was added to the working copy with an
3842    * svn:externals; if file_external is TRUE, then switched is always
3843    * FALSE.
3844    * @since New in 1.6
3845    */
3846   svn_boolean_t file_external;
3847
3848   /** The actual status of the text compared to the pristine base of the
3849    * file. This value isn't masked by other working copy statuses.
3850    * @c pristine_text_status is #svn_wc_status_none if this value was
3851    * not calculated during the status walk.
3852    * @since New in 1.6
3853    */
3854   enum svn_wc_status_kind pristine_text_status;
3855
3856   /** The actual status of the properties compared to the pristine base of
3857    * the node. This value isn't masked by other working copy statuses.
3858    * @c pristine_prop_status is #svn_wc_status_none if this value was
3859    * not calculated during the status walk.
3860    * @since New in 1.6
3861    */
3862   enum svn_wc_status_kind pristine_prop_status;
3863
3864 } svn_wc_status2_t;
3865
3866
3867
3868 /**
3869  * Same as #svn_wc_status2_t, but without the #svn_lock_t 'repos_lock', const char 'url', #svn_revnum_t 'ood_last_cmt_rev', apr_time_t 'ood_last_cmt_date', #svn_node_kind_t 'ood_kind', const char 'ood_last_cmt_author', #svn_wc_conflict_description_t 'tree_conflict', #svn_boolean_t 'file_external', #svn_wc_status_kind 'pristine_text_status', and #svn_wc_status_kind 'pristine_prop_status' fields.
3870  *
3871  * @deprecated Provided for backward compatibility with the 1.1 API.
3872  */
3873 typedef struct svn_wc_status_t
3874 {
3875   /** Can be @c NULL if not under version control. */
3876   const svn_wc_entry_t *entry;
3877
3878   /** The status of the entries text. */
3879   enum svn_wc_status_kind text_status;
3880
3881   /** The status of the entries properties. */
3882   enum svn_wc_status_kind prop_status;
3883
3884   /** a directory can be 'locked' if a working copy update was interrupted. */
3885   svn_boolean_t locked;
3886
3887   /** a file or directory can be 'copied' if it's scheduled for
3888    * addition-with-history (or part of a subtree that is scheduled as such.).
3889    */
3890   svn_boolean_t copied;
3891
3892   /** a file or directory can be 'switched' if the switch command has been
3893    * used.
3894    */
3895   svn_boolean_t switched;
3896
3897   /** The entry's text status in the repository. */
3898   enum svn_wc_status_kind repos_text_status;
3899
3900   /** The entry's property status in the repository. */
3901   enum svn_wc_status_kind repos_prop_status;
3902
3903 } svn_wc_status_t;
3904
3905
3906 /**
3907  * Return a deep copy of the @a orig_stat status structure, allocated
3908  * in @a pool.
3909  *
3910  * @since New in 1.7.
3911  */
3912 svn_wc_status3_t *
3913 svn_wc_dup_status3(const svn_wc_status3_t *orig_stat,
3914                    apr_pool_t *pool);
3915
3916 /**
3917  * Same as svn_wc_dup_status3(), but for older svn_wc_status_t structures.
3918  *
3919  * @since New in 1.2
3920  * @deprecated Provided for backward compatibility with the 1.6 API.
3921  */
3922 SVN_DEPRECATED
3923 svn_wc_status2_t *
3924 svn_wc_dup_status2(const svn_wc_status2_t *orig_stat,
3925                    apr_pool_t *pool);
3926
3927
3928 /**
3929  * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures.
3930  *
3931  * @deprecated Provided for backward compatibility with the 1.1 API.
3932  */
3933 SVN_DEPRECATED
3934 svn_wc_status_t *
3935 svn_wc_dup_status(const svn_wc_status_t *orig_stat,
3936                   apr_pool_t *pool);
3937
3938
3939 /**
3940  * Fill @a *status for @a local_abspath, allocating in @a result_pool.
3941  * Use @a scratch_pool for temporary allocations.
3942  *
3943  * Here are some things to note about the returned structure.  A quick
3944  * examination of the @c status->text_status after a successful return of
3945  * this function can reveal the following things:
3946  *
3947  *    - #svn_wc_status_none : @a local_abspath is not versioned, and is
3948  *                            not present on disk
3949  *
3950  *    - #svn_wc_status_missing : @a local_abspath is versioned, but is
3951  *                               missing from the working copy.
3952  *
3953  *    - #svn_wc_status_unversioned : @a local_abspath is not versioned,
3954  *                                   but is present on disk and not being
3955  *                                   ignored (see above).
3956  *
3957  * The other available results for the @c text_status field are more
3958  * straightforward in their meanings.  See the comments on the
3959  * #svn_wc_status_kind structure for some hints.
3960  *
3961  * @since New in 1.7.
3962  */
3963 svn_error_t *
3964 svn_wc_status3(svn_wc_status3_t **status,
3965                svn_wc_context_t *wc_ctx,
3966                const char *local_abspath,
3967                apr_pool_t *result_pool,
3968                apr_pool_t *scratch_pool);
3969
3970 /** Similar to svn_wc_status3(), but with a adm_access baton and absolute
3971  * path.
3972  *
3973  * @since New in 1.2.
3974  * @deprecated Provided for backward compatibility with the 1.6 API.
3975  */
3976 SVN_DEPRECATED
3977 svn_error_t *
3978 svn_wc_status2(svn_wc_status2_t **status,
3979                const char *path,
3980                svn_wc_adm_access_t *adm_access,
3981                apr_pool_t *pool);
3982
3983
3984 /**
3985  *  Same as svn_wc_status2(), but for older svn_wc_status_t structures.
3986  *
3987  * @deprecated Provided for backward compatibility with the 1.1 API.
3988  */
3989 SVN_DEPRECATED
3990 svn_error_t *
3991 svn_wc_status(svn_wc_status_t **status,
3992               const char *path,
3993               svn_wc_adm_access_t *adm_access,
3994               apr_pool_t *pool);
3995
3996
3997 \f
3998
3999 /**
4000  * A callback for reporting a @a status about @a local_abspath.
4001  *
4002  * @a baton is a closure object; it should be provided by the
4003  * implementation, and passed by the caller.
4004  *
4005  * @a scratch_pool will be cleared between invocations to the callback.
4006  *
4007  * @since New in 1.7.
4008  */
4009 typedef svn_error_t *(*svn_wc_status_func4_t)(void *baton,
4010                                               const char *local_abspath,
4011                                               const svn_wc_status3_t *status,
4012                                               apr_pool_t *scratch_pool);
4013
4014 /**
4015  * Same as svn_wc_status_func4_t, but with a non-const status and a relative
4016  * path.
4017  *
4018  * @since New in 1.6.
4019  * @deprecated Provided for backward compatibility with the 1.6 API.
4020  */
4021 typedef svn_error_t *(*svn_wc_status_func3_t)(void *baton,
4022                                               const char *path,
4023                                               svn_wc_status2_t *status,
4024                                               apr_pool_t *pool);
4025
4026 /**
4027  * Same as svn_wc_status_func3_t, but without a provided pool or
4028  * the ability to propagate errors.
4029  *
4030  * @since New in 1.2.
4031  * @deprecated Provided for backward compatibility with the 1.5 API.
4032  */
4033 typedef void (*svn_wc_status_func2_t)(void *baton,
4034                                       const char *path,
4035                                       svn_wc_status2_t *status);
4036
4037 /**
4038  *  Same as svn_wc_status_func2_t, but for older svn_wc_status_t structures.
4039  *
4040  * @deprecated Provided for backward compatibility with the 1.1 API.
4041  */
4042 typedef void (*svn_wc_status_func_t)(void *baton,
4043                                      const char *path,
4044                                      svn_wc_status_t *status);
4045
4046 /**
4047  * Walk the working copy status of @a local_abspath using @a wc_ctx, by
4048  * creating #svn_wc_status3_t structures and sending these through
4049  * @a status_func / @a status_baton.
4050  *
4051  *  * Assuming the target is a directory, then:
4052  *
4053  *   - If @a get_all is FALSE, then only locally-modified entries will be
4054  *     returned.  If TRUE, then all entries will be returned.
4055  *
4056  *   - If @a ignore_text_mods is TRUE, then the walk will not check for
4057  *     modified files.  Any #svn_wc_status3_t structures returned for files
4058  *     will always have a text_status field set to svn_wc_status_normal.
4059  *     If @a ignore_text_mods is FALSE, the walk checks for text changes
4060  *     and returns #svn_wc_status3_t structures describing any changes.
4061  *
4062  *   - If @a depth is #svn_depth_empty, a status structure will
4063  *     be returned for the target only; if #svn_depth_files, for the
4064  *     target and its immediate file children; if
4065  *     #svn_depth_immediates, for the target and its immediate
4066  *     children; if #svn_depth_infinity, for the target and
4067  *     everything underneath it, fully recursively.
4068  *
4069  *     If @a depth is #svn_depth_unknown, take depths from the
4070  *     working copy and behave as above in each directory's case.
4071  *
4072  *     If the given @a depth is incompatible with the depth found in a
4073  *     working copy directory, the found depth always governs.
4074  *
4075  * If @a no_ignore is set, statuses that would typically be ignored
4076  * will instead be reported.
4077  *
4078  * @a ignore_patterns is an array of file patterns matching
4079  * unversioned files to ignore for the purposes of status reporting,
4080  * or @c NULL if the default set of ignorable file patterns should be used.
4081  *
4082  * If @a cancel_func is non-NULL, call it with @a cancel_baton while walking
4083  * to determine if the client has canceled the operation.
4084  *
4085  * This function uses @a scratch_pool for temporary allocations.
4086  *
4087  * @since New in 1.7.
4088  */
4089 svn_error_t *
4090 svn_wc_walk_status(svn_wc_context_t *wc_ctx,
4091                    const char *local_abspath,
4092                    svn_depth_t depth,
4093                    svn_boolean_t get_all,
4094                    svn_boolean_t no_ignore,
4095                    svn_boolean_t ignore_text_mods,
4096                    const apr_array_header_t *ignore_patterns,
4097                    svn_wc_status_func4_t status_func,
4098                    void *status_baton,
4099                    svn_cancel_func_t cancel_func,
4100                    void *cancel_baton,
4101                    apr_pool_t *scratch_pool);
4102
4103 /**
4104  * DEPRECATED -- please use APIs from svn_client.h
4105  *
4106  * ---
4107  *
4108  * Set @a *editor and @a *edit_baton to an editor that generates
4109  * #svn_wc_status3_t structures and sends them through @a status_func /
4110  * @a status_baton.  @a anchor_abspath is a working copy directory
4111  * directory which will be used as the root of our editor.  If @a
4112  * target_basename is not "", it represents a node in the @a anchor_abspath
4113  * which is the subject of the editor drive (otherwise, the @a
4114  * anchor_abspath is the subject).
4115  *
4116  * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
4117  * be used in a call to the svn_wc_status_set_repos_locks() function.
4118  *
4119  * Callers drive this editor to describe working copy out-of-dateness
4120  * with respect to the repository.  If this information is not
4121  * available or not desired, callers should simply call the
4122  * close_edit() function of the @a editor vtable.
4123  *
4124  * If the editor driver calls @a editor's set_target_revision() vtable
4125  * function, then when the edit drive is completed, @a *edit_revision
4126  * will contain the revision delivered via that interface.
4127  *
4128  * Assuming the target is a directory, then:
4129  *
4130  *   - If @a get_all is FALSE, then only locally-modified entries will be
4131  *     returned.  If TRUE, then all entries will be returned.
4132  *
4133  *   - If @a depth is #svn_depth_empty, a status structure will
4134  *     be returned for the target only; if #svn_depth_files, for the
4135  *     target and its immediate file children; if
4136  *     #svn_depth_immediates, for the target and its immediate
4137  *     children; if #svn_depth_infinity, for the target and
4138  *     everything underneath it, fully recursively.
4139  *
4140  *     If @a depth is #svn_depth_unknown, take depths from the
4141  *     working copy and behave as above in each directory's case.
4142  *
4143  *     If the given @a depth is incompatible with the depth found in a
4144  *     working copy directory, the found depth always governs.
4145  *
4146  * If @a no_ignore is set, statuses that would typically be ignored
4147  * will instead be reported.
4148  *
4149  * @a ignore_patterns is an array of file patterns matching
4150  * unversioned files to ignore for the purposes of status reporting,
4151  * or @c NULL if the default set of ignorable file patterns should be used.
4152  *
4153  * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
4154  * the @a statushash to determine if the client has canceled the operation.
4155  *
4156  * If @a depth_as_sticky is set handle @a depth like when depth_is_sticky is
4157  * passed for updating. This will show excluded nodes show up as added in the
4158  * repository.
4159  *
4160  * If @a server_performs_filtering is TRUE, assume that the server handles
4161  * the ambient depth filtering, so this doesn't have to be handled in the
4162  * editor.
4163  *
4164  * Allocate the editor itself in @a result_pool, and use @a scratch_pool
4165  * for temporary allocations. The editor will do its temporary allocations
4166  * in a subpool of @a result_pool.
4167  *
4168  * @since New in 1.7.
4169  * @deprecated Provided for backward compatibility with the 1.7 API.
4170  */
4171 SVN_DEPRECATED
4172 svn_error_t *
4173 svn_wc_get_status_editor5(const svn_delta_editor_t **editor,
4174                           void **edit_baton,
4175                           void **set_locks_baton,
4176                           svn_revnum_t *edit_revision,
4177                           svn_wc_context_t *wc_ctx,
4178                           const char *anchor_abspath,
4179                           const char *target_basename,
4180                           svn_depth_t depth,
4181                           svn_boolean_t get_all,
4182                           svn_boolean_t no_ignore,
4183                           svn_boolean_t depth_as_sticky,
4184                           svn_boolean_t server_performs_filtering,
4185                           const apr_array_header_t *ignore_patterns,
4186                           svn_wc_status_func4_t status_func,
4187                           void *status_baton,
4188                           svn_cancel_func_t cancel_func,
4189                           void *cancel_baton,
4190                           apr_pool_t *result_pool,
4191                           apr_pool_t *scratch_pool);
4192
4193 /**
4194  * Same as svn_wc_get_status_editor5, but using #svn_wc_status_func3_t
4195  * instead of #svn_wc_status_func4_t. And @a server_performs_filtering
4196  * always set to #TRUE.
4197  *
4198  * This also uses a single pool parameter, stating that all temporary
4199  * allocations are performed in manually constructed/destroyed subpool.
4200  *
4201  * @since New in 1.6.
4202  * @deprecated Provided for backward compatibility with the 1.6 API.
4203  */
4204 SVN_DEPRECATED
4205 svn_error_t *
4206 svn_wc_get_status_editor4(const svn_delta_editor_t **editor,
4207                           void **edit_baton,
4208                           void **set_locks_baton,
4209                           svn_revnum_t *edit_revision,
4210                           svn_wc_adm_access_t *anchor,
4211                           const char *target,
4212                           svn_depth_t depth,
4213                           svn_boolean_t get_all,
4214                           svn_boolean_t no_ignore,
4215                           const apr_array_header_t *ignore_patterns,
4216                           svn_wc_status_func3_t status_func,
4217                           void *status_baton,
4218                           svn_cancel_func_t cancel_func,
4219                           void *cancel_baton,
4220                           svn_wc_traversal_info_t *traversal_info,
4221                           apr_pool_t *pool);
4222
4223 /**
4224  * Same as svn_wc_get_status_editor4(), but using #svn_wc_status_func2_t
4225  * instead of #svn_wc_status_func3_t.
4226  *
4227  * @since New in 1.5.
4228  * @deprecated Provided for backward compatibility with the 1.5 API.
4229  */
4230 SVN_DEPRECATED
4231 svn_error_t *
4232 svn_wc_get_status_editor3(const svn_delta_editor_t **editor,
4233                           void **edit_baton,
4234                           void **set_locks_baton,
4235                           svn_revnum_t *edit_revision,
4236                           svn_wc_adm_access_t *anchor,
4237                           const char *target,
4238                           svn_depth_t depth,
4239                           svn_boolean_t get_all,
4240                           svn_boolean_t no_ignore,
4241                           const apr_array_header_t *ignore_patterns,
4242                           svn_wc_status_func2_t status_func,
4243                           void *status_baton,
4244                           svn_cancel_func_t cancel_func,
4245                           void *cancel_baton,
4246                           svn_wc_traversal_info_t *traversal_info,
4247                           apr_pool_t *pool);
4248
4249 /**
4250  * Like svn_wc_get_status_editor3(), but with @a ignore_patterns
4251  * provided from the corresponding value in @a config, and @a recurse
4252  * instead of @a depth.  If @a recurse is TRUE, behave as if for
4253  * #svn_depth_infinity; else if @a recurse is FALSE, behave as if for
4254  * #svn_depth_immediates.
4255  *
4256  * @since New in 1.2.
4257  * @deprecated Provided for backward compatibility with the 1.4 API.
4258  */
4259 SVN_DEPRECATED
4260 svn_error_t *
4261 svn_wc_get_status_editor2(const svn_delta_editor_t **editor,
4262                           void **edit_baton,
4263                           void **set_locks_baton,
4264                           svn_revnum_t *edit_revision,
4265                           svn_wc_adm_access_t *anchor,
4266                           const char *target,
4267                           apr_hash_t *config,
4268                           svn_boolean_t recurse,
4269                           svn_boolean_t get_all,
4270                           svn_boolean_t no_ignore,
4271                           svn_wc_status_func2_t status_func,
4272                           void *status_baton,
4273                           svn_cancel_func_t cancel_func,
4274                           void *cancel_baton,
4275                           svn_wc_traversal_info_t *traversal_info,
4276                           apr_pool_t *pool);
4277
4278 /**
4279  * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set
4280  * to @c NULL, and taking a deprecated svn_wc_status_func_t argument.
4281  *
4282  * @deprecated Provided for backward compatibility with the 1.1 API.
4283  */
4284 SVN_DEPRECATED
4285 svn_error_t *
4286 svn_wc_get_status_editor(const svn_delta_editor_t **editor,
4287                          void **edit_baton,
4288                          svn_revnum_t *edit_revision,
4289                          svn_wc_adm_access_t *anchor,
4290                          const char *target,
4291                          apr_hash_t *config,
4292                          svn_boolean_t recurse,
4293                          svn_boolean_t get_all,
4294                          svn_boolean_t no_ignore,
4295                          svn_wc_status_func_t status_func,
4296                          void *status_baton,
4297                          svn_cancel_func_t cancel_func,
4298                          void *cancel_baton,
4299                          svn_wc_traversal_info_t *traversal_info,
4300                          apr_pool_t *pool);
4301
4302
4303 /**
4304  * Associate @a locks, a hash table mapping <tt>const char*</tt>
4305  * absolute repository paths to <tt>svn_lock_t</tt> objects, with a
4306  * @a set_locks_baton returned by an earlier call to
4307  * svn_wc_get_status_editor3().  @a repos_root is the repository root URL.
4308  * Perform all allocations in @a pool.
4309  *
4310  * @note @a locks will not be copied, so it must be valid throughout the
4311  * edit.  @a pool must also not be destroyed or cleared before the edit is
4312  * finished.
4313  *
4314  * @since New in 1.2.
4315  */
4316 svn_error_t *
4317 svn_wc_status_set_repos_locks(void *set_locks_baton,
4318                               apr_hash_t *locks,
4319                               const char *repos_root,
4320                               apr_pool_t *pool);
4321
4322 /** @} */
4323
4324 \f
4325 /**
4326  * Copy @a src_abspath to @a dst_abspath, and schedule @a dst_abspath
4327  * for addition to the repository, remembering the copy history. @a wc_ctx
4328  * is used for accessing the working copy and must contain a write lock for
4329  * the parent directory of @a dst_abspath,
4330  *
4331  * If @a metadata_only is TRUE then this is a database-only operation and
4332  * the working directories and files are not copied.
4333  *
4334  * @a src_abspath must be a file or directory under version control;
4335  * the parent of @a dst_abspath must be a directory under version control
4336  * in the same working copy; @a dst_abspath will be the name of the copied
4337  * item, and it must not exist already if @a metadata_only is FALSE.  Note that
4338  * when @a src points to a versioned file, the working file doesn't
4339  * necessarily exist in which case its text-base is used instead.
4340  *
4341  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4342  * various points during the operation.  If it returns an error
4343  * (typically #SVN_ERR_CANCELLED), return that error immediately.
4344  *
4345  * If @a notify_func is non-NULL, call it with @a notify_baton and the path
4346  * of the root node (only) of the destination.
4347  *
4348  * Use @a scratch_pool for temporary allocations.
4349  *
4350  * @since New in 1.7.
4351  */
4352 svn_error_t *
4353 svn_wc_copy3(svn_wc_context_t *wc_ctx,
4354              const char *src_abspath,
4355              const char *dst_abspath,
4356              svn_boolean_t metadata_only,
4357              svn_cancel_func_t cancel_func,
4358              void *cancel_baton,
4359              svn_wc_notify_func2_t notify_func,
4360              void *notify_baton,
4361              apr_pool_t *scratch_pool);
4362
4363 /** Similar to svn_wc_copy3(), but takes access batons and a relative path
4364  * and a basename instead of absolute paths and a working copy context.
4365  *
4366  * @since New in 1.2.
4367  * @deprecated Provided for backward compatibility with the 1.6 API.
4368  */
4369 SVN_DEPRECATED
4370 svn_error_t *
4371 svn_wc_copy2(const char *src,
4372              svn_wc_adm_access_t *dst_parent,
4373              const char *dst_basename,
4374              svn_cancel_func_t cancel_func,
4375              void *cancel_baton,
4376              svn_wc_notify_func2_t notify_func,
4377              void *notify_baton,
4378              apr_pool_t *pool);
4379
4380 /**
4381  * Similar to svn_wc_copy2(), but takes an #svn_wc_notify_func_t instead.
4382  *
4383  * @deprecated Provided for backward compatibility with the 1.1 API.
4384  */
4385 SVN_DEPRECATED
4386 svn_error_t *
4387 svn_wc_copy(const char *src,
4388             svn_wc_adm_access_t *dst_parent,
4389             const char *dst_basename,
4390             svn_cancel_func_t cancel_func,
4391             void *cancel_baton,
4392             svn_wc_notify_func_t notify_func,
4393             void *notify_baton,
4394             apr_pool_t *pool);
4395
4396 /**
4397  * Move @a src_abspath to @a dst_abspath, by scheduling @a dst_abspath
4398  * for addition to the repository, remembering the history. Mark @a src_abspath
4399  * as deleted after moving.@a wc_ctx is used for accessing the working copy and
4400  * must contain a write lock for the parent directory of @a src_abspath and
4401  * @a dst_abspath.
4402  *
4403  * If @a metadata_only is TRUE then this is a database-only operation and
4404  * the working directories and files are not changed.
4405  *
4406  * @a src_abspath must be a file or directory under version control;
4407  * the parent of @a dst_abspath must be a directory under version control
4408  * in the same working copy; @a dst_abspath will be the name of the copied
4409  * item, and it must not exist already if @a metadata_only is FALSE.  Note that
4410  * when @a src points to a versioned file, the working file doesn't
4411  * necessarily exist in which case its text-base is used instead.
4412  *
4413  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4414  * various points during the operation.  If it returns an error
4415  * (typically #SVN_ERR_CANCELLED), return that error immediately.
4416  *
4417  * If @a notify_func is non-NULL, call it with @a notify_baton and the path
4418  * of the root node (only) of the destination.
4419  *
4420  * Use @a scratch_pool for temporary allocations.
4421  *
4422  * @since New in 1.7.
4423  * @deprecated Provided for backward compatibility with the 1.7 API.
4424  * @see svn_client_move7()
4425  */
4426 SVN_DEPRECATED
4427 svn_error_t *
4428 svn_wc_move(svn_wc_context_t *wc_ctx,
4429             const char *src_abspath,
4430             const char *dst_abspath,
4431             svn_boolean_t metadata_only,
4432             svn_cancel_func_t cancel_func,
4433             void *cancel_baton,
4434             svn_wc_notify_func2_t notify_func,
4435             void *notify_baton,
4436             apr_pool_t *scratch_pool);
4437
4438 /**
4439  * Schedule @a local_abspath for deletion.  It will be deleted from the
4440  * repository on the next commit.  If @a local_abspath refers to a
4441  * directory, then a recursive deletion will occur. @a wc_ctx must hold
4442  * a write lock for the parent of @a local_abspath, @a local_abspath itself
4443  * and everything below @a local_abspath.
4444  *
4445  * If @a keep_local is FALSE, this function immediately deletes all files,
4446  * modified and unmodified, versioned and of @a delete_unversioned is TRUE,
4447  * unversioned from the working copy.
4448  * It also immediately deletes unversioned directories and directories that
4449  * are scheduled to be added below @a local_abspath.  Only versioned may
4450  * remain in the working copy, these get deleted by the update following
4451  * the commit.
4452  *
4453  * If @a keep_local is TRUE, all files and directories will be kept in the
4454  * working copy (and will become unversioned on the next commit).
4455  *
4456  * If @a delete_unversioned_target is TRUE and @a local_abspath is not
4457  * versioned, @a local_abspath will be handled as an added files without
4458  * history. So it will be deleted if @a keep_local is FALSE. If @a
4459  * delete_unversioned is FALSE and @a local_abspath is not versioned a
4460  * #SVN_ERR_WC_PATH_NOT_FOUND error will be returned.
4461  *
4462  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4463  * various points during the operation.  If it returns an error
4464  * (typically #SVN_ERR_CANCELLED), return that error immediately.
4465  *
4466  * For each path marked for deletion, @a notify_func will be called with
4467  * the @a notify_baton and that path. The @a notify_func callback may be
4468  * @c NULL if notification is not needed.
4469  *
4470  * Use @a scratch_pool for temporary allocations.  It may be cleared
4471  * immediately upon returning from this function.
4472  *
4473  * @since New in 1.7.
4474  */
4475  /* ### BH: Maybe add a delete_switched flag that allows deny switched
4476             nodes like file externals? */
4477 svn_error_t *
4478 svn_wc_delete4(svn_wc_context_t *wc_ctx,
4479                const char *local_abspath,
4480                svn_boolean_t keep_local,
4481                svn_boolean_t delete_unversioned_target,
4482                svn_cancel_func_t cancel_func,
4483                void *cancel_baton,
4484                svn_wc_notify_func2_t notify_func,
4485                void *notify_baton,
4486                apr_pool_t *scratch_pool);
4487
4488 /**
4489  * Similar to svn_wc_delete4, but uses an access baton and relative path
4490  * instead of a working copy context and absolute path. @a adm_access
4491  * must hold a write lock for the parent of @a path.
4492  *
4493  * @c delete_unversioned_target will always be set to TRUE.
4494  *
4495  * @since New in 1.5.
4496  * @deprecated Provided for backward compatibility with the 1.6 API.
4497  */
4498 SVN_DEPRECATED
4499 svn_error_t *
4500 svn_wc_delete3(const char *path,
4501                svn_wc_adm_access_t *adm_access,
4502                svn_cancel_func_t cancel_func,
4503                void *cancel_baton,
4504                svn_wc_notify_func2_t notify_func,
4505                void *notify_baton,
4506                svn_boolean_t keep_local,
4507                apr_pool_t *pool);
4508
4509 /**
4510  * Similar to svn_wc_delete3(), but with @a keep_local always set to FALSE.
4511  *
4512  * @deprecated Provided for backward compatibility with the 1.4 API.
4513  */
4514 SVN_DEPRECATED
4515 svn_error_t *
4516 svn_wc_delete2(const char *path,
4517                svn_wc_adm_access_t *adm_access,
4518                svn_cancel_func_t cancel_func,
4519                void *cancel_baton,
4520                svn_wc_notify_func2_t notify_func,
4521                void *notify_baton,
4522                apr_pool_t *pool);
4523
4524 /**
4525  * Similar to svn_wc_delete2(), but takes an #svn_wc_notify_func_t instead.
4526  *
4527  * @deprecated Provided for backward compatibility with the 1.1 API.
4528  */
4529 SVN_DEPRECATED
4530 svn_error_t *
4531 svn_wc_delete(const char *path,
4532               svn_wc_adm_access_t *adm_access,
4533               svn_cancel_func_t cancel_func,
4534               void *cancel_baton,
4535               svn_wc_notify_func_t notify_func,
4536               void *notify_baton,
4537               apr_pool_t *pool);
4538
4539
4540 /**
4541  * Schedule the single node that exists on disk at @a local_abspath for
4542  * addition to the working copy.  The added node will have the properties
4543  * provided in @a props, or none if that is NULL.
4544  *
4545  * Check and canonicalize the properties in the same way as
4546  * svn_wc_prop_set4().  Return an error and don't add the node if the
4547  * properties are not valid on this node.  Unlike svn_wc_prop_set4()
4548  * there is no option to skip some of the checks and canonicalizations.
4549  *
4550  * ### The error code on validity check failure should be specified, and
4551  *     preferably should be a single code.
4552  *
4553  * The versioned state of the parent path must be a modifiable directory,
4554  * and the versioned state of @a local_abspath must be either nonexistent or
4555  * deleted; if deleted, the new node will be a replacement.
4556  *
4557  * If @a local_abspath does not exist as file, directory or symlink, return
4558  * #SVN_ERR_WC_PATH_NOT_FOUND.
4559  *
4560  * ### TODO: Split into add_dir, add_file, add_symlink?
4561  *
4562  * @since New in 1.8.
4563  */
4564 svn_error_t *
4565 svn_wc_add_from_disk2(svn_wc_context_t *wc_ctx,
4566                       const char *local_abspath,
4567                       const apr_hash_t *props,
4568                       svn_wc_notify_func2_t notify_func,
4569                       void *notify_baton,
4570                       apr_pool_t *scratch_pool);
4571
4572
4573 /**
4574  * Similar to svn_wc_add_from_disk2(), but always passes NULL for @a
4575  * props.
4576  *
4577  * This is a replacement for svn_wc_add4() case 2a (which see for
4578  * details).
4579
4580  * @see svn_wc_add4()
4581  *
4582  * @since New in 1.7.
4583  * @deprecated Provided for backward compatibility with the 1.7 API.
4584  */
4585 SVN_DEPRECATED
4586 svn_error_t *
4587 svn_wc_add_from_disk(svn_wc_context_t *wc_ctx,
4588                      const char *local_abspath,
4589                      svn_wc_notify_func2_t notify_func,
4590                      void *notify_baton,
4591                      apr_pool_t *scratch_pool);
4592
4593
4594 /**
4595  * Put @a local_abspath under version control by registering it as addition
4596  * or copy in the database containing its parent. The new node is scheduled
4597  * for addition to the repository below its parent node.
4598  *
4599  * 1) If the node is already versioned, it MUST BE the root of a separate
4600  * working copy from the same repository as the parent WC. The new node
4601  * and anything below it will be scheduled for addition inside the parent
4602  * working copy as a copy of the original location. The separate working
4603  * copy will be integrated by this step. In this case, which is only used
4604  * by code like that of "svn cp URL@rev path" @a copyfrom_url and
4605  * @a copyfrom_rev MUST BE the url and revision of @a local_abspath
4606  * in the separate working copy.
4607  *
4608  * 2a) If the node was not versioned before it will be scheduled as a local
4609  * addition or 2b) if @a copyfrom_url and @a copyfrom_rev are set as a copy
4610  * of that location. In this last case the function doesn't set the pristine
4611  * version (of a file) and/or pristine properties, which callers should
4612  * handle via different APIs. Usually it is easier to call
4613  * svn_wc_add_repos_file4() (### or a possible svn_wc_add_repos_dir()) than
4614  * using this variant.
4615  *
4616  * If @a local_abspath does not exist as file, directory or symlink, return
4617  * #SVN_ERR_WC_PATH_NOT_FOUND.
4618  *
4619  * If @a local_abspath is an unversioned directory, record @a depth on it;
4620  * otherwise, ignore @a depth. (Use #svn_depth_infinity unless you exactly
4621  * know what you are doing, or you may create an unexpected sparse working
4622  * copy)
4623  *
4624  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4625  * various points during the operation.  If it returns an error
4626  * (typically #SVN_ERR_CANCELLED), return that error immediately.
4627  *
4628  * When the @a local_abspath has been added, then @a notify_func will be
4629  * called (if it is not @c NULL) with the @a notify_baton and the path.
4630  *
4631  * @note Case 1 is deprecated. Consider doing a WC-to-WC copy instead.
4632  * @note For case 2a, prefer svn_wc_add_from_disk().
4633  *
4634  * @since New in 1.7.
4635  */
4636 svn_error_t *
4637 svn_wc_add4(svn_wc_context_t *wc_ctx,
4638             const char *local_abspath,
4639             svn_depth_t depth,
4640             const char *copyfrom_url,
4641             svn_revnum_t copyfrom_rev,
4642             svn_cancel_func_t cancel_func,
4643             void *cancel_baton,
4644             svn_wc_notify_func2_t notify_func,
4645             void *notify_baton,
4646             apr_pool_t *scratch_pool);
4647
4648 /**
4649  * Similar to svn_wc_add4(), but with an access baton
4650  * and relative path instead of a context and absolute path.
4651  * @since New in 1.6.
4652  * @deprecated Provided for backward compatibility with the 1.6 API.
4653  */
4654 SVN_DEPRECATED
4655 svn_error_t *
4656 svn_wc_add3(const char *path,
4657             svn_wc_adm_access_t *parent_access,
4658             svn_depth_t depth,
4659             const char *copyfrom_url,
4660             svn_revnum_t copyfrom_rev,
4661             svn_cancel_func_t cancel_func,
4662             void *cancel_baton,
4663             svn_wc_notify_func2_t notify_func,
4664             void *notify_baton,
4665             apr_pool_t *pool);
4666
4667 /**
4668  * Similar to svn_wc_add3(), but with the @a depth parameter always
4669  * #svn_depth_infinity.
4670  *
4671  * @since New in 1.2.
4672  * @deprecated Provided for backward compatibility with the 1.5 API.
4673  */
4674 SVN_DEPRECATED
4675 svn_error_t *
4676 svn_wc_add2(const char *path,
4677             svn_wc_adm_access_t *parent_access,
4678             const char *copyfrom_url,
4679             svn_revnum_t copyfrom_rev,
4680             svn_cancel_func_t cancel_func,
4681             void *cancel_baton,
4682             svn_wc_notify_func2_t notify_func,
4683             void *notify_baton,
4684             apr_pool_t *pool);
4685
4686 /**
4687  * Similar to svn_wc_add2(), but takes an #svn_wc_notify_func_t instead.
4688  *
4689  * @deprecated Provided for backward compatibility with the 1.1 API.
4690  */
4691 SVN_DEPRECATED
4692 svn_error_t *
4693 svn_wc_add(const char *path,
4694            svn_wc_adm_access_t *parent_access,
4695            const char *copyfrom_url,
4696            svn_revnum_t copyfrom_rev,
4697            svn_cancel_func_t cancel_func,
4698            void *cancel_baton,
4699            svn_wc_notify_func_t notify_func,
4700            void *notify_baton,
4701            apr_pool_t *pool);
4702
4703 /** Add a file to a working copy at @a local_abspath, obtaining the
4704  * text-base's contents from @a new_base_contents, the wc file's
4705  * content from @a new_contents, its unmodified properties from @a
4706  * new_base_props and its actual properties from @a new_props. Use
4707  * @a wc_ctx for accessing the working copy.
4708  *
4709  * The unmodified text and props normally come from the repository
4710  * file represented by the copyfrom args, see below.  The new file
4711  * will be marked as copy.
4712  *
4713  * @a new_contents and @a new_props may be NULL, in which case
4714  * the working copy text and props are taken from the base files with
4715  * appropriate translation of the file's content.
4716  *
4717  * @a new_contents must be provided in Normal Form. This is required
4718  * in order to pass both special and non-special files through a stream.
4719  *
4720  * @a wc_ctx must contain a write lock for the parent of @a local_abspath.
4721  *
4722  * If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a
4723  * valid revision number, and together they are the copyfrom history
4724  * for the new file.
4725  *
4726  * The @a cancel_func and @a cancel_baton are a standard cancellation
4727  * callback, or NULL if no callback is needed. @a notify_func and
4728  * @a notify_baton are a notification callback, and (if not NULL)
4729  * will be notified of the addition of this file.
4730  *
4731  * Use @a scratch_pool for temporary allocations.
4732  *
4733  * ### This function is very redundant with svn_wc_add().  Ideally,
4734  * we'd merge them, so that svn_wc_add() would just take optional
4735  * new_props and optional copyfrom information.  That way it could be
4736  * used for both 'svn add somefilesittingonmydisk' and for adding
4737  * files from repositories, with or without copyfrom history.
4738  *
4739  * The problem with this Ideal Plan is that svn_wc_add() also takes
4740  * care of recursive URL-rewriting.  There's a whole comment in its
4741  * doc string about how that's really weird, outside its core mission,
4742  * etc, etc.  So another part of the Ideal Plan is that that
4743  * functionality of svn_wc_add() would move into a separate function.
4744  *
4745  * @since New in 1.7.
4746  */
4747 svn_error_t *
4748 svn_wc_add_repos_file4(svn_wc_context_t *wc_ctx,
4749                        const char *local_abspath,
4750                        svn_stream_t *new_base_contents,
4751                        svn_stream_t *new_contents,
4752                        apr_hash_t *new_base_props,
4753                        apr_hash_t *new_props,
4754                        const char *copyfrom_url,
4755                        svn_revnum_t copyfrom_rev,
4756                        svn_cancel_func_t cancel_func,
4757                        void *cancel_baton,
4758                        apr_pool_t *scratch_pool);
4759
4760 /** Similar to svn_wc_add_repos_file4, but uses access batons and a
4761  * relative path instead of a working copy context and absolute path.
4762  *
4763  * ### NOTE: the notification callback/baton is not yet used.
4764  *
4765  * @since New in 1.6.
4766  * @deprecated Provided for compatibility with the 1.6 API.
4767  */
4768 SVN_DEPRECATED
4769 svn_error_t *
4770 svn_wc_add_repos_file3(const char *dst_path,
4771                        svn_wc_adm_access_t *adm_access,
4772                        svn_stream_t *new_base_contents,
4773                        svn_stream_t *new_contents,
4774                        apr_hash_t *new_base_props,
4775                        apr_hash_t *new_props,
4776                        const char *copyfrom_url,
4777                        svn_revnum_t copyfrom_rev,
4778                        svn_cancel_func_t cancel_func,
4779                        void *cancel_baton,
4780                        svn_wc_notify_func2_t notify_func,
4781                        void *notify_baton,
4782                        apr_pool_t *scratch_pool);
4783
4784
4785 /** Same as svn_wc_add_repos_file3(), except that it has pathnames rather
4786  * than streams for the text base, and actual text, and has no cancellation.
4787  *
4788  * @since New in 1.4.
4789  * @deprecated Provided for compatibility with the 1.5 API
4790  */
4791 SVN_DEPRECATED
4792 svn_error_t *
4793 svn_wc_add_repos_file2(const char *dst_path,
4794                        svn_wc_adm_access_t *adm_access,
4795                        const char *new_text_base_path,
4796                        const char *new_text_path,
4797                        apr_hash_t *new_base_props,
4798                        apr_hash_t *new_props,
4799                        const char *copyfrom_url,
4800                        svn_revnum_t copyfrom_rev,
4801                        apr_pool_t *pool);
4802
4803 /** Same as svn_wc_add_repos_file3(), except that it doesn't have the
4804  * BASE arguments or cancellation.
4805  *
4806  * @deprecated Provided for compatibility with the 1.3 API
4807  */
4808 SVN_DEPRECATED
4809 svn_error_t *
4810 svn_wc_add_repos_file(const char *dst_path,
4811                       svn_wc_adm_access_t *adm_access,
4812                       const char *new_text_path,
4813                       apr_hash_t *new_props,
4814                       const char *copyfrom_url,
4815                       svn_revnum_t copyfrom_rev,
4816                       apr_pool_t *pool);
4817
4818
4819 /** Remove @a local_abspath from revision control.  @a wc_ctx must
4820  * hold a write lock on the parent of @a local_abspath, or if that is a
4821  * WC root then on @a local_abspath itself.
4822  *
4823  * If @a local_abspath is a file, all its info will be removed from the
4824  * administrative area.  If @a local_abspath is a directory, then the
4825  * administrative area will be deleted, along with *all* the administrative
4826  * areas anywhere in the tree below @a adm_access.
4827  *
4828  * Normally, only administrative data is removed.  However, if
4829  * @a destroy_wf is TRUE, then all working file(s) and dirs are deleted
4830  * from disk as well.  When called with @a destroy_wf, any locally
4831  * modified files will *not* be deleted, and the special error
4832  * #SVN_ERR_WC_LEFT_LOCAL_MOD might be returned.  (Callers only need to
4833  * check for this special return value if @a destroy_wf is TRUE.)
4834  *
4835  * If @a instant_error is TRUE, then return
4836  * #SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is
4837  * encountered.  Otherwise, leave locally modified files in place and
4838  * return the error only after all the recursion is complete.
4839  *
4840  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
4841  * various points during the removal.  If it returns an error
4842  * (typically #SVN_ERR_CANCELLED), return that error immediately.
4843  *
4844  * WARNING:  This routine is exported for careful, measured use by
4845  * libsvn_client.  Do *not* call this routine unless you really
4846  * understand what the heck you're doing.
4847  *
4848  * @since New in 1.7.
4849  */
4850 svn_error_t *
4851 svn_wc_remove_from_revision_control2(svn_wc_context_t *wc_ctx,
4852                                      const char *local_abspath,
4853                                      svn_boolean_t destroy_wf,
4854                                      svn_boolean_t instant_error,
4855                                      svn_cancel_func_t cancel_func,
4856                                      void *cancel_baton,
4857                                      apr_pool_t *pool);
4858
4859 /**
4860  * Similar to svn_wc_remove_from_revision_control2() but with a name
4861  * and access baton.
4862  *
4863  * WARNING:  This routine was exported for careful, measured use by
4864  * libsvn_client.  Do *not* call this routine unless you really
4865  * understand what the heck you're doing.
4866  *
4867  * @deprecated Provided for compatibility with the 1.6 API
4868  */
4869 SVN_DEPRECATED
4870 svn_error_t *
4871 svn_wc_remove_from_revision_control(svn_wc_adm_access_t *adm_access,
4872                                     const char *name,
4873                                     svn_boolean_t destroy_wf,
4874                                     svn_boolean_t instant_error,
4875                                     svn_cancel_func_t cancel_func,
4876                                     void *cancel_baton,
4877                                     apr_pool_t *pool);
4878
4879
4880 /**
4881  * Assuming @a local_abspath is under version control or a tree conflict
4882  * victim and in a state of conflict, then take @a local_abspath *out*
4883  * of this state.  If @a resolve_text is TRUE then any text conflict is
4884  * resolved, if @a resolve_tree is TRUE then any tree conflicts are
4885  * resolved. If @a resolve_prop is set to "" all property conflicts are
4886  * resolved, if it is set to any other string value, conflicts on that
4887  * specific property are resolved and when resolve_prop is NULL, no
4888  * property conflicts are resolved.
4889  *
4890  * If @a depth is #svn_depth_empty, act only on @a local_abspath; if
4891  * #svn_depth_files, resolve @a local_abspath and its conflicted file
4892  * children (if any); if #svn_depth_immediates, resolve @a local_abspath
4893  * and all its immediate conflicted children (both files and directories,
4894  * if any); if #svn_depth_infinity, resolve @a local_abspath and every
4895  * conflicted file or directory anywhere beneath it.
4896  *
4897  * If @a conflict_choice is #svn_wc_conflict_choose_base, resolve the
4898  * conflict with the old file contents; if
4899  * #svn_wc_conflict_choose_mine_full, use the original working contents;
4900  * if #svn_wc_conflict_choose_theirs_full, the new contents; and if
4901  * #svn_wc_conflict_choose_merged, don't change the contents at all,
4902  * just remove the conflict status, which is the pre-1.5 behavior.
4903  *
4904  * #svn_wc_conflict_choose_theirs_conflict and
4905  * #svn_wc_conflict_choose_mine_conflict are not legal for binary
4906  * files or properties.
4907  *
4908  * @a wc_ctx is a working copy context, with a write lock, for @a
4909  * local_abspath.
4910  *
4911  * Needless to say, this function doesn't touch conflict markers or
4912  * anything of that sort -- only a human can semantically resolve a
4913  * conflict.  Instead, this function simply marks a file as "having
4914  * been resolved", clearing the way for a commit.
4915  *
4916  * The implementation details are opaque, as our "conflicted" criteria
4917  * might change over time.  (At the moment, this routine removes the
4918  * three fulltext 'backup' files and any .prej file created in a conflict,
4919  * and modifies @a local_abspath's entry.)
4920  *
4921  * If @a local_abspath is not under version control and not a tree
4922  * conflict, return #SVN_ERR_ENTRY_NOT_FOUND. If @a path isn't in a
4923  * state of conflict to begin with, do nothing, and return #SVN_NO_ERROR.
4924  *
4925  * If @c local_abspath was successfully taken out of a state of conflict,
4926  * report this information to @c notify_func (if non-@c NULL.)  If only
4927  * text, only property, or only tree conflict resolution was requested,
4928  * and it was successful, then success gets reported.
4929  *
4930  * Temporary allocations will be performed in @a scratch_pool.
4931  *
4932  * @since New in 1.7.
4933  */
4934 svn_error_t *
4935 svn_wc_resolved_conflict5(svn_wc_context_t *wc_ctx,
4936                           const char *local_abspath,
4937                           svn_depth_t depth,
4938                           svn_boolean_t resolve_text,
4939                           const char *resolve_prop,
4940                           svn_boolean_t resolve_tree,
4941                           svn_wc_conflict_choice_t conflict_choice,
4942                           svn_cancel_func_t cancel_func,
4943                           void *cancel_baton,
4944                           svn_wc_notify_func2_t notify_func,
4945                           void *notify_baton,
4946                           apr_pool_t *scratch_pool);
4947
4948 /** Similar to svn_wc_resolved_conflict5, but takes an absolute path
4949  * and an access baton. This version doesn't support resolving a specific
4950  * property.conflict.
4951  *
4952  * @since New in 1.6.
4953  * @deprecated Provided for backward compatibility with the 1.6 API.
4954  */
4955 SVN_DEPRECATED
4956 svn_error_t *
4957 svn_wc_resolved_conflict4(const char *path,
4958                           svn_wc_adm_access_t *adm_access,
4959                           svn_boolean_t resolve_text,
4960                           svn_boolean_t resolve_props,
4961                           svn_boolean_t resolve_tree,
4962                           svn_depth_t depth,
4963                           svn_wc_conflict_choice_t conflict_choice,
4964                           svn_wc_notify_func2_t notify_func,
4965                           void *notify_baton,
4966                           svn_cancel_func_t cancel_func,
4967                           void *cancel_baton,
4968                           apr_pool_t *pool);
4969
4970
4971 /**
4972  * Similar to svn_wc_resolved_conflict4(), but without tree-conflict
4973  * resolution support.
4974  *
4975  * @since New in 1.5.
4976  * @deprecated Provided for backward compatibility with the 1.5 API.
4977  */
4978 SVN_DEPRECATED
4979 svn_error_t *
4980 svn_wc_resolved_conflict3(const char *path,
4981                           svn_wc_adm_access_t *adm_access,
4982                           svn_boolean_t resolve_text,
4983                           svn_boolean_t resolve_props,
4984                           svn_depth_t depth,
4985                           svn_wc_conflict_choice_t conflict_choice,
4986                           svn_wc_notify_func2_t notify_func,
4987                           void *notify_baton,
4988                           svn_cancel_func_t cancel_func,
4989                           void *cancel_baton,
4990                           apr_pool_t *pool);
4991
4992
4993 /**
4994  * Similar to svn_wc_resolved_conflict3(), but without automatic conflict
4995  * resolution support, and with @a depth set according to @a recurse:
4996  * if @a recurse is TRUE, @a depth is #svn_depth_infinity, else it is
4997  * #svn_depth_files.
4998  *
4999  * @since New in 1.2.
5000  * @deprecated Provided for backward compatibility with the 1.4 API.
5001  */
5002 SVN_DEPRECATED
5003 svn_error_t *
5004 svn_wc_resolved_conflict2(const char *path,
5005                           svn_wc_adm_access_t *adm_access,
5006                           svn_boolean_t resolve_text,
5007                           svn_boolean_t resolve_props,
5008                           svn_boolean_t recurse,
5009                           svn_wc_notify_func2_t notify_func,
5010                           void *notify_baton,
5011                           svn_cancel_func_t cancel_func,
5012                           void *cancel_baton,
5013                           apr_pool_t *pool);
5014
5015 /**
5016  * Similar to svn_wc_resolved_conflict2(), but takes an
5017  * svn_wc_notify_func_t and doesn't have cancellation support.
5018  *
5019  * @deprecated Provided for backward compatibility with the 1.1 API.
5020  */
5021 SVN_DEPRECATED
5022 svn_error_t *
5023 svn_wc_resolved_conflict(const char *path,
5024                          svn_wc_adm_access_t *adm_access,
5025                          svn_boolean_t resolve_text,
5026                          svn_boolean_t resolve_props,
5027                          svn_boolean_t recurse,
5028                          svn_wc_notify_func_t notify_func,
5029                          void *notify_baton,
5030                          apr_pool_t *pool);
5031
5032 \f
5033 /* Commits. */
5034
5035
5036 /**
5037  * Storage type for queued post-commit data.
5038  *
5039  * @since New in 1.5.
5040  */
5041 typedef struct svn_wc_committed_queue_t svn_wc_committed_queue_t;
5042
5043
5044 /**
5045  * Create a queue for use with svn_wc_queue_committed() and
5046  * svn_wc_process_committed_queue().
5047  *
5048  * The returned queue and all further allocations required for queuing
5049  * new items will also be done from @a pool.
5050  *
5051  * @since New in 1.5.
5052  */
5053 svn_wc_committed_queue_t *
5054 svn_wc_committed_queue_create(apr_pool_t *pool);
5055
5056
5057 /**
5058  * Queue committed items to be processed later by
5059  * svn_wc_process_committed_queue2().
5060  *
5061  * Record in @a queue that @a local_abspath will need to be bumped
5062  * after a commit succeeds.
5063  *
5064  * If non-NULL, @a wcprop_changes is an array of <tt>svn_prop_t *</tt>
5065  * changes to wc properties; if an #svn_prop_t->value is NULL, then
5066  * that property is deleted.
5067  *   ### [JAF]  No, a prop whose value is NULL is ignored, not deleted.  This
5068  *   ### seems to be not a set of changes but rather the new complete set of
5069  *   ### props.  And it's renamed to 'new_dav_cache' inside; why?
5070  *
5071  * If @a remove_lock is @c TRUE, any entryprops related to a repository
5072  * lock will be removed.
5073  *
5074  * If @a remove_changelist is @c TRUE, any association with a
5075  * changelist will be removed.
5076  *
5077  *
5078  * If @a sha1_checksum is non-NULL, use it to identify the node's pristine
5079  * text.
5080  *
5081  * If @a recurse is TRUE and @a local_abspath is a directory, then bump every
5082  * versioned object at or under @a local_abspath.  This is usually done for
5083  * copied trees.
5084  *
5085  * ### In the present implementation, if a recursive directory item is in
5086  *     the queue, then any children (at any depth) of that directory that
5087  *     are also in the queue as separate items will get:
5088  *       'wcprop_changes' = NULL;
5089  *       'remove_lock' = FALSE;
5090  *       'remove_changelist' from the recursive parent item;
5091  *     and any children (at any depth) of that directory that are NOT in
5092  *     the queue as separate items will get:
5093  *       'wcprop_changes' = NULL;
5094  *       'remove_lock' = FALSE;
5095  *       'remove_changelist' from the recursive parent item;
5096  *
5097  * @note the @a recurse parameter should be used with extreme care since
5098  * it will bump ALL nodes under the directory, regardless of their
5099  * actual inclusion in the new revision.
5100  *
5101  * All pointer data passed to this function (@a local_abspath,
5102  * @a wcprop_changes and the checksums) should remain valid until the
5103  * queue has been processed by svn_wc_process_committed_queue2().
5104  *
5105  * Temporary allocations will be performed in @a scratch_pool, and persistent
5106  * allocations will use the same pool as @a queue used when it was created.
5107  *
5108  * @since New in 1.7.
5109  */
5110 svn_error_t *
5111 svn_wc_queue_committed3(svn_wc_committed_queue_t *queue,
5112                         svn_wc_context_t *wc_ctx,
5113                         const char *local_abspath,
5114                         svn_boolean_t recurse,
5115                         const apr_array_header_t *wcprop_changes,
5116                         svn_boolean_t remove_lock,
5117                         svn_boolean_t remove_changelist,
5118                         const svn_checksum_t *sha1_checksum,
5119                         apr_pool_t *scratch_pool);
5120
5121 /** Same as svn_wc_queue_committed3() except @a path doesn't have to be an
5122  * abspath and @a adm_access is unused and a SHA-1 checksum cannot be
5123  * specified.
5124  *
5125  * @since New in 1.6.
5126  *
5127  * @deprecated Provided for backwards compatibility with the 1.6 API.
5128  */
5129 SVN_DEPRECATED
5130 svn_error_t *
5131 svn_wc_queue_committed2(svn_wc_committed_queue_t *queue,
5132                         const char *path,
5133                         svn_wc_adm_access_t *adm_access,
5134                         svn_boolean_t recurse,
5135                         const apr_array_header_t *wcprop_changes,
5136                         svn_boolean_t remove_lock,
5137                         svn_boolean_t remove_changelist,
5138                         const svn_checksum_t *md5_checksum,
5139                         apr_pool_t *scratch_pool);
5140
5141
5142 /** Same as svn_wc_queue_committed2() but the @a queue parameter has an
5143  * extra indirection and @a digest is supplied instead of a checksum type.
5144  *
5145  * @note despite the extra indirection, this function does NOT allocate
5146  *   the queue for you. svn_wc_committed_queue_create() must be called.
5147  *
5148  * @since New in 1.5
5149  *
5150  * @deprecated Provided for backwards compatibility with 1.5
5151  */
5152 SVN_DEPRECATED
5153 svn_error_t *
5154 svn_wc_queue_committed(svn_wc_committed_queue_t **queue,
5155                        const char *path,
5156                        svn_wc_adm_access_t *adm_access,
5157                        svn_boolean_t recurse,
5158                        const apr_array_header_t *wcprop_changes,
5159                        svn_boolean_t remove_lock,
5160                        svn_boolean_t remove_changelist,
5161                        const unsigned char *digest,
5162                        apr_pool_t *pool);
5163
5164
5165 /**
5166  * Bump all items in @a queue to @a new_revnum after a commit succeeds.
5167  * @a rev_date and @a rev_author are the (server-side) date and author
5168  * of the new revision; one or both may be @c NULL.
5169  *
5170  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
5171  * if the client wants to cancel the operation.
5172  *
5173  * @since New in 1.7.
5174  */
5175 svn_error_t *
5176 svn_wc_process_committed_queue2(svn_wc_committed_queue_t *queue,
5177                                 svn_wc_context_t *wc_ctx,
5178                                 svn_revnum_t new_revnum,
5179                                 const char *rev_date,
5180                                 const char *rev_author,
5181                                 svn_cancel_func_t cancel_func,
5182                                 void *cancel_baton,
5183                                 apr_pool_t *scratch_pool);
5184
5185 /** @see svn_wc_process_committed_queue2()
5186  *
5187  * @since New in 1.5.
5188  * @deprecated Provided for backwards compatibility with the 1.6 API.
5189  */
5190 SVN_DEPRECATED
5191 svn_error_t *
5192 svn_wc_process_committed_queue(svn_wc_committed_queue_t *queue,
5193                                svn_wc_adm_access_t *adm_access,
5194                                svn_revnum_t new_revnum,
5195                                const char *rev_date,
5196                                const char *rev_author,
5197                                apr_pool_t *pool);
5198
5199
5200 /**
5201  * @note this function has improper expectations around the operation and
5202  *   execution of other parts of the Subversion WC library. The resulting
5203  *   coupling makes this interface near-impossible to support. Documentation
5204  *   has been removed, as a result.
5205  *
5206  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
5207  *   for backwards compatibility with the 1.5 API.
5208  */
5209 SVN_DEPRECATED
5210 svn_error_t *
5211 svn_wc_process_committed4(const char *path,
5212                           svn_wc_adm_access_t *adm_access,
5213                           svn_boolean_t recurse,
5214                           svn_revnum_t new_revnum,
5215                           const char *rev_date,
5216                           const char *rev_author,
5217                           const apr_array_header_t *wcprop_changes,
5218                           svn_boolean_t remove_lock,
5219                           svn_boolean_t remove_changelist,
5220                           const unsigned char *digest,
5221                           apr_pool_t *pool);
5222
5223 /** @see svn_wc_process_committed4()
5224  *
5225  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
5226  *   for backwards compatibility with the 1.4 API.
5227  */
5228 SVN_DEPRECATED
5229 svn_error_t *
5230 svn_wc_process_committed3(const char *path,
5231                           svn_wc_adm_access_t *adm_access,
5232                           svn_boolean_t recurse,
5233                           svn_revnum_t new_revnum,
5234                           const char *rev_date,
5235                           const char *rev_author,
5236                           const apr_array_header_t *wcprop_changes,
5237                           svn_boolean_t remove_lock,
5238                           const unsigned char *digest,
5239                           apr_pool_t *pool);
5240
5241 /** @see svn_wc_process_committed4()
5242  *
5243  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
5244  *   for backwards compatibility with the 1.3 API.
5245  */
5246 SVN_DEPRECATED
5247 svn_error_t *
5248 svn_wc_process_committed2(const char *path,
5249                           svn_wc_adm_access_t *adm_access,
5250                           svn_boolean_t recurse,
5251                           svn_revnum_t new_revnum,
5252                           const char *rev_date,
5253                           const char *rev_author,
5254                           const apr_array_header_t *wcprop_changes,
5255                           svn_boolean_t remove_lock,
5256                           apr_pool_t *pool);
5257
5258 /** @see svn_wc_process_committed4()
5259  *
5260  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
5261  *   for backward compatibility with the 1.1 API.
5262  */
5263 SVN_DEPRECATED
5264 svn_error_t *
5265 svn_wc_process_committed(const char *path,
5266                          svn_wc_adm_access_t *adm_access,
5267                          svn_boolean_t recurse,
5268                          svn_revnum_t new_revnum,
5269                          const char *rev_date,
5270                          const char *rev_author,
5271                          const apr_array_header_t *wcprop_changes,
5272                          apr_pool_t *pool);
5273
5274
5275
5276 \f
5277
5278 /**
5279  * Do a depth-first crawl in a working copy, beginning at @a local_abspath,
5280  * using @a wc_ctx for accessing the working copy.
5281  *
5282  * Communicate the `state' of the working copy's revisions and depths
5283  * to @a reporter/@a report_baton.  Obviously, if @a local_abspath is a
5284  * file instead of a directory, this depth-first crawl will be a short one.
5285  *
5286  * No locks or logs are created, nor are any animals harmed in the
5287  * process unless @a restore_files is TRUE.  No cleanup is necessary.
5288  *
5289  * After all revisions are reported, @a reporter->finish_report() is
5290  * called, which immediately causes the RA layer to update the working
5291  * copy.  Thus the return value may very well reflect the result of
5292  * the update!
5293  *
5294  * If @a depth is #svn_depth_empty, then report state only for
5295  * @a path itself.  If #svn_depth_files, do the same and include
5296  * immediate file children of @a path.  If #svn_depth_immediates,
5297  * then behave as if for #svn_depth_files but also report the
5298  * property states of immediate subdirectories.  If @a depth is
5299  * #svn_depth_infinity, then report state fully recursively.  All
5300  * descents are only as deep as @a path's own depth permits, of
5301  * course.  If @a depth is #svn_depth_unknown, then just use
5302  * #svn_depth_infinity, which in practice means depth of @a path.
5303  *
5304  * Iff @a honor_depth_exclude is TRUE, the crawler will report paths
5305  * whose ambient depth is #svn_depth_exclude as being excluded, and
5306  * thus prevent the server from pushing update data for those paths;
5307  * therefore, don't set this flag if you wish to pull in excluded paths.
5308  * Note that #svn_depth_exclude on the target @a path is never
5309  * honored, even if @a honor_depth_exclude is TRUE, because we need to
5310  * be able to explicitly pull in a target.  For example, if this is
5311  * the working copy...
5312  *
5313  *    svn co greek_tree_repos wc_dir
5314  *    svn up --set-depth exclude wc_dir/A/B/E  # now A/B/E is excluded
5315  *
5316  * ...then 'svn up wc_dir/A/B' would report E as excluded (assuming
5317  * @a honor_depth_exclude is TRUE), but 'svn up wc_dir/A/B/E' would
5318  * not, because the latter is trying to explicitly pull in E.  In
5319  * general, we never report the update target as excluded.
5320  *
5321  * Iff @a depth_compatibility_trick is TRUE, then set the @c start_empty
5322  * flag on @a reporter->set_path() and @a reporter->link_path() calls
5323  * as necessary to trick a pre-1.5 (i.e., depth-unaware) server into
5324  * sending back all the items the client might need to upgrade a
5325  * working copy from a shallower depth to a deeper one.
5326  *
5327  * If @a restore_files is TRUE, then unexpectedly missing working files
5328  * will be restored from the administrative directory's cache. For each
5329  * file restored, the @a notify_func function will be called with the
5330  * @a notify_baton and the path of the restored file. @a notify_func may
5331  * be @c NULL if this notification is not required.  If @a
5332  * use_commit_times is TRUE, then set restored files' timestamps to
5333  * their last-commit-times.
5334  *
5335  * @since New in 1.7.
5336  */
5337 svn_error_t *
5338 svn_wc_crawl_revisions5(svn_wc_context_t *wc_ctx,
5339                         const char *local_abspath,
5340                         const svn_ra_reporter3_t *reporter,
5341                         void *report_baton,
5342                         svn_boolean_t restore_files,
5343                         svn_depth_t depth,
5344                         svn_boolean_t honor_depth_exclude,
5345                         svn_boolean_t depth_compatibility_trick,
5346                         svn_boolean_t use_commit_times,
5347                         svn_cancel_func_t cancel_func,
5348                         void *cancel_baton,
5349                         svn_wc_notify_func2_t notify_func,
5350                         void *notify_baton,
5351                         apr_pool_t *scratch_pool);
5352
5353 /**
5354  * Similar to svn_wc_crawl_revisions5, but with a relative path and
5355  * access baton instead of an absolute path and wc_ctx.
5356  *
5357  * Passes NULL for @a cancel_func and @a cancel_baton.
5358  *
5359  * @since New in 1.6.
5360  * @deprecated Provided for compatibility with the 1.6 API.
5361  */
5362 SVN_DEPRECATED
5363 svn_error_t *
5364 svn_wc_crawl_revisions4(const char *path,
5365                         svn_wc_adm_access_t *adm_access,
5366                         const svn_ra_reporter3_t *reporter,
5367                         void *report_baton,
5368                         svn_boolean_t restore_files,
5369                         svn_depth_t depth,
5370                         svn_boolean_t honor_depth_exclude,
5371                         svn_boolean_t depth_compatibility_trick,
5372                         svn_boolean_t use_commit_times,
5373                         svn_wc_notify_func2_t notify_func,
5374                         void *notify_baton,
5375                         svn_wc_traversal_info_t *traversal_info,
5376                         apr_pool_t *pool);
5377
5378
5379 /**
5380  * Similar to svn_wc_crawl_revisions4, but with @a honor_depth_exclude always
5381  * set to false.
5382  *
5383  * @deprecated Provided for compatibility with the 1.5 API.
5384  */
5385 SVN_DEPRECATED
5386 svn_error_t *
5387 svn_wc_crawl_revisions3(const char *path,
5388                         svn_wc_adm_access_t *adm_access,
5389                         const svn_ra_reporter3_t *reporter,
5390                         void *report_baton,
5391                         svn_boolean_t restore_files,
5392                         svn_depth_t depth,
5393                         svn_boolean_t depth_compatibility_trick,
5394                         svn_boolean_t use_commit_times,
5395                         svn_wc_notify_func2_t notify_func,
5396                         void *notify_baton,
5397                         svn_wc_traversal_info_t *traversal_info,
5398                         apr_pool_t *pool);
5399
5400 /**
5401  * Similar to svn_wc_crawl_revisions3, but taking svn_ra_reporter2_t
5402  * instead of svn_ra_reporter3_t, and therefore only able to report
5403  * #svn_depth_infinity for depths; and taking @a recurse instead of @a
5404  * depth; and with @a depth_compatibility_trick always false.
5405  *
5406  * @deprecated Provided for compatibility with the 1.4 API.
5407  */
5408 SVN_DEPRECATED
5409 svn_error_t *
5410 svn_wc_crawl_revisions2(const char *path,
5411                         svn_wc_adm_access_t *adm_access,
5412                         const svn_ra_reporter2_t *reporter,
5413                         void *report_baton,
5414                         svn_boolean_t restore_files,
5415                         svn_boolean_t recurse,
5416                         svn_boolean_t use_commit_times,
5417                         svn_wc_notify_func2_t notify_func,
5418                         void *notify_baton,
5419                         svn_wc_traversal_info_t *traversal_info,
5420                         apr_pool_t *pool);
5421
5422 /**
5423  * Similar to svn_wc_crawl_revisions2(), but takes an #svn_wc_notify_func_t
5424  * and a #svn_ra_reporter_t instead.
5425  *
5426  * @deprecated Provided for backward compatibility with the 1.1 API.
5427  */
5428 SVN_DEPRECATED
5429 svn_error_t *
5430 svn_wc_crawl_revisions(const char *path,
5431                        svn_wc_adm_access_t *adm_access,
5432                        const svn_ra_reporter_t *reporter,
5433                        void *report_baton,
5434                        svn_boolean_t restore_files,
5435                        svn_boolean_t recurse,
5436                        svn_boolean_t use_commit_times,
5437                        svn_wc_notify_func_t notify_func,
5438                        void *notify_baton,
5439                        svn_wc_traversal_info_t *traversal_info,
5440                        apr_pool_t *pool);
5441
5442 \f
5443 /**
5444  * @defgroup svn_wc_roots Working copy roots
5445  * @{
5446  */
5447
5448 /** If @a is_wcroot is not @c NULL, set @a *is_wcroot to @c TRUE if @a
5449  * local_abspath is the root of the working copy, otherwise to @c FALSE.
5450  *
5451  * If @a is_switched is not @c NULL, set @a *is_switched to @c TRUE if @a
5452  * local_abspath is not the root of the working copy, and switched against its
5453  * parent.
5454  *
5455  * If @a kind is not @c NULL, set @a *kind to the node kind of @a
5456  * local_abspath.
5457  *
5458  * Use @a scratch_pool for any temporary allocations.
5459  *
5460  * @since New in 1.8.
5461  */
5462 svn_error_t *
5463 svn_wc_check_root(svn_boolean_t *is_wcroot,
5464                   svn_boolean_t *is_switched,
5465                   svn_node_kind_t *kind,
5466                   svn_wc_context_t *wc_ctx,
5467                   const char *local_abspath,
5468                   apr_pool_t *scratch_pool);
5469
5470 /** Set @a *wc_root to @c TRUE if @a local_abspath represents a "working copy
5471  * root", @c FALSE otherwise. Here, @a local_abspath is a "working copy root"
5472  * if its parent directory is not a WC or if it is switched. Also, a deleted
5473  * tree-conflict victim is considered a "working copy root" because it has no
5474  * URL.
5475  *
5476  * If @a local_abspath is not found, return the error #SVN_ERR_ENTRY_NOT_FOUND.
5477  *
5478  * Use @a scratch_pool for any temporary allocations.
5479  *
5480  * @note For legacy reasons only a directory can be a wc-root. However, this
5481  * function will also set wc_root to @c TRUE for a switched file.
5482  *
5483  * @since New in 1.7.
5484  * @deprecated Provided for backward compatibility with the 1.7 API. Consider
5485  * using svn_wc_check_root() instead.
5486  */
5487 SVN_DEPRECATED
5488 svn_error_t *
5489 svn_wc_is_wc_root2(svn_boolean_t *wc_root,
5490                    svn_wc_context_t *wc_ctx,
5491                    const char *local_abspath,
5492                    apr_pool_t *scratch_pool);
5493
5494
5495 /**
5496  * Similar to svn_wc_is_wc_root2(), but with an access baton and relative
5497  * path.
5498  *
5499  * @note If @a path is '', this function will always return @c TRUE.
5500  *
5501  * @deprecated Provided for backward compatibility with the 1.6 API.
5502  */
5503 SVN_DEPRECATED
5504 svn_error_t *
5505 svn_wc_is_wc_root(svn_boolean_t *wc_root,
5506                   const char *path,
5507                   svn_wc_adm_access_t *adm_access,
5508                   apr_pool_t *pool);
5509
5510 /** @} */
5511
5512
5513 /* Updates. */
5514
5515 /** Conditionally split @a path into an @a anchor and @a target for the
5516  * purpose of updating and committing.
5517  *
5518  * @a anchor is the directory at which the update or commit editor
5519  * should be rooted.
5520  *
5521  * @a target is the actual subject (relative to the @a anchor) of the
5522  * update/commit, or "" if the @a anchor itself is the subject.
5523  *
5524  * Allocate @a anchor and @a target in @a result_pool; @a scratch_pool
5525  * is used for temporary allocations.
5526  *
5527  * @note Even though this API uses a #svn_wc_context_t, it accepts a
5528  * (possibly) relative path and returns a (possibly) relative path in
5529  * @a *anchor.  The reason being that the outputs are generally used to
5530  * open access batons, and such opening currently requires relative paths.
5531  * In the long-run, I expect this API to be removed from 1.7, due to the
5532  * remove of access batons, but for the time being, the #svn_wc_context_t
5533  * parameter allows us to avoid opening a duplicate database, just for this
5534  * function.
5535  *
5536  * @since New in 1.7.
5537  */
5538 svn_error_t *
5539 svn_wc_get_actual_target2(const char **anchor,
5540                           const char **target,
5541                           svn_wc_context_t *wc_ctx,
5542                           const char *path,
5543                           apr_pool_t *result_pool,
5544                           apr_pool_t *scratch_pool);
5545
5546
5547 /** Similar to svn_wc_get_actual_target2(), but without the wc context, and
5548  * with a absolute path.
5549  *
5550  * @deprecated Provided for backward compatibility with the 1.6 API.
5551  */
5552 SVN_DEPRECATED
5553 svn_error_t *
5554 svn_wc_get_actual_target(const char *path,
5555                          const char **anchor,
5556                          const char **target,
5557                          apr_pool_t *pool);
5558
5559
5560 /**
5561  * @defgroup svn_wc_update_switch Update and switch (update-like functionality)
5562  * @{
5563  */
5564
5565 /**
5566  * A simple callback type to wrap svn_ra_get_file();  see that
5567  * docstring for more information.
5568  *
5569  * This technique allows libsvn_client to 'wrap' svn_ra_get_file() and
5570  * pass it down into libsvn_wc functions, thus allowing the WC layer
5571  * to legally call the RA function via (blind) callback.
5572  *
5573  * @since New in 1.5
5574  * @deprecated Provided for backward compatibility with the 1.6 API.
5575  */
5576 typedef svn_error_t *(*svn_wc_get_file_t)(void *baton,
5577                                           const char *path,
5578                                           svn_revnum_t revision,
5579                                           svn_stream_t *stream,
5580                                           svn_revnum_t *fetched_rev,
5581                                           apr_hash_t **props,
5582                                           apr_pool_t *pool);
5583
5584 /**
5585  * A simple callback type to wrap svn_ra_get_dir2() for avoiding issue #3569,
5586  * where a directory is updated to a revision without some of its children
5587  * recorded in the working copy. A future update won't bring these files in
5588  * because the repository assumes they are already there.
5589  *
5590  * We really only need the names of the dirents for a not-present marking,
5591  * but we also store the node-kind if we receive one.
5592  *
5593  * @a *dirents should be set to a hash mapping <tt>const char *</tt> child
5594  * names, to <tt>const svn_dirent_t *</tt> instances.
5595  *
5596  * @since New in 1.7.
5597  */
5598 typedef svn_error_t *(*svn_wc_dirents_func_t)(void *baton,
5599                                               apr_hash_t **dirents,
5600                                               const char *repos_root_url,
5601                                               const char *repos_relpath,
5602                                               apr_pool_t *result_pool,
5603                                               apr_pool_t *scratch_pool);
5604
5605
5606 /**
5607  * DEPRECATED -- please use APIs from svn_client.h
5608  *
5609  * ---
5610  *
5611  * Set @a *editor and @a *edit_baton to an editor and baton for updating a
5612  * working copy.
5613  *
5614  * @a anchor_abspath is a local working copy directory, with a fully recursive
5615  * write lock in @a wc_ctx, which will be used as the root of our editor.
5616  *
5617  * @a target_basename is the entry in @a anchor_abspath that will actually be
5618  * updated, or the empty string if all of @a anchor_abspath should be updated.
5619  *
5620  * The editor invokes @a notify_func with @a notify_baton as the update
5621  * progresses, if @a notify_func is non-NULL.
5622  *
5623  * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
5624  * @a cancel_baton as the update progresses to see if it should continue.
5625  *
5626  * If @a conflict_func is non-NULL, then invoke it with @a
5627  * conflict_baton whenever a conflict is encountered, giving the
5628  * callback a chance to resolve the conflict before the editor takes
5629  * more drastic measures (such as marking a file conflicted, or
5630  * bailing out of the update).
5631  *
5632  * If @a external_func is non-NULL, then invoke it with @a external_baton
5633  * whenever external changes are encountered, giving the callback a chance
5634  * to store the external information for processing.
5635  *
5636  * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
5637  * any merging; otherwise, use the built-in merge code.
5638  *
5639  * @a preserved_exts is an array of filename patterns which, when
5640  * matched against the extensions of versioned files, determine for
5641  * which such files any related generated conflict files will preserve
5642  * the original file's extension as their own.  If a file's extension
5643  * does not match any of the patterns in @a preserved_exts (which is
5644  * certainly the case if @a preserved_exts is @c NULL or empty),
5645  * generated conflict files will carry Subversion's custom extensions.
5646  *
5647  * @a target_revision is a pointer to a revision location which, after
5648  * successful completion of the drive of this editor, will be
5649  * populated with the revision to which the working copy was updated.
5650  *
5651  * If @a use_commit_times is TRUE, then all edited/added files will
5652  * have their working timestamp set to the last-committed-time.  If
5653  * FALSE, the working files will be touched with the 'now' time.
5654  *
5655  * If @a allow_unver_obstructions is TRUE, then allow unversioned
5656  * obstructions when adding a path.
5657  *
5658  * If @a adds_as_modification is TRUE, a local addition at the same path
5659  * as an incoming addition of the same node kind results in a normal node
5660  * with a possible local modification, instead of a tree conflict.
5661  *
5662  * If @a depth is #svn_depth_infinity, update fully recursively.
5663  * Else if it is #svn_depth_immediates, update the uppermost
5664  * directory, its file entries, and the presence or absence of
5665  * subdirectories (but do not descend into the subdirectories).
5666  * Else if it is #svn_depth_files, update the uppermost directory
5667  * and its immediate file entries, but not subdirectories.
5668  * Else if it is #svn_depth_empty, update exactly the uppermost
5669  * target, and don't touch its entries.
5670  *
5671  * If @a depth_is_sticky is set and @a depth is not
5672  * #svn_depth_unknown, then in addition to updating PATHS, also set
5673  * their sticky ambient depth value to @a depth.
5674  *
5675  * If @a server_performs_filtering is TRUE, assume that the server handles
5676  * the ambient depth filtering, so this doesn't have to be handled in the
5677  * editor.
5678  *
5679  * If @a clean_checkout is TRUE, assume that we are checking out into an
5680  * empty directory, and so bypass a number of conflict checks that are
5681  * unnecessary in this case.
5682  *
5683  * If @a fetch_dirents_func is not NULL, the update editor may call this
5684  * callback, when asked to perform a depth restricted update. It will do this
5685  * before returning the editor to allow using the primary ra session for this.
5686  *
5687  * @since New in 1.7.
5688  * @deprecated Provided for backward compatibility with the 1.7 API.
5689  */
5690 SVN_DEPRECATED
5691 svn_error_t *
5692 svn_wc_get_update_editor4(const svn_delta_editor_t **editor,
5693                           void **edit_baton,
5694                           svn_revnum_t *target_revision,
5695                           svn_wc_context_t *wc_ctx,
5696                           const char *anchor_abspath,
5697                           const char *target_basename,
5698                           svn_boolean_t use_commit_times,
5699                           svn_depth_t depth,
5700                           svn_boolean_t depth_is_sticky,
5701                           svn_boolean_t allow_unver_obstructions,
5702                           svn_boolean_t adds_as_modification,
5703                           svn_boolean_t server_performs_filtering,
5704                           svn_boolean_t clean_checkout,
5705                           const char *diff3_cmd,
5706                           const apr_array_header_t *preserved_exts,
5707                           svn_wc_dirents_func_t fetch_dirents_func,
5708                           void *fetch_dirents_baton,
5709                           svn_wc_conflict_resolver_func2_t conflict_func,
5710                           void *conflict_baton,
5711                           svn_wc_external_update_t external_func,
5712                           void *external_baton,
5713                           svn_cancel_func_t cancel_func,
5714                           void *cancel_baton,
5715                           svn_wc_notify_func2_t notify_func,
5716                           void *notify_baton,
5717                           apr_pool_t *result_pool,
5718                           apr_pool_t *scratch_pool);
5719
5720 /** Similar to svn_wc_get_update_editor4, but uses access batons and relative
5721  * path instead of a working copy context-abspath pair and
5722  * svn_wc_traversal_info_t instead of an externals callback.  Also,
5723  * @a fetch_func and @a fetch_baton are ignored.
5724  *
5725  * If @a ti is non-NULL, record traversal info in @a ti, for use by
5726  * post-traversal accessors such as svn_wc_edited_externals().
5727  *
5728  * All locks, both those in @a anchor and newly acquired ones, will be
5729  * released when the editor driver calls @c close_edit.
5730  *
5731  * Always sets @a adds_as_modification to TRUE, @a server_performs_filtering
5732  * and @a clean_checkout to FALSE.
5733  *
5734  * Uses a svn_wc_conflict_resolver_func_t conflict resolver instead of a
5735  * svn_wc_conflict_resolver_func2_t.
5736  *
5737  * This function assumes that @a diff3_cmd is path encoded. Later versions
5738  * assume utf-8.
5739  *
5740  * Always passes a null dirent function.
5741  *
5742  * @since New in 1.5.
5743  * @deprecated Provided for backward compatibility with the 1.6 API.
5744  */
5745 SVN_DEPRECATED
5746 svn_error_t *
5747 svn_wc_get_update_editor3(svn_revnum_t *target_revision,
5748                           svn_wc_adm_access_t *anchor,
5749                           const char *target,
5750                           svn_boolean_t use_commit_times,
5751                           svn_depth_t depth,
5752                           svn_boolean_t depth_is_sticky,
5753                           svn_boolean_t allow_unver_obstructions,
5754                           svn_wc_notify_func2_t notify_func,
5755                           void *notify_baton,
5756                           svn_cancel_func_t cancel_func,
5757                           void *cancel_baton,
5758                           svn_wc_conflict_resolver_func_t conflict_func,
5759                           void *conflict_baton,
5760                           svn_wc_get_file_t fetch_func,
5761                           void *fetch_baton,
5762                           const char *diff3_cmd,
5763                           const apr_array_header_t *preserved_exts,
5764                           const svn_delta_editor_t **editor,
5765                           void **edit_baton,
5766                           svn_wc_traversal_info_t *ti,
5767                           apr_pool_t *pool);
5768
5769
5770 /**
5771  * Similar to svn_wc_get_update_editor3() but with the @a
5772  * allow_unver_obstructions parameter always set to FALSE, @a
5773  * conflict_func and baton set to NULL, @a fetch_func and baton set to
5774  * NULL, @a preserved_exts set to NULL, @a depth_is_sticky set to
5775  * FALSE, and @a depth set according to @a recurse: if @a recurse is
5776  * TRUE, pass #svn_depth_infinity, if FALSE, pass #svn_depth_files.
5777  *
5778  * @deprecated Provided for backward compatibility with the 1.4 API.
5779  */
5780 SVN_DEPRECATED
5781 svn_error_t *
5782 svn_wc_get_update_editor2(svn_revnum_t *target_revision,
5783                           svn_wc_adm_access_t *anchor,
5784                           const char *target,
5785                           svn_boolean_t use_commit_times,
5786                           svn_boolean_t recurse,
5787                           svn_wc_notify_func2_t notify_func,
5788                           void *notify_baton,
5789                           svn_cancel_func_t cancel_func,
5790                           void *cancel_baton,
5791                           const char *diff3_cmd,
5792                           const svn_delta_editor_t **editor,
5793                           void **edit_baton,
5794                           svn_wc_traversal_info_t *ti,
5795                           apr_pool_t *pool);
5796
5797 /**
5798  * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t
5799  * instead.
5800  *
5801  * @deprecated Provided for backward compatibility with the 1.1 API.
5802  */
5803 SVN_DEPRECATED
5804 svn_error_t *
5805 svn_wc_get_update_editor(svn_revnum_t *target_revision,
5806                          svn_wc_adm_access_t *anchor,
5807                          const char *target,
5808                          svn_boolean_t use_commit_times,
5809                          svn_boolean_t recurse,
5810                          svn_wc_notify_func_t notify_func,
5811                          void *notify_baton,
5812                          svn_cancel_func_t cancel_func,
5813                          void *cancel_baton,
5814                          const char *diff3_cmd,
5815                          const svn_delta_editor_t **editor,
5816                          void **edit_baton,
5817                          svn_wc_traversal_info_t *ti,
5818                          apr_pool_t *pool);
5819
5820 /**
5821  * DEPRECATED -- please use APIs from svn_client.h
5822  *
5823  * ---
5824  *
5825  * A variant of svn_wc_get_update_editor4().
5826  *
5827  * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
5828  * a working copy to a new @a switch_url.  (Right now, this URL must be
5829  * within the same repository that the working copy already comes
5830  * from.)  @a switch_url must not be @c NULL.
5831  *
5832  * All other parameters behave as for svn_wc_get_update_editor4().
5833  *
5834  * @since New in 1.7.
5835  * @deprecated Provided for backward compatibility with the 1.7 API.
5836  */
5837 SVN_DEPRECATED
5838 svn_error_t *
5839 svn_wc_get_switch_editor4(const svn_delta_editor_t **editor,
5840                           void **edit_baton,
5841                           svn_revnum_t *target_revision,
5842                           svn_wc_context_t *wc_ctx,
5843                           const char *anchor_abspath,
5844                           const char *target_basename,
5845                           const char *switch_url,
5846                           svn_boolean_t use_commit_times,
5847                           svn_depth_t depth,
5848                           svn_boolean_t depth_is_sticky,
5849                           svn_boolean_t allow_unver_obstructions,
5850                           svn_boolean_t server_performs_filtering,
5851                           const char *diff3_cmd,
5852                           const apr_array_header_t *preserved_exts,
5853                           svn_wc_dirents_func_t fetch_dirents_func,
5854                           void *fetch_dirents_baton,
5855                           svn_wc_conflict_resolver_func2_t conflict_func,
5856                           void *conflict_baton,
5857                           svn_wc_external_update_t external_func,
5858                           void *external_baton,
5859                           svn_cancel_func_t cancel_func,
5860                           void *cancel_baton,
5861                           svn_wc_notify_func2_t notify_func,
5862                           void *notify_baton,
5863                           apr_pool_t *result_pool,
5864                           apr_pool_t *scratch_pool);
5865
5866 /** Similar to svn_wc_get_switch_editor4, but uses access batons and relative
5867  * path instead of a working copy context and svn_wc_traversal_info_t instead
5868  * of an externals callback.
5869  *
5870  * If @a ti is non-NULL, record traversal info in @a ti, for use by
5871  * post-traversal accessors such as svn_wc_edited_externals().
5872  *
5873  * All locks, both those in @a anchor and newly acquired ones, will be
5874  * released when the editor driver calls @c close_edit.
5875  *
5876  * Always sets @a server_performs_filtering to FALSE.
5877  *
5878  * Uses a svn_wc_conflict_resolver_func_t conflict resolver instead of a
5879  * svn_wc_conflict_resolver_func2_t.
5880  *
5881  * This function assumes that @a diff3_cmd is path encoded. Later versions
5882  * assume utf-8.
5883  *
5884  * @since New in 1.5.
5885  * @deprecated Provided for backward compatibility with the 1.6 API.
5886  */
5887 SVN_DEPRECATED
5888 svn_error_t *
5889 svn_wc_get_switch_editor3(svn_revnum_t *target_revision,
5890                           svn_wc_adm_access_t *anchor,
5891                           const char *target,
5892                           const char *switch_url,
5893                           svn_boolean_t use_commit_times,
5894                           svn_depth_t depth,
5895                           svn_boolean_t depth_is_sticky,
5896                           svn_boolean_t allow_unver_obstructions,
5897                           svn_wc_notify_func2_t notify_func,
5898                           void *notify_baton,
5899                           svn_cancel_func_t cancel_func,
5900                           void *cancel_baton,
5901                           svn_wc_conflict_resolver_func_t conflict_func,
5902                           void *conflict_baton,
5903                           const char *diff3_cmd,
5904                           const apr_array_header_t *preserved_exts,
5905                           const svn_delta_editor_t **editor,
5906                           void **edit_baton,
5907                           svn_wc_traversal_info_t *ti,
5908                           apr_pool_t *pool);
5909
5910 /**
5911  * Similar to svn_wc_get_switch_editor3() but with the
5912  * @a allow_unver_obstructions parameter always set to FALSE,
5913  * @a preserved_exts set to NULL, @a conflict_func and baton set to NULL,
5914  * @a depth_is_sticky set to FALSE, and @a depth set according to @a
5915  * recurse: if @a recurse is TRUE, pass #svn_depth_infinity, if
5916  * FALSE, pass #svn_depth_files.
5917  *
5918  * @deprecated Provided for backward compatibility with the 1.4 API.
5919  */
5920 SVN_DEPRECATED
5921 svn_error_t *
5922 svn_wc_get_switch_editor2(svn_revnum_t *target_revision,
5923                           svn_wc_adm_access_t *anchor,
5924                           const char *target,
5925                           const char *switch_url,
5926                           svn_boolean_t use_commit_times,
5927                           svn_boolean_t recurse,
5928                           svn_wc_notify_func2_t notify_func,
5929                           void *notify_baton,
5930                           svn_cancel_func_t cancel_func,
5931                           void *cancel_baton,
5932                           const char *diff3_cmd,
5933                           const svn_delta_editor_t **editor,
5934                           void **edit_baton,
5935                           svn_wc_traversal_info_t *ti,
5936                           apr_pool_t *pool);
5937
5938 /**
5939  * Similar to svn_wc_get_switch_editor2(), but takes an
5940  * #svn_wc_notify_func_t instead.
5941  *
5942  * @deprecated Provided for backward compatibility with the 1.1 API.
5943  */
5944 SVN_DEPRECATED
5945 svn_error_t *
5946 svn_wc_get_switch_editor(svn_revnum_t *target_revision,
5947                          svn_wc_adm_access_t *anchor,
5948                          const char *target,
5949                          const char *switch_url,
5950                          svn_boolean_t use_commit_times,
5951                          svn_boolean_t recurse,
5952                          svn_wc_notify_func_t notify_func,
5953                          void *notify_baton,
5954                          svn_cancel_func_t cancel_func,
5955                          void *cancel_baton,
5956                          const char *diff3_cmd,
5957                          const svn_delta_editor_t **editor,
5958                          void **edit_baton,
5959                          svn_wc_traversal_info_t *ti,
5960                          apr_pool_t *pool);
5961
5962 /** @} */
5963
5964
5965 /**
5966  * @defgroup svn_wc_properties Properties
5967  * @{
5968  */
5969
5970 /** Set @a *props to a hash table mapping <tt>char *</tt> names onto
5971  * <tt>svn_string_t *</tt> values for all the regular properties of
5972  * @a local_abspath.  Allocate the table, names, and values in
5973  * @a result_pool.  If the node has no properties, then an empty hash
5974  * is returned.  Use @a wc_ctx to access the working copy, and @a
5975  * scratch_pool for temporary allocations.
5976  *
5977  * If the node does not exist, #SVN_ERR_WC_PATH_NOT_FOUND is returned.
5978  *
5979  * @since New in 1.7.
5980  */
5981 svn_error_t *
5982 svn_wc_prop_list2(apr_hash_t **props,
5983                   svn_wc_context_t *wc_ctx,
5984                   const char *local_abspath,
5985                   apr_pool_t *result_pool,
5986                   apr_pool_t *scratch_pool);
5987
5988 /** Similar to svn_wc_prop_list2() but with a #svn_wc_adm_access_t /
5989  * relative path parameter pair.
5990  *
5991  * @deprecated Provided for backwards compatibility with the 1.6 API.
5992  */
5993 SVN_DEPRECATED
5994 svn_error_t *
5995 svn_wc_prop_list(apr_hash_t **props,
5996                  const char *path,
5997                  svn_wc_adm_access_t *adm_access,
5998                  apr_pool_t *pool);
5999
6000
6001 /** Return the set of "pristine" properties for @a local_abspath.
6002  *
6003  * There are node states where properties do not make sense. For these
6004  * cases, NULL will be returned in @a *props. Otherwise, a hash table
6005  * will always be returned (but may be empty, indicating no properties).
6006  *
6007  * If the node is locally-added, then @a *props will be set to NULL since
6008  * pristine properties are undefined. Note: if this addition is replacing a
6009  * previously-deleted node, then the replaced node's properties are not
6010  * available until the addition is reverted.
6011  *
6012  * If the node has been copied (from another node in the repository), then
6013  * the pristine properties will correspond to those original properties.
6014  *
6015  * If the node is locally-deleted, these properties will correspond to
6016  * the BASE node's properties, as checked-out from the repository. Note: if
6017  * this deletion is a child of a copy, then the pristine properties will
6018  * correspond to that copy's properties, not any potential BASE node. The
6019  * BASE node's properties will not be accessible until the copy is reverted.
6020  *
6021  * Nodes that are incomplete, excluded, absent, or not present at the
6022  * node's revision will return NULL in @a props.
6023  *
6024  * If the node is not versioned, SVN_ERR_WC_PATH_NOT_FOUND will be returned.
6025  *
6026  * @a props will be allocated in @a result_pool, and all temporary
6027  * allocations will be performed in @a scratch_pool.
6028  *
6029  * @since New in 1.7.
6030  */
6031 svn_error_t *
6032 svn_wc_get_pristine_props(apr_hash_t **props,
6033                           svn_wc_context_t *wc_ctx,
6034                           const char *local_abspath,
6035                           apr_pool_t *result_pool,
6036                           apr_pool_t *scratch_pool);
6037
6038
6039 /** Set @a *value to the value of property @a name for @a local_abspath,
6040  * allocating @a *value in @a result_pool.  If no such prop, set @a *value
6041  * to @c NULL. @a name may be a regular or wc property; if it is an
6042  * entry property, return the error #SVN_ERR_BAD_PROP_KIND.  @a wc_ctx
6043  * is used to access the working copy.
6044  *
6045  * If @a local_abspath is not a versioned path, return
6046  * #SVN_ERR_WC_PATH_NOT_FOUND
6047  *
6048  * @since New in 1.7.
6049  */
6050 svn_error_t *
6051 svn_wc_prop_get2(const svn_string_t **value,
6052                  svn_wc_context_t *wc_ctx,
6053                  const char *local_abspath,
6054                  const char *name,
6055                  apr_pool_t *result_pool,
6056                  apr_pool_t *scratch_pool);
6057
6058 /** Similar to svn_wc_prop_get2(), but with a #svn_wc_adm_access_t /
6059  * relative path parameter pair.
6060  *
6061  * When @a path is not versioned, set @a *value to NULL.
6062  *
6063  * @deprecated Provided for backwards compatibility with the 1.6 API.
6064  */
6065 SVN_DEPRECATED
6066 svn_error_t *
6067 svn_wc_prop_get(const svn_string_t **value,
6068                 const char *name,
6069                 const char *path,
6070                 svn_wc_adm_access_t *adm_access,
6071                 apr_pool_t *pool);
6072
6073 /**
6074  * Set property @a name to @a value for @a local_abspath, or if @a value is
6075  * NULL, remove property @a name from @a local_abspath.  Use @a wc_ctx to
6076  * access @a local_abspath.
6077  *
6078  * @a name may be a regular property or a "wc property".  If @a name is
6079  * an "entry property", return the error #SVN_ERR_BAD_PROP_KIND (even if
6080  * @a skip_checks is TRUE).
6081  *
6082  * If @a name is a "wc property", then just update the WC DAV cache for
6083  * @a local_abspath with @a name and @a value.  In this case, @a depth
6084  * must be #svn_depth_empty.
6085  *
6086  * The rest of this description applies when @a name is a regular property.
6087  *
6088  * If @a name is a name in the reserved "svn:" name space, and @a value is
6089  * non-null, then canonicalize the property value and check the property
6090  * name and value as documented for svn_wc_canonicalize_svn_prop().
6091  * @a skip_checks controls the level of checking as documented there.
6092  *
6093  * Return an error if the canonicalization or the check fails.
6094  * The error will be either #SVN_ERR_ILLEGAL_TARGET (if the
6095  * property is not appropriate for @a path), or
6096  * #SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value
6097  * is not a valid mime-type).
6098  * ### That is not currently right -- several other errors can be raised.
6099  *
6100  * @a depth follows the usual semantics for depth.
6101  *
6102  * @a changelist_filter is an array of <tt>const char *</tt> changelist
6103  * names, used as a restrictive filter on items whose properties are
6104  * set; that is, don't set properties on any item unless it's a member
6105  * of one of those changelists.  If @a changelist_filter is empty (or
6106  * altogether @c NULL), no changelist filtering occurs.
6107  *
6108  * If @a cancel_func is non-NULL, then it will be invoked (with the
6109  * @a cancel_baton value passed) during the processing of the property
6110  * set (i.e. when @a depth indicates some amount of recursion).
6111  *
6112  * For each file or directory operated on, @a notify_func will be called
6113  * with its path and the @a notify_baton.  @a notify_func may be @c NULL
6114  * if you are not interested in this information.
6115  *
6116  * Use @a scratch_pool for temporary allocation.
6117  *
6118  * @note If the caller is setting both svn:mime-type and svn:eol-style in
6119  * separate calls, and @a skip_checks is false, there is an ordering
6120  * dependency between them, as the validity check for svn:eol-style makes
6121  * use of the current value of svn:mime-type.
6122  *
6123  * ### The error code on validity check failure should be specified, and
6124  *     should be a single code or a very small set of possibilities.
6125  *
6126  * @since New in 1.7.
6127  */
6128 svn_error_t *
6129 svn_wc_prop_set4(svn_wc_context_t *wc_ctx,
6130                  const char *local_abspath,
6131                  const char *name,
6132                  const svn_string_t *value,
6133                  svn_depth_t depth,
6134                  svn_boolean_t skip_checks,
6135                  const apr_array_header_t *changelist_filter,
6136                  svn_cancel_func_t cancel_func,
6137                  void *cancel_baton,
6138                  svn_wc_notify_func2_t notify_func,
6139                  void *notify_baton,
6140                  apr_pool_t *scratch_pool);
6141
6142 /** Similar to svn_wc_prop_set4(), but with a #svn_wc_adm_access_t /
6143  * relative path parameter pair, no @a depth parameter, no changelist
6144  * filtering (for the depth-based property setting), and no cancellation.
6145  *
6146  * @since New in 1.6.
6147  * @deprecated Provided for backwards compatibility with the 1.6 API.
6148  */
6149 SVN_DEPRECATED
6150 svn_error_t *
6151 svn_wc_prop_set3(const char *name,
6152                  const svn_string_t *value,
6153                  const char *path,
6154                  svn_wc_adm_access_t *adm_access,
6155                  svn_boolean_t skip_checks,
6156                  svn_wc_notify_func2_t notify_func,
6157                  void *notify_baton,
6158                  apr_pool_t *pool);
6159
6160
6161 /**
6162  * Like svn_wc_prop_set3(), but without the notification callbacks.
6163  *
6164  * @since New in 1.2.
6165  * @deprecated Provided for backwards compatibility with the 1.5 API.
6166  */
6167 SVN_DEPRECATED
6168 svn_error_t *
6169 svn_wc_prop_set2(const char *name,
6170                  const svn_string_t *value,
6171                  const char *path,
6172                  svn_wc_adm_access_t *adm_access,
6173                  svn_boolean_t skip_checks,
6174                  apr_pool_t *pool);
6175
6176
6177 /**
6178  * Like svn_wc_prop_set2(), but with @a skip_checks always FALSE.
6179  *
6180  * @deprecated Provided for backward compatibility with the 1.1 API.
6181  */
6182 SVN_DEPRECATED
6183 svn_error_t *
6184 svn_wc_prop_set(const char *name,
6185                 const svn_string_t *value,
6186                 const char *path,
6187                 svn_wc_adm_access_t *adm_access,
6188                 apr_pool_t *pool);
6189
6190
6191 /** Return TRUE iff @a name is a 'normal' property name.  'Normal' is
6192  * defined as a user-visible and user-tweakable property that shows up
6193  * when you fetch a proplist.
6194  *
6195  * The function currently parses the namespace like so:
6196  *
6197  *   - 'svn:wc:'  ==>  a wcprop, stored/accessed separately via different API.
6198  *
6199  *   - 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file.
6200  *
6201  * If these patterns aren't found, then the property is assumed to be
6202  * Normal.
6203  */
6204 svn_boolean_t
6205 svn_wc_is_normal_prop(const char *name);
6206
6207
6208
6209 /** Return TRUE iff @a name is a 'wc' property name. */
6210 svn_boolean_t
6211 svn_wc_is_wc_prop(const char *name);
6212
6213 /** Return TRUE iff @a name is a 'entry' property name. */
6214 svn_boolean_t
6215 svn_wc_is_entry_prop(const char *name);
6216
6217 /** Callback type used by #svn_wc_canonicalize_svn_prop.
6218  *
6219  * If @a mime_type is non-null, it sets @a *mime_type to the value of
6220  * #SVN_PROP_MIME_TYPE for the path passed to
6221  * #svn_wc_canonicalize_svn_prop (allocated from @a pool).  If @a
6222  * stream is non-null, it writes the contents of the file to @a
6223  * stream.
6224  *
6225  * (Currently, this is used if you are attempting to set the
6226  * #SVN_PROP_EOL_STYLE property, to make sure that the value matches
6227  * the mime type and contents.)
6228  *
6229  * @since New in 1.5.
6230  */
6231 typedef svn_error_t *(*svn_wc_canonicalize_svn_prop_get_file_t)(
6232   const svn_string_t **mime_type,
6233   svn_stream_t *stream,
6234   void *baton,
6235   apr_pool_t *pool);
6236
6237
6238 /** Canonicalize the value of an svn:* property @a propname with
6239  * value @a propval.
6240  *
6241  * If the property is not appropriate for a node of kind @a kind, or
6242  * is otherwise invalid, throw an error.  Otherwise, set @a *propval_p
6243  * to a canonicalized version of the property value.
6244  *
6245  * The exact set of canonicalizations and checks may vary across different
6246  * versions of this API.  Currently:
6247  *
6248  *   - svn:executable
6249  *   - svn:needs-lock
6250  *   - svn:special
6251  *     - set the value to '*'
6252  *
6253  *   - svn:keywords
6254  *     - strip leading and trailing white space
6255  *
6256  *   - svn:ignore
6257  *   - svn:global-ignores
6258  *   - svn:auto-props
6259  *     - add a final a newline character if missing
6260  *
6261  *   - svn:externals
6262  *     - add a final a newline character if missing
6263  *     - check for valid syntax
6264  *     - check for no duplicate entries
6265  *
6266  *   - svn:mergeinfo
6267  *     - canonicalize
6268  *     - check for validity
6269  *
6270  * Also, unless @a skip_some_checks is TRUE:
6271  *
6272  *   - svn:eol-style
6273  *     - strip leading and trailing white space
6274  *     - check value is recognized
6275  *     - check file content has a self-consistent EOL style
6276  *       (but not necessarily that it matches @a propval)
6277  *
6278  *   - svn:mime-type
6279  *     - strip white space
6280  *     - check for reasonable syntax
6281  *
6282  * The EOL-style check (if not skipped) requires access to the contents and
6283  * MIME type of the target if it is a file.  It will call @a prop_getter with
6284  * @a getter_baton.  The callback must set the MIME type and/or write the
6285  * contents of the file to the given stream.  If @a skip_some_checks is true,
6286  * then @a prop_getter is not used and may be NULL.
6287  *
6288  * @a path should be the path of the file in question; it is only used
6289  * for error messages.
6290  *
6291  * ### The error code on validity check failure should be specified, and
6292  *     should be a single code or a very small set of possibilities.
6293  *
6294  * ### This is not actually related to the WC, but it does need to call
6295  * ### svn_wc_parse_externals_description3.
6296  *
6297  * @since New in 1.5.
6298  */
6299 svn_error_t *
6300 svn_wc_canonicalize_svn_prop(const svn_string_t **propval_p,
6301                              const char *propname,
6302                              const svn_string_t *propval,
6303                              const char *path,
6304                              svn_node_kind_t kind,
6305                              svn_boolean_t skip_some_checks,
6306                              svn_wc_canonicalize_svn_prop_get_file_t prop_getter,
6307                              void *getter_baton,
6308                              apr_pool_t *pool);
6309
6310 /** @} */
6311
6312 \f
6313 /**
6314  * @defgroup svn_wc_diffs Diffs
6315  * @{
6316  */
6317
6318 /**
6319  * DEPRECATED -- please use APIs from svn_client.h
6320  *
6321  * ---
6322  *
6323  * Return an @a editor/@a edit_baton for diffing a working copy against the
6324  * repository. The editor is allocated in @a result_pool; temporary
6325  * calculations are performed in @a scratch_pool.
6326  *
6327  * This editor supports diffing either the actual files and properties in the
6328  * working copy (when @a use_text_base is #FALSE), or the current pristine
6329  * information (when @a use_text_base is #TRUE) against the editor driver.
6330  *
6331  * @a anchor_abspath/@a target represent the base of the hierarchy to be
6332  * compared. The diff callback paths will be relative to this path.
6333  *
6334  * Diffs will be reported as valid relpaths, with @a anchor_abspath being
6335  * the root ("").
6336  *
6337  * @a callbacks/@a callback_baton is the callback table to use.
6338  *
6339  * If @a depth is #svn_depth_empty, just diff exactly @a target or
6340  * @a anchor_path if @a target is empty.  If #svn_depth_files then do the same
6341  * and for top-level file entries as well (if any).  If
6342  * #svn_depth_immediates, do the same as #svn_depth_files but also diff
6343  * top-level subdirectories at #svn_depth_empty.  If #svn_depth_infinity,
6344  * then diff fully recursively.
6345  *
6346  * @a ignore_ancestry determines whether paths that have discontinuous node
6347  * ancestry are treated as delete/add or as simple modifications.  If
6348  * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
6349  * result in the diff given as a full delete followed by an add.
6350  *
6351  * @a show_copies_as_adds determines whether paths added with history will
6352  * appear as a diff against their copy source, or whether such paths will
6353  * appear as if they were newly added in their entirety.
6354  * @a show_copies_as_adds implies not @a ignore_ancestry.
6355  *
6356  * If @a use_git_diff_format is TRUE, copied paths will be treated as added
6357  * if they weren't modified after being copied. This allows the callbacks
6358  * to generate appropriate --git diff headers for such files.
6359  * @a use_git_diff_format implies @a show_copies_as_adds, and as such implies
6360  * not @a ignore_ancestry.
6361  *
6362  * Normally, the difference from repository->working_copy is shown.
6363  * If @a reverse_order is TRUE, then show working_copy->repository diffs.
6364  *
6365  * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
6366  * to periodically check if the client has canceled the operation.
6367  *
6368  * @a changelist_filter is an array of <tt>const char *</tt> changelist
6369  * names, used as a restrictive filter on items whose differences are
6370  * reported; that is, don't generate diffs about any item unless
6371  * it's a member of one of those changelists.  If @a changelist_filter is
6372  * empty (or altogether @c NULL), no changelist filtering occurs.
6373  *
6374   * If @a server_performs_filtering is TRUE, assume that the server handles
6375  * the ambient depth filtering, so this doesn't have to be handled in the
6376  * editor.
6377  *
6378  * @since New in 1.7.
6379  * @deprecated Provided for backward compatibility with the 1.7 API.
6380  */
6381 SVN_DEPRECATED
6382 svn_error_t *
6383 svn_wc_get_diff_editor6(const svn_delta_editor_t **editor,
6384                         void **edit_baton,
6385                         svn_wc_context_t *wc_ctx,
6386                         const char *anchor_abspath,
6387                         const char *target,
6388                         svn_depth_t depth,
6389                         svn_boolean_t ignore_ancestry,
6390                         svn_boolean_t show_copies_as_adds,
6391                         svn_boolean_t use_git_diff_format,
6392                         svn_boolean_t use_text_base,
6393                         svn_boolean_t reverse_order,
6394                         svn_boolean_t server_performs_filtering,
6395                         const apr_array_header_t *changelist_filter,
6396                         const svn_wc_diff_callbacks4_t *callbacks,
6397                         void *callback_baton,
6398                         svn_cancel_func_t cancel_func,
6399                         void *cancel_baton,
6400                         apr_pool_t *result_pool,
6401                         apr_pool_t *scratch_pool);
6402
6403 /**
6404  * Similar to svn_wc_get_diff_editor6(), but with an access baton and relative
6405  * path. @a server_performs_filtering always true and with a
6406  * #svn_wc_diff_callbacks3_t instead of #svn_wc_diff_callbacks4_t,
6407  * @a show_copies_as_adds, and @a use_git_diff_format set to @c FALSE.
6408  *
6409  * Diffs will be reported as below the relative path stored in @a anchor.
6410  *
6411  * @since New in 1.6.
6412  *
6413  * @deprecated Provided for backward compatibility with the 1.6 API.
6414  */
6415 SVN_DEPRECATED
6416 svn_error_t *
6417 svn_wc_get_diff_editor5(svn_wc_adm_access_t *anchor,
6418                         const char *target,
6419                         const svn_wc_diff_callbacks3_t *callbacks,
6420                         void *callback_baton,
6421                         svn_depth_t depth,
6422                         svn_boolean_t ignore_ancestry,
6423                         svn_boolean_t use_text_base,
6424                         svn_boolean_t reverse_order,
6425                         svn_cancel_func_t cancel_func,
6426                         void *cancel_baton,
6427                         const apr_array_header_t *changelist_filter,
6428                         const svn_delta_editor_t **editor,
6429                         void **edit_baton,
6430                         apr_pool_t *pool);
6431
6432 /**
6433  * Similar to svn_wc_get_diff_editor5(), but with an
6434  * #svn_wc_diff_callbacks2_t instead of #svn_wc_diff_callbacks3_t.
6435  *
6436  * @deprecated Provided for backward compatibility with the 1.5 API.
6437  */
6438 SVN_DEPRECATED
6439 svn_error_t *
6440 svn_wc_get_diff_editor4(svn_wc_adm_access_t *anchor,
6441                         const char *target,
6442                         const svn_wc_diff_callbacks2_t *callbacks,
6443                         void *callback_baton,
6444                         svn_depth_t depth,
6445                         svn_boolean_t ignore_ancestry,
6446                         svn_boolean_t use_text_base,
6447                         svn_boolean_t reverse_order,
6448                         svn_cancel_func_t cancel_func,
6449                         void *cancel_baton,
6450                         const apr_array_header_t *changelist_filter,
6451                         const svn_delta_editor_t **editor,
6452                         void **edit_baton,
6453                         apr_pool_t *pool);
6454
6455 /**
6456  * Similar to svn_wc_get_diff_editor4(), but with @a changelist_filter
6457  * passed as @c NULL, and @a depth set to #svn_depth_infinity if @a
6458  * recurse is TRUE, or #svn_depth_files if @a recurse is FALSE.
6459  *
6460  * @deprecated Provided for backward compatibility with the 1.4 API.
6461
6462  * @since New in 1.2.
6463  */
6464 SVN_DEPRECATED
6465 svn_error_t *
6466 svn_wc_get_diff_editor3(svn_wc_adm_access_t *anchor,
6467                         const char *target,
6468                         const svn_wc_diff_callbacks2_t *callbacks,
6469                         void *callback_baton,
6470                         svn_boolean_t recurse,
6471                         svn_boolean_t ignore_ancestry,
6472                         svn_boolean_t use_text_base,
6473                         svn_boolean_t reverse_order,
6474                         svn_cancel_func_t cancel_func,
6475                         void *cancel_baton,
6476                         const svn_delta_editor_t **editor,
6477                         void **edit_baton,
6478                         apr_pool_t *pool);
6479
6480
6481 /**
6482  * Similar to svn_wc_get_diff_editor3(), but with an
6483  * #svn_wc_diff_callbacks_t instead of #svn_wc_diff_callbacks2_t.
6484  *
6485  * @deprecated Provided for backward compatibility with the 1.1 API.
6486  */
6487 SVN_DEPRECATED
6488 svn_error_t *
6489 svn_wc_get_diff_editor2(svn_wc_adm_access_t *anchor,
6490                         const char *target,
6491                         const svn_wc_diff_callbacks_t *callbacks,
6492                         void *callback_baton,
6493                         svn_boolean_t recurse,
6494                         svn_boolean_t ignore_ancestry,
6495                         svn_boolean_t use_text_base,
6496                         svn_boolean_t reverse_order,
6497                         svn_cancel_func_t cancel_func,
6498                         void *cancel_baton,
6499                         const svn_delta_editor_t **editor,
6500                         void **edit_baton,
6501                         apr_pool_t *pool);
6502
6503
6504 /**
6505  * Similar to svn_wc_get_diff_editor2(), but with @a ignore_ancestry
6506  * always set to @c FALSE.
6507  *
6508  * @deprecated Provided for backward compatibility with the 1.0 API.
6509  */
6510 SVN_DEPRECATED
6511 svn_error_t *
6512 svn_wc_get_diff_editor(svn_wc_adm_access_t *anchor,
6513                        const char *target,
6514                        const svn_wc_diff_callbacks_t *callbacks,
6515                        void *callback_baton,
6516                        svn_boolean_t recurse,
6517                        svn_boolean_t use_text_base,
6518                        svn_boolean_t reverse_order,
6519                        svn_cancel_func_t cancel_func,
6520                        void *cancel_baton,
6521                        const svn_delta_editor_t **editor,
6522                        void **edit_baton,
6523                        apr_pool_t *pool);
6524
6525
6526 /**
6527  * Compare working copy against the text-base.
6528  *
6529  * @a target_abspath represents the base of the hierarchy to be compared.
6530  *
6531  * @a callbacks/@a callback_baton is the callback table to use when two
6532  * files are to be compared.
6533  *
6534  * If @a depth is #svn_depth_empty, just diff exactly @a target_path.
6535  * If #svn_depth_files then do the same
6536  * and for top-level file entries as well (if any).  If
6537  * #svn_depth_immediates, do the same as #svn_depth_files but also diff
6538  * top-level subdirectories at #svn_depth_empty.  If #svn_depth_infinity,
6539  * then diff fully recursively.
6540  *
6541  * @a ignore_ancestry determines whether paths that have discontinuous node
6542  * ancestry are treated as delete/add or as simple modifications.  If
6543  * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
6544  * result in the diff given as a full delete followed by an add.
6545  *
6546  * @a show_copies_as_adds determines whether paths added with history will
6547  * appear as a diff against their copy source, or whether such paths will
6548  * appear as if they were newly added in their entirety.
6549  *
6550  * If @a use_git_diff_format is TRUE, copied paths will be treated as added
6551  * if they weren't modified after being copied. This allows the callbacks
6552  * to generate appropriate --git diff headers for such files.
6553  *
6554  * @a changelist_filter is an array of <tt>const char *</tt> changelist
6555  * names, used as a restrictive filter on items whose differences are
6556  * reported; that is, don't generate diffs about any item unless
6557  * it's a member of one of those changelists.  If @a changelist_filter is
6558  * empty (or altogether @c NULL), no changelist filtering occurs.
6559  *
6560  * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at various
6561  * points during the operation.  If it returns an error (typically
6562  * #SVN_ERR_CANCELLED), return that error immediately.
6563  *
6564  * @since New in 1.7.
6565  */
6566 svn_error_t *
6567 svn_wc_diff6(svn_wc_context_t *wc_ctx,
6568              const char *target_abspath,
6569              const svn_wc_diff_callbacks4_t *callbacks,
6570              void *callback_baton,
6571              svn_depth_t depth,
6572              svn_boolean_t ignore_ancestry,
6573              svn_boolean_t show_copies_as_adds,
6574              svn_boolean_t use_git_diff_format,
6575              const apr_array_header_t *changelist_filter,
6576              svn_cancel_func_t cancel_func,
6577              void *cancel_baton,
6578              apr_pool_t *scratch_pool);
6579
6580 /**
6581  * Similar to svn_wc_diff6(), but with a #svn_wc_diff_callbacks3_t argument
6582  * instead of #svn_wc_diff_callbacks4_t, @a show_copies_as_adds,
6583  * and @a use_git_diff_format set to * @c FALSE.
6584  * It also doesn't allow specifying a cancel function.
6585  *
6586  * @since New in 1.6.
6587  * @deprecated Provided for backward compatibility with the 1.6 API.
6588  */
6589 SVN_DEPRECATED
6590 svn_error_t *
6591 svn_wc_diff5(svn_wc_adm_access_t *anchor,
6592              const char *target,
6593              const svn_wc_diff_callbacks3_t *callbacks,
6594              void *callback_baton,
6595              svn_depth_t depth,
6596              svn_boolean_t ignore_ancestry,
6597              const apr_array_header_t *changelist_filter,
6598              apr_pool_t *pool);
6599
6600 /**
6601  * Similar to svn_wc_diff5(), but with a #svn_wc_diff_callbacks2_t argument
6602  * instead of #svn_wc_diff_callbacks3_t.
6603  *
6604  * @since New in 1.5.
6605  * @deprecated Provided for backward compatibility with the 1.5 API.
6606  */
6607 SVN_DEPRECATED
6608 svn_error_t *
6609 svn_wc_diff4(svn_wc_adm_access_t *anchor,
6610              const char *target,
6611              const svn_wc_diff_callbacks2_t *callbacks,
6612              void *callback_baton,
6613              svn_depth_t depth,
6614              svn_boolean_t ignore_ancestry,
6615              const apr_array_header_t *changelist_filter,
6616              apr_pool_t *pool);
6617
6618 /**
6619  * Similar to svn_wc_diff4(), but with @a changelist_filter passed @c NULL,
6620  * and @a depth set to #svn_depth_infinity if @a recurse is TRUE, or
6621  * #svn_depth_files if @a recurse is FALSE.
6622  *
6623  * @since New in 1.2.
6624  * @deprecated Provided for backward compatibility with the 1.4 API.
6625  */
6626 SVN_DEPRECATED
6627 svn_error_t *
6628 svn_wc_diff3(svn_wc_adm_access_t *anchor,
6629              const char *target,
6630              const svn_wc_diff_callbacks2_t *callbacks,
6631              void *callback_baton,
6632              svn_boolean_t recurse,
6633              svn_boolean_t ignore_ancestry,
6634              apr_pool_t *pool);
6635
6636 /**
6637  * Similar to svn_wc_diff3(), but with a #svn_wc_diff_callbacks_t argument
6638  * instead of #svn_wc_diff_callbacks2_t.
6639  *
6640  * @since New in 1.1.
6641  * @deprecated Provided for backward compatibility with the 1.1 API.
6642  */
6643 SVN_DEPRECATED
6644 svn_error_t *
6645 svn_wc_diff2(svn_wc_adm_access_t *anchor,
6646              const char *target,
6647              const svn_wc_diff_callbacks_t *callbacks,
6648              void *callback_baton,
6649              svn_boolean_t recurse,
6650              svn_boolean_t ignore_ancestry,
6651              apr_pool_t *pool);
6652
6653 /**
6654  * Similar to svn_wc_diff2(), but with @a ignore_ancestry always set
6655  * to @c FALSE.
6656  *
6657  * @deprecated Provided for backward compatibility with the 1.0 API.
6658  */
6659 SVN_DEPRECATED
6660 svn_error_t *
6661 svn_wc_diff(svn_wc_adm_access_t *anchor,
6662             const char *target,
6663             const svn_wc_diff_callbacks_t *callbacks,
6664             void *callback_baton,
6665             svn_boolean_t recurse,
6666             apr_pool_t *pool);
6667
6668
6669 /** Given a @a local_abspath to a file or directory under version control,
6670  * discover any local changes made to properties and/or the set of 'pristine'
6671  * properties.  @a wc_ctx will be used to access the working copy.
6672  *
6673  * If @a propchanges is non-@c NULL, return these changes as an array of
6674  * #svn_prop_t structures stored in @a *propchanges.  The structures and
6675  * array will be allocated in @a result_pool.  If there are no local property
6676  * modifications on @a local_abspath, then set @a *propchanges will be empty.
6677  *
6678  * If @a original_props is non-@c NULL, then set @a *original_props to
6679  * hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
6680  * that represents the 'pristine' property list of @a path.  This hashtable is
6681  * allocated in @a result_pool.
6682  *
6683  * Use @a scratch_pool for temporary allocations.
6684  */
6685 svn_error_t *
6686 svn_wc_get_prop_diffs2(apr_array_header_t **propchanges,
6687                        apr_hash_t **original_props,
6688                        svn_wc_context_t *wc_ctx,
6689                        const char *local_abspath,
6690                        apr_pool_t *result_pool,
6691                        apr_pool_t *scratch_pool);
6692
6693 /** Similar to svn_wc_get_prop_diffs2(), but with a #svn_wc_adm_access_t /
6694  * relative path parameter pair.
6695  *
6696  * @deprecated Provided for backwards compatibility with the 1.6 API.
6697  */
6698 SVN_DEPRECATED
6699 svn_error_t *
6700 svn_wc_get_prop_diffs(apr_array_header_t **propchanges,
6701                       apr_hash_t **original_props,
6702                       const char *path,
6703                       svn_wc_adm_access_t *adm_access,
6704                       apr_pool_t *pool);
6705
6706 /** @} */
6707
6708
6709 /**
6710  * @defgroup svn_wc_merging Merging
6711  * @{
6712  */
6713
6714 /** The outcome of a merge carried out (or tried as a dry-run) by
6715  * svn_wc_merge()
6716  */
6717 typedef enum svn_wc_merge_outcome_t
6718 {
6719    /** The working copy is (or would be) unchanged.  The changes to be
6720     * merged were already present in the working copy
6721     */
6722    svn_wc_merge_unchanged,
6723
6724    /** The working copy has been (or would be) changed. */
6725    svn_wc_merge_merged,
6726
6727    /** The working copy has been (or would be) changed, but there was (or
6728     * would be) a conflict
6729     */
6730    svn_wc_merge_conflict,
6731
6732    /** No merge was performed, probably because the target file was
6733     * either absent or not under version control.
6734     */
6735    svn_wc_merge_no_merge
6736
6737 } svn_wc_merge_outcome_t;
6738
6739 /** Given absolute paths to three fulltexts, merge the differences between
6740  * @a left_abspath and @a right_abspath into @a target_abspath.
6741  * It may help to know that @a left_abspath, @a right_abspath and @a
6742  * target_abspath correspond to "OLDER", "YOURS", and "MINE",
6743  * respectively, in the diff3 documentation.
6744  *
6745  * @a wc_ctx should contain a write lock for the directory containing @a
6746  * target_abspath.
6747  *
6748  * This function assumes that @a left_abspath and @a right_abspath are
6749  * in repository-normal form (linefeeds, with keywords contracted); if
6750  * necessary, @a target_abspath is temporarily converted to this form to
6751  * receive the changes, then translated back again.
6752  *
6753  * If @a target_abspath is absent, or present but not under version
6754  * control, then set @a *merge_content_outcome to #svn_wc_merge_no_merge and
6755  * return success without merging anything.  (The reasoning is that if
6756  * the file is not versioned, then it is probably unrelated to the
6757  * changes being considered, so they should not be merged into it.
6758  * Furthermore, merging into an unversioned file is a lossy operation.)
6759  *
6760  * @a dry_run determines whether the working copy is modified.  When it
6761  * is @c FALSE the merge will cause @a target_abspath to be modified, when
6762  * it is @c TRUE the merge will be carried out to determine the result but
6763  * @a target_abspath will not be modified.
6764  *
6765  * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
6766  * any merging; otherwise, use the built-in merge code.  If @a
6767  * merge_options is non-NULL, either pass its elements to @a diff3_cmd or
6768  * parse it and use as options to the internal merge code (see
6769  * svn_diff_file_options_parse()).  @a merge_options must contain
6770  * <tt>const char *</tt> elements.
6771  *
6772  * If @a merge_props_state is non-NULL, merge @a prop_diff into the
6773  * working properties before merging the text.  (If @a merge_props_state
6774  * is NULL, do not merge any property changes; in this case, @a prop_diff
6775  * is only used to help determine the text merge result.)  Handle any
6776  * conflicts as described for svn_wc_merge_props3(), with the parameters
6777  * @a dry_run, @a conflict_func and @a conflict_baton.  Return the
6778  * outcome of the property merge in @a *merge_props_state.
6779  *
6780  * The outcome of the text merge is returned in @a *merge_content_outcome. If
6781  * there is a conflict and @a dry_run is @c FALSE, then attempt to call @a
6782  * conflict_func with @a conflict_baton (if non-NULL).  If the
6783  * conflict callback cannot resolve the conflict, then:
6784  *
6785  *   * Put conflict markers around the conflicting regions in
6786  *     @a target_abspath, labeled with @a left_label, @a right_label, and
6787  *     @a target_label.  (If any of these labels are @c NULL, default
6788  *     values will be used.)
6789  *
6790  *   * Copy @a left_abspath, @a right_abspath, and the original @a
6791  *     target_abspath to unique names in the same directory as @a
6792  *     target_abspath, ending with the suffixes ".LEFT_LABEL", ".RIGHT_LABEL",
6793  *     and ".TARGET_LABEL" respectively.
6794  *
6795  *   * Mark @a target_abspath as "text-conflicted", and track the above
6796  *     mentioned backup files as well.
6797  *
6798  *   * If @a left_version and/or @a right_version are not NULL, provide
6799  *     these values to the conflict handler and track these while the conflict
6800  *     exists.
6801  *
6802  * Binary case:
6803  *
6804  *  If @a target_abspath is a binary file, then no merging is attempted,
6805  *  the merge is deemed to be a conflict.  If @a dry_run is @c FALSE the
6806  *  working @a target_abspath is untouched, and copies of @a left_abspath and
6807  *  @a right_abspath are created next to it using @a left_label and
6808  *  @a right_label. @a target_abspath is marked as "text-conflicted", and
6809  *  begins tracking the two backup files and the version information.
6810  *
6811  * If @a dry_run is @c TRUE no files are changed.  The outcome of the merge
6812  * is returned in @a *merge_content_outcome.
6813  * ### (and what about @a *merge_props_state?)
6814  *
6815  * ### BH: Two kinds of outcome is not how it should be.
6816  *
6817  * ### For text, we report the outcome as 'merged' if there was some
6818  *     incoming change that we dealt with (even if we decided to no-op?)
6819  *     but the callers then convert this outcome into a notification
6820  *     of 'merged' only if there was already a local modification;
6821  *     otherwise they notify it as simply 'updated'.  But for props
6822  *     we report a notify state of 'merged' here if there was an
6823  *     incoming change regardless of the local-mod state.  Inconsistent.
6824  *
6825  * Use @a scratch_pool for any temporary allocation.
6826  *
6827  * @since New in 1.8.
6828  */
6829 svn_error_t *
6830 svn_wc_merge5(enum svn_wc_merge_outcome_t *merge_content_outcome,
6831               enum svn_wc_notify_state_t *merge_props_state,
6832               svn_wc_context_t *wc_ctx,
6833               const char *left_abspath,
6834               const char *right_abspath,
6835               const char *target_abspath,
6836               const char *left_label,
6837               const char *right_label,
6838               const char *target_label,
6839               const svn_wc_conflict_version_t *left_version,
6840               const svn_wc_conflict_version_t *right_version,
6841               svn_boolean_t dry_run,
6842               const char *diff3_cmd,
6843               const apr_array_header_t *merge_options,
6844               apr_hash_t *original_props,
6845               const apr_array_header_t *prop_diff,
6846               svn_wc_conflict_resolver_func2_t conflict_func,
6847               void *conflict_baton,
6848               svn_cancel_func_t cancel_func,
6849               void *cancel_baton,
6850               apr_pool_t *scratch_pool);
6851
6852 /** Similar to svn_wc_merge5() but with @a merge_props_state and @a
6853  * original_props always passed as NULL.
6854  *
6855  * Unlike svn_wc_merge5(), this function doesn't merge property
6856  * changes.  Callers of this function must first use
6857  * svn_wc_merge_props3() to get this functionality.
6858  *
6859  * @since New in 1.7.
6860  * @deprecated Provided for backwards compatibility with the 1.7 API.
6861  */
6862 SVN_DEPRECATED
6863 svn_error_t *
6864 svn_wc_merge4(enum svn_wc_merge_outcome_t *merge_outcome,
6865               svn_wc_context_t *wc_ctx,
6866               const char *left_abspath,
6867               const char *right_abspath,
6868               const char *target_abspath,
6869               const char *left_label,
6870               const char *right_label,
6871               const char *target_label,
6872               const svn_wc_conflict_version_t *left_version,
6873               const svn_wc_conflict_version_t *right_version,
6874               svn_boolean_t dry_run,
6875               const char *diff3_cmd,
6876               const apr_array_header_t *merge_options,
6877               const apr_array_header_t *prop_diff,
6878               svn_wc_conflict_resolver_func2_t conflict_func,
6879               void *conflict_baton,
6880               svn_cancel_func_t cancel_func,
6881               void *cancel_baton,
6882               apr_pool_t *scratch_pool);
6883
6884
6885 /** Similar to svn_wc_merge4() but takes relative paths and an access
6886  * baton. It doesn't support a cancel function or tracking origin version
6887  * information.
6888  *
6889  * Uses a svn_wc_conflict_resolver_func_t conflict resolver instead of a
6890  * svn_wc_conflict_resolver_func2_t.
6891  *
6892  * This function assumes that @a diff3_cmd is path encoded. Later versions
6893  * assume utf-8.
6894  *
6895  * @since New in 1.5.
6896  * @deprecated Provided for backwards compatibility with the 1.6 API.
6897  */
6898 SVN_DEPRECATED
6899 svn_error_t *
6900 svn_wc_merge3(enum svn_wc_merge_outcome_t *merge_outcome,
6901               const char *left,
6902               const char *right,
6903               const char *merge_target,
6904               svn_wc_adm_access_t *adm_access,
6905               const char *left_label,
6906               const char *right_label,
6907               const char *target_label,
6908               svn_boolean_t dry_run,
6909               const char *diff3_cmd,
6910               const apr_array_header_t *merge_options,
6911               const apr_array_header_t *prop_diff,
6912               svn_wc_conflict_resolver_func_t conflict_func,
6913               void *conflict_baton,
6914               apr_pool_t *pool);
6915
6916
6917 /** Similar to svn_wc_merge3(), but with @a prop_diff, @a
6918  * conflict_func, @a conflict_baton set to NULL.
6919  *
6920  * @deprecated Provided for backwards compatibility with the 1.4 API.
6921  */
6922 SVN_DEPRECATED
6923 svn_error_t *
6924 svn_wc_merge2(enum svn_wc_merge_outcome_t *merge_outcome,
6925               const char *left,
6926               const char *right,
6927               const char *merge_target,
6928               svn_wc_adm_access_t *adm_access,
6929               const char *left_label,
6930               const char *right_label,
6931               const char *target_label,
6932               svn_boolean_t dry_run,
6933               const char *diff3_cmd,
6934               const apr_array_header_t *merge_options,
6935               apr_pool_t *pool);
6936
6937
6938 /** Similar to svn_wc_merge2(), but with @a merge_options set to NULL.
6939  *
6940  * @deprecated Provided for backwards compatibility with the 1.3 API.
6941  */
6942 SVN_DEPRECATED
6943 svn_error_t *
6944 svn_wc_merge(const char *left,
6945              const char *right,
6946              const char *merge_target,
6947              svn_wc_adm_access_t *adm_access,
6948              const char *left_label,
6949              const char *right_label,
6950              const char *target_label,
6951              svn_boolean_t dry_run,
6952              enum svn_wc_merge_outcome_t *merge_outcome,
6953              const char *diff3_cmd,
6954              apr_pool_t *pool);
6955
6956
6957 /** Given a @a local_abspath under version control, merge an array of @a
6958  * propchanges into the path's existing properties.  @a propchanges is
6959  * an array of #svn_prop_t objects, and @a baseprops is a hash
6960  * representing the original set of properties that @a propchanges is
6961  * working against.  @a wc_ctx contains a lock for @a local_abspath.
6962  *
6963  * Only the working properties will be changed.
6964  *
6965  * If @a state is non-NULL, set @a *state to the state of the properties
6966  * after the merge.
6967  *
6968  * If a conflict is found when merging a property, and @a dry_run is
6969  * false and @a conflict_func is not null, then call @a conflict_func
6970  * with @a conflict_baton and a description of the conflict.  If any
6971  * conflicts are not resolved by such callbacks, describe the unresolved
6972  * conflicts in a temporary .prej file (or append to an already-existing
6973  * .prej file) and mark the path as conflicted in the WC DB.
6974  *
6975  * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at various
6976  * points during the operation.  If it returns an error (typically
6977  * #SVN_ERR_CANCELLED), return that error immediately.
6978  *
6979  * If @a local_abspath is not under version control, return the error
6980  * #SVN_ERR_WC_PATH_NOT_FOUND and don't touch anyone's properties.
6981  *
6982  * If @a local_abspath has a status in which it doesn't have properties
6983  * (E.g. deleted) return the error SVN_ERR_WC_PATH_UNEXPECTED_STATUS.
6984  *
6985  * @since New in 1.7.
6986  */
6987 svn_error_t *
6988 svn_wc_merge_props3(svn_wc_notify_state_t *state,
6989                     svn_wc_context_t *wc_ctx,
6990                     const char *local_abspath,
6991                     const svn_wc_conflict_version_t *left_version,
6992                     const svn_wc_conflict_version_t *right_version,
6993                     apr_hash_t *baseprops,
6994                     const apr_array_header_t *propchanges,
6995                     svn_boolean_t dry_run,
6996                     svn_wc_conflict_resolver_func2_t conflict_func,
6997                     void *conflict_baton,
6998                     svn_cancel_func_t cancel_func,
6999                     void *cancel_baton,
7000                     apr_pool_t *scratch_pool);
7001
7002
7003 /** Similar to svn_wc_merge_props3, but takes an access baton and relative
7004  * path, no cancel_function, and no left and right version.
7005  *
7006  * This function has the @a base_merge parameter which (when TRUE) will
7007  * apply @a propchanges to this node's pristine set of properties. This
7008  * functionality is not supported since API version 1.7 and will give an
7009  * error if requested (unless @a dry_run is TRUE). For details see
7010  * 'notes/api-errata/1.7/wc006.txt'.
7011  *
7012  * Uses a svn_wc_conflict_resolver_func_t conflict resolver instead of a
7013  * svn_wc_conflict_resolver_func2_t.
7014  *
7015  * For compatibility reasons this function returns
7016  * #SVN_ERR_UNVERSIONED_RESOURCE, when svn_wc_merge_props3 would return either
7017  * #SVN_ERR_WC_PATH_NOT_FOUND or #SVN_ERR_WC_PATH_UNEXPECTED_STATUS.
7018  *
7019  * @since New in 1.5. The base_merge option is not supported since 1.7.
7020  * @deprecated Provided for backward compatibility with the 1.6 API.
7021  */
7022 SVN_DEPRECATED
7023 svn_error_t *
7024 svn_wc_merge_props2(svn_wc_notify_state_t *state,
7025                     const char *path,
7026                     svn_wc_adm_access_t *adm_access,
7027                     apr_hash_t *baseprops,
7028                     const apr_array_header_t *propchanges,
7029                     svn_boolean_t base_merge,
7030                     svn_boolean_t dry_run,
7031                     svn_wc_conflict_resolver_func_t conflict_func,
7032                     void *conflict_baton,
7033                     apr_pool_t *pool);
7034
7035
7036 /**
7037  * Same as svn_wc_merge_props2(), but with a @a conflict_func (and
7038  * baton) of NULL.
7039  *
7040  * @since New in 1.3. The base_merge option is not supported since 1.7.
7041  * @deprecated Provided for backward compatibility with the 1.4 API.
7042  */
7043 SVN_DEPRECATED
7044 svn_error_t *
7045 svn_wc_merge_props(svn_wc_notify_state_t *state,
7046                    const char *path,
7047                    svn_wc_adm_access_t *adm_access,
7048                    apr_hash_t *baseprops,
7049                    const apr_array_header_t *propchanges,
7050                    svn_boolean_t base_merge,
7051                    svn_boolean_t dry_run,
7052                    apr_pool_t *pool);
7053
7054
7055 /**
7056  * Similar to svn_wc_merge_props(), but no baseprops are given.
7057  * Instead, it's assumed that the incoming propchanges are based
7058  * against the working copy's own baseprops.  While this assumption is
7059  * correct for 'svn update', it's incorrect for 'svn merge', and can
7060  * cause flawed behavior.  (See issue #2035.)
7061  *
7062  * @since The base_merge option is not supported since 1.7.
7063  * @deprecated Provided for backward compatibility with the 1.2 API.
7064  * Replaced by svn_wc_merge_props().
7065  */
7066 SVN_DEPRECATED
7067 svn_error_t *
7068 svn_wc_merge_prop_diffs(svn_wc_notify_state_t *state,
7069                         const char *path,
7070                         svn_wc_adm_access_t *adm_access,
7071                         const apr_array_header_t *propchanges,
7072                         svn_boolean_t base_merge,
7073                         svn_boolean_t dry_run,
7074                         apr_pool_t *pool);
7075
7076 /** @} */
7077
7078
7079 /** Given a @a path to a wc file, return in @a *contents a readonly stream to
7080  * the pristine contents of the file that would serve as base content for the
7081  * next commit. That means:
7082  *
7083  * When there is no change in node history scheduled, i.e. when there are only
7084  * local text-mods, prop-mods or a delete, return the last checked-out or
7085  * updated-/switched-to contents of the file.
7086  *
7087  * If the file is simply added or replaced (no copy-/move-here involved),
7088  * set @a *contents to @c NULL.
7089  *
7090  * When the file has been locally copied-/moved-here, return the contents of
7091  * the copy/move source (even if the copy-/move-here replaces a locally
7092  * deleted file).
7093  *
7094  * If @a local_abspath refers to an unversioned or non-existing path, return
7095  * @c SVN_ERR_WC_PATH_NOT_FOUND. Use @a wc_ctx to access the working copy.
7096  * @a contents may not be @c NULL (unlike @a *contents).
7097  *
7098  * @since New in 1.7. */
7099 svn_error_t *
7100 svn_wc_get_pristine_contents2(svn_stream_t **contents,
7101                               svn_wc_context_t *wc_ctx,
7102                               const char *local_abspath,
7103                               apr_pool_t *result_pool,
7104                               apr_pool_t *scratch_pool);
7105
7106 /** Similar to svn_wc_get_pristine_contents2, but takes no working copy
7107  * context and a path that can be relative
7108  *
7109  * @since New in 1.6.
7110  * @deprecated Provided for backward compatibility with the 1.6 API.
7111  */
7112 SVN_DEPRECATED
7113 svn_error_t *
7114 svn_wc_get_pristine_contents(svn_stream_t **contents,
7115                              const char *path,
7116                              apr_pool_t *result_pool,
7117                              apr_pool_t *scratch_pool);
7118
7119
7120 /** Set @a *pristine_path to the path of the "normal" pristine text file for
7121  * the versioned file @a path.
7122  *
7123  * If @a path does not have a pristine text, set @a *pristine_path to a path where
7124  * nothing exists on disk (in a directory that does exist).
7125  *
7126  * @note: Before version 1.7, the behaviour in that case was to provide the
7127  * path where the pristine text *would be* if it were present.  The new
7128  * behaviour is intended to provide backward compatibility for callers that
7129  * open or test the provided path immediately, and not for callers that
7130  * store the path for later use.
7131  *
7132  * @deprecated Provided for backwards compatibility with the 1.5 API.
7133  * Callers should use svn_wc_get_pristine_contents() instead.
7134  */
7135 SVN_DEPRECATED
7136 svn_error_t *
7137 svn_wc_get_pristine_copy_path(const char *path,
7138                               const char **pristine_path,
7139                               apr_pool_t *pool);
7140
7141
7142 /**
7143  * Recurse from @a local_abspath, cleaning up unfinished log business.  Perform
7144  * any temporary allocations in @a scratch_pool.  Any working copy locks under
7145  * @a local_abspath will be taken over and then cleared by this function.
7146  *
7147  * WARNING: there is no mechanism that will protect locks that are still being
7148  * used.
7149  *
7150  * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at various
7151  * points during the operation.  If it returns an error (typically
7152  * #SVN_ERR_CANCELLED), return that error immediately.
7153  *
7154  * @since New in 1.7.
7155  */
7156 svn_error_t *
7157 svn_wc_cleanup3(svn_wc_context_t *wc_ctx,
7158                 const char *local_abspath,
7159                 svn_cancel_func_t cancel_func,
7160                 void *cancel_baton,
7161                 apr_pool_t *scratch_pool);
7162
7163 /**
7164  * Similar to svn_wc_cleanup3() but uses relative paths and creates its own
7165  * #svn_wc_context_t.
7166  *
7167  * @since New in 1.2.
7168  * @deprecated Provided for backward compatibility with the 1.6 API.
7169  */
7170 SVN_DEPRECATED
7171 svn_error_t *
7172 svn_wc_cleanup2(const char *path,
7173                 const char *diff3_cmd,
7174                 svn_cancel_func_t cancel_func,
7175                 void *cancel_baton,
7176                 apr_pool_t *pool);
7177
7178 /**
7179  * Similar to svn_wc_cleanup2(). @a optional_adm_access is an historic
7180  * relic and not used, it may be NULL.
7181  *
7182  * @deprecated Provided for backward compatibility with the 1.1 API.
7183  */
7184 SVN_DEPRECATED
7185 svn_error_t *
7186 svn_wc_cleanup(const char *path,
7187                svn_wc_adm_access_t *optional_adm_access,
7188                const char *diff3_cmd,
7189                svn_cancel_func_t cancel_func,
7190                void *cancel_baton,
7191                apr_pool_t *pool);
7192
7193 /** Callback for retrieving a repository root for a url from upgrade.
7194  *
7195  * Called by svn_wc_upgrade() when no repository root and/or repository
7196  * uuid are recorded in the working copy. For normal Subversion 1.5 and
7197  * later working copies, this callback will not be used.
7198  *
7199  * @since New in 1.7.
7200  */
7201 typedef svn_error_t * (*svn_wc_upgrade_get_repos_info_t)(
7202                                     const char **repos_root,
7203                                     const char **repos_uuid,
7204                                     void *baton,
7205                                     const char *url,
7206                                     apr_pool_t *result_pool,
7207                                     apr_pool_t *scratch_pool);
7208
7209
7210 /**
7211  * Upgrade the working copy at @a local_abspath to the latest metadata
7212  * storage format.  @a local_abspath should be an absolute path to the
7213  * root of the working copy.
7214  *
7215  * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at
7216  * various points during the operation.  If it returns an error
7217  * (typically #SVN_ERR_CANCELLED), return that error immediately.
7218  *
7219  * For each directory converted, @a notify_func will be called with
7220  * in @a notify_baton action #svn_wc_notify_upgraded_path and as path
7221  * the path of the upgraded directory. @a notify_func may be @c NULL
7222  * if this notification is not needed.
7223  *
7224  * If the old working copy doesn't contain a repository root and/or
7225  * repository uuid, @a repos_info_func (if non-NULL) will be called
7226  * with @a repos_info_baton to provide the missing information.
7227  *
7228  * @since New in 1.7.
7229  */
7230 svn_error_t *
7231 svn_wc_upgrade(svn_wc_context_t *wc_ctx,
7232                const char *local_abspath,
7233                svn_wc_upgrade_get_repos_info_t repos_info_func,
7234                void *repos_info_baton,
7235                svn_cancel_func_t cancel_func,
7236                void *cancel_baton,
7237                svn_wc_notify_func2_t notify_func,
7238                void *notify_baton,
7239                apr_pool_t *scratch_pool);
7240
7241
7242 /** Relocation validation callback typedef.
7243  *
7244  * Called for each relocated file/directory.  @a uuid, if non-NULL, contains
7245  * the expected repository UUID, @a url contains the tentative URL.
7246  *
7247  * @a baton is a closure object; it should be provided by the
7248  * implementation, and passed by the caller.
7249  *
7250  * If @a root_url is passed, then the implementation should make sure that
7251  * @a url is the repository root.
7252  * @a pool may be used for temporary allocations.
7253  *
7254  * @since New in 1.5.
7255  */
7256 typedef svn_error_t *(*svn_wc_relocation_validator3_t)(void *baton,
7257                                                        const char *uuid,
7258                                                        const char *url,
7259                                                        const char *root_url,
7260                                                        apr_pool_t *pool);
7261
7262 /** Similar to #svn_wc_relocation_validator3_t, but with
7263  * the @a root argument.
7264  *
7265  * If @a root is TRUE, then the implementation should make sure that @a url
7266  * is the repository root.  Else, it can be a URL inside the repository.
7267  *
7268  * @deprecated Provided for backwards compatibility with the 1.4 API.
7269  */
7270 typedef svn_error_t *(*svn_wc_relocation_validator2_t)(void *baton,
7271                                                        const char *uuid,
7272                                                        const char *url,
7273                                                        svn_boolean_t root,
7274                                                        apr_pool_t *pool);
7275
7276 /** Similar to #svn_wc_relocation_validator2_t, but without
7277  * the @a root and @a pool arguments.  @a uuid will not be NULL in this version
7278  * of the function.
7279  *
7280  * @deprecated Provided for backwards compatibility with the 1.3 API.
7281  */
7282 typedef svn_error_t *(*svn_wc_relocation_validator_t)(void *baton,
7283                                                       const char *uuid,
7284                                                       const char *url);
7285
7286 /** Recursively change repository references at @a wcroot_abspath
7287  * (which is the root directory of a working copy).  The pre-change
7288  * URL should begin with @a from, and the post-change URL will begin
7289  * with @a to.  @a validator (and its baton, @a validator_baton), will
7290  * be called for the newly generated base URL and calculated repo
7291  * root.
7292  *
7293  * @a wc_ctx is an working copy context.
7294  *
7295  * @a scratch_pool will be used for temporary allocations.
7296  *
7297  * @since New in 1.7.
7298  */
7299 svn_error_t *
7300 svn_wc_relocate4(svn_wc_context_t *wc_ctx,
7301                  const char *wcroot_abspath,
7302                  const char *from,
7303                  const char *to,
7304                  svn_wc_relocation_validator3_t validator,
7305                  void *validator_baton,
7306                  apr_pool_t *scratch_pool);
7307
7308 /** Similar to svn_wc_relocate4(), but with a #svn_wc_adm_access_t /
7309  * relative path parameter pair.
7310  *
7311  * @note As of the 1.7 API, @a path is required to be a working copy
7312  * root directory, and @a recurse is required to be TRUE.
7313  *
7314  * @since New in 1.5.
7315  * @deprecated Provided for limited backwards compatibility with the
7316  * 1.6 API.
7317  */
7318 SVN_DEPRECATED
7319 svn_error_t *
7320 svn_wc_relocate3(const char *path,
7321                  svn_wc_adm_access_t *adm_access,
7322                  const char *from,
7323                  const char *to,
7324                  svn_boolean_t recurse,
7325                  svn_wc_relocation_validator3_t validator,
7326                  void *validator_baton,
7327                  apr_pool_t *pool);
7328
7329 /** Similar to svn_wc_relocate3(), but uses #svn_wc_relocation_validator2_t.
7330  *
7331  * @since New in 1.4.
7332  * @deprecated Provided for backwards compatibility with the 1.4 API. */
7333 SVN_DEPRECATED
7334 svn_error_t *
7335 svn_wc_relocate2(const char *path,
7336                  svn_wc_adm_access_t *adm_access,
7337                  const char *from,
7338                  const char *to,
7339                  svn_boolean_t recurse,
7340                  svn_wc_relocation_validator2_t validator,
7341                  void *validator_baton,
7342                  apr_pool_t *pool);
7343
7344 /** Similar to svn_wc_relocate2(), but uses #svn_wc_relocation_validator_t.
7345  *
7346  * @deprecated Provided for backwards compatibility with the 1.3 API. */
7347 SVN_DEPRECATED
7348 svn_error_t *
7349 svn_wc_relocate(const char *path,
7350                 svn_wc_adm_access_t *adm_access,
7351                 const char *from,
7352                 const char *to,
7353                 svn_boolean_t recurse,
7354                 svn_wc_relocation_validator_t validator,
7355                 void *validator_baton,
7356                 apr_pool_t *pool);
7357
7358
7359 /**
7360  * Revert changes to @a local_abspath.  Perform necessary allocations in
7361  * @a scratch_pool.
7362  *
7363  * @a wc_ctx contains the necessary locks required for performing the
7364  * operation.
7365  *
7366  * If @a depth is #svn_depth_empty, revert just @a path (if a
7367  * directory, then revert just the properties on that directory).
7368  * Else if #svn_depth_files, revert @a path and any files
7369  * directly under @a path if it is directory.  Else if
7370  * #svn_depth_immediates, revert all of the preceding plus
7371  * properties on immediate subdirectories; else if #svn_depth_infinity,
7372  * revert path and everything under it fully recursively.
7373  *
7374  * @a changelist_filter is an array of <tt>const char *</tt> changelist
7375  * names, used as a restrictive filter on items reverted; that is,
7376  * don't revert any item unless it's a member of one of those
7377  * changelists.  If @a changelist_filter is empty (or altogether @c NULL),
7378  * no changelist filtering occurs.
7379  *
7380  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
7381  * various points during the reversion process.  If it returns an
7382  * error (typically #SVN_ERR_CANCELLED), return that error
7383  * immediately.
7384  *
7385  * If @a use_commit_times is TRUE, then all reverted working-files
7386  * will have their timestamp set to the last-committed-time.  If
7387  * FALSE, the reverted working-files will be touched with the 'now' time.
7388  *
7389  * For each item reverted, @a notify_func will be called with @a notify_baton
7390  * and the path of the reverted item. @a notify_func may be @c NULL if this
7391  * notification is not needed.
7392  *
7393  * If @a path is not under version control, return the error
7394  * #SVN_ERR_UNVERSIONED_RESOURCE.
7395  *
7396  * @since New in 1.7.
7397  */
7398 svn_error_t *
7399 svn_wc_revert4(svn_wc_context_t *wc_ctx,
7400                const char *local_abspath,
7401                svn_depth_t depth,
7402                svn_boolean_t use_commit_times,
7403                const apr_array_header_t *changelist_filter,
7404                svn_cancel_func_t cancel_func,
7405                void *cancel_baton,
7406                svn_wc_notify_func2_t notify_func,
7407                void *notify_baton,
7408                apr_pool_t *scratch_pool);
7409
7410 /** Similar to svn_wc_revert4() but takes a relative path and access baton.
7411  *
7412  * @since New in 1.5.
7413  * @deprecated Provided for backward compatibility with the 1.6 API.
7414  */
7415 SVN_DEPRECATED
7416 svn_error_t *
7417 svn_wc_revert3(const char *path,
7418                svn_wc_adm_access_t *parent_access,
7419                svn_depth_t depth,
7420                svn_boolean_t use_commit_times,
7421                const apr_array_header_t *changelist_filter,
7422                svn_cancel_func_t cancel_func,
7423                void *cancel_baton,
7424                svn_wc_notify_func2_t notify_func,
7425                void *notify_baton,
7426                apr_pool_t *pool);
7427
7428 /**
7429  * Similar to svn_wc_revert3(), but with @a changelist_filter passed as @c
7430  * NULL, and @a depth set according to @a recursive: if @a recursive
7431  * is TRUE, @a depth is #svn_depth_infinity; if FALSE, @a depth is
7432  * #svn_depth_empty.
7433  *
7434  * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files;
7435  * revert is deliberately different.
7436  *
7437  * @since New in 1.2.
7438  * @deprecated Provided for backward compatibility with the 1.4 API.
7439  */
7440 SVN_DEPRECATED
7441 svn_error_t *
7442 svn_wc_revert2(const char *path,
7443                svn_wc_adm_access_t *parent_access,
7444                svn_boolean_t recursive,
7445                svn_boolean_t use_commit_times,
7446                svn_cancel_func_t cancel_func,
7447                void *cancel_baton,
7448                svn_wc_notify_func2_t notify_func,
7449                void *notify_baton,
7450                apr_pool_t *pool);
7451
7452 /**
7453  * Similar to svn_wc_revert2(), but takes an #svn_wc_notify_func_t instead.
7454  *
7455  * @deprecated Provided for backward compatibility with the 1.1 API.
7456  */
7457 SVN_DEPRECATED
7458 svn_error_t *
7459 svn_wc_revert(const char *path,
7460               svn_wc_adm_access_t *parent_access,
7461               svn_boolean_t recursive,
7462               svn_boolean_t use_commit_times,
7463               svn_cancel_func_t cancel_func,
7464               void *cancel_baton,
7465               svn_wc_notify_func_t notify_func,
7466               void *notify_baton,
7467               apr_pool_t *pool);
7468
7469 /**
7470  * Restores a missing node, @a local_abspath using the @a wc_ctx. Records
7471  * the new last modified time of the file for status processing.
7472  *
7473  * If @a use_commit_times is TRUE, then set restored files' timestamps
7474  * to their last-commit-times.
7475  *
7476  * Returns SVN_ERROR_WC_PATH_NOT_FOUND if LOCAL_ABSPATH is not versioned and
7477  * SVN_ERROR_WC_PATH_UNEXPECTED_STATUS if LOCAL_ABSPATH is in a status where
7478  * it can't be restored.
7479  *
7480  * @since New in 1.7.
7481  */
7482 svn_error_t *
7483 svn_wc_restore(svn_wc_context_t *wc_ctx,
7484                const char *local_abspath,
7485                svn_boolean_t use_commit_times,
7486                apr_pool_t *scratch_pool);
7487
7488 \f
7489 /* Tmp files */
7490
7491 /** Create a unique temporary file in administrative tmp/ area of
7492  * directory @a path.  Return a handle in @a *fp and the path
7493  * in @a *new_name. Either @a fp or @a new_name can be NULL.
7494  *
7495  * The flags will be <tt>APR_WRITE | APR_CREATE | APR_EXCL</tt> and
7496  * optionally @c APR_DELONCLOSE (if the @a delete_when argument is
7497  * set to #svn_io_file_del_on_close).
7498  *
7499  * This means that as soon as @a fp is closed, the tmp file will vanish.
7500  *
7501  * @since New in 1.4
7502  * @deprecated For compatibility with 1.6 API
7503  */
7504 SVN_DEPRECATED
7505 svn_error_t *
7506 svn_wc_create_tmp_file2(apr_file_t **fp,
7507                         const char **new_name,
7508                         const char *path,
7509                         svn_io_file_del_t delete_when,
7510                         apr_pool_t *pool);
7511
7512
7513 /** Same as svn_wc_create_tmp_file2(), but with @a new_name set to @c NULL,
7514  * and without the ability to delete the file on pool cleanup.
7515  *
7516  * @deprecated For compatibility with 1.3 API
7517  */
7518 SVN_DEPRECATED
7519 svn_error_t *
7520 svn_wc_create_tmp_file(apr_file_t **fp,
7521                        const char *path,
7522                        svn_boolean_t delete_on_close,
7523                        apr_pool_t *pool);
7524
7525
7526 /**
7527  * @defgroup svn_wc_translate EOL conversion and keyword expansion
7528  * @{
7529  */
7530
7531
7532 /** Set @a xlated_path to a translated copy of @a src
7533  * or to @a src itself if no translation is necessary.
7534  * That is, if @a versioned_file's properties indicate newline conversion or
7535  * keyword expansion, point @a *xlated_path to a copy of @a src
7536  * whose newlines and keywords are converted using the translation
7537  * as requested by @a flags.
7538  *
7539  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
7540  * if the client has canceled the operation.
7541  *
7542  * When translating to the normal form, inconsistent eol styles will be
7543  * repaired when appropriate for the given setting.  When translating
7544  * from normal form, no EOL repair is performed (consistency is assumed).
7545  * This behaviour can be overridden by specifying
7546  * #SVN_WC_TRANSLATE_FORCE_EOL_REPAIR.
7547  *
7548  * The caller can explicitly request a new file to be returned by setting the
7549  * #SVN_WC_TRANSLATE_FORCE_COPY flag in @a flags.
7550  *
7551  * This function is generally used to get a file that can be compared
7552  * meaningfully against @a versioned_file's text base, if
7553  * @c SVN_WC_TRANSLATE_TO_NF is specified, against @a versioned_file itself
7554  * if @c SVN_WC_TRANSLATE_FROM_NF is specified.
7555  *
7556  * If a new output file is created, it is created in the temp file area
7557  * belonging to @a versioned_file.  By default it will be deleted at pool
7558  * cleanup.  If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the
7559  * default pool cleanup handler to remove @a *xlated_path is not registered.
7560  * If the input file is returned as the output, its lifetime is not
7561  * specified.
7562  *
7563  * If an error is returned, the effect on @a *xlated_path is undefined.
7564  *
7565  * @since New in 1.4
7566  * @deprecated Provided for compatibility with the 1.6 API
7567  */
7568 SVN_DEPRECATED
7569 svn_error_t *
7570 svn_wc_translated_file2(const char **xlated_path,
7571                         const char *src,
7572                         const char *versioned_file,
7573                         svn_wc_adm_access_t *adm_access,
7574                         apr_uint32_t flags,
7575                         apr_pool_t *pool);
7576
7577
7578 /** Same as svn_wc_translated_file2, but will never clean up
7579  * temporary files.
7580  *
7581  * @deprecated Provided for compatibility with the 1.3 API
7582  */
7583 SVN_DEPRECATED
7584 svn_error_t *
7585 svn_wc_translated_file(const char **xlated_p,
7586                        const char *vfile,
7587                        svn_wc_adm_access_t *adm_access,
7588                        svn_boolean_t force_repair,
7589                        apr_pool_t *pool);
7590
7591
7592 /** Returns a @a stream allocated in @a pool with access to the given
7593  * @a path taking the file properties from @a versioned_file using
7594  * @a adm_access.
7595  *
7596  * If @a flags includes #SVN_WC_TRANSLATE_FROM_NF, the stream will
7597  * translate from Normal Form to working copy form while writing to
7598  * @a path; stream read operations are not supported.
7599  * Conversely, if @a flags includes #SVN_WC_TRANSLATE_TO_NF, the stream will
7600  * translate from working copy form to Normal Form while reading from
7601  * @a path; stream write operations are not supported.
7602  *
7603  * The @a flags are the same constants as those used for
7604  * svn_wc_translated_file2().
7605  *
7606  * @since New in 1.5.
7607  * @deprecated Provided for compatibility with the 1.6 API.
7608  */
7609 SVN_DEPRECATED
7610 svn_error_t *
7611 svn_wc_translated_stream(svn_stream_t **stream,
7612                          const char *path,
7613                          const char *versioned_file,
7614                          svn_wc_adm_access_t *adm_access,
7615                          apr_uint32_t flags,
7616                          apr_pool_t *pool);
7617
7618 \f/** @} */
7619
7620
7621 /**
7622  * @defgroup svn_wc_deltas Text/Prop Deltas Using an Editor
7623  * @{
7624  */
7625
7626 /** Send the local modifications for versioned file @a local_abspath (with
7627  * matching @a file_baton) through @a editor, then close @a file_baton
7628  * afterwards.  Use @a scratch_pool for any temporary allocation.
7629  *
7630  * If @a new_text_base_md5_checksum is non-NULL, set
7631  * @a *new_text_base_md5_checksum to the MD5 checksum of (@a local_abspath
7632  * translated to repository-normal form), allocated in @a result_pool.
7633  *
7634  * If @a new_text_base_sha1_checksum in non-NULL, store a copy of (@a
7635  * local_abspath translated to repository-normal form) in the pristine text
7636  * store, and set @a *new_text_base_sha1_checksum to its SHA-1 checksum.
7637  *
7638  * If @a fulltext, send the untranslated copy of @a local_abspath through
7639  * @a editor as full-text; else send it as svndiff against the current text
7640  * base.
7641  *
7642  * If sending a diff, and the recorded checksum for @a local_abspath's
7643  * text-base does not match the current actual checksum, then remove the tmp
7644  * copy (and set @a *tempfile to NULL if appropriate), and return the
7645  * error #SVN_ERR_WC_CORRUPT_TEXT_BASE.
7646  *
7647  * @note This is intended for use with both infix and postfix
7648  * text-delta styled editor drivers.
7649  *
7650  * @since New in 1.7.
7651  */
7652 svn_error_t *
7653 svn_wc_transmit_text_deltas3(const svn_checksum_t **new_text_base_md5_checksum,
7654                              const svn_checksum_t **new_text_base_sha1_checksum,
7655                              svn_wc_context_t *wc_ctx,
7656                              const char *local_abspath,
7657                              svn_boolean_t fulltext,
7658                              const svn_delta_editor_t *editor,
7659                              void *file_baton,
7660                              apr_pool_t *result_pool,
7661                              apr_pool_t *scratch_pool);
7662
7663 /** Similar to svn_wc_transmit_text_deltas3(), but with a relative path
7664  * and adm_access baton, and the checksum output is an MD5 digest instead of
7665  * two svn_checksum_t objects.
7666  *
7667  * If @a tempfile is non-NULL, make a copy of @a path with keywords
7668  * and eol translated to repository-normal form, and set @a *tempfile to the
7669  * absolute path to this copy, allocated in @a result_pool.  The copy will
7670  * be in the temporary-text-base directory.  Do not clean up the copy;
7671  * caller can do that.  (The purpose of handing back the tmp copy is that it
7672  * is usually about to become the new text base anyway, but the installation
7673  * of the new text base is outside the scope of this function.)
7674  *
7675  * @since New in 1.4.
7676  * @deprecated Provided for backwards compatibility with the 1.6 API.
7677  */
7678 SVN_DEPRECATED
7679 svn_error_t *
7680 svn_wc_transmit_text_deltas2(const char **tempfile,
7681                              unsigned char digest[],
7682                              const char *path,
7683                              svn_wc_adm_access_t *adm_access,
7684                              svn_boolean_t fulltext,
7685                              const svn_delta_editor_t *editor,
7686                              void *file_baton,
7687                              apr_pool_t *pool);
7688
7689 /** Similar to svn_wc_transmit_text_deltas2(), but with @a digest set to NULL.
7690  *
7691  * @deprecated Provided for backwards compatibility with the 1.3 API.
7692  */
7693 SVN_DEPRECATED
7694 svn_error_t *
7695 svn_wc_transmit_text_deltas(const char *path,
7696                             svn_wc_adm_access_t *adm_access,
7697                             svn_boolean_t fulltext,
7698                             const svn_delta_editor_t *editor,
7699                             void *file_baton,
7700                             const char **tempfile,
7701                             apr_pool_t *pool);
7702
7703
7704 /** Given a @a local_abspath, transmit all local property
7705  * modifications using the appropriate @a editor method (in conjunction
7706  * with @a baton). Use @a scratch_pool for any temporary allocation.
7707  *
7708  * @since New in 1.7.
7709  */
7710 svn_error_t *
7711 svn_wc_transmit_prop_deltas2(svn_wc_context_t *wc_ctx,
7712                              const char *local_abspath,
7713                              const svn_delta_editor_t *editor,
7714                              void *baton,
7715                              apr_pool_t *scratch_pool);
7716
7717
7718 /** Similar to svn_wc_transmit_prop_deltas2(), but with a relative path,
7719  * adm_access baton and tempfile.
7720  *
7721  * If a temporary file remains after this function is finished, the
7722  * path to that file is returned in @a *tempfile (so the caller can
7723  * clean this up if it wishes to do so).
7724  *
7725  * @note Starting version 1.5, no tempfile will ever be returned
7726  *       anymore.  If @a *tempfile is passed, its value is set to @c NULL.
7727  *
7728  * @deprecated Provided for backwards compatibility with the 1.6 API.
7729  */
7730 SVN_DEPRECATED
7731 svn_error_t *
7732 svn_wc_transmit_prop_deltas(const char *path,
7733                             svn_wc_adm_access_t *adm_access,
7734                             const svn_wc_entry_t *entry,
7735                             const svn_delta_editor_t *editor,
7736                             void *baton,
7737                             const char **tempfile,
7738                             apr_pool_t *pool);
7739
7740 /** @} */
7741
7742
7743 /**
7744  * @defgroup svn_wc_ignore Ignoring unversioned files and directories
7745  * @{
7746  */
7747
7748 /** Get the run-time configured list of ignore patterns from the
7749  * #svn_config_t's in the @a config hash, and store them in @a *patterns.
7750  * Allocate @a *patterns and its contents in @a pool.
7751  */
7752 svn_error_t *
7753 svn_wc_get_default_ignores(apr_array_header_t **patterns,
7754                            apr_hash_t *config,
7755                            apr_pool_t *pool);
7756
7757 /** Get the list of ignore patterns from the #svn_config_t's in the
7758  * @a config hash and the local ignore patterns from the directory
7759  * at @a local_abspath, using @a wc_ctx, and store them in @a *patterns.
7760  * Allocate @a *patterns and its contents in @a result_pool, use @a
7761  * scratch_pool for temporary allocations.
7762  *
7763  * @since New in 1.7.
7764  */
7765 svn_error_t *
7766 svn_wc_get_ignores2(apr_array_header_t **patterns,
7767                     svn_wc_context_t *wc_ctx,
7768                     const char *local_abspath,
7769                     apr_hash_t *config,
7770                     apr_pool_t *result_pool,
7771                     apr_pool_t *scratch_pool);
7772
7773 /** Similar to svn_wc_get_ignores2(), but with a #svn_wc_adm_access_t
7774  * parameter in place of #svn_wc_context_t and @c local_abspath parameters.
7775  *
7776  * @since New in 1.3.
7777  * @deprecated Provided for backwards compatibility with the 1.6 API.
7778  */
7779 SVN_DEPRECATED
7780 svn_error_t *
7781 svn_wc_get_ignores(apr_array_header_t **patterns,
7782                    apr_hash_t *config,
7783                    svn_wc_adm_access_t *adm_access,
7784                    apr_pool_t *pool);
7785
7786 /** Return TRUE iff @a str matches any of the elements of @a list, a
7787  * list of zero or more ignore patterns.
7788  *
7789  * @since New in 1.5.
7790  */
7791 svn_boolean_t
7792 svn_wc_match_ignore_list(const char *str,
7793                          const apr_array_header_t *list,
7794                          apr_pool_t *pool);
7795
7796 /** @} */
7797
7798
7799 /**
7800  * @defgroup svn_wc_repos_locks Repository locks
7801  * @{
7802  */
7803
7804 /** Add @a lock to the working copy for @a local_abspath.  If @a
7805  * local_abspath is read-only, due to locking properties, make it writable.
7806  * Perform temporary allocations in @a scratch_pool.
7807  *
7808  * @since New in 1.7.
7809  */
7810 svn_error_t *
7811 svn_wc_add_lock2(svn_wc_context_t *wc_ctx,
7812                  const char *abspath,
7813                  const svn_lock_t *lock,
7814                  apr_pool_t *scratch_pool);
7815
7816 /**
7817  * Similar to svn_wc_add_lock2(), but with a #svn_wc_adm_access_t /
7818  * relative path parameter pair.
7819  *
7820  * @deprecated Provided for backward compatibility with the 1.6 API.
7821  * @since New in 1.2.
7822  */
7823 SVN_DEPRECATED
7824 svn_error_t *
7825 svn_wc_add_lock(const char *path,
7826                 const svn_lock_t *lock,
7827                 svn_wc_adm_access_t *adm_access,
7828                 apr_pool_t *pool);
7829
7830 /** Remove any lock from @a local_abspath.  If @a local_abspath has a
7831  * lock and the locking so specifies, make the file read-only.  Don't
7832  * return an error if @a local_abspath didn't have a lock.  Perform temporary
7833  * allocations in @a scratch_pool.
7834  *
7835  * @since New in 1.7.
7836  */
7837 svn_error_t *
7838 svn_wc_remove_lock2(svn_wc_context_t *wc_ctx,
7839                     const char *local_abspath,
7840                     apr_pool_t *scratch_pool);
7841
7842 /**
7843  * Similar to svn_wc_remove_lock2(), but with a #svn_wc_adm_access_t /
7844  * relative path parameter pair.
7845  *
7846  * @deprecated Provided for backward compatibility with the 1.6 API.
7847  * @since New in 1.2.
7848  */
7849 SVN_DEPRECATED
7850 svn_error_t *
7851 svn_wc_remove_lock(const char *path,
7852                    svn_wc_adm_access_t *adm_access,
7853                    apr_pool_t *pool);
7854
7855 /** @} */
7856
7857
7858 /** A structure to report a summary of a working copy, including the
7859  * mix of revisions found within it, whether any parts are switched or
7860  * locally modified, and whether it is a sparse checkout.
7861  *
7862  * @note Fields may be added to the end of this structure in future
7863  * versions.  Therefore, to preserve binary compatibility, users
7864  * should not directly allocate structures of this type.
7865  *
7866  * @since New in 1.4
7867  */
7868 typedef struct svn_wc_revision_status_t
7869 {
7870   svn_revnum_t min_rev;   /**< Lowest revision found */
7871   svn_revnum_t max_rev;   /**< Highest revision found */
7872
7873   svn_boolean_t switched; /**< Is anything switched? */
7874   svn_boolean_t modified; /**< Is anything modified? */
7875
7876   /** Whether any WC paths are at a depth other than #svn_depth_infinity.
7877    * @since New in 1.5.
7878    */
7879   svn_boolean_t sparse_checkout;
7880 } svn_wc_revision_status_t;
7881
7882 /** Set @a *result_p to point to a new #svn_wc_revision_status_t structure
7883  * containing a summary of the revision range and status of the working copy
7884  * at @a local_abspath (not including "externals").  @a local_abspath must
7885  * be absolute. Return SVN_ERR_WC_PATH_NOT_FOUND if @a local_abspath is not
7886  * a working copy path.
7887  *
7888  * Set @a (*result_p)->min_rev and @a (*result_p)->max_rev respectively to the
7889  * lowest and highest revision numbers in the working copy.  If @a committed
7890  * is TRUE, summarize the last-changed revisions, else the base revisions.
7891  *
7892  * Set @a (*result_p)->switched to indicate whether any item in the WC is
7893  * switched relative to its parent.  If @a trail_url is non-NULL, use it to
7894  * determine if @a local_abspath itself is switched.  It should be any trailing
7895  * portion of @a local_abspath's expected URL, long enough to include any parts
7896  * that the caller considers might be changed by a switch.  If it does not
7897  * match the end of @a local_abspath's actual URL, then report a "switched"
7898  * status.
7899  *
7900  * Set @a (*result_p)->modified to indicate whether any item is locally
7901  * modified.
7902  *
7903  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
7904  * if the client has canceled the operation.
7905  *
7906  * Allocate *result_p in @a result_pool, use @a scratch_pool for temporary
7907  * allocations.
7908  *
7909  * @a wc_ctx should be a valid working copy context.
7910  *
7911  * @since New in 1.7
7912  */
7913 svn_error_t *
7914 svn_wc_revision_status2(svn_wc_revision_status_t **result_p,
7915                         svn_wc_context_t *wc_ctx,
7916                         const char *local_abspath,
7917                         const char *trail_url,
7918                         svn_boolean_t committed,
7919                         svn_cancel_func_t cancel_func,
7920                         void *cancel_baton,
7921                         apr_pool_t *result_pool,
7922                         apr_pool_t *scratch_pool);
7923
7924
7925 /** Similar to svn_wc_revision_status2(), but with a (possibly) local
7926  * path and no wc_ctx parameter.
7927  *
7928  * @since New in 1.4.
7929  * @deprecated Provided for backward compatibility with the 1.6 API.
7930  */
7931 SVN_DEPRECATED
7932 svn_error_t *
7933 svn_wc_revision_status(svn_wc_revision_status_t **result_p,
7934                        const char *wc_path,
7935                        const char *trail_url,
7936                        svn_boolean_t committed,
7937                        svn_cancel_func_t cancel_func,
7938                        void *cancel_baton,
7939                        apr_pool_t *pool);
7940
7941
7942 /**
7943  * Set @a local_abspath's 'changelist' attribute to @a changelist iff
7944  * @a changelist is not @c NULL; otherwise, remove any current
7945  * changelist assignment from @a local_abspath.  @a changelist may not
7946  * be the empty string.  Recurse to @a depth.
7947  *
7948  * @a changelist_filter is an array of <tt>const char *</tt> changelist
7949  * names, used as a restrictive filter on items whose changelist
7950  * assignments are adjusted; that is, don't tweak the changeset of any
7951  * item unless it's currently a member of one of those changelists.
7952  * If @a changelist_filter is empty (or altogether @c NULL), no changelist
7953  * filtering occurs.
7954  *
7955  * If @a cancel_func is not @c NULL, call it with @a cancel_baton to
7956  * determine if the client has canceled the operation.
7957  *
7958  * If @a notify_func is not @c NULL, call it with @a notify_baton to
7959  * report the change (using notification types
7960  * #svn_wc_notify_changelist_set and #svn_wc_notify_changelist_clear).
7961  *
7962  * Use @a scratch_pool for temporary allocations.
7963  *
7964  * @note For now, directories are NOT allowed to be associated with
7965  * changelists; there is confusion about whether they should behave
7966  * as depth-0 or depth-infinity objects.  If @a local_abspath is a directory,
7967  * return an error.
7968  *
7969  * @note This metadata is purely a client-side "bookkeeping"
7970  * convenience, and is entirely managed by the working copy.
7971  *
7972  * @since New in 1.7.
7973  */
7974 svn_error_t *
7975 svn_wc_set_changelist2(svn_wc_context_t *wc_ctx,
7976                        const char *local_abspath,
7977                        const char *changelist,
7978                        svn_depth_t depth,
7979                        const apr_array_header_t *changelist_filter,
7980                        svn_cancel_func_t cancel_func,
7981                        void *cancel_baton,
7982                        svn_wc_notify_func2_t notify_func,
7983                        void *notify_baton,
7984                        apr_pool_t *scratch_pool);
7985
7986 /** Similar to svn_wc_set_changelist2(), but with an access baton and
7987  * relative path.
7988  *
7989  * @since New in 1.5.
7990  * @deprecated Provided for backward compatibility with the 1.6 API.
7991  */
7992 SVN_DEPRECATED
7993 svn_error_t *
7994 svn_wc_set_changelist(const char *path,
7995                       const char *changelist,
7996                       svn_wc_adm_access_t *adm_access,
7997                       svn_cancel_func_t cancel_func,
7998                       void *cancel_baton,
7999                       svn_wc_notify_func2_t notify_func,
8000                       void *notify_baton,
8001                       apr_pool_t *pool);
8002
8003
8004
8005 /**
8006  * The callback type used by svn_wc_get_changelists() and
8007  * svn_client_get_changelists().
8008  *
8009  * On each invocation, @a path is a newly discovered member of the
8010  * changelist, and @a baton is a private function closure.
8011  *
8012  * @since New in 1.5.
8013  */
8014 typedef svn_error_t *(*svn_changelist_receiver_t) (void *baton,
8015                                                    const char *path,
8016                                                    const char *changelist,
8017                                                    apr_pool_t *pool);
8018
8019
8020 /**
8021  * ### TODO: Doc string, please.
8022  *
8023  * @since New in 1.7.
8024  */
8025 svn_error_t *
8026 svn_wc_get_changelists(svn_wc_context_t *wc_ctx,
8027                        const char *local_abspath,
8028                        svn_depth_t depth,
8029                        const apr_array_header_t *changelist_filter,
8030                        svn_changelist_receiver_t callback_func,
8031                        void *callback_baton,
8032                        svn_cancel_func_t cancel_func,
8033                        void *cancel_baton,
8034                        apr_pool_t *scratch_pool);
8035
8036
8037 /** Crop @a local_abspath according to @a depth.
8038  *
8039  * Remove any item that exceeds the boundary of @a depth (relative to
8040  * @a local_abspath) from revision control.  Leave modified items behind
8041  * (unversioned), while removing unmodified ones completely.
8042  *
8043  * @a depth can be svn_depth_empty, svn_depth_files or svn_depth_immediates.
8044  * Excluding nodes is handled by svn_wc_exclude().
8045  *
8046  * If @a local_abspath starts out with a shallower depth than @a depth,
8047  * do not upgrade it to @a depth (that would not be cropping); however, do
8048  * check children and crop them appropriately according to @a depth.
8049  *
8050  * Returns immediately with an #SVN_ERR_UNSUPPORTED_FEATURE error if @a
8051  * local_abspath is not a directory, or if @a depth is not restrictive
8052  * (e.g., #svn_depth_infinity).
8053  *
8054  * @a wc_ctx contains a tree lock, for the local path to the working copy
8055  * which will be used as the root of this operation.
8056  *
8057  * If @a cancel_func is not @c NULL, call it with @a cancel_baton at
8058  * various points to determine if the client has canceled the operation.
8059  *
8060  * If @a notify_func is not @c NULL, call it with @a notify_baton to
8061  * report changes as they are made.
8062  *
8063  * @since New in 1.7
8064  */
8065 svn_error_t *
8066 svn_wc_crop_tree2(svn_wc_context_t *wc_ctx,
8067                   const char *local_abspath,
8068                   svn_depth_t depth,
8069                   svn_cancel_func_t cancel_func,
8070                   void *cancel_baton,
8071                   svn_wc_notify_func2_t notify_func,
8072                   void *notify_baton,
8073                   apr_pool_t *scratch_pool);
8074
8075 /** Similar to svn_wc_crop_tree2(), but uses an access baton and target.
8076  *
8077  * svn_wc_crop_tree() also allows #svn_depth_exclude, which is now
8078  * handled via svn_wc_exclude()
8079  *
8080  * @a target is a basename in @a anchor or "" for @a anchor itself.
8081  *
8082  * @since New in 1.6
8083  * @deprecated Provided for backward compatibility with the 1.6 API.
8084  */
8085 SVN_DEPRECATED
8086 svn_error_t *
8087 svn_wc_crop_tree(svn_wc_adm_access_t *anchor,
8088                  const char *target,
8089                  svn_depth_t depth,
8090                  svn_wc_notify_func2_t notify_func,
8091                  void *notify_baton,
8092                  svn_cancel_func_t cancel_func,
8093                  void *cancel_baton,
8094                  apr_pool_t *pool);
8095
8096 /** Remove the local node for @a local_abspath from the working copy and
8097  * add an excluded node placeholder in its place.
8098  *
8099  * This feature is only supported for unmodified nodes. An
8100  * #SVN_ERR_UNSUPPORTED_FEATURE error is returned if the node can't be
8101  * excluded in its current state.
8102  *
8103  * @a wc_ctx contains a tree lock, for the local path to the working copy
8104  * which will be used as the root of this operation
8105  *
8106  * If @a notify_func is not @c NULL, call it with @a notify_baton to
8107  * report changes as they are made.
8108  *
8109  * If @a cancel_func is not @c NULL, call it with @a cancel_baton at
8110  * various points to determine if the client has canceled the operation.
8111  *
8112  *
8113  * @since New in 1.7
8114  */
8115 svn_error_t *
8116 svn_wc_exclude(svn_wc_context_t *wc_ctx,
8117                const char *local_abspath,
8118                svn_cancel_func_t cancel_func,
8119                void *cancel_baton,
8120                svn_wc_notify_func2_t notify_func,
8121                void *notify_baton,
8122                apr_pool_t *scratch_pool);
8123
8124 \f
8125 /** @} */
8126
8127 /**
8128  * Set @a kind to the #svn_node_kind_t of @a abspath.  Use @a wc_ctx to access
8129  * the working copy, and @a scratch_pool for all temporary allocations.
8130  *
8131  * If @a abspath is not under version control, set @a kind to #svn_node_none.
8132  *
8133  * If @a show_hidden and @a show_deleted are both @c FALSE, the kind of
8134  * scheduled for delete, administrative only 'not present' and excluded
8135  * nodes is reported as #svn_node_none. This is recommended as a check
8136  * for 'is there a versioned file or directory here?'
8137  *
8138  * If @a show_deleted is FALSE, but @a show_hidden is @c TRUE then only
8139  * scheduled for delete and administrative only 'not present' nodes are
8140  * reported as #svn_node_none. This is recommended as check for
8141  * 'Can I add a node here?'
8142  *
8143  * If @a show_deleted is TRUE, but @a show_hidden is FALSE, then only
8144  * administrative only 'not present' nodes and excluded nodes are reported as
8145  * #svn_node_none. This behavior is the behavior bescribed as 'hidden'
8146  * before Subversion 1.7.
8147  *
8148  * If @a show_hidden and @a show_deleted are both @c TRUE all nodes are
8149  * reported.
8150  *
8151  * @since New in 1.8.
8152  */
8153 svn_error_t *
8154 svn_wc_read_kind2(svn_node_kind_t *kind,
8155                   svn_wc_context_t *wc_ctx,
8156                   const char *local_abspath,
8157                   svn_boolean_t show_deleted,
8158                   svn_boolean_t show_hidden,
8159                   apr_pool_t *scratch_pool);
8160
8161 /** Similar to svn_wc_read_kind2() but with @a show_deleted always
8162  * passed as TRUE.
8163  *
8164  * @since New in 1.7.
8165  * @deprecated Provided for backward compatibility with the 1.7 API.
8166  */
8167 SVN_DEPRECATED
8168 svn_error_t *
8169 svn_wc_read_kind(svn_node_kind_t *kind,
8170                  svn_wc_context_t *wc_ctx,
8171                  const char *abspath,
8172                  svn_boolean_t show_hidden,
8173                  apr_pool_t *scratch_pool);
8174
8175
8176 /** @} */
8177
8178 #ifdef __cplusplus
8179 }
8180 #endif /* __cplusplus */
8181
8182 #endif  /* SVN_WC_H */