Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svn_wc.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
4  * Copyright (c) 2000-2008 CollabNet. All rights reserved.
5  *
6  * This software is licensed as described in the file COPYING, which
7  * you should have received as part of this distribution. The terms
8  * are also available at http://subversion.tigris.org/license-1.html.
9  * If newer versions of this license are posted there, you may use a
10  * newer version instead, at your option.
11  *
12  * This software consists of voluntary contributions made by many
13  * individuals. For exact contribution history, see the revision
14  * history and logs, available at http://subversion.tigris.org/.
15  * ====================================================================
16  * @endcopyright
17  *
18  * @file svn_wc.h
19  * @brief Subversion's working copy library
20  *
21  * Requires:
22  * - A working copy
23  *
24  * Provides:
25  * - Ability to manipulate working copy's versioned data.
26  * - Ability to manipulate working copy's administrative files.
27  *
28  * Used By:
29  * - Clients.
30  *
31  * Notes:
32  * The 'path' parameters to most of these functions can be
33  * absolute or relative (relative to current working
34  * directory). If there are any cases where they are
35  * relative to the path associated with the
36  * 'svn_wc_adm_access_t *adm_access' baton passed along
37  * with the path, those cases should be explicitly
38  * documented, and if they are not, please fix it.
39  */
40 
41 #ifndef SVN_WC_H
42 #define SVN_WC_H
43 
44 #include <apr.h>
45 #include <apr_pools.h>
46 #include <apr_tables.h>
47 #include <apr_hash.h>
48 #include <apr_time.h>
49 #include <apr_file_io.h>
50 
51 #include "svn_types.h"
52 #include "svn_string.h"
53 #include "svn_checksum.h"
54 #include "svn_io.h"
55 #include "svn_delta.h" /* for svn_stream_t */
56 #include "svn_opt.h"
57 #include "svn_ra.h" /* for svn_ra_reporter_t type */
58 #include "svn_version.h"
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif /* __cplusplus */
63 
64 
65 /**
66  * Get libsvn_wc version information.
67  *
68  * @since New in 1.1.
69  */
70 const svn_version_t *
71 svn_wc_version(void);
72 
73 /**
74  * @defgroup svn_wc Working copy management
75  * @{
76  */
77 
78 /** Flags for use with svn_wc_translated_file2
79  *
80  * @defgroup translate_flags Translation flags
81  *
82  * @{
83  */
84 
85  /** Translate from Normal Form.
86  *
87  * The working copy text bases and repository files are stored
88  * in normal form. Some files' contents - or ever representation -
89  * differs between the working copy and the normal form. This flag
90  * specifies to take the latter form as input and transform it
91  * to the former.
92  *
93  * Either this flag or @c SVN_WC_TRANSLATE_TO_NF should be specified,
94  * but not both.
95  */
96 #define SVN_WC_TRANSLATE_FROM_NF 0x00000000
97 
98  /** Translate to Normal Form.
99  *
100  * Either this flag or @c SVN_WC_TRANSLATE_FROM_NF should be specified,
101  * but not both.
102  */
103 #define SVN_WC_TRANSLATE_TO_NF 0x00000001
104 
105  /** Force repair of eol styles, making sure the output file consistently
106  * contains the one eol style as specified by the svn:eol-style
107  * property and the required translation direction.
108  *
109  */
110 #define SVN_WC_TRANSLATE_FORCE_EOL_REPAIR 0x00000002
111 
112  /** Don't register a pool cleanup to delete the output file */
113 #define SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP 0x00000004
114 
115  /** Guarantee a new file is created on successful return.
116  * The default shortcuts translation by returning the path
117  * of the untranslated file when no translation is required.
118  */
119 #define SVN_WC_TRANSLATE_FORCE_COPY 0x00000008
120 
121  /** Use a non-wc-local tmp directory for creating output files,
122  * instead of in the working copy admin tmp area which is the default.
123  *
124  * @since New in 1.4.
125  */
126 #define SVN_WC_TRANSLATE_USE_GLOBAL_TMP 0x00000010
127 
128 /** @} */
129 
130 
131 /* Locking/Opening/Closing */
132 
133 /** Baton for access to a working copy administrative area.
134  *
135  * One day all such access will require a baton, we're not there yet.
136  *
137  * Access batons can be grouped into sets, by passing an existing open
138  * baton when opening a new baton. Given one baton in a set, other batons
139  * may be retrieved. This allows an entire hierarchy to be locked, and
140  * then the set of batons can be passed around by passing a single baton.
141  */
143 
144 
145 /**
146  * Return, in @a *adm_access, a pointer to a new access baton for the working
147  * copy administrative area associated with the directory @a path. If
148  * @a write_lock is TRUE the baton will include a write lock, otherwise the
149  * baton can only be used for read access. If @a path refers to a directory
150  * that is already write locked then the error @c SVN_ERR_WC_LOCKED will be
151  * returned. The error @c SVN_ERR_WC_NOT_DIRECTORY will be returned if
152  * @a path is not a versioned directory.
153  *
154  * If @a associated is an open access baton then @a adm_access will be added
155  * to the set containing @a associated. @a associated can be @c NULL, in
156  * which case @a adm_access is the start of a new set.
157  *
158  * @a levels_to_lock specifies how far to lock. Zero means just the specified
159  * directory. Any negative value means to lock the entire working copy
160  * directory hierarchy under @a path. A positive value indicates the number of
161  * levels of directories to lock -- 1 means just immediate subdirectories, 2
162  * means immediate subdirectories and their subdirectories, etc. All the
163  * access batons will become part of the set containing @a adm_access. This
164  * is an all-or-nothing option, if it is not possible to lock all the
165  * requested directories then an error will be returned and @a adm_access will
166  * be invalid, with the exception that subdirectories of @a path that are
167  * missing from the physical filesystem will not be locked and will not cause
168  * an error. The error @c SVN_ERR_WC_LOCKED will be returned if a
169  * subdirectory of @a path is already write locked.
170  *
171  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
172  * if the client has cancelled the operation.
173  *
174  * @a pool will be used to allocate memory for the baton and any subsequently
175  * cached items. If @a adm_access has not been closed when the pool is
176  * cleared, it will be closed automatically at that point, and removed from
177  * its set. A baton closed in this way will not remove physical locks from
178  * the working copy if cleanup is required.
179  *
180  * The first baton in a set, with @a associated passed as @c NULL, must have
181  * the longest lifetime of all the batons in the set. This implies it must be
182  * the root of the hierarchy.
183  *
184  * @since New in 1.2.
185  */
186 svn_error_t *
188  svn_wc_adm_access_t *associated,
189  const char *path,
190  svn_boolean_t write_lock,
191  int levels_to_lock,
192  svn_cancel_func_t cancel_func,
193  void *cancel_baton,
194  apr_pool_t *pool);
195 
196 /**
197  * Similar to svn_wc_adm_open3(), but without cancellation support.
198  *
199  * @deprecated Provided for backward compatibility with the 1.1 API.
200  */
202 svn_error_t *
204  svn_wc_adm_access_t *associated,
205  const char *path,
206  svn_boolean_t write_lock,
207  int levels_to_lock,
208  apr_pool_t *pool);
209 
210 /**
211  * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of
212  * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
213  * is @c TRUE, else 0.
214  *
215  * @deprecated Provided for backward compatibility with the 1.0 API.
216  */
218 svn_error_t *
220  svn_wc_adm_access_t *associated,
221  const char *path,
222  svn_boolean_t write_lock,
223  svn_boolean_t tree_lock,
224  apr_pool_t *pool);
225 
226 /**
227  * Checks the working copy to determine the node type of @a path. If
228  * @a path is a versioned directory then the behaviour is like that of
229  * svn_wc_adm_open3(), otherwise, if @a path is a file or does not
230  * exist, then the behaviour is like that of svn_wc_adm_open3() with
231  * @a path replaced by the parent directory of @a path. If @a path is
232  * an unversioned directory, the behaviour is also like that of
233  * svn_wc_adm_open3() on the parent, except that if the open fails,
234  * then the returned SVN_ERR_WC_NOT_DIRECTORY error refers to @a path,
235  * not to @a path's parent.
236  *
237  * @since New in 1.2.
238  */
239 svn_error_t *
241  svn_wc_adm_access_t *associated,
242  const char *path,
243  svn_boolean_t write_lock,
244  int levels_to_lock,
245  svn_cancel_func_t cancel_func,
246  void *cancel_baton,
247  apr_pool_t *pool);
248 
249 /**
250  * Similar to svn_wc_adm_probe_open3() without the cancel
251  * functionality.
252  *
253  * @deprecated Provided for backward compatibility with the 1.1 API.
254  */
256 svn_error_t *
258  svn_wc_adm_access_t *associated,
259  const char *path,
260  svn_boolean_t write_lock,
261  int levels_to_lock,
262  apr_pool_t *pool);
263 
264 /**
265  * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of
266  * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
267  * is @c TRUE, else 0.
268  *
269  * @deprecated Provided for backward compatibility with the 1.0 API.
270  */
272 svn_error_t *
274  svn_wc_adm_access_t *associated,
275  const char *path,
276  svn_boolean_t write_lock,
277  svn_boolean_t tree_lock,
278  apr_pool_t *pool);
279 
280 /**
281  * Open access batons for @a path and return in @a *anchor_access and
282  * @a *target the anchor and target required to drive an editor. Return
283  * in @a *target_access the access baton for the target, which may be the
284  * same as @a *anchor_access (in which case @a *target is the empty
285  * string, never NULL). All the access batons will be in the
286  * @a *anchor_access set.
287  *
288  * @a levels_to_lock determines the levels_to_lock used when opening
289  * @a path if @a path is a versioned directory, @a levels_to_lock is
290  * ignored otherwise. If @a write_lock is @c TRUE the access batons
291  * will hold write locks.
292  *
293  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
294  * if the client has cancelled the operation.
295  *
296  * This function is essentially a combination of svn_wc_adm_open3() and
297  * svn_wc_get_actual_target(), with the emphasis on reducing physical IO.
298  *
299  * @since New in 1.2.
300  */
301 svn_error_t *
303  svn_wc_adm_access_t **target_access,
304  const char **target,
305  const char *path,
306  svn_boolean_t write_lock,
307  int levels_to_lock,
308  svn_cancel_func_t cancel_func,
309  void *cancel_baton,
310  apr_pool_t *pool);
311 
312 /** Return, in @a *adm_access, a pointer to an existing access baton associated
313  * with @a path. @a path must be a directory that is locked as part of the
314  * set containing the @a associated access baton.
315  *
316  * If the requested access baton is marked as missing in, or is simply
317  * absent from, @a associated, return SVN_ERR_WC_NOT_LOCKED.
318  *
319  * @a pool is used only for local processing, it is not used for the batons.
320  */
321 svn_error_t *
323  svn_wc_adm_access_t *associated,
324  const char *path,
325  apr_pool_t *pool);
326 
327 /** Check the working copy to determine the node type of @a path. If
328  * @a path is a versioned directory then the behaviour is like that of
329  * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned
330  * directory, or does not exist, then the behaviour is like that of
331  * svn_wc_adm_retrieve() with @a path replaced by the parent directory of
332  * @a path.
333  */
334 svn_error_t *
336  svn_wc_adm_access_t *associated,
337  const char *path,
338  apr_pool_t *pool);
339 
340 /**
341  * Try various ways to obtain an access baton for @a path.
342  *
343  * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(),
344  * but if this fails because @a associated can't give a baton for
345  * @a path or @a path's parent, then try svn_wc_adm_probe_open3(),
346  * this time passing @a write_lock and @a levels_to_lock. If there is
347  * still no access because @a path is not a versioned directory, then
348  * just set @a *adm_access to NULL and return success. But if it is
349  * because @a path is locked, then return the error @c SVN_ERR_WC_LOCKED,
350  * and the effect on @a *adm_access is undefined. (Or if the attempt
351  * fails for any other reason, return the corresponding error, and the
352  * effect on @a *adm_access is also undefined.)
353  *
354  * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to
355  * @a associated.
356  *
357  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
358  * if the client has cancelled the operation.
359  *
360  * Use @a pool only for local processing, not to allocate @a *adm_access.
361  *
362  * @since New in 1.2.
363  */
364 svn_error_t *
366  svn_wc_adm_access_t *associated,
367  const char *path,
368  svn_boolean_t write_lock,
369  int levels_to_lock,
370  svn_cancel_func_t cancel_func,
371  void *cancel_baton,
372  apr_pool_t *pool);
373 
374 /**
375  * Similar to svn_wc_adm_probe_try3() without the cancel
376  * functionality.
377  *
378  * @deprecated Provided for backward compatibility with the 1.1 API.
379  */
381 svn_error_t *
383  svn_wc_adm_access_t *associated,
384  const char *path,
385  svn_boolean_t write_lock,
386  int levels_to_lock,
387  apr_pool_t *pool);
388 
389 /**
390  * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of
391  * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
392  * is @c TRUE, else 0.
393  *
394  * @deprecated Provided for backward compatibility with the 1.0 API.
395  */
397 svn_error_t *
399  svn_wc_adm_access_t *associated,
400  const char *path,
401  svn_boolean_t write_lock,
402  svn_boolean_t tree_lock,
403  apr_pool_t *pool);
404 
405 
406 /** Give up the access baton @a adm_access, and its lock if any. This will
407  * recursively close any batons in the same set that are direct
408  * subdirectories of @a adm_access. Any physical locks will be removed from
409  * the working copy. Lock removal is unconditional, there is no check to
410  * determine if cleanup is required.
411  *
412  * Any temporary allocations are performed using @a scratch_pool.
413  *
414  * @since New in 1.6
415  */
416 svn_error_t *
418  apr_pool_t *scratch_pool);
419 
420 /* @deprecated Provided for backward compabibility with the 1.5 API. */
422 svn_error_t *
423 svn_wc_adm_close(svn_wc_adm_access_t *adm_access);
424 
425 /** Return the path used to open the access baton @a adm_access */
426 const char *
428 
429 /** Return the pool used by access baton @a adm_access */
430 apr_pool_t *
432 
433 /** Return @c TRUE is the access baton @a adm_access has a write lock,
434  * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast
435  * function that doesn't access the filesystem.
436  */
438 svn_wc_adm_locked(const svn_wc_adm_access_t *adm_access);
439 
440 /** Set @a *locked to non-zero if @a path is locked, else set it to zero. */
441 svn_error_t *
443  const char *path,
444  apr_pool_t *pool);
445 
446 
447 /**
448  * Return @c TRUE if @a name is the name of the WC administrative
449  * directory. Use @a pool for any temporary allocations. Only works
450  * with base directory names, not paths or URIs.
451  *
452  * For compatibility, the default name (.svn) will always be treated
453  * as an admin dir name, even if the working copy is actually using an
454  * alternative name.
455  *
456  * @since New in 1.3.
457  */
459 svn_wc_is_adm_dir(const char *name, apr_pool_t *pool);
460 
461 
462 /**
463  * Return the name of the administrative directory.
464  * Use @a pool for any temporary allocations.
465  *
466  * The returned pointer will refer to either a statically allocated
467  * string, or to a string allocated in @a pool.
468  *
469  * @since New in 1.3.
470  */
471 const char *
472 svn_wc_get_adm_dir(apr_pool_t *pool);
473 
474 
475 /**
476  * Use @a name for the administrative directory in the working copy.
477  * Use @a pool for any temporary allocations.
478  *
479  * The list of valid names is limited. Currently only ".svn" (the
480  * default) and "_svn" are allowed.
481  *
482  * @note This function changes global (per-process) state and must be
483  * called in a single-threaded context during the initialization of a
484  * Subversion client.
485  *
486  * @since New in 1.3.
487  */
488 svn_error_t *
489 svn_wc_set_adm_dir(const char *name,
490  apr_pool_t *pool);
491 
492 
493 
494 /** Traversal information is information gathered by a working copy
495  * crawl or update. For example, the before and after values of the
496  * svn:externals property are important after an update, and since
497  * we're traversing the working tree anyway (a complete traversal
498  * during the initial crawl, and a traversal of changed paths during
499  * the checkout/update/switch), it makes sense to gather the
500  * property's values then instead of making a second pass.
501  */
503 
504 
505 /** Return a new, empty traversal info object, allocated in @a pool. */
507 svn_wc_init_traversal_info(apr_pool_t *pool);
508 
509 
510 /** Set @a *externals_old and @a *externals_new to hash tables representing
511  * changes to values of the svn:externals property on directories
512  * traversed by @a traversal_info.
513  *
514  * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
515  * only useful after it has been passed through another function, such
516  * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
517  * svn_wc_get_switch_editor(), etc.
518  *
519  * Each hash maps <tt>const char *</tt> directory names onto
520  * <tt>const char *</tt> values of the externals property for that directory.
521  * The dir names are full paths -- that is, anchor plus target, not target
522  * alone. The values are not parsed, they are simply copied raw, and are
523  * never NULL: directories that acquired or lost the property are
524  * simply omitted from the appropriate table. Directories whose value
525  * of the property did not change show the same value in each hash.
526  *
527  * The hashes, keys, and values have the same lifetime as @a traversal_info.
528  */
529 void
530 svn_wc_edited_externals(apr_hash_t **externals_old,
531  apr_hash_t **externals_new,
532  svn_wc_traversal_info_t *traversal_info);
533 
534 
535 /** Set @a *depths to a hash table mapping <tt>const char *</tt>
536  * directory names (directories traversed by @a traversal_info) to
537  * <tt>const char *</tt> values (the depths of those directories, as
538  * converted by svn_depth_to_word()).
539  *
540  * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
541  * only useful after it has been passed through another function, such
542  * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
543  * svn_wc_get_switch_editor(), etc.
544  *
545  * The dir names are full paths -- that is, anchor plus target, not target
546  * alone. The values are not allocated, they are static constant strings.
547  * Although the values are never NULL, not all directories traversed
548  * are necessarily listed. For example, directories which did not
549  * have an svn:externals property set or modified are not included.
550  *
551  * The hashes and keys have the same lifetime as @a traversal_info.
552  *
553  * @since New in 1.5.
554  */
555 void
556 svn_wc_traversed_depths(apr_hash_t **depths,
557  svn_wc_traversal_info_t *traversal_info);
558 
559 
560 /** One external item. This usually represents one line from an
561  * svn:externals description but with the path and URL
562  * canonicalized.
563  *
564  * In order to avoid backwards compatibility problems clients should use
565  * svn_wc_external_item_create() to allocate and initialize this structure
566  * instead of doing so themselves.
567  *
568  * @since New in 1.5.
569  */
571 {
572  /** The name of the subdirectory into which this external should be
573  checked out. This is relative to the parent directory that
574  holds this external item. (Note that these structs are often
575  stored in hash tables with the target dirs as keys, so this
576  field will often be redundant.) */
577  const char *target_dir;
578 
579  /** Where to check out from. */
580  const char *url;
581 
582  /** What revision to check out. The only valid kinds for this are
583  svn_opt_revision_number, svn_opt_revision_date, and
584  svn_opt_revision_head. */
586 
587  /** The peg revision to use when checking out. The only valid kinds are
588  svn_opt_revision_number, svn_opt_revision_date, and
589  svn_opt_revision_head. */
591 
593 
594 /**
595  * Initialize an external item.
596  * Set @a *item to an external item object, allocated in @a pool.
597  *
598  * In order to avoid backwards compatibility problems, this function
599  * is used to initialize and allocate the @c svn_wc_external_item2_t
600  * structure rather than doing so explicitly, as the size of this
601  * structure may change in the future.
602  *
603  * The current implementation never returns error, but callers should
604  * still check for error, for compatibility with future versions.
605  *
606  * @since New in 1.5.
607  */
608 svn_error_t *
610  apr_pool_t *pool);
611 
612 /**
613  * Return a duplicate of @a item, allocated in @a pool. No part of the new
614  * item will be shared with @a item.
615  *
616  * @since New in 1.5.
617  */
620  apr_pool_t *pool);
621 
622 /**
623  * One external item. Similar to svn_wc_external_item2_t, except
624  * @a revision is interpreted as both the operational revision and the
625  * peg revision.
626  *
627  * @deprecated Provided for backward compatibility with the 1.4 API.
628  */
630 {
631  /** Same as @c svn_wc_external_item2_t.target_dir */
632  const char *target_dir;
633 
634  /** Same as @c svn_wc_external_item2_t.url */
635  const char *url;
636 
637  /** Same as @c svn_wc_external_item2_t.revision */
639 
641 
642 /**
643  * Return a duplicate of @a item, allocated in @a pool. No part of the new
644  * item will be shared with @a item.
645  *
646  * @since New in 1.3.
647  *
648  * @deprecated Provided for backward compatibility with the 1.4 API.
649  */
653  apr_pool_t *pool);
654 
655 /**
656  * If @a externals_p is non-NULL, set @a *externals_p to an array of
657  * @c svn_wc_external_item2_t * objects based on @a desc. The @a url
658  * member of the objects will be canonicalized if @a canonicalize_url
659  * is @c TRUE.
660  *
661  * If the format of @a desc is invalid, don't touch @a *externals_p and
662  * return @c SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if
663  * you just want to check the validity of an externals description,
664  * and don't care about the parsed result, pass NULL for @a externals_p.
665  *
666  * The format of @a desc is the same as for values of the directory
667  * property @c SVN_PROP_EXTERNALS, which see.
668  *
669  * Allocate the table, keys, and values in @a pool.
670  *
671  * Use @a parent_directory only in constructing error strings.
672  *
673  * @since New in 1.5.
674  */
675 svn_error_t *
676 svn_wc_parse_externals_description3(apr_array_header_t **externals_p,
677  const char *parent_directory,
678  const char *desc,
679  svn_boolean_t canonicalize_url,
680  apr_pool_t *pool);
681 
682 /**
683  * Similar to svn_wc_parse_externals_description3() with @a
684  * canonicalize_url set to @c TRUE, but returns an array of @c
685  * svn_wc_external_item_t * objects instead of @c
686  * svn_wc_external_item2_t * objects
687  *
688  * @since New in 1.1.
689  *
690  * @deprecated Provided for backward compatibility with the 1.4 API.
691  */
693 svn_error_t *
694 svn_wc_parse_externals_description2(apr_array_header_t **externals_p,
695  const char *parent_directory,
696  const char *desc,
697  apr_pool_t *pool);
698 
699 /**
700  * Similar to svn_wc_parse_externals_description2(), but returns the
701  * parsed externals in a hash instead of an array. This function
702  * should not be used, as storing the externals in a hash causes their
703  * order of evaluation to be not easily identifiable.
704  *
705  * @deprecated Provided for backward compatibility with the 1.0 API.
706  */
708 svn_error_t *
709 svn_wc_parse_externals_description(apr_hash_t **externals_p,
710  const char *parent_directory,
711  const char *desc,
712  apr_pool_t *pool);
713 
714 
715 
716 /* Notification/callback handling. */
717 
718 /**
719  * @defgroup svn_wc_notifications Notification callback handling
720  * @{
721  *
722  * In many cases, the WC library will scan a working copy and make
723  * changes. The caller usually wants to know when each of these changes
724  * has been made, so that it can display some kind of notification to
725  * the user.
726  *
727  * These notifications have a standard callback function type, which
728  * takes the path of the file that was affected, and a caller-
729  * supplied baton.
730  *
731  * Note that the callback is a 'void' return -- this is a simple
732  * reporting mechanism, rather than an opportunity for the caller to
733  * alter the operation of the WC library.
734  *
735  * Note also that some of the actions are used across several
736  * different Subversion commands. For example, the update actions are
737  * also used for checkouts, switches, and merges.
738  */
739 
740 /** The type of action occurring. */
742 {
743  /** Adding a path to revision control. */
745 
746  /** Copying a versioned path. */
748 
749  /** Deleting a versioned path. */
751 
752  /** Restoring a missing path from the pristine text-base. */
754 
755  /** Reverting a modified path. */
757 
758  /** A revert operation has failed. */
760 
761  /** Resolving a conflict. */
763 
764  /** Skipping a path. */
766 
767  /** Got a delete in an update. */
769 
770  /** Got an add in an update. */
772 
773  /** Got any other action in an update. */
775 
776  /** The last notification in an update (including updates of externals). */
778 
779  /** Updating an external module. */
781 
782  /** The last notification in a status (including status on externals). */
784 
785  /** Running status on an external module. */
787 
788  /** Committing a modification. */
790 
791  /** Committing an addition. */
793 
794  /** Committing a deletion. */
796 
797  /** Committing a replacement. */
799 
800  /** Transmitting post-fix text-delta data for a file. */
802 
803  /** Processed a single revision's blame. */
805 
806  /** Locking a path. @since New in 1.2. */
808 
809  /** Unlocking a path. @since New in 1.2. */
811 
812  /** Failed to lock a path. @since New in 1.2. */
814 
815  /** Failed to unlock a path. @since New in 1.2. */
817 
818  /** Tried adding a path that already exists. @since New in 1.5. */
820 
821  /** Changelist name set. @since New in 1.5. */
823 
824  /** Changelist name cleared. @since New in 1.5. */
826 
827  /** Warn user that a path has moved from one changelist to another.
828  @since New in 1.5. */
830 
831  /** A merge operation (to path) has begun. See @c merge_range in
832  @c svn_wc_notify_t. @since New in 1.5. */
834 
835  /** A merge operation (to path) from a foreign repository has begun.
836  See @c merge_range in @c svn_wc_notify_t. @since New in 1.5. */
838 
839  /** Replace notification. @since New in 1.5. */
841 
842  /** Property added. @since New in 1.6. */
844 
845  /** Property updated. @since New in 1.6. */
847 
848  /** Property deleted. @since New in 1.6. */
850 
851  /** Nonexistent property deleted. @since New in 1.6. */
853 
854  /** Revprop set. @since New in 1.6. */
856 
857  /** Revprop deleted. @since New in 1.6. */
859 
860  /** The last notification in a merge. @since New in 1.6. */
862 
863  /** The path is a tree-conflict victim of the intended action (*not*
864  * a persistent tree-conflict from an earlier operation, but *this*
865  * operation caused the tree-conflict). @since New in 1.6. */
867 
868  /** The path is a subdirectory referenced in an externals definition
869  * which is unable to be operated on. @since New in 1.6. */
871 
873 
874 
875 /** The type of notification that is occurring. */
877 {
878  svn_wc_notify_state_inapplicable = 0,
879 
880  /** Notifier doesn't know or isn't saying. */
882 
883  /** The state did not change. */
885 
886  /** The item wasn't present. */
888 
889  /** An unversioned item obstructed work. */
891 
892  /** Pristine state was modified. */
894 
895  /** Modified state had mods merged in. */
897 
898  /** Modified state got conflicting mods. */
900 
902 
903 /**
904  * What happened to a lock during an operation.
905  *
906  * @since New in 1.2.
907  */
909 {
910  svn_wc_notify_lock_state_inapplicable = 0,
911 
912  svn_wc_notify_lock_state_unknown,
913 
914  /** The lock wasn't changed. */
916 
917  /** The item was locked. */
919 
920  /** The item was unlocked. */
922 
924 
925 /**
926  * Structure used in the @c svn_wc_notify_func2_t function.
927  *
928  * @c kind, @c content_state, @c prop_state and @c lock_state are from
929  * after @c action, not before.
930  *
931  * @note If @c action is @c svn_wc_notify_update, then @c path has
932  * already been installed, so it is legitimate for an implementation of
933  * @c svn_wc_notify_func2_t to examine @c path in the working copy.
934  *
935  * @note The purpose of the @c kind, @c mime_type, @c content_state, and
936  * @c prop_state fields is to provide "for free" information that an
937  * implementation is likely to want, and which it would otherwise be
938  * forced to deduce via expensive operations such as reading entries
939  * and properties. However, if the caller does not have this
940  * information, it will simply pass the corresponding `*_unknown'
941  * values, and it is up to the implementation how to handle that
942  * (i.e., whether to attempt deduction, or just to punt and
943  * give a less informative notification).
944  *
945  * @note Callers of notification functions should use svn_wc_create_notify()
946  * or svn_wc_create_notify_url() to create structures of this type to allow
947  * for extensibility.
948  *
949  * @since New in 1.2.
950  */
951 typedef struct svn_wc_notify_t {
952 
953  /** Path, either absolute or relative to the current working directory
954  * (i.e., not relative to an anchor).@c path is "." or another valid path
955  * value for compatibilty reasons when the real target is an url that
956  * is available in @c url. */
957  const char *path;
958 
959  /** Action that describes what happened to @c path. */
961 
962  /** Node kind of @c path. */
964 
965  /** If non-NULL, indicates the mime-type of @c path.
966  * It is always @c NULL for directories. */
967  const char *mime_type;
968 
969  /** Points to the lock structure received from the repository when
970  * @c action is @c svn_wc_notify_locked. For other actions, it is
971  * @c NULL. */
972  const svn_lock_t *lock;
973 
974  /** Points to an error describing the reason for the failure when @c
975  * action is one of the following: @c svn_wc_notify_failed_lock, @c
976  * svn_wc_notify_failed_unlock, @c svn_wc_notify_failed_external.
977  * Is @c NULL otherwise. */
979 
980  /** The type of notification that is occurring about node content. */
982 
983  /** The type of notification that is occurring about node properties. */
985 
986  /** Reflects the addition or removal of a lock token in the working copy. */
988 
989  /** When @c action is @c svn_wc_notify_update_completed, target revision
990  * of the update, or @c SVN_INVALID_REVNUM if not available; when @c
991  * action is @c svn_wc_notify_blame_revision, processed revision.
992  * In all other cases, it is @c SVN_INVALID_REVNUM. */
994 
995  /** When @c action is @c svn_wc_notify_changelist_add or name. In all other
996  * cases, it is @c NULL. @since New in 1.5 */
997  const char *changelist_name;
998 
999  /** When @c action is @c svn_wc_notify_merge_begin, and both the
1000  * left and right sides of the merge are from the same URL. In all
1001  * other cases, it is @c NULL. @since New in 1.5 */
1003 
1004  /** Similar to @c path, but if non-NULL the notification is about a url.
1005  * @since New in 1.6 */
1006  const char *url;
1007 
1008  /** If non-NULL, specifies an absolute path prefix that can be subtracted
1009  * from the start of the absolute path in @c path or @c url. Its purpose
1010  * is to allow notification to remove a common prefix from all the paths
1011  * displayed for an operation. @since New in 1.6 */
1012  const char *path_prefix;
1013 
1014  /** If @c action relates to properties, specifies the name of the property.
1015  * @since New in 1.6 */
1016  const char *prop_name;
1017 
1018  /** If @c action is @c svn_wc_notify_blame_revision, contains a list of
1019  * revision properties for the specified revision */
1020  apr_hash_t *rev_props;
1021 
1022  /* NOTE: Add new fields at the end to preserve binary compatibility.
1023  Also, if you add fields here, you have to update svn_wc_create_notify
1024  and svn_wc_dup_notify. */
1025 } svn_wc_notify_t;
1026 
1027 /**
1028  * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return
1029  * it.
1030  *
1031  * Set the @c path field of the created struct to @a path, and @c action to
1032  * @a action. Set all other fields to their @c _unknown, @c NULL or
1033  * invalid value, respectively. Make only a shallow copy of the pointer
1034  * @a path.
1035  *
1036  * @since New in 1.2.
1037  */
1039 svn_wc_create_notify(const char *path,
1040  svn_wc_notify_action_t action,
1041  apr_pool_t *pool);
1042 
1043 /**
1044  * Allocate an @c svn_wc_notify_t structure in @a pool, initialize and return
1045  * it.
1046  *
1047  * Set the @c url field of the created struct to @a url, @c action to, @c path
1048  * to "." and @a action. Set all other fields to their @c _unknown, @c NULL or
1049  * invalid value, respectively. Make only a shallow copy of the pointer
1050  * @a url.
1051  *
1052  * @since New in 1.6.
1053  */
1055 svn_wc_create_notify_url(const char *url,
1056  svn_wc_notify_action_t action,
1057  apr_pool_t *pool);
1058 
1059 /**
1060  * Return a deep copy of @a notify, allocated in @a pool.
1061  *
1062  * @since New in 1.2.
1063  */
1065 svn_wc_dup_notify(const svn_wc_notify_t *notify,
1066  apr_pool_t *pool);
1067 
1068 /**
1069  * Notify the world that @a notify->action has happened to @a notify->path.
1070  *
1071  * Recommendation: callers of @c svn_wc_notify_func2_t should avoid
1072  * invoking it multiple times on the same path within a given
1073  * operation, and implementations should not bother checking for such
1074  * duplicate calls. For example, in an update, the caller should not
1075  * invoke the notify func on receiving a prop change and then again
1076  * on receiving a text change. Instead, wait until all changes have
1077  * been received, and then invoke the notify func once (from within
1078  * an @c svn_delta_editor_t's close_file(), for example), passing
1079  * the appropriate @a notify->content_state and @a notify->prop_state flags.
1080  *
1081  * @since New in 1.2.
1082  */
1083 typedef void (*svn_wc_notify_func2_t)(void *baton,
1084  const svn_wc_notify_t *notify,
1085  apr_pool_t *pool);
1086 
1087 /**
1088  * Similar to @c svn_wc_notify_func2_t, but takes the information as arguments
1089  * instead of struct fields.
1090  *
1091  * @deprecated Provided for backward compatibility with the 1.1 API.
1092  */
1093 typedef void (*svn_wc_notify_func_t)(void *baton,
1094  const char *path,
1095  svn_wc_notify_action_t action,
1096  svn_node_kind_t kind,
1097  const char *mime_type,
1098  svn_wc_notify_state_t content_state,
1099  svn_wc_notify_state_t prop_state,
1100  svn_revnum_t revision);
1101 
1102 /** @} */
1103 
1104 
1105 /**
1106  * A simple callback type to wrap svn_ra_get_file(); see that
1107  * docstring for more information.
1108  *
1109  * This technique allows libsvn_client to 'wrap' svn_ra_get_file() and
1110  * pass it down into libsvn_wc functions, thus allowing the WC layer
1111  * to legally call the RA function via (blind) callback.
1112  *
1113  * @since New in 1.5
1114  */
1115 typedef svn_error_t *(*svn_wc_get_file_t)(void *baton,
1116  const char *path,
1117  svn_revnum_t revision,
1118  svn_stream_t *stream,
1119  svn_revnum_t *fetched_rev,
1120  apr_hash_t **props,
1121  apr_pool_t *pool);
1122 
1123 
1124 /**
1125  * Interactive conflict handling
1126  *
1127  * @defgroup svn_wc_conflict Conflict callback functionality
1128  *
1129  * @{
1130  *
1131  * This API gives a Subversion client application the opportunity to
1132  * define a callback that allows the user to resolve conflicts
1133  * interactively during updates and merges.
1134  *
1135  * If a conflict is discovered, libsvn_wc invokes the callback with an
1136  * @c svn_wc_conflict_description_t. This structure describes the
1137  * path in conflict, whether it's a text or property conflict, and may
1138  * also present up to three files that can be used to resolve the
1139  * conflict (perhaps by launching an editor or 3rd-party merging
1140  * tool). The structure also provides a possible fourth file (@c
1141  * merged_file) which, if not NULL, represents libsvn_wc's attempt to
1142  * contextually merge the first three files. (Note that libsvn_wc
1143  * will not attempt to merge a file that it believes is binary, and it
1144  * will only attempt to merge property values it believes to be a
1145  * series of multi-line text.)
1146  *
1147  * When the callback is finished interacting with the user, it
1148  * responds by returning a @c svn_wc_conflict_result_t. This
1149  * structure indicates whether the user wants to postpone the conflict
1150  * for later (allowing libsvn_wc to mark the path "conflicted" as
1151  * usual), or whether the user wants libsvn_wc to use one of the four
1152  * files as the "final" state for resolving the conflict immediately.
1153  *
1154  * Note that the callback is at liberty (and encouraged) to merge the
1155  * three files itself. If it does so, it signals this to libsvn_wc by
1156  * returning a choice of @c svn_wc_conflict_choose_merged. To return
1157  * the 'final' merged file to libsvn_wc, the callback has the option of
1158  * either:
1159  *
1160  * - editing the original @c merged_file in-place
1161  *
1162  * or, if libsvn_wc never supplied a merged_file in the
1163  * description structure (i.e. passed NULL for that field),
1164  *
1165  * - return the merged file in the @c svn_wc_conflict_result_t.
1166  *
1167  */
1168 
1169 /** The type of action being attempted on an object.
1170  *
1171  * @since New in 1.5.
1172  */
1174 {
1175  svn_wc_conflict_action_edit, /* attempting to change text or props */
1176  svn_wc_conflict_action_add, /* attempting to add object */
1177  svn_wc_conflict_action_delete /* attempting to delete object */
1178 
1180 
1181 
1182 /** The pre-existing condition which is causing a state of conflict.
1183  *
1184  * @since New in 1.5.
1185  */
1187 {
1188  /** Local edits are already present */
1190  /** Another object is in the way */
1192  /** Object is already schedule-delete */
1194  /** Object is unknown or missing */
1196  /** Object is unversioned */
1198  /** Object is already added or schedule-add. @since New in 1.6. */
1200 
1202 
1203 
1204 /** The type of conflict being described by an @c
1205  * svn_wc_conflict_description_t (see below).
1206  *
1207  * @since New in 1.5.
1208  */
1210 {
1211  /** textual conflict (on a file) */
1213  /** property conflict (on a file or dir) */
1215  /** tree conflict (on a dir) @since New in 1.6. */
1218 
1219 
1220 /** The user operation that exposed a conflict.
1221  *
1222  * @since New in 1.6.
1223  */
1225 {
1226  svn_wc_operation_none = 0,
1227  svn_wc_operation_update,
1228  svn_wc_operation_switch,
1229  svn_wc_operation_merge
1230 
1232 
1233 
1234 /** Info about one of the conflicting versions of a node. Each field may
1235  * have its respective null/invalid/unknown value if the corresponding
1236  * information is not relevant or not available.
1237  *
1238  * @todo Consider making some or all of the info mandatory, to reduce
1239  * complexity.
1240  *
1241  * @note Fields may be added to the end of this structure in future
1242  * versions. Therefore, to preserve binary compatibility, users
1243  * should not directly allocate structures of this type.
1244  *
1245  * @see svn_wc_conflict_version_create()
1246  * @see svn_wc_conflict_version_dup()
1247  *
1248  * @since New in 1.6.
1249 */
1251 {
1252  /** @name Where to find this node version in a repository */
1253  /**@{*/
1254 
1255  /** URL of repository root */
1256  const char *repos_url;
1257 
1258  /** revision at which to look up path_in_repos */
1260 
1261  /** path within repos; must not start with '/' */
1262  const char *path_in_repos;
1263  /* @todo We may decide to add the repository UUID, to handle conflicts
1264  * properly during a repository move. */
1265  /** @} */
1266 
1267  /** Info about this node */
1268  svn_node_kind_t node_kind; /* note that 'none' is a legitimate value */
1269 
1270  /* @todo Add metadata about a local copy of the node, if and when
1271  * we store one. */
1272 
1273  /* Remember to update svn_wc_conflict_version_create() and
1274  * svn_wc_conflict_version_dup() in case you add fields to this struct. */
1276 
1277 /**
1278  * Allocate an @c svn_wc_conflict_version_t structure in @a pool,
1279  * initialize to contain a conflict origin, and return it.
1280  *
1281  * Set the @c repos_url field of the created struct to @a repos_url, the
1282  * @c path_in_repos field to @a path_in_repos, the @c peg_rev field to
1283  * @a peg_rev and the the @c node_kind to @c node_kind. Make only shallow
1284  * copies of the pointer arguments.
1285  *
1286  * @since New in 1.6.
1287  */
1289 svn_wc_conflict_version_create(const char *repos_url,
1290  const char* path_in_repos,
1291  svn_revnum_t peg_rev,
1292  svn_node_kind_t node_kind,
1293  apr_pool_t *pool);
1294 
1295 /** Return a duplicate of @a version, allocated in @a pool.
1296  * No part of the new version will be shared with @a version.
1297  *
1298  * @since New in 1.6.
1299  */
1302  apr_pool_t *pool);
1303 
1304 
1305 /** A struct that describes a conflict that has occurred in the
1306  * working copy. Passed to @c svn_wc_conflict_resolver_func_t.
1307  *
1308  * The conflict described by this structure is one of:
1309  * - a conflict on the content of the file node @a path
1310  * - a conflict on the property @a property_name of @a path
1311  *
1312  * @note Fields may be added to the end of this structure in future
1313  * versions. Therefore, to preserve binary compatibility, users
1314  * should not directly allocate structures of this type but should use
1315  * svn_wc_create_conflict_description_text() or
1316  * svn_wc_create_conflict_description_prop() or
1317  * svn_wc_create_conflict_description_tree() instead.
1318  *
1319  * @since New in 1.5.
1320  */
1322 {
1323  /** The path that is in conflict (for a tree conflict, it is the victim) */
1324  const char *path;
1325 
1326  /** The node type of the path being operated on (for a tree conflict,
1327  * ### which version?) */
1329 
1330  /** What sort of conflict are we describing? */
1332 
1333  /** The name of the property whose conflict is being described.
1334  * (Only if @a kind is 'property'; else undefined.) */
1335  const char *property_name;
1336 
1337  /** Whether svn thinks ('my' version of) @c path is a 'binary' file.
1338  * (Only if @c kind is 'text', else undefined.) */
1340 
1341  /** The svn:mime-type property of ('my' version of) @c path, if available,
1342  * else NULL.
1343  * (Only if @c kind is 'text', else undefined.) */
1344  const char *mime_type;
1345 
1346  /** If not NULL, an open working copy access baton to either the
1347  * path itself (if @c path is a directory), or to the parent
1348  * directory (if @c path is a file.)
1349  * For a tree conflict, this will always be an access baton
1350  * to the parent directory of the path, even if the path is
1351  * a directory. */
1353 
1354  /** The action being attempted on the conflicted node or property.
1355  * (When @c kind is 'text', this action must be 'edit'.) */
1357 
1358  /** The state of the target node or property, relative to its merge-left
1359  * source, that is the reason for the conflict.
1360  * (When @c kind is 'text', this reason must be 'edited'.) */
1362 
1363  /** If this is text-conflict and involves the merging of two files
1364  * descended from a common ancestor, here are the paths of up to
1365  * four fulltext files that can be used to interactively resolve the
1366  * conflict. All four files will be in repository-normal form -- LF
1367  * line endings and contracted keywords. (If any of these files are
1368  * not available, they default to NULL.)
1369  *
1370  * On the other hand, if this is a property-conflict, then these
1371  * paths represent temporary files that contain the three different
1372  * property-values in conflict. The fourth path (@c merged_file)
1373  * may or may not be NULL; if set, it represents libsvn_wc's
1374  * attempt to merge the property values together. (Remember that
1375  * property values are technically binary values, and thus can't
1376  * always be merged.)
1377  */
1378  const char *base_file; /* common ancestor of the two files being merged */
1379 
1380  /** their version of the file */
1381  const char *their_file;
1382 
1383  /** my locally-edited version of the file */
1384  const char *my_file;
1385 
1386  /** merged version; may contain conflict markers */
1387  const char *merged_file;
1388 
1389  /** The operation that exposed the conflict.
1390  * Used only for tree conflicts.
1391  *
1392  * @since New in 1.6.
1393  */
1395 
1396  /** Info on the "merge-left source" or "older" version of incoming change.
1397  * @since New in 1.6. */
1399 
1400  /** Info on the "merge-right source" or "their" version of incoming change.
1401  * @since New in 1.6. */
1403 
1404  /* Remember to adjust svn_wc__conflict_description_dup()
1405  * if you add new fields to this struct. */
1407 
1408 /**
1409  * Allocate an @c svn_wc_conflict_description_t structure in @a pool,
1410  * initialize to represent a text conflict, and return it.
1411  *
1412  * Set the @c path field of the created struct to @a path, the @c access
1413  * field to @a adm_access, the @c kind field to @c
1414  * svn_wc_conflict_kind_text, the @c node_kind to @c svn_node_file, the @c
1415  * action to @c svn_wc_conflict_action_edit, and the @c reason to @c
1416  * svn_wc_conflict_reason_edited. Make only shallow copies of the pointer
1417  * arguments.
1418  *
1419  * @note: It is the caller's responsibility to set the other required fields
1420  * (such as the four file names and @c mime_type and @c is_binary).
1421  *
1422  * @since New in 1.6.
1423  */
1426  svn_wc_adm_access_t *adm_access,
1427  apr_pool_t *pool);
1428 
1429 /**
1430  * Allocate an @c svn_wc_conflict_description_t structure in @a pool,
1431  * initialize to represent a property conflict, and return it.
1432  *
1433  * Set the @c path field of the created struct to @a path, the @c access
1434  * field to @a adm_access, the @c kind field to @c
1435  * svn_wc_conflict_kind_prop, the @c node_kind to @a node_kind, and the @c
1436  * property_name to @a property_name. Make only shallow copies of the pointer
1437  * arguments.
1438  *
1439  * @note: It is the caller's responsibility to set the other required fields
1440  * (such as the four file names and @c action and @c reason).
1441  *
1442  * @since New in 1.6.
1443  */
1446  svn_wc_adm_access_t *adm_access,
1447  svn_node_kind_t node_kind,
1448  const char *property_name,
1449  apr_pool_t *pool);
1450 
1451 /**
1452  * Allocate an @c svn_wc_conflict_description_t structure in @a pool,
1453  * initialize to represent a tree conflict, and return it.
1454  *
1455  * Set the @c path field of the created struct to @a path, the @c access
1456  * field to @a adm_access, the @c kind field to @c
1457  * svn_wc_conflict_kind_tree, the @c node_kind to @a node_kind, the @c
1458  * operation to @a operation, the @c src_left_version field to
1459  * @a src_left_version, and the @c src_right_version field to
1460  * @a src_right_version.
1461  * Make only shallow copies of the pointer arguments.
1462  *
1463  * @note: It is the caller's responsibility to set the other required fields
1464  * (such as the four file names and @c action and @c reason).
1465  *
1466  * @since New in 1.6.
1467  */
1470  svn_wc_adm_access_t *adm_access,
1471  svn_node_kind_t node_kind,
1472  svn_wc_operation_t operation,
1474  *src_left_version,
1476  *src_right_version,
1477  apr_pool_t *pool);
1478 
1479 
1480 /** The way in which the conflict callback chooses a course of action.
1481  *
1482  * @since New in 1.5.
1483  */
1485 {
1486  /* Don't resolve the conflict now. Let libsvn_wc mark the path
1487  'conflicted', so user can run 'svn resolved' later. */
1488  svn_wc_conflict_choose_postpone,
1489 
1490  /* If their were files to choose from, select one as a way of
1491  resolving the conflict here and now. libsvn_wc will then do the
1492  work of "installing" the chosen file.
1493  */
1494  svn_wc_conflict_choose_base, /* original version */
1495  svn_wc_conflict_choose_theirs_full, /* incoming version */
1496  svn_wc_conflict_choose_mine_full, /* own version */
1497  svn_wc_conflict_choose_theirs_conflict, /* incoming (for conflicted hunks) */
1498  svn_wc_conflict_choose_mine_conflict, /* own (for conflicted hunks) */
1499  svn_wc_conflict_choose_merged /* merged version */
1500 
1502 
1503 
1504 /** The final result returned by @c svn_wc_conflict_resolver_func_t.
1505  *
1506  * @note Fields may be added to the end of this structure in future
1507  * versions. Therefore, to preserve binary compatibility, users
1508  * should not directly allocate structures of this type. Instead,
1509  * construct this structure using @c svn_wc_create_conflict_result()
1510  * below.
1511  *
1512  * @since New in 1.5.
1513  */
1515 {
1516  /** A choice to either delay the conflict resolution or select a
1517  particular file to resolve the conflict. */
1519 
1520  /** If not NULL, this is a path to a file which contains the client's
1521  (or more likely, the user's) merging of the three values in
1522  conflict. libsvn_wc accepts this file if (and only if) @c choice
1523  is set to @c svn_wc_conflict_choose_merged.*/
1524  const char *merged_file;
1525 
1526  /** If true, save a backup copy of merged_file (or the original
1527  merged_file from the conflict description, if merged_file is
1528  NULL) in the user's working copy. */
1530 
1532 
1533 
1534 /**
1535  * Allocate an @c svn_wc_conflict_result_t structure in @a pool,
1536  * initialize and return it.
1537  *
1538  * Set the @c choice field of the structure to @a choice, and @c
1539  * merged_file to @a merged_file. Set all other fields to their @c
1540  * _unknown, @c NULL or invalid value, respectively. Make only a shallow
1541  * copy of the pointer argument @a merged_file.
1542  *
1543  * @since New in 1.5.
1544  */
1547  const char *merged_file,
1548  apr_pool_t *pool);
1549 
1550 
1551 /** A callback used in svn_client_merge3(), svn_client_update3(), and
1552  * svn_client_switch2() for resolving conflicts during the application
1553  * of a tree delta to a working copy.
1554  *
1555  * @a description describes the exact nature of the conflict, and
1556  * provides information to help resolve it. @a baton is a closure
1557  * object; it should be provided by the implementation, and passed by
1558  * the caller. All allocations should be performed in @a pool. When
1559  * finished, the callback signals its resolution by returning a
1560  * structure in @a *result. (See @c svn_wc_conflict_result_t.)
1561  *
1562  * The values @c svn_wc_conflict_choose_mine_conflict and @c
1563  * svn_wc_conflict_choose_theirs_conflict are not legal for conflicts
1564  * in binary files or properties.
1565  *
1566  * Implementations of this callback are free to present the conflict
1567  * using any user interface. This may include simple contextual
1568  * conflicts in a file's text or properties, or more complex
1569  * 'tree'-based conflcts related to obstructed additions, deletions,
1570  * and edits. The callback implementation is free to decide which
1571  * sorts of conflicts to handle; it's also free to decide which types
1572  * of conflicts are automatically resolvable and which require user
1573  * interaction.
1574  *
1575  * @since New in 1.5.
1576  */
1577 typedef svn_error_t *(*svn_wc_conflict_resolver_func_t)
1579  const svn_wc_conflict_description_t *description,
1580  void *baton,
1581  apr_pool_t *pool);
1582 
1583 /** @} */
1584 
1585 
1586 
1587 /**
1588  * A callback vtable invoked by our diff-editors, as they receive
1589  * diffs from the server. 'svn diff' and 'svn merge' both implement
1590  * their own versions of this table.
1591  *
1592  * Common parameters:
1593  *
1594  * @a adm_access will be an access baton for the directory containing
1595  * @a path, or @c NULL if the diff editor is not using access batons.
1596  *
1597  * If @a state is non-NULL, set @a *state to the state of the item
1598  * after the operation has been performed. (In practice, this is only
1599  * useful with merge, not diff; diff callbacks will probably set
1600  * @a *state to @c svn_wc_notify_state_unknown, since they do not change
1601  * the state and therefore do not bother to know the state after the
1602  * operation.) By default, @a state refers to the item's content
1603  * state. Functions concerned with property state have separate
1604  * @a contentstate and @a propstate arguments.
1605  *
1606  * If @a tree_conflicted is non-NULL, set @a *tree_conflicted to true if
1607  * this operation caused a tree conflict, else to false. (Like with @a
1608  * state, this is only useful with merge, not diff; diff callbacks
1609  * should set this to false.)
1610  *
1611  * @since New in 1.6.
1612  */
1614 {
1615  /**
1616  * A file @a path has changed. If @a tmpfile2 is non-NULL, the
1617  * contents have changed and those changes can be seen by comparing
1618  * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
1619  * the file, respectively.
1620  *
1621  * If known, the @c svn:mime-type value of each file is passed into
1622  * @a mimetype1 and @a mimetype2; either or both of the values can
1623  * be NULL. The implementor can use this information to decide if
1624  * (or how) to generate differences.
1625  *
1626  * @a propchanges is an array of (@c svn_prop_t) structures. If it contains
1627  * any elements, the original list of properties is provided in
1628  * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1629  * property name.
1630  *
1631  */
1632  svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
1633  svn_wc_notify_state_t *contentstate,
1634  svn_wc_notify_state_t *propstate,
1635  svn_boolean_t *tree_conflicted,
1636  const char *path,
1637  const char *tmpfile1,
1638  const char *tmpfile2,
1639  svn_revnum_t rev1,
1640  svn_revnum_t rev2,
1641  const char *mimetype1,
1642  const char *mimetype2,
1643  const apr_array_header_t *propchanges,
1644  apr_hash_t *originalprops,
1645  void *diff_baton);
1646 
1647  /**
1648  * A file @a path was added. The contents can be seen by comparing
1649  * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
1650  * of the file, respectively. (If either file is empty, the rev
1651  * will be 0.)
1652  *
1653  * If known, the @c svn:mime-type value of each file is passed into
1654  * @a mimetype1 and @a mimetype2; either or both of the values can
1655  * be NULL. The implementor can use this information to decide if
1656  * (or how) to generate differences.
1657  *
1658  * @a propchanges is an array of (@c svn_prop_t) structures. If it contains
1659  * any elements, the original list of properties is provided in
1660  * @a originalprops, which is a hash of @c svn_string_t values, keyed on the
1661  * property name.
1662  */
1663  svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
1664  svn_wc_notify_state_t *contentstate,
1665  svn_wc_notify_state_t *propstate,
1666  svn_boolean_t *tree_conflicted,
1667  const char *path,
1668  const char *tmpfile1,
1669  const char *tmpfile2,
1670  svn_revnum_t rev1,
1671  svn_revnum_t rev2,
1672  const char *mimetype1,
1673  const char *mimetype2,
1674  const apr_array_header_t *propchanges,
1675  apr_hash_t *originalprops,
1676  void *diff_baton);
1677 
1678  /**
1679  * A file @a path was deleted. The [loss of] contents can be seen by
1680  * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides
1681  * the properties of the file.
1682  * ### Some existing callers include WC "entry props" in @a originalprops.
1683  *
1684  * If known, the @c svn:mime-type value of each file is passed into
1685  * @a mimetype1 and @a mimetype2; either or both of the values can
1686  * be NULL. The implementor can use this information to decide if
1687  * (or how) to generate differences.
1688  */
1689  svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
1690  svn_wc_notify_state_t *state,
1691  svn_boolean_t *tree_conflicted,
1692  const char *path,
1693  const char *tmpfile1,
1694  const char *tmpfile2,
1695  const char *mimetype1,
1696  const char *mimetype2,
1697  apr_hash_t *originalprops,
1698  void *diff_baton);
1699 
1700  /**
1701  * A directory @a path was added. @a rev is the revision that the
1702  * directory came from.
1703  */
1704  svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
1705  svn_wc_notify_state_t *state,
1706  svn_boolean_t *tree_conflicted,
1707  const char *path,
1708  svn_revnum_t rev,
1709  void *diff_baton);
1710 
1711  /**
1712  * A directory @a path was deleted.
1713  */
1714  svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
1715  svn_wc_notify_state_t *state,
1716  svn_boolean_t *tree_conflicted,
1717  const char *path,
1718  void *diff_baton);
1719 
1720  /**
1721  * A list of property changes (@a propchanges) was applied to the
1722  * directory @a path.
1723  *
1724  * The array is a list of (@c svn_prop_t) structures.
1725  *
1726  * The original list of properties is provided in @a original_props,
1727  * which is a hash of @c svn_string_t values, keyed on the property
1728  * name.
1729  */
1730  svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access,
1731  svn_wc_notify_state_t *propstate,
1732  svn_boolean_t *tree_conflicted,
1733  const char *path,
1734  const apr_array_header_t *propchanges,
1735  apr_hash_t *original_props,
1736  void *diff_baton);
1737 
1738  /**
1739  * A directory @a path has been opened. @a rev is the revision that the
1740  * directory came from.
1741  *
1742  * This function is called for @a path before any of the callbacks are
1743  * called for a child of @a path.
1744  */
1745  svn_error_t *(*dir_opened)(svn_wc_adm_access_t *adm_access,
1746  svn_boolean_t *tree_conflicted,
1747  const char *path,
1748  svn_revnum_t rev,
1749  void *diff_baton);
1750 
1751  /**
1752  * A directory @a path has been closed.
1753  */
1754  svn_error_t *(*dir_closed)(svn_wc_adm_access_t *adm_access,
1755  svn_wc_notify_state_t *contentstate,
1756  svn_wc_notify_state_t *propstate,
1757  svn_boolean_t *tree_conflicted,
1758  const char *path,
1759  void *diff_baton);
1760 
1762 
1763 /**
1764  * Similar to @c svn_wc_diff_callbacks3_t, but without the dir_opened()
1765  * function, and without the 'tree_conflicted' argument to the functions.
1766  *
1767  * @deprecated Provided for backward compatibility with the 1.2 API.
1768  */
1770 {
1771  /** The same as @c file_changed in @c svn_wc_diff_callbacks3_t. */
1772  svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
1773  svn_wc_notify_state_t *contentstate,
1774  svn_wc_notify_state_t *propstate,
1775  const char *path,
1776  const char *tmpfile1,
1777  const char *tmpfile2,
1778  svn_revnum_t rev1,
1779  svn_revnum_t rev2,
1780  const char *mimetype1,
1781  const char *mimetype2,
1782  const apr_array_header_t *propchanges,
1783  apr_hash_t *originalprops,
1784  void *diff_baton);
1785 
1786  /** The same as @c file_added in @c svn_wc_diff_callbacks3_t. */
1787  svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
1788  svn_wc_notify_state_t *contentstate,
1789  svn_wc_notify_state_t *propstate,
1790  const char *path,
1791  const char *tmpfile1,
1792  const char *tmpfile2,
1793  svn_revnum_t rev1,
1794  svn_revnum_t rev2,
1795  const char *mimetype1,
1796  const char *mimetype2,
1797  const apr_array_header_t *propchanges,
1798  apr_hash_t *originalprops,
1799  void *diff_baton);
1800 
1801  /** The same as @c file_deleted in @c svn_wc_diff_callbacks3_t. */
1802  svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
1803  svn_wc_notify_state_t *state,
1804  const char *path,
1805  const char *tmpfile1,
1806  const char *tmpfile2,
1807  const char *mimetype1,
1808  const char *mimetype2,
1809  apr_hash_t *originalprops,
1810  void *diff_baton);
1811 
1812  /** The same as @c dir_added in @c svn_wc_diff_callbacks3_t. */
1813  svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
1814  svn_wc_notify_state_t *state,
1815  const char *path,
1816  svn_revnum_t rev,
1817  void *diff_baton);
1818 
1819  /** The same as @c dir_deleted in @c svn_wc_diff_callbacks3_t. */
1820  svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
1821  svn_wc_notify_state_t *state,
1822  const char *path,
1823  void *diff_baton);
1824 
1825  /** The same as @c dir_props_changed in @c svn_wc_diff_callbacks3_t. */
1826  svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access,
1827  svn_wc_notify_state_t *state,
1828  const char *path,
1829  const apr_array_header_t *propchanges,
1830  apr_hash_t *original_props,
1831  void *diff_baton);
1832 
1834 
1835 /**
1836  * Similar to @c svn_wc_diff_callbacks2_t, but with file additions/content
1837  * changes and property changes split into different functions.
1838  *
1839  * @deprecated Provided for backward compatibility with the 1.1 API.
1840  */
1842 {
1843  /** Similar to @c file_changed in @c svn_wc_diff_callbacks2_t, but without
1844  * property change information. @a tmpfile2 is never NULL. @a state applies
1845  * to the file contents. */
1846  svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
1847  svn_wc_notify_state_t *state,
1848  const char *path,
1849  const char *tmpfile1,
1850  const char *tmpfile2,
1851  svn_revnum_t rev1,
1852  svn_revnum_t rev2,
1853  const char *mimetype1,
1854  const char *mimetype2,
1855  void *diff_baton);
1856 
1857  /** Similar to @c file_added in @c svn_wc_diff_callbacks2_t, but without
1858  * property change information. @a *state applies to the file contents. */
1859  svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
1860  svn_wc_notify_state_t *state,
1861  const char *path,
1862  const char *tmpfile1,
1863  const char *tmpfile2,
1864  svn_revnum_t rev1,
1865  svn_revnum_t rev2,
1866  const char *mimetype1,
1867  const char *mimetype2,
1868  void *diff_baton);
1869 
1870  /** Similar to @c file_deleted in @c svn_wc_diff_callbacks2_t, but without
1871  * the properties. */
1872  svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
1873  svn_wc_notify_state_t *state,
1874  const char *path,
1875  const char *tmpfile1,
1876  const char *tmpfile2,
1877  const char *mimetype1,
1878  const char *mimetype2,
1879  void *diff_baton);
1880 
1881  /** The same as @c dir_added in @c svn_wc_diff_callbacks2_t. */
1882  svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
1883  svn_wc_notify_state_t *state,
1884  const char *path,
1885  svn_revnum_t rev,
1886  void *diff_baton);
1887 
1888  /** The same as @c dir_deleted in @c svn_wc_diff_callbacks2_t. */
1889  svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
1890  svn_wc_notify_state_t *state,
1891  const char *path,
1892  void *diff_baton);
1893 
1894  /** Similar to @c dir_props_changed in @c svn_wc_diff_callbacks2_t, but this
1895  * function is called for files as well as directories. */
1896  svn_error_t *(*props_changed)(svn_wc_adm_access_t *adm_access,
1897  svn_wc_notify_state_t *state,
1898  const char *path,
1899  const apr_array_header_t *propchanges,
1900  apr_hash_t *original_props,
1901  void *diff_baton);
1902 
1904 
1905 
1906 /* Asking questions about a working copy. */
1907 
1908 /** Set @a *wc_format to @a path's working copy format version number if
1909  * @a path is a valid working copy directory, else set it to 0.
1910  * Return error @c APR_ENOENT if @a path does not exist at all.
1911  */
1912 svn_error_t *
1913 svn_wc_check_wc(const char *path,
1914  int *wc_format,
1915  apr_pool_t *pool);
1916 
1917 
1918 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked
1919  * with a property indicating that it is non-text (in other words, binary).
1920  * @a adm_access is an access baton set that contains @a path.
1921  */
1922 svn_error_t *
1923 svn_wc_has_binary_prop(svn_boolean_t *has_binary_prop,
1924  const char *path,
1925  svn_wc_adm_access_t *adm_access,
1926  apr_pool_t *pool);
1927 
1928 
1929 /* Detecting modification. */
1930 
1931 /** Set @a *modified_p to non-zero if @a filename's text is modified
1932  * with regard to the base revision, else set @a *modified_p to zero.
1933  * @a filename is a path to the file, not just a basename. @a adm_access
1934  * must be an access baton for @a filename.
1935  *
1936  * If @a force_comparison is @c TRUE, this function will not allow
1937  * early return mechanisms that avoid actual content comparison.
1938  * Instead, if there is a text base, a full byte-by-byte comparison
1939  * will be done, and the entry checksum verified as well. (This means
1940  * that if the text base is much longer than the working file, every
1941  * byte of the text base will still be examined.)
1942  *
1943  * If @a filename does not exist, consider it unmodified. If it exists
1944  * but is not under revision control (not even scheduled for
1945  * addition), return the error @c SVN_ERR_ENTRY_NOT_FOUND.
1946  *
1947  * If @a filename is unmodified but has a timestamp variation then this
1948  * function may "repair" @a filename's text-time by setting it to
1949  * @a filename's last modification time.
1950  */
1951 svn_error_t *
1953  const char *filename,
1954  svn_boolean_t force_comparison,
1955  svn_wc_adm_access_t *adm_access,
1956  apr_pool_t *pool);
1957 
1958 
1959 /** Set @a *modified_p to non-zero if @a path's properties are modified
1960  * with regard to the base revision, else set @a modified_p to zero.
1961  * @a adm_access must be an access baton for @a path.
1962  */
1963 svn_error_t *
1965  const char *path,
1966  svn_wc_adm_access_t *adm_access,
1967  apr_pool_t *pool);
1968 
1969 
1970 
1971 
1972 /** Administrative subdir.
1973  *
1974  * Ideally, this would be completely private to wc internals (in fact,
1975  * it used to be that adm_subdir() in adm_files.c was the only function
1976  * who knew the adm subdir's name). However, import wants to protect
1977  * against importing administrative subdirs, so now the name is a
1978  * matter of public record.
1979  *
1980  * @deprecated Provided for backward compatibility with the 1.2 API.
1981  */
1982 #define SVN_WC_ADM_DIR_NAME ".svn"
1983 
1984 
1985 
1986 /* Entries and status. */
1987 
1988 /** The schedule states an entry can be in. */
1989 typedef enum svn_wc_schedule_t
1990 {
1991  /** Nothing special here */
1993 
1994  /** Slated for addition */
1996 
1997  /** Slated for deletion */
1999 
2000  /** Slated for replacement (delete + add) */
2002 
2004 
2005 
2006 /**
2007  * Values for the working_size field in svn_wc_entry_t
2008  * when it isn't set to the actual size value of the unchanged
2009  * working file.
2010  *
2011  * @defgroup svn_wc_entry_working_size_constants Working size constants
2012  *
2013  * @{
2014  */
2015 
2016 /** The value of the working size is unknown (hasn't been
2017  * calculated and stored in the past for whatever reason).
2018  *
2019  * @since New in 1.5
2020  */
2021 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN (-1)
2022 
2023 /** @} */
2024 
2025 /** A working copy entry -- that is, revision control information about
2026  * one versioned entity.
2027  */
2028 typedef struct svn_wc_entry_t
2029 {
2030  /* IMPORTANT: If you extend this structure, add new fields to the end. */
2031 
2032  /* General Attributes */
2033 
2034  /** entry's name */
2035  const char *name;
2036 
2037  /** base revision */
2039 
2040  /** url in repository */
2041  const char *url;
2042 
2043  /** canonical repository URL or NULL if not known */
2044  const char *repos;
2045 
2046  /** repository uuid */
2047  const char *uuid;
2048 
2049  /** node kind (file, dir, ...) */
2051 
2052  /* State information */
2053 
2054  /** scheduling (add, delete, replace ...) */
2056 
2057  /** in a copied state (possibly because the entry is a child of a
2058  * path that is @c svn_wc_schedule_add or @c svn_wc_schedule_replace,
2059  * when the entry itself is @c svn_wc_schedule_normal).
2060  * COPIED is true for nodes under a directory that was copied, but
2061  * COPYFROM_URL is null there. They are both set for the root
2062  * destination of the copy.
2063  */
2065 
2066  /** The directory containing this entry had a versioned child of this
2067  * name, but this entry represents a different revision or a switched
2068  * path at which no item exists in the repository. This typically
2069  * arises from committing or updating to a deletion of this entry
2070  * without committing or updating the parent directory.
2071  *
2072  * The schedule can be 'normal' or 'add'. */
2074 
2075  /** absent -- we know an entry of this name exists, but that's all
2076  (usually this happens because of authz restrictions) */
2078 
2079  /** for THIS_DIR entry, implies whole entries file is incomplete */
2081 
2082  /** copyfrom location */
2083  const char *copyfrom_url;
2084 
2085  /** copyfrom revision */
2087 
2088  /** old version of conflicted file. A file basename, relative to the
2089  * user's directory that the THIS_DIR entry refers to. */
2090  const char *conflict_old;
2091 
2092  /** new version of conflicted file. A file basename, relative to the
2093  * user's directory that the THIS_DIR entry refers to. */
2094  const char *conflict_new;
2095 
2096  /** working version of conflicted file. A file basename, relative to the
2097  * user's directory that the THIS_DIR entry refers to. */
2098  const char *conflict_wrk;
2099 
2100  /** property reject file. A file basename, relative to the user's
2101  * directory that the THIS_DIR entry refers to. */
2102  const char *prejfile;
2103 
2104  /** last up-to-date time for text contents (0 means no information available)
2105  */
2106  apr_time_t text_time;
2107 
2108  /** last up-to-date time for properties (0 means no information available)
2109  *
2110  * @deprecated This value will always be 0 in version 1.4 and later.
2111  */
2112  apr_time_t prop_time;
2113 
2114  /** Hex MD5 checksum for the untranslated text base file,
2115  * can be @c NULL for backwards compatibility.
2116  */
2117  const char *checksum;
2118 
2119  /* "Entry props" */
2120 
2121  /** last revision this was changed */
2123 
2124  /** last date this was changed */
2125  apr_time_t cmt_date;
2126 
2127  /** last commit author of this item */
2128  const char *cmt_author;
2129 
2130  /** lock token or NULL if path not locked in this WC
2131  * @since New in 1.2.
2132  */
2133  const char *lock_token;
2134 
2135  /** lock owner, or NULL if not locked in this WC
2136  * @since New in 1.2.
2137  */
2138  const char *lock_owner;
2139 
2140  /** lock comment or NULL if not locked in this WC or no comment
2141  * @since New in 1.2.
2142  */
2143  const char *lock_comment;
2144 
2145  /** Lock creation date or 0 if not locked in this WC
2146  * @since New in 1.2.
2147  */
2149 
2150  /** Whether this entry has any working properties.
2151  * False if this information is not stored in the entry.
2152  *
2153  * @since New in 1.4. */
2155 
2156  /** Whether this entry has property modifications.
2157  *
2158  * @note For working copies in older formats, this flag is not valid.
2159  *
2160  * @see svn_wc_props_modified_p().
2161  *
2162  * @since New in 1.4. */
2164 
2165  /** A space-separated list of all properties whose presence/absence is cached
2166  * in this entry.
2167  *
2168  * @see @c present_props.
2169  *
2170  * @since New in 1.4.
2171  * @deprecated This value will always be "" in version 1.7 and later. */
2172  const char *cachable_props;
2173 
2174  /** Cached property existence for this entry.
2175  * This is a space-separated list of property names. If a name exists in
2176  * @c cachable_props but not in this list, this entry does not have that
2177  * property. If a name exists in both lists, the property is present on this
2178  * entry.
2179  *
2180  * @since New in 1.4.
2181  * @deprecated This value will always be "" in version 1.7 and later. */
2182  const char *present_props;
2183 
2184  /** which changelist this item is part of, or NULL if not part of any.
2185  * @since New in 1.5.
2186  */
2187  const char *changelist;
2188 
2189  /** Size of the file after being translated into local
2190  * representation, or @c SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if
2191  * unknown.
2192  *
2193  * @since New in 1.5.
2194  */
2195  apr_off_t working_size;
2196 
2197  /** Whether a local copy of this entry should be kept in the working copy
2198  * after a deletion has been committed, Only valid for the this-dir entry
2199  * when it is scheduled for deletion.
2200  *
2201  * @since New in 1.5. */
2203 
2204  /** The depth of this entry.
2205  *
2206  * ### It's a bit annoying that we only use this on this_dir
2207  * ### entries, yet it will exist (with value svn_depth_infinity) on
2208  * ### all entries. Maybe some future extensibility would make this
2209  * ### field meaningful on entries besides this_dir.
2210  *
2211  * @since New in 1.5. */
2213 
2214  /** Serialized data for all of the tree conflicts detected in this_dir.
2215  *
2216  * @since New in 1.6. */
2217  const char *tree_conflict_data;
2218 
2219  /** The entry is a intra-repository file external and this is the
2220  * repository root relative path to the file specified in the
2221  * externals definition, otherwise NULL if the entry is not a file
2222  * external.
2223  *
2224  * @since New in 1.6. */
2225  const char *file_external_path;
2226 
2227  /** The entry is a intra-repository file external and this is the
2228  * peg revision number specified in the externals definition. This
2229  * field is only valid when the file_external_path field is
2230  * non-NULL. The only permissible values are
2231  * svn_opt_revision_unspecified if the entry is not an external,
2232  * svn_opt_revision_head if the external revision is unspecified or
2233  * specified with -r HEAD or svn_opt_revision_number for a specific
2234  * revision number.
2235  *
2236  * @since New in 1.6. */
2238 
2239  /** The entry is a intra-repository file external and this is the
2240  * operative revision number specified in the externals definition.
2241  * This field is only valid when the file_external_path field is
2242  * non-NULL. The only permissible values are
2243  * svn_opt_revision_unspecified if the entry is not an external,
2244  * svn_opt_revision_head if the external revision is unspecified or
2245  * specified with -r HEAD or svn_opt_revision_number for a specific
2246  * revision number.
2247  *
2248  * @since New in 1.6. */
2250 
2251  /* IMPORTANT: If you extend this structure, check the following functions in
2252  * subversion/libsvn_wc/entries.c, to see if you need to extend them as well.
2253  *
2254  * svn_wc__atts_to_entry()
2255  * svn_wc_entry_dup()
2256  * alloc_entry()
2257  * read_entry()
2258  * write_entry()
2259  * fold_entry()
2260  */
2261 } svn_wc_entry_t;
2262 
2263 
2264 /** How an entries file's owner dir is named in the entries file. */
2265 #define SVN_WC_ENTRY_THIS_DIR ""
2266 
2267 
2268 /** Set @a *entry to an entry for @a path, allocated in the access baton pool.
2269  * If @a show_hidden is TRUE, return the entry even if it's in 'excluded',
2270  * 'deleted' or 'absent' state. Excluded entries are those with their depth
2271  * set to @c svn_depth_exclude. If @a path is not under revision control, or
2272  * if entry is hidden, not scheduled for re-addition, and @a show_hidden is @c
2273  * FALSE, then set @a *entry to @c NULL.
2274  *
2275  * @a *entry should not be modified, since doing so modifies the entries
2276  * cache in @a adm_access without changing the entries file on disk.
2277  *
2278  * If @a path is not a directory then @a adm_access must be an access baton
2279  * for the parent directory of @a path. To avoid needing to know whether
2280  * @a path is a directory or not, if @a path is a directory @a adm_access
2281  * can still be an access baton for the parent of @a path so long as the
2282  * access baton for @a path itself is in the same access baton set.
2283  *
2284  * @a path can be relative or absolute but must share the same base used
2285  * to open @a adm_access.
2286  *
2287  * Note that it is possible for @a path to be absent from disk but still
2288  * under revision control; and conversely, it is possible for @a path to
2289  * be present, but not under revision control.
2290  *
2291  * Use @a pool only for local processing.
2292  */
2293 svn_error_t *
2294 svn_wc_entry(const svn_wc_entry_t **entry,
2295  const char *path,
2296  svn_wc_adm_access_t *adm_access,
2297  svn_boolean_t show_hidden,
2298  apr_pool_t *pool);
2299 
2300 
2301 /** Parse the `entries' file for @a adm_access and return a hash @a entries,
2302  * whose keys are (<tt>const char *</tt>) entry names and values are
2303  * (<tt>svn_wc_entry_t *</tt>). The hash @a entries, and its keys and
2304  * values, are allocated from the pool used to open the @a adm_access
2305  * baton (that's how the entries caching works). @a pool is used for
2306  * transient allocations.
2307  *
2308  * Entries that are in a 'excluded', 'deleted' or 'absent' state (and not
2309  * scheduled for re-addition) are not returned in the hash, unless
2310  * @a show_hidden is TRUE. Excluded entries are those with their depth set to
2311  * @c svn_depth_exclude.
2312  *
2313  * @par Important:
2314  * The @a entries hash is the entries cache in @a adm_access
2315  * and so usually the hash itself, the keys and the values should be treated
2316  * as read-only. If any of these are modified then it is the caller's
2317  * responsibility to ensure that the entries file on disk is updated. Treat
2318  * the hash values as type (<tt>const svn_wc_entry_t *</tt>) if you wish to
2319  * avoid accidental modification. Modifying the schedule member is a
2320  * particularly bad idea, as the entries writing process relies on having
2321  * access to the original schedule. Use a duplicate entry to modify the
2322  * schedule.
2323  *
2324  * @par Important:
2325  * Only the entry structures representing files and
2326  * @c SVN_WC_ENTRY_THIS_DIR contain complete information. The entry
2327  * structures representing subdirs have only the `kind' and `state'
2328  * fields filled in. If you want info on a subdir, you must use this
2329  * routine to open its @a path and read the @c SVN_WC_ENTRY_THIS_DIR
2330  * structure, or call svn_wc_entry() on its @a path.
2331  */
2332 svn_error_t *
2333 svn_wc_entries_read(apr_hash_t **entries,
2334  svn_wc_adm_access_t *adm_access,
2335  svn_boolean_t show_hidden,
2336  apr_pool_t *pool);
2337 
2338 
2339 /** Return a duplicate of @a entry, allocated in @a pool. No part of the new
2340  * entry will be shared with @a entry.
2341  */
2343 svn_wc_entry_dup(const svn_wc_entry_t *entry,
2344  apr_pool_t *pool);
2345 
2346 
2347 /** Given a @a path in a dir under version control, decide if it is in a
2348  * state of conflict; return the answers in @a *text_conflicted_p, @a
2349  * *prop_conflicted_p, and @a *tree_conflicted_p. If one or two of the
2350  * answers are uninteresting, simply pass @c NULL pointers for those.
2351  *
2352  * If @a path is unversioned or does not exist, @a *text_conflicted_p and
2353  * @a *prop_conflicted_p will be @c FALSE if non-NULL.
2354  *
2355  * @a adm_access is the admin access baton of the parent directory.
2356  *
2357  * If the @a path has corresponding text conflict files (with suffix .mine,
2358  * .theirs, etc.) that cannot be found, assume that the text conflict has
2359  * been resolved by the user and return @c FALSE in @a *text_conflicted_p.
2360  *
2361  * Similarly, if a property conflicts file (.prej suffix) is said to exist,
2362  * but it cannot be found, assume that the property conflicts have been
2363  * resolved by the user and return @c FALSE in @a *prop_conflicted_p.
2364  *
2365  * @a *tree_conflicted_p can't be auto-resolved in this fashion. An
2366  * explicit `resolved' is needed.
2367  *
2368  * @since New in 1.6.
2369  */
2370 svn_error_t *
2371 svn_wc_conflicted_p2(svn_boolean_t *text_conflicted_p,
2372  svn_boolean_t *prop_conflicted_p,
2373  svn_boolean_t *tree_conflicted_p,
2374  const char *path,
2375  svn_wc_adm_access_t *adm_access,
2376  apr_pool_t *pool);
2377 
2378 /** Given a @a dir_path under version control, decide if one of its entries
2379  * (@a entry) is in a state of conflict; return the answers in @a
2380  * text_conflicted_p and @a prop_conflicted_p. These pointers must not be
2381  * null.
2382  *
2383  * If the @a entry mentions that text conflict files (with suffix .mine,
2384  * .theirs, etc.) exist, but they cannot be found, assume the text conflict
2385  * has been resolved by the user and return FALSE in @a *text_conflicted_p.
2386  *
2387  * Similarly, if the @a entry mentions that a property conflicts file (.prej
2388  * suffix) exists, but it cannot be found, assume the property conflicts
2389  * have been resolved by the user and return FALSE in @a *prop_conflicted_p.
2390  *
2391  * The @a entry is not updated.
2392  *
2393  * @deprecated Provided for backward compatibility with the 1.5 API.
2394  */
2396 svn_error_t *
2397 svn_wc_conflicted_p(svn_boolean_t *text_conflicted_p,
2398  svn_boolean_t *prop_conflicted_p,
2399  const char *dir_path,
2400  const svn_wc_entry_t *entry,
2401  apr_pool_t *pool);
2402 
2403 /** Set @a *url and @a *rev to the ancestor URL and revision for @a path,
2404  * allocating in @a pool. @a adm_access must be an access baton for @a path.
2405  *
2406  * If @a url or @a rev is NULL, then ignore it (just don't return the
2407  * corresponding information).
2408  */
2409 svn_error_t *
2410 svn_wc_get_ancestry(char **url,
2411  svn_revnum_t *rev,
2412  const char *path,
2413  svn_wc_adm_access_t *adm_access,
2414  apr_pool_t *pool);
2415 
2416 
2417 /** A callback vtable invoked by the generic entry-walker function.
2418  * @since New in 1.5.
2419  */
2421 {
2422  /** An @a entry was found at @a path. */
2423  svn_error_t *(*found_entry)(const char *path,
2424  const svn_wc_entry_t *entry,
2425  void *walk_baton,
2426  apr_pool_t *pool);
2427 
2428  /** Handle the error @a err encountered while processing @a path.
2429  * Wrap or squelch @a err as desired, and return an @c svn_error_t
2430  * *, or @c SVN_NO_ERROR.
2431  */
2432  svn_error_t *(*handle_error)(const char *path,
2433  svn_error_t *err,
2434  void *walk_baton,
2435  apr_pool_t *pool);
2436 
2438 
2439 /** @deprecated Provided for backward compatibility with the 1.4 API. */
2441 {
2442  /** An @a entry was found at @a path. */
2443  svn_error_t *(*found_entry)(const char *path,
2444  const svn_wc_entry_t *entry,
2445  void *walk_baton,
2446  apr_pool_t *pool);
2447 
2449 
2450 /**
2451  * A generic entry-walker.
2452  *
2453  * Do a potentially recursive depth-first entry-walk beginning on
2454  * @a path, which can be a file or dir. Call callbacks in
2455  * @a walk_callbacks, passing @a walk_baton to each. Use @a pool for
2456  * looping, recursion, and to allocate all entries returned.
2457  * @a adm_access must be an access baton for @a path.
2458  *
2459  * If @a depth is @c svn_depth_empty, invoke the callbacks on @a path
2460  * and return without recursing further. If @c svn_depth_files, do
2461  * the same and invoke the callbacks on file children (if any) of
2462  * @a path, then return. If @c svn_depth_immediates, do the preceding
2463  * but also invoke callbacks on immediate subdirectories, then return.
2464  * If @c svn_depth_infinity, recurse fully starting from @a path.
2465  *
2466  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
2467  * if the client has cancelled the operation.
2468  *
2469  * Like our other entries interfaces, entries that are in a 'excluded',
2470  * 'deleted' or 'absent' state (and not scheduled for re-addition) are not
2471  * discovered, unless @a show_hidden is TRUE. Excluded entries are those with
2472  * their depth set to @c svn_depth_exclude.
2473  *
2474  * When a new directory is entered, @c SVN_WC_ENTRY_THIS_DIR will always
2475  * be returned first.
2476  *
2477  * @note Callers should be aware that each directory will be
2478  * returned *twice*: first as an entry within its parent, and
2479  * subsequently as the '.' entry within itself. The two calls can be
2480  * distinguished by looking for @c SVN_WC_ENTRY_THIS_DIR in the 'name'
2481  * field of the entry.
2482  *
2483  * @since New in 1.5.
2484  */
2485 svn_error_t *
2486 svn_wc_walk_entries3(const char *path,
2487  svn_wc_adm_access_t *adm_access,
2488  const svn_wc_entry_callbacks2_t *walk_callbacks,
2489  void *walk_baton,
2490  svn_depth_t depth,
2491  svn_boolean_t show_hidden,
2492  svn_cancel_func_t cancel_func,
2493  void *cancel_baton,
2494  apr_pool_t *pool);
2495 
2496 /**
2497  * Similar to svn_wc_walk_entries3(), but without cancellation support
2498  * or error handling from @a walk_callbacks, and with @a depth always
2499  * set to @c svn_depth_infinity.
2500  *
2501  * @deprecated Provided for backward compatibility with the 1.4 API.
2502  */
2504 svn_error_t *
2505 svn_wc_walk_entries2(const char *path,
2506  svn_wc_adm_access_t *adm_access,
2507  const svn_wc_entry_callbacks_t *walk_callbacks,
2508  void *walk_baton,
2509  svn_boolean_t show_hidden,
2510  svn_cancel_func_t cancel_func,
2511  void *cancel_baton,
2512  apr_pool_t *pool);
2513 
2514 /**
2515  * Similar to svn_wc_walk_entries2(), but without cancellation support.
2516  *
2517  * @deprecated Provided for backward compatibility with the 1.0 API.
2518  */
2520 svn_error_t *
2521 svn_wc_walk_entries(const char *path,
2522  svn_wc_adm_access_t *adm_access,
2523  const svn_wc_entry_callbacks_t *walk_callbacks,
2524  void *walk_baton,
2525  svn_boolean_t show_hidden,
2526  apr_pool_t *pool);
2527 
2528 
2529 /** Mark missing @a path as 'deleted' in its @a parent's list of entries.
2530  *
2531  * Return @c SVN_ERR_WC_PATH_FOUND if @a path isn't actually missing.
2532  */
2533 svn_error_t *
2534 svn_wc_mark_missing_deleted(const char *path,
2535  svn_wc_adm_access_t *parent,
2536  apr_pool_t *pool);
2537 
2538 
2539 /** Ensure that an administrative area exists for @a path, so that @a
2540  * path is a working copy subdir based on @a url at @a revision, with
2541  * depth @a depth, and with repository UUID @a uuid and repository
2542  * root URL @a repos.
2543  *
2544  * @a depth must be a definite depth, it cannot be @c svn_depth_unknown.
2545  * @a uuid and @a repos may be @c NULL. If non-@c NULL, @a repos must
2546  * be a prefix of @a url.
2547  *
2548  * If the administrative area does not exist, then create it and
2549  * initialize it to an unlocked state.
2550  *
2551  * If the administrative area already exists then the given @a url
2552  * must match the URL in the administrative area and the given
2553  * @a revision must match the BASE of the working copy dir unless
2554  * the admin directory is scheduled for deletion or the
2555  * SVN_ERR_WC_OBSTRUCTED_UPDATE error will be returned.
2556  *
2557  * Do not ensure existence of @a path itself; if @a path does not
2558  * exist, return error.
2559  *
2560  * @since New in 1.5.
2561  */
2562 svn_error_t *
2563 svn_wc_ensure_adm3(const char *path,
2564  const char *uuid,
2565  const char *url,
2566  const char *repos,
2567  svn_revnum_t revision,
2568  svn_depth_t depth,
2569  apr_pool_t *pool);
2570 
2571 
2572 /**
2573  * Similar to svn_wc_ensure_adm3(), but with @a depth set to
2574  * @c svn_depth_infinity.
2575  *
2576  * @deprecated Provided for backwards compatibility with the 1.4 API.
2577  *
2578  * @since New in 1.3.
2579  */
2581 svn_error_t *
2582 svn_wc_ensure_adm2(const char *path,
2583  const char *uuid,
2584  const char *url,
2585  const char *repos,
2586  svn_revnum_t revision,
2587  apr_pool_t *pool);
2588 
2589 
2590 /**
2591  * Similar to svn_wc_ensure_adm2(), but with @a repos set to @c NULL.
2592  *
2593  * @deprecated Provided for backwards compatibility with the 1.2 API.
2594  */
2596 svn_error_t *
2597 svn_wc_ensure_adm(const char *path,
2598  const char *uuid,
2599  const char *url,
2600  svn_revnum_t revision,
2601  apr_pool_t *pool);
2602 
2603 
2604 /** Set the repository root URL of @a path to @a repos, if possible.
2605  *
2606  * @a adm_access must contain @a path and be write-locked, if @a path
2607  * is versioned. Return no error if path is missing or unversioned.
2608  * Use @a pool for temporary allocations.
2609  *
2610  * @note In some circumstances, the repository root can't be set
2611  * without making the working copy corrupt. In such cases, this
2612  * function just returns no error, without modifying the @a path entry.
2613  *
2614  * @note This function exists to make it possible to try to set the repository
2615  * root in old working copies; new working copies normally get this set at
2616  * creation time.
2617  *
2618  * @since New in 1.3.
2619  */
2620 svn_error_t *
2622  const char *path,
2623  const char *repos,
2624  apr_pool_t *pool);
2625 
2626 
2627 /**
2628  * @defgroup svn_wc_status Working copy status.
2629  * @{
2630  *
2631  * We have two functions for getting working copy status: one function
2632  * for getting the status of exactly one thing, and another for
2633  * getting the statuses of (potentially) multiple things.
2634  *
2635  * The concept of depth, as explained in the documentation for
2636  * svn_depth_t, may be useful in understanding this. Suppose we're
2637  * getting the status of directory D:
2638  *
2639  * To offer all three levels, we could have one unified function,
2640  * taking a `depth' parameter. Unfortunately, because this function
2641  * would have to handle multiple return values as well as the single
2642  * return value case, getting the status of just one entity would
2643  * become cumbersome: you'd have to roll through a hash to find one
2644  * lone status.
2645  *
2646  * So we have svn_wc_status() for depth-empty (just D itself), and
2647  * svn_wc_get_status_editor() for depth-immediates and depth-infinity,
2648  * since the latter two involve multiple return values.
2649  *
2650  * @note The status structures may contain a @c NULL ->entry field.
2651  * This indicates an item that is not versioned in the working copy.
2652  */
2653 
2654 /** The type of status for the working copy. */
2656 {
2657  /** does not exist */
2659 
2660  /** is not a versioned thing in this wc */
2662 
2663  /** exists, but uninteresting */
2665 
2666  /** is scheduled for addition */
2668 
2669  /** under v.c., but is missing */
2671 
2672  /** scheduled for deletion */
2674 
2675  /** was deleted and then re-added */
2677 
2678  /** text or props have been modified */
2680 
2681  /** local mods received repos mods */
2683 
2684  /** local mods received conflicting repos mods */
2686 
2687  /** is unversioned but configured to be ignored */
2689 
2690  /** an unversioned resource is in the way of the versioned resource */
2692 
2693  /** an unversioned directory path populated by an svn:externals
2694  property; this status is not used for file externals */
2696 
2697  /** a directory doesn't contain a complete entries list */
2699 };
2700 
2701 /**
2702  * Structure for holding the "status" of a working copy item.
2703  *
2704  * The item's entry data is in @a entry, augmented and possibly shadowed
2705  * by the other fields. @a entry is @c NULL if this item is not under
2706  * version control.
2707  *
2708  * @note Fields may be added to the end of this structure in future
2709  * versions. Therefore, to preserve binary compatibility, users
2710  * should not directly allocate structures of this type.
2711  *
2712  * @since New in 1.2.
2713  */
2714 typedef struct svn_wc_status2_t
2715 {
2716  /** Can be @c NULL if not under version control. */
2718 
2719  /** The status of the entries text. */
2721 
2722  /** The status of the entries properties. */
2724 
2725  /** a directory can be 'locked' if a working copy update was interrupted. */
2727 
2728  /** a file or directory can be 'copied' if it's scheduled for
2729  * addition-with-history (or part of a subtree that is scheduled as such.).
2730  */
2732 
2733  /** a file or directory can be 'switched' if the switch command has been
2734  * used. If this is TRUE, then file_external will be FALSE.
2735  */
2737 
2738  /** The entry's text status in the repository. */
2740 
2741  /** The entry's property status in the repository. */
2743 
2744  /** The entry's lock in the repository, if any. */
2746 
2747  /** Set to the URI (actual or expected) of the item.
2748  * @since New in 1.3
2749  */
2750  const char *url;
2751 
2752  /**
2753  * @defgroup svn_wc_status_ood WC out-of-date info from the repository
2754  * @{
2755  *
2756  * When the working copy item is out-of-date compared to the
2757  * repository, the following fields represent the state of the
2758  * youngest revision of the item in the repository. If the working
2759  * copy is not out of date, the fields are initialized as described
2760  * below.
2761  */
2762 
2763  /** Set to the youngest committed revision, or @c SVN_INVALID_REVNUM
2764  * if not out of date.
2765  * @since New in 1.3
2766  */
2768 
2769  /** Set to the most recent commit date, or @c 0 if not out of date.
2770  * @since New in 1.3
2771  */
2772  apr_time_t ood_last_cmt_date;
2773 
2774  /** Set to the node kind of the youngest commit, or @c svn_node_none
2775  * if not out of date.
2776  * @since New in 1.3
2777  */
2779 
2780  /** Set to the user name of the youngest commit, or @c NULL if not
2781  * out of date or non-existent. Because a non-existent @c
2782  * svn:author property has the same behavior as an out-of-date
2783  * working copy, examine @c ood_last_cmt_rev to determine whether
2784  * the working copy is out of date.
2785  * @since New in 1.3
2786  */
2787  const char *ood_last_cmt_author;
2788 
2789  /** @} */
2790 
2791  /** Non-NULL if the entry is the victim of a tree conflict.
2792  * @since New in 1.6
2793  */
2795 
2796  /** If the item is a file that was added to the working copy with an
2797  * svn:externals; if file_external is TRUE, then switched is always
2798  * FALSE.
2799  * @since New in 1.6
2800  */
2802 
2803  /** The actual status of the text compared to the pristine base of the
2804  * file. This value isn't masked by other working copy statuses.
2805  * @c pristine_text_status is @c svn_wc_status_none if this value was
2806  * not calculated during the status walk.
2807  * @since New in 1.6
2808  */
2810 
2811  /** The actual status of the properties compared to the pristine base of
2812  * the node. This value isn't masked by other working copy statuses.
2813  * @c pristine_prop_status is @c svn_wc_status_none if this value was
2814  * not calculated during the status walk.
2815  * @since New in 1.6
2816  */
2818 
2819  /* NOTE! Please update svn_wc_dup_status2() when adding new fields here. */
2821 
2822 
2823 
2824 /**
2825  * Same as @c svn_wc_status2_t, but without the svn_lock_t 'repos_lock' field.
2826  *
2827  * @deprecated Provided for backward compatibility with the 1.1 API.
2828  */
2829 typedef struct svn_wc_status_t
2830 {
2831  /** Can be @c NULL if not under version control. */
2833 
2834  /** The status of the entries text. */
2836 
2837  /** The status of the entries properties. */
2839 
2840  /** a directory can be 'locked' if a working copy update was interrupted. */
2842 
2843  /** a file or directory can be 'copied' if it's scheduled for
2844  * addition-with-history (or part of a subtree that is scheduled as such.).
2845  */
2847 
2848  /** a file or directory can be 'switched' if the switch command has been
2849  * used.
2850  */
2852 
2853  /** The entry's text status in the repository. */
2855 
2856  /** The entry's property status in the repository. */
2858 
2859 } svn_wc_status_t;
2860 
2861 
2862 
2863 /**
2864  * Return a deep copy of the @a orig_stat status structure, allocated
2865  * in @a pool.
2866  *
2867  * @since New in 1.2.
2868  */
2870 svn_wc_dup_status2(const svn_wc_status2_t *orig_stat,
2871  apr_pool_t *pool);
2872 
2873 
2874 /**
2875  * Same as svn_wc_dup_status2(), but for older svn_wc_status_t structures.
2876  *
2877  * @deprecated Provided for backward compatibility with the 1.1 API.
2878  */
2881 svn_wc_dup_status(const svn_wc_status_t *orig_stat,
2882  apr_pool_t *pool);
2883 
2884 
2885 /**
2886  * Fill @a *status for @a path, allocating in @a pool.
2887  * @a adm_access must be an access baton for @a path.
2888  *
2889  * Here are some things to note about the returned structure. A quick
2890  * examination of the @c status->text_status after a successful return of
2891  * this function can reveal the following things:
2892  *
2893  * - @c svn_wc_status_none : @a path is not versioned, and is either not
2894  * present on disk, or is ignored by svn's
2895  * default ignore regular expressions or the
2896  * svn:ignore property setting for @a path's
2897  * parent directory.
2898  *
2899  * - @c svn_wc_status_missing : @a path is versioned, but is missing from
2900  * the working copy.
2901  *
2902  * - @c svn_wc_status_unversioned : @a path is not versioned, but is
2903  * present on disk and not being
2904  * ignored (see above).
2905  *
2906  * The other available results for the @c text_status field are more
2907  * straightforward in their meanings. See the comments on the
2908  * @c svn_wc_status_kind structure for some hints.
2909  *
2910  * @since New in 1.2.
2911  */
2912 svn_error_t *
2914  const char *path,
2915  svn_wc_adm_access_t *adm_access,
2916  apr_pool_t *pool);
2917 
2918 
2919 /**
2920  * Same as svn_wc_status2(), but for older svn_wc_status_t structures.
2921  *
2922  * @deprecated Provided for backward compatibility with the 1.1 API.
2923  */
2925 svn_error_t *
2927  const char *path,
2928  svn_wc_adm_access_t *adm_access,
2929  apr_pool_t *pool);
2930 
2931 
2932 
2933 
2934 /**
2935  * A callback for reporting a @a status about @a path.
2936  *
2937  * @a baton is a closure object; it should be provided by the
2938  * implementation, and passed by the caller.
2939  *
2940  * @a pool will be cleared between invocations to the callback.
2941  *
2942  * @since New in 1.6.
2943  */
2944 typedef svn_error_t *(*svn_wc_status_func3_t)(void *baton,
2945  const char *path,
2946  svn_wc_status2_t *status,
2947  apr_pool_t *pool);
2948 
2949 /**
2950  * Same as svn_wc_status_func3_t(), but without a provided pool or
2951  * the ability to propagate errors.
2952  *
2953  * @since New in 1.2.
2954  * @deprecated Provided for backward compatibility with the 1.5 API.
2955  */
2956 typedef void (*svn_wc_status_func2_t)(void *baton,
2957  const char *path,
2958  svn_wc_status2_t *status);
2959 
2960 /**
2961  * Same as svn_wc_status_func2_t(), but for older svn_wc_status_t structures.
2962  *
2963  * @deprecated Provided for backward compatibility with the 1.1 API.
2964  */
2965 typedef void (*svn_wc_status_func_t)(void *baton,
2966  const char *path,
2967  svn_wc_status_t *status);
2968 
2969 
2970 /**
2971  * Set @a *editor and @a *edit_baton to an editor that generates @c
2972  * svn_wc_status2_t structures and sends them through @a status_func /
2973  * @a status_baton. @a anchor is an access baton, with a tree lock,
2974  * for the local path to the working copy which will be used as the
2975  * root of our editor. If @a target is not empty, it represents an
2976  * entry in the @a anchor path which is the subject of the editor
2977  * drive (otherwise, the @a anchor is the subject).
2978  *
2979  * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
2980  * be used in a call to the svn_wc_status_set_repos_locks() function.
2981  *
2982  * Callers drive this editor to describe working copy out-of-dateness
2983  * with respect to the repository. If this information is not
2984  * available or not desired, callers should simply call the
2985  * close_edit() function of the @a editor vtable.
2986  *
2987  * If the editor driver calls @a editor's set_target_revision() vtable
2988  * function, then when the edit drive is completed, @a *edit_revision
2989  * will contain the revision delivered via that interface.
2990  *
2991  * Assuming the target is a directory, then:
2992  *
2993  * - If @a get_all is FALSE, then only locally-modified entries will be
2994  * returned. If TRUE, then all entries will be returned.
2995  *
2996  * - If @a depth is @c svn_depth_empty, a status structure will
2997  * be returned for the target only; if @c svn_depth_files, for the
2998  * target and its immediate file children; if
2999  * @c svn_depth_immediates, for the target and its immediate
3000  * children; if @c svn_depth_infinity, for the target and
3001  * everything underneath it, fully recursively.
3002  *
3003  * If @a depth is @c svn_depth_unknown, take depths from the
3004  * working copy and behave as above in each directory's case.
3005  *
3006  * If the given @a depth is incompatible with the depth found in a
3007  * working copy directory, the found depth always governs.
3008  *
3009  * If @a no_ignore is set, statuses that would typically be ignored
3010  * will instead be reported.
3011  *
3012  * @a ignore_patterns is an array of file patterns matching
3013  * unversioned files to ignore for the purposes of status reporting,
3014  * or @c NULL if the default set of ignorable file patterns should be used.
3015  *
3016  * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
3017  * the @a statushash to determine if the client has cancelled the operation.
3018  *
3019  * If @a traversal_info is non-NULL, then record pre-update traversal
3020  * state in it. (Caller should obtain @a traversal_info from
3021  * svn_wc_init_traversal_info().)
3022  *
3023  * Allocate the editor itself in @a pool, but the editor does temporary
3024  * allocations in a subpool of @a pool.
3025  *
3026  * @since New in 1.6.
3027  */
3028 svn_error_t *
3030  void **edit_baton,
3031  void **set_locks_baton,
3032  svn_revnum_t *edit_revision,
3033  svn_wc_adm_access_t *anchor,
3034  const char *target,
3035  svn_depth_t depth,
3036  svn_boolean_t get_all,
3037  svn_boolean_t no_ignore,
3038  const apr_array_header_t *ignore_patterns,
3039  svn_wc_status_func3_t status_func,
3040  void *status_baton,
3041  svn_cancel_func_t cancel_func,
3042  void *cancel_baton,
3043  svn_wc_traversal_info_t *traversal_info,
3044  apr_pool_t *pool);
3045 
3046 /**
3047  * Same as svn_wc_get_status_editor4(), but using @c svn_wc_status_func2_t
3048  * instead of @c svn_wc_status_func3_t.
3049  *
3050  * @since New in 1.5.
3051  * @deprecated Provided for backward compatibility with the 1.4 API.
3052  */
3054 svn_error_t *
3056  void **edit_baton,
3057  void **set_locks_baton,
3058  svn_revnum_t *edit_revision,
3059  svn_wc_adm_access_t *anchor,
3060  const char *target,
3061  svn_depth_t depth,
3062  svn_boolean_t get_all,
3063  svn_boolean_t no_ignore,
3064  apr_array_header_t *ignore_patterns,
3065  svn_wc_status_func2_t status_func,
3066  void *status_baton,
3067  svn_cancel_func_t cancel_func,
3068  void *cancel_baton,
3069  svn_wc_traversal_info_t *traversal_info,
3070  apr_pool_t *pool);
3071 
3072 /**
3073  * Like svn_wc_get_status_editor3(), but with @a ignore_patterns
3074  * provided from the corresponding value in @a config, and @a recurse
3075  * instead of @a depth. If @a recurse is TRUE, behave as if for @c
3076  * svn_depth_infinity; else if @a recurse is FALSE, behave as if for
3077  * @c svn_depth_immediates.
3078  *
3079  * @since New in 1.2.
3080  * @deprecated Provided for backward compatibility with the 1.4 API.
3081  */
3083 svn_error_t *
3085  void **edit_baton,
3086  void **set_locks_baton,
3087  svn_revnum_t *edit_revision,
3088  svn_wc_adm_access_t *anchor,
3089  const char *target,
3090  apr_hash_t *config,
3091  svn_boolean_t recurse,
3092  svn_boolean_t get_all,
3093  svn_boolean_t no_ignore,
3094  svn_wc_status_func2_t status_func,
3095  void *status_baton,
3096  svn_cancel_func_t cancel_func,
3097  void *cancel_baton,
3098  svn_wc_traversal_info_t *traversal_info,
3099  apr_pool_t *pool);
3100 
3101 /**
3102  * Same as svn_wc_get_status_editor2(), but with @a set_locks_baton set
3103  * to @c NULL, and taking a deprecated svn_wc_status_func_t argument.
3104  *
3105  * @deprecated Provided for backward compatibility with the 1.1 API.
3106  */
3108 svn_error_t *
3110  void **edit_baton,
3111  svn_revnum_t *edit_revision,
3112  svn_wc_adm_access_t *anchor,
3113  const char *target,
3114  apr_hash_t *config,
3115  svn_boolean_t recurse,
3116  svn_boolean_t get_all,
3117  svn_boolean_t no_ignore,
3118  svn_wc_status_func_t status_func,
3119  void *status_baton,
3120  svn_cancel_func_t cancel_func,
3121  void *cancel_baton,
3122  svn_wc_traversal_info_t *traversal_info,
3123  apr_pool_t *pool);
3124 
3125 
3126 /**
3127  * Associate @a locks, a hash table mapping <tt>const char*</tt>
3128  * absolute repository paths to <tt>svn_lock_t</tt> objects, with a
3129  * @a set_locks_baton returned by an earlier call to
3130  * svn_wc_get_status_editor3(). @a repos_root is the repository root URL.
3131  * Perform all allocations in @a pool.
3132  *
3133  * @note @a locks will not be copied, so it must be valid throughout the
3134  * edit. @a pool must also not be destroyed or cleared before the edit is
3135  * finished.
3136  *
3137  * @since New in 1.2.
3138  */
3139 svn_error_t *
3140 svn_wc_status_set_repos_locks(void *set_locks_baton,
3141  apr_hash_t *locks,
3142  const char *repos_root,
3143  apr_pool_t *pool);
3144 
3145 /** @} */
3146 
3147 
3148 /**
3149  * Copy @a src to @a dst_basename in @a dst_parent, and schedule
3150  * @a dst_basename for addition to the repository, remembering the copy
3151  * history.
3152  *
3153  * @a src must be a file or directory under version control; @a dst_parent
3154  * must be a directory under version control in the same working copy;
3155  * @a dst_basename will be the name of the copied item, and it must not
3156  * exist already.
3157  *
3158  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
3159  * various points during the operation. If it returns an error
3160  * (typically @c SVN_ERR_CANCELLED), return that error immediately.
3161  *
3162  * For each file or directory copied, @a notify_func will be called
3163  * with its path and the @a notify_baton. @a notify_func may be @c NULL
3164  * if you are not interested in this information.
3165  *
3166  * @par Important:
3167  * This is a variant of svn_wc_add(). No changes will happen
3168  * to the repository until a commit occurs. This scheduling can be
3169  * removed with svn_client_revert2().
3170  *
3171  * @since New in 1.2.
3172  */
3173 svn_error_t *
3174 svn_wc_copy2(const char *src,
3175  svn_wc_adm_access_t *dst_parent,
3176  const char *dst_basename,
3177  svn_cancel_func_t cancel_func,
3178  void *cancel_baton,
3179  svn_wc_notify_func2_t notify_func,
3180  void *notify_baton,
3181  apr_pool_t *pool);
3182 
3183 /**
3184  * Similar to svn_wc_copy2(), but takes an @c svn_wc_notify_func_t instead.
3185  *
3186  * @deprecated Provided for backward compatibility with the 1.1 API.
3187  */
3189 svn_error_t *
3190 svn_wc_copy(const char *src,
3191  svn_wc_adm_access_t *dst_parent,
3192  const char *dst_basename,
3193  svn_cancel_func_t cancel_func,
3194  void *cancel_baton,
3195  svn_wc_notify_func_t notify_func,
3196  void *notify_baton,
3197  apr_pool_t *pool);
3198 
3199 /**
3200  * Schedule @a path for deletion, it will be deleted from the repository on
3201  * the next commit. If @a path refers to a directory, then a recursive
3202  * deletion will occur. @a adm_access must hold a write lock for the parent
3203  * of @a path.
3204  *
3205  * If @a keep_local is FALSE, this function immediately deletes all files,
3206  * modified and unmodified, versioned and unversioned from the working copy.
3207  * It also immediately deletes unversioned directories and directories that
3208  * are scheduled to be added. Only versioned directories will remain in the
3209  * working copy, these get deleted by the update following the commit.
3210  *
3211  * If @a keep_local is TRUE, all files and directories will be kept in the
3212  * working copy (and will become unversioned on the next commit).
3213  *
3214  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
3215  * various points during the operation. If it returns an error
3216  * (typically @c SVN_ERR_CANCELLED), return that error immediately.
3217  *
3218  * For each path marked for deletion, @a notify_func will be called with
3219  * the @a notify_baton and that path. The @a notify_func callback may be
3220  * @c NULL if notification is not needed.
3221  *
3222  * @since New in 1.5.
3223  */
3224 svn_error_t *
3225 svn_wc_delete3(const char *path,
3226  svn_wc_adm_access_t *adm_access,
3227  svn_cancel_func_t cancel_func,
3228  void *cancel_baton,
3229  svn_wc_notify_func2_t notify_func,
3230  void *notify_baton,
3231  svn_boolean_t keep_local,
3232  apr_pool_t *pool);
3233 
3234 /**
3235  * Similar to svn_wc_delete3(), but with @a keep_local always set to FALSE.
3236  *
3237  * @deprecated Provided for backward compatibility with the 1.4 API.
3238  */
3240 svn_error_t *
3241 svn_wc_delete2(const char *path,
3242  svn_wc_adm_access_t *adm_access,
3243  svn_cancel_func_t cancel_func,
3244  void *cancel_baton,
3245  svn_wc_notify_func2_t notify_func,
3246  void *notify_baton,
3247  apr_pool_t *pool);
3248 
3249 /**
3250  * Similar to svn_wc_delete2(), but takes an @c svn_wc_notify_func_t instead.
3251  *
3252  * @deprecated Provided for backward compatibility with the 1.1 API.
3253  */
3255 svn_error_t *
3256 svn_wc_delete(const char *path,
3257  svn_wc_adm_access_t *adm_access,
3258  svn_cancel_func_t cancel_func,
3259  void *cancel_baton,
3260  svn_wc_notify_func_t notify_func,
3261  void *notify_baton,
3262  apr_pool_t *pool);
3263 
3264 
3265 /**
3266  * Put @a path under version control by adding an entry in its parent,
3267  * and, if @a path is a directory, adding an administrative area. The
3268  * new entry and anything under it is scheduled for addition to the
3269  * repository. @a parent_access should hold a write lock for the parent
3270  * directory of @a path. If @a path is a directory then an access baton
3271  * for @a path will be added to the set containing @a parent_access.
3272  *
3273  * If @a path does not exist, return @c SVN_ERR_WC_PATH_NOT_FOUND.
3274  *
3275  * If @a path is a directory, add it at @a depth; otherwise, ignore
3276  * @a depth.
3277  *
3278  * If @a copyfrom_url is non-NULL, it and @a copyfrom_rev are used as
3279  * `copyfrom' args. This is for copy operations, where one wants
3280  * to schedule @a path for addition with a particular history.
3281  *
3282  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
3283  * various points during the operation. If it returns an error
3284  * (typically @c SVN_ERR_CANCELLED), return that error immediately.
3285  *
3286  * When the @a path has been added, then @a notify_func will be called
3287  * (if it is not @c NULL) with the @a notify_baton and the path.
3288  *
3289  * Return @c SVN_ERR_WC_NODE_KIND_CHANGE if @a path is both an unversioned
3290  * directory and a file that is scheduled for deletion or in state deleted.
3291  *
3292  *<pre> ### This function currently does double duty -- it is also
3293  * ### responsible for "switching" a working copy directory over to a
3294  * ### new copyfrom ancestry and scheduling it for addition. Here is
3295  * ### the old doc string from Ben, lightly edited to bring it
3296  * ### up-to-date, explaining the TRUE, secret life of this function:</pre>
3297  *
3298  * Given a @a path within a working copy of type KIND, follow this algorithm:
3299  *
3300  * - if @a path is not under version control:
3301  * - Place it under version control and schedule for addition;
3302  * if @a copyfrom_url is non-NULL, use it and @a copyfrom_rev as
3303  * 'copyfrom' history
3304  *
3305  * - if @a path is already under version control:
3306  * (This can only happen when a directory is copied, in which
3307  * case ancestry must have been supplied as well.)
3308  *
3309  * - Schedule the directory itself for addition with copyfrom history.
3310  * - Mark all its children with a 'copied' flag
3311  * - Rewrite all the URLs to what they will be after a commit.
3312  * - ### @todo Remove old wcprops too, see the '###' below.
3313  *
3314  *<pre> ### I think possibly the "switchover" functionality should be
3315  * ### broken out into a separate function, but its all intertwined in
3316  * ### the code right now. Ben, thoughts? Hard? Easy? Mauve?</pre>
3317  *
3318  * ### Update: see "###" comment in svn_wc_add_repos_file3()'s doc
3319  * string about this.
3320  *
3321  * @since New in 1.6.
3322  */
3323 svn_error_t *
3324 svn_wc_add3(const char *path,
3325  svn_wc_adm_access_t *parent_access,
3326  svn_depth_t depth,
3327  const char *copyfrom_url,
3328  svn_revnum_t copyfrom_rev,
3329  svn_cancel_func_t cancel_func,
3330  void *cancel_baton,
3331  svn_wc_notify_func2_t notify_func,
3332  void *notify_baton,
3333  apr_pool_t *pool);
3334 
3335 /**
3336  * Similar to svn_wc_add3(), but with the @a depth parameter always
3337  * @c svn_depth_infinity.
3338  *
3339  * @since New in 1.2.
3340  * @deprecated Provided for backward compatibility with the 1.5 API.
3341  */
3343 svn_error_t *
3344 svn_wc_add2(const char *path,
3345  svn_wc_adm_access_t *parent_access,
3346  const char *copyfrom_url,
3347  svn_revnum_t copyfrom_rev,
3348  svn_cancel_func_t cancel_func,
3349  void *cancel_baton,
3350  svn_wc_notify_func2_t notify_func,
3351  void *notify_baton,
3352  apr_pool_t *pool);
3353 
3354 /**
3355  * Similar to svn_wc_add2(), but takes an @c svn_wc_notify_func_t instead.
3356  *
3357  * @deprecated Provided for backward compatibility with the 1.1 API.
3358  */
3360 svn_error_t *
3361 svn_wc_add(const char *path,
3362  svn_wc_adm_access_t *parent_access,
3363  const char *copyfrom_url,
3364  svn_revnum_t copyfrom_rev,
3365  svn_cancel_func_t cancel_func,
3366  void *cancel_baton,
3367  svn_wc_notify_func_t notify_func,
3368  void *notify_baton,
3369  apr_pool_t *pool);
3370 
3371 /** Add a file to a working copy at @a dst_path, obtaining the text-base's
3372  * contents from @a new_base_contents, the wc file's content from
3373  * @a new_contents, its base properties from @a new_base_props and
3374  * wc properties from @a new_props.
3375  *
3376  * The base text and props normally come from the repository file
3377  * represented by the copyfrom args, see below. The new file will
3378  * be scheduled for addition with history.
3379  *
3380  * @a new_contents and @a new_props may be NULL, in which case
3381  * the working copy text and props are taken from the base files with
3382  * appropriate translation of the file's content.
3383  *
3384  * @a new_contents must be provided in Normal Form. This is required
3385  * in order to pass both special and non-special files through a stream.
3386  *
3387  * @a adm_access, or an access baton in its associated set, must
3388  * contain a write lock for the parent of @a dst_path.
3389  *
3390  * If @a copyfrom_url is non-NULL, then @a copyfrom_rev must be a
3391  * valid revision number, and together they are the copyfrom history
3392  * for the new file.
3393  *
3394  * The @a cancel_func and @a cancel_baton are a standard cancellation
3395  * callback, or NULL if no callback is needed. @a notify_func and
3396  * @a notify_baton are a notification callback, and will be notified
3397  * of the addition of this file.
3398  *
3399  * Use @a scratch_pool for temporary allocations.
3400  *
3401  * ### NOTE: the notification callback/baton is not yet used.
3402  *
3403  * ### This function is very redundant with svn_wc_add(). Ideally,
3404  * we'd merge them, so that svn_wc_add() would just take optional
3405  * new_props and optional copyfrom information. That way it could be
3406  * used for both 'svn add somefilesittingonmydisk' and for adding
3407  * files from repositories, with or without copyfrom history.
3408  *
3409  * The problem with this Ideal Plan is that svn_wc_add() also takes
3410  * care of recursive URL-rewriting. There's a whole comment in its
3411  * doc string about how that's really weird, outside its core mission,
3412  * etc, etc. So another part of the Ideal Plan is that that
3413  * functionality of svn_wc_add() would move into a separate function.
3414  *
3415  * @since New in 1.6
3416  */
3417 svn_error_t *
3418 svn_wc_add_repos_file3(const char *dst_path,
3419  svn_wc_adm_access_t *adm_access,
3420  svn_stream_t *new_base_contents,
3421  svn_stream_t *new_contents,
3422  apr_hash_t *new_base_props,
3423  apr_hash_t *new_props,
3424  const char *copyfrom_url,
3425  svn_revnum_t copyfrom_rev,
3426  svn_cancel_func_t cancel_func,
3427  void *cancel_baton,
3428  svn_wc_notify_func2_t notify_func,
3429  void *notify_baton,
3430  apr_pool_t *scratch_pool);
3431 
3432 
3433 /** Same as svn_wc_add_repos_file3(), except that it has pathnames rather
3434  * than streams for the text base, and actual text, and has no cancellation.
3435  *
3436  * @since New in 1.4.
3437  * @deprecated Provided for compatibility with the 1.5 API
3438  */
3440 svn_error_t *
3441 svn_wc_add_repos_file2(const char *dst_path,
3442  svn_wc_adm_access_t *adm_access,
3443  const char *new_text_base_path,
3444  const char *new_text_path,
3445  apr_hash_t *new_base_props,
3446  apr_hash_t *new_props,
3447  const char *copyfrom_url,
3448  svn_revnum_t copyfrom_rev,
3449  apr_pool_t *pool);
3450 
3451 /** Same as svn_wc_add_repos_file3(), except that it doesn't have the
3452  * BASE arguments or cancellation.
3453  *
3454  * @deprecated Provided for compatibility with the 1.3 API
3455  */
3457 svn_error_t *
3458 svn_wc_add_repos_file(const char *dst_path,
3459  svn_wc_adm_access_t *adm_access,
3460  const char *new_text_path,
3461  apr_hash_t *new_props,
3462  const char *copyfrom_url,
3463  svn_revnum_t copyfrom_rev,
3464  apr_pool_t *pool);
3465 
3466 
3467 /** Remove entry @a name in @a adm_access from revision control. @a name
3468  * must be either a file or @c SVN_WC_ENTRY_THIS_DIR. @a adm_access must
3469  * hold a write lock.
3470  *
3471  * If @a name is a file, all its info will be removed from @a adm_access's
3472  * administrative directory. If @a name is @c SVN_WC_ENTRY_THIS_DIR, then
3473  * @a adm_access's entire administrative area will be deleted, along with
3474  * *all* the administrative areas anywhere in the tree below @a adm_access.
3475  *
3476  * Normally, only administrative data is removed. However, if
3477  * @a destroy_wf is TRUE, then all working file(s) and dirs are deleted
3478  * from disk as well. When called with @a destroy_wf, any locally
3479  * modified files will *not* be deleted, and the special error
3480  * @c SVN_ERR_WC_LEFT_LOCAL_MOD might be returned. (Callers only need to
3481  * check for this special return value if @a destroy_wf is TRUE.)
3482  *
3483  * If @a instant_error is TRUE, then return @c
3484  * SVN_ERR_WC_LEFT_LOCAL_MOD the instant a locally modified file is
3485  * encountered. Otherwise, leave locally modified files in place and
3486  * return the error only after all the recursion is complete.
3487  *
3488  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
3489  * various points during the removal. If it returns an error
3490  * (typically @c SVN_ERR_CANCELLED), return that error immediately.
3491  *
3492  * WARNING: This routine is exported for careful, measured use by
3493  * libsvn_client. Do *not* call this routine unless you really
3494  * understand what the heck you're doing.
3495  */
3496 svn_error_t *
3498  const char *name,
3499  svn_boolean_t destroy_wf,
3500  svn_boolean_t instant_error,
3501  svn_cancel_func_t cancel_func,
3502  void *cancel_baton,
3503  apr_pool_t *pool);
3504 
3505 
3506 /**
3507  * Assuming @a path is under version control and in a state of conflict,
3508  * then take @a path *out* of this state. If @a resolve_text is TRUE then
3509  * any text conflict is resolved, if @a resolve_props is TRUE then any
3510  * property conflicts are resolved, if @a resolve_tree is TRUE then any
3511  * tree conflicts are resolved.
3512  *
3513  * If @a depth is @c svn_depth_empty, act only on @a path; if
3514  * @c svn_depth_files, resolve @a path and its conflicted file
3515  * children (if any); if @c svn_depth_immediates, resolve @a path and
3516  * all its immediate conflicted children (both files and directories,
3517  * if any); if @c svn_depth_infinity, resolve @a path and every
3518  * conflicted file or directory anywhere beneath it.
3519  *
3520  * If @a conflict_choice is @c svn_wc_conflict_choose_base, resolve the
3521  * conflict with the old file contents; if
3522  * @c svn_wc_conflict_choose_mine_full, use the original working contents;
3523  * if @c svn_wc_conflict_choose_theirs_full, the new contents; and if
3524  * @c svn_wc_conflict_choose_merged, don't change the contents at all,
3525  * just remove the conflict status, which is the pre-1.5 behavior.
3526  *
3527  * @c svn_wc_conflict_choose_theirs_conflict and @c
3528  * svn_wc_conflict_choose_mine_conflict are not legal for binary
3529  * files or properties.
3530  *
3531  * @a adm_access is an access baton, with a write lock, for @a path.
3532  *
3533  * Needless to say, this function doesn't touch conflict markers or
3534  * anything of that sort -- only a human can semantically resolve a
3535  * conflict. Instead, this function simply marks a file as "having
3536  * been resolved", clearing the way for a commit.
3537  *
3538  * The implementation details are opaque, as our "conflicted" criteria
3539  * might change over time. (At the moment, this routine removes the
3540  * three fulltext 'backup' files and any .prej file created in a conflict,
3541  * and modifies @a path's entry.)
3542  *
3543  * If @a path is not under version control, return @c SVN_ERR_ENTRY_NOT_FOUND.
3544  * If @a path isn't in a state of conflict to begin with, do nothing, and
3545  * return @c SVN_NO_ERROR.
3546  *
3547  * If @c path was successfully taken out of a state of conflict, report this
3548  * information to @c notify_func (if non-@c NULL.) If only text, only
3549  * property, or only tree conflict resolution was requested, and it was
3550  * successful, then success gets reported.
3551  *
3552  * @since New in 1.6.
3553  */
3554 svn_error_t *
3555 svn_wc_resolved_conflict4(const char *path,
3556  svn_wc_adm_access_t *adm_access,
3557  svn_boolean_t resolve_text,
3558  svn_boolean_t resolve_props,
3559  svn_boolean_t resolve_tree,
3560  svn_depth_t depth,
3561  svn_wc_conflict_choice_t conflict_choice,
3562  svn_wc_notify_func2_t notify_func,
3563  void *notify_baton,
3564  svn_cancel_func_t cancel_func,
3565  void *cancel_baton,
3566  apr_pool_t *pool);
3567 
3568 
3569 /**
3570  * Similar to svn_wc_resolved_conflict4(), but without tree-conflict
3571  * resolution support.
3572  *
3573  * @deprecated Provided for backward compatibility with the 1.5 API.
3574  */
3576 svn_error_t *
3577 svn_wc_resolved_conflict3(const char *path,
3578  svn_wc_adm_access_t *adm_access,
3579  svn_boolean_t resolve_text,
3580  svn_boolean_t resolve_props,
3581  svn_depth_t depth,
3582  svn_wc_conflict_choice_t conflict_choice,
3583  svn_wc_notify_func2_t notify_func,
3584  void *notify_baton,
3585  svn_cancel_func_t cancel_func,
3586  void *cancel_baton,
3587  apr_pool_t *pool);
3588 
3589 
3590 /**
3591  * Similar to svn_wc_resolved_conflict3(), but without automatic conflict
3592  * resolution support, and with @a depth set according to @a recurse:
3593  * if @a recurse is TRUE, @a depth is @c svn_depth_infinity, else it is
3594  * @c svn_depth_files.
3595  *
3596  * @deprecated Provided for backward compatibility with the 1.4 API.
3597  */
3599 svn_error_t *
3600 svn_wc_resolved_conflict2(const char *path,
3601  svn_wc_adm_access_t *adm_access,
3602  svn_boolean_t resolve_text,
3603  svn_boolean_t resolve_props,
3604  svn_boolean_t recurse,
3605  svn_wc_notify_func2_t notify_func,
3606  void *notify_baton,
3607  svn_cancel_func_t cancel_func,
3608  void *cancel_baton,
3609  apr_pool_t *pool);
3610 
3611 /**
3612  * Similar to svn_wc_resolved_conflict2(), but takes an
3613  * svn_wc_notify_func_t and doesn't have cancellation support.
3614  *
3615  * @deprecated Provided for backward compatibility with the 1.0 API.
3616  */
3618 svn_error_t *
3619 svn_wc_resolved_conflict(const char *path,
3620  svn_wc_adm_access_t *adm_access,
3621  svn_boolean_t resolve_text,
3622  svn_boolean_t resolve_props,
3623  svn_boolean_t recurse,
3624  svn_wc_notify_func_t notify_func,
3625  void *notify_baton,
3626  apr_pool_t *pool);
3627 
3628 
3629 /* Commits. */
3630 
3631 
3632 /**
3633  * Storage type for queued post-commit data.
3634  *
3635  * @since New in 1.5.
3636  */
3638 
3639 
3640 /**
3641  * Create a queue for use with svn_wc_queue_committed() and
3642  * svn_wc_process_committed_queue().
3643  *
3644  * The returned queue and all further allocations required for queueing
3645  * new items will also be done from @a pool.
3646  *
3647  * @since New in 1.5.
3648  */
3650 svn_wc_committed_queue_create(apr_pool_t *pool);
3651 
3652 
3653 /**
3654  * Queue committed items to be processed later by
3655  * svn_wc_process_committed_queue().
3656  *
3657  * All pointer data passed to this function (@a path, @a adm_access,
3658  * @a wcprop_changes and @a checksum) should remain valid until the queue
3659  * has been processed by svn_wc_process_committed_queue().
3660  *
3661  * Record in @a queue that @a path will need to be bumped after a commit
3662  * succeeds. @a adm_access must hold a write lock appropriate for @a path.
3663  *
3664  * If non-NULL, @a wcprop_changes is an array of <tt>svn_prop_t *</tt>
3665  * changes to wc properties; if an @c svn_prop_t->value is NULL, then
3666  * that property is deleted.
3667  *
3668  * If @a remove_lock is @c TRUE, any entryprops related to a repository
3669  * lock will be removed.
3670  *
3671  * If @a remove_changelist is @c TRUE, any association with a
3672  * changelist will be removed.
3673  *
3674  * If @a path is a file and @a checksum is non-NULL, use @a checksum as
3675  * the checksum for the new text base. Otherwise, calculate the checksum
3676  * if needed.
3677  *
3678  * If @a recurse is TRUE and @a path is a directory, then bump every
3679  * versioned object at or under @a path. This is usually done for
3680  * copied trees.
3681  *
3682  * Temporary allocations will be performed in @a scratch_pool, and persistent
3683  * allocations will use the same pool as @a queue used when it was created.
3684  *
3685  * @note the @a recurse parameter should be used with extreme care since
3686  * it will bump ALL nodes under the directory, regardless of their
3687  * actual inclusion in the new revision.
3688  *
3689  * @since New in 1.6.
3690  */
3691 svn_error_t *
3693  const char *path,
3694  svn_wc_adm_access_t *adm_access,
3695  svn_boolean_t recurse,
3696  apr_array_header_t *wcprop_changes,
3697  svn_boolean_t remove_lock,
3698  svn_boolean_t remove_changelist,
3699  svn_checksum_t *checksum,
3700  apr_pool_t *scratch_pool);
3701 
3702 
3703 /** Same as svn_wc_queue_committed2() but the @a queue parameter has an
3704  * extra indirection and @a digest is supplied instead of a checksum type.
3705  *
3706  * @note despite the extra indirection, this function does NOT allocate
3707  * the queue for you. svn_wc_committed_queue_create() must be called.
3708  *
3709  * @since New in 1.5
3710  *
3711  * @deprecated Provided for backwards compatibility with 1.5
3712  */
3713 svn_error_t *
3715  const char *path,
3716  svn_wc_adm_access_t *adm_access,
3717  svn_boolean_t recurse,
3718  apr_array_header_t *wcprop_changes,
3719  svn_boolean_t remove_lock,
3720  svn_boolean_t remove_changelist,
3721  const unsigned char *digest,
3722  apr_pool_t *pool);
3723 
3724 
3725 /**
3726  * Bump all items in @a queue to @a new_revnum after a commit succeeds.
3727  * @a rev_date and @a rev_author are the (server-side) date and author
3728  * of the new revision; one or both may be @c NULL.
3729  *
3730  * @a adm_access must be associated with all affected directories, and
3731  * must hold a write lock in each one.
3732  *
3733  * @since New in 1.5.
3734  */
3735 svn_error_t *
3737  svn_wc_adm_access_t *adm_access,
3738  svn_revnum_t new_revnum,
3739  const char *rev_date,
3740  const char *rev_author,
3741  apr_pool_t *pool);
3742 
3743 
3744 /**
3745  * @note this function has improper expectations around the operation and
3746  * execution of other parts of the Subversion WC library. The resulting
3747  * coupling makes this interface near-impossible to support. Documentation
3748  * has been removed, as a result.
3749  *
3750  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
3751  * for backwards compatibility with the 1.5 API.
3752  */
3754 svn_error_t *
3755 svn_wc_process_committed4(const char *path,
3756  svn_wc_adm_access_t *adm_access,
3757  svn_boolean_t recurse,
3758  svn_revnum_t new_revnum,
3759  const char *rev_date,
3760  const char *rev_author,
3761  apr_array_header_t *wcprop_changes,
3762  svn_boolean_t remove_lock,
3763  svn_boolean_t remove_changelist,
3764  const unsigned char *digest,
3765  apr_pool_t *pool);
3766 
3767 /** @see svn_wc_process_committed4()
3768  *
3769  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
3770  * for backwards compatibility with the 1.4 API.
3771  */
3773 svn_error_t *
3774 svn_wc_process_committed3(const char *path,
3775  svn_wc_adm_access_t *adm_access,
3776  svn_boolean_t recurse,
3777  svn_revnum_t new_revnum,
3778  const char *rev_date,
3779  const char *rev_author,
3780  apr_array_header_t *wcprop_changes,
3781  svn_boolean_t remove_lock,
3782  const unsigned char *digest,
3783  apr_pool_t *pool);
3784 
3785 /** @see svn_wc_process_committed4()
3786  *
3787  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
3788  * for backwards compatibility with the 1.3 API.
3789  */
3791 svn_error_t *
3792 svn_wc_process_committed2(const char *path,
3793  svn_wc_adm_access_t *adm_access,
3794  svn_boolean_t recurse,
3795  svn_revnum_t new_revnum,
3796  const char *rev_date,
3797  const char *rev_author,
3798  apr_array_header_t *wcprop_changes,
3799  svn_boolean_t remove_lock,
3800  apr_pool_t *pool);
3801 
3802 /** @see svn_wc_process_committed4()
3803  *
3804  * @deprecated Use the svn_wc_committed_queue_* functions instead. Provided
3805  * for backward compatibility with the 1.1 API.
3806  */
3808 svn_error_t *
3809 svn_wc_process_committed(const char *path,
3810  svn_wc_adm_access_t *adm_access,
3811  svn_boolean_t recurse,
3812  svn_revnum_t new_revnum,
3813  const char *rev_date,
3814  const char *rev_author,
3815  apr_array_header_t *wcprop_changes,
3816  apr_pool_t *pool);
3817 
3818 
3819 
3820 
3821 
3822 /**
3823  * Do a depth-first crawl in a working copy, beginning at @a path.
3824  *
3825  * Communicate the `state' of the working copy's revisions and depths
3826  * to @a reporter/@a report_baton. Obviously, if @a path is a file
3827  * instead of a directory, this depth-first crawl will be a short one.
3828  *
3829  * No locks are or logs are created, nor are any animals harmed in the
3830  * process. No cleanup is necessary. @a adm_access must be an access
3831  * baton for the @a path hierarchy, it does not require a write lock.
3832  *
3833  * After all revisions are reported, @a reporter->finish_report() is
3834  * called, which immediately causes the RA layer to update the working
3835  * copy. Thus the return value may very well reflect the result of
3836  * the update!
3837  *
3838  * If @a depth is @c svn_depth_empty, then report state only for
3839  * @a path itself. If @c svn_depth_files, do the same and include
3840  * immediate file children of @a path. If @c svn_depth_immediates,
3841  * then behave as if for @c svn_depth_files but also report the
3842  * property states of immediate subdirectories. If @a depth is
3843  * @c svn_depth_infinity, then report state fully recursively. All
3844  * descents are only as deep as @a path's own depth permits, of
3845  * course. If @a depth is @c svn_depth_unknown, then just use
3846  * @c svn_depth_infinity, which in practice means depth of @a path.
3847  *
3848  * Iff @a honor_depth_exclude is TRUE, the crawler will report paths
3849  * whose ambient depth is @c svn_depth_exclude as being excluded, and
3850  * thus prevent the server from pushing update data for those paths;
3851  * therefore, don't set this flag if you wish to pull in excluded paths.
3852  * Note that @c svn_depth_exclude on the target @a path is never
3853  * honored, even if @a honor_depth_exclude is TRUE, because we need to
3854  * be able to explicitly pull in a target. For example, if this is
3855  * the working copy...
3856  *
3857  * svn co greek_tree_repos wc_dir
3858  * svn up --set-depth exclude wc_dir/A/B/E # now A/B/E is excluded
3859  *
3860  * ...then 'svn up wc_dir/A/B' would report E as excluded (assuming
3861  * @a honor_depth_exclude is TRUE), but 'svn up wc_dir/A/B/E' would
3862  * not, because the latter is trying to explicitly pull in E. In
3863  * general, we never report the update target as excluded.
3864  *
3865  * Iff @a depth_compatibility_trick is TRUE, then set the @c start_empty
3866  * flag on @a reporter->set_path() and @a reporter->link_path() calls
3867  * as necessary to trick a pre-1.5 (i.e., depth-unaware) server into
3868  * sending back all the items the client might need to upgrade a
3869  * working copy from a shallower depth to a deeper one.
3870  *
3871  * If @a restore_files is TRUE, then unexpectedly missing working files
3872  * will be restored from the administrative directory's cache. For each
3873  * file restored, the @a notify_func function will be called with the
3874  * @a notify_baton and the path of the restored file. @a notify_func may
3875  * be @c NULL if this notification is not required. If @a
3876  * use_commit_times is TRUE, then set restored files' timestamps to
3877  * their last-commit-times.
3878  *
3879  * If @a traversal_info is non-NULL, then record pre-update traversal
3880  * state in it. (Caller should obtain @a traversal_info from
3881  * svn_wc_init_traversal_info().)
3882  *
3883  * @since New in 1.6.
3884  */
3885 svn_error_t *
3886 svn_wc_crawl_revisions4(const char *path,
3887  svn_wc_adm_access_t *adm_access,
3888  const svn_ra_reporter3_t *reporter,
3889  void *report_baton,
3890  svn_boolean_t restore_files,
3891  svn_depth_t depth,
3892  svn_boolean_t honor_depth_exclude,
3893  svn_boolean_t depth_compatibility_trick,
3894  svn_boolean_t use_commit_times,
3895  svn_wc_notify_func2_t notify_func,
3896  void *notify_baton,
3897  svn_wc_traversal_info_t *traversal_info,
3898  apr_pool_t *pool);
3899 
3900 /**
3901  * Similar to svn_wc_crawl_revisions4, but with @a honor_depth_exclude always
3902  * set to false.
3903  *
3904  * @deprecated Provided for compatibility with the 1.5 API.
3905  */
3906 svn_error_t *
3907 svn_wc_crawl_revisions3(const char *path,
3908  svn_wc_adm_access_t *adm_access,
3909  const svn_ra_reporter3_t *reporter,
3910  void *report_baton,
3911  svn_boolean_t restore_files,
3912  svn_depth_t depth,
3913  svn_boolean_t depth_compatibility_trick,
3914  svn_boolean_t use_commit_times,
3915  svn_wc_notify_func2_t notify_func,
3916  void *notify_baton,
3917  svn_wc_traversal_info_t *traversal_info,
3918  apr_pool_t *pool);
3919 
3920 /**
3921  * Similar to svn_wc_crawl_revisions3, but taking svn_ra_reporter2_t
3922  * instead of svn_ra_reporter3_t, and therefore only able to report @c
3923  * svn_depth_infinity for depths; and taking @a recurse instead of @a
3924  * depth; and with @a depth_compatibility_trick always false.
3925  *
3926  * @deprecated Provided for compatibility with the 1.4 API.
3927  */
3929 svn_error_t *
3930 svn_wc_crawl_revisions2(const char *path,
3931  svn_wc_adm_access_t *adm_access,
3932  const svn_ra_reporter2_t *reporter,
3933  void *report_baton,
3934  svn_boolean_t restore_files,
3935  svn_boolean_t recurse,
3936  svn_boolean_t use_commit_times,
3937  svn_wc_notify_func2_t notify_func,
3938  void *notify_baton,
3939  svn_wc_traversal_info_t *traversal_info,
3940  apr_pool_t *pool);
3941 
3942 /**
3943  * Similar to svn_wc_crawl_revisions2(), but takes an svn_wc_notify_func_t
3944  * and a @c svn_reporter_t instead.
3945  *
3946  * @deprecated Provided for backward compatibility with the 1.1 API.
3947  */
3949 svn_error_t *
3950 svn_wc_crawl_revisions(const char *path,
3951  svn_wc_adm_access_t *adm_access,
3952  const svn_ra_reporter_t *reporter,
3953  void *report_baton,
3954  svn_boolean_t restore_files,
3955  svn_boolean_t recurse,
3956  svn_boolean_t use_commit_times,
3957  svn_wc_notify_func_t notify_func,
3958  void *notify_baton,
3959  svn_wc_traversal_info_t *traversal_info,
3960  apr_pool_t *pool);
3961 
3962 
3963 /* Updates. */
3964 
3965 /** Set @a *wc_root to @c TRUE if @a path represents a "working copy root",
3966  * @c FALSE otherwise. Here, @a path is a "working copy root" if its parent
3967  * directory is not a WC or if its parent directory's repository URL is not
3968  * the parent of its own repository URL. Thus, a switched subtree is
3969  * considered to be a working copy root. Also, a deleted tree-conflict
3970  * victim is considered a "working copy root" because it has no URL.
3971  *
3972  * If @a path is not found, return the error @c SVN_ERR_ENTRY_NOT_FOUND.
3973  *
3974  * Use @a pool for any intermediate allocations.
3975  *
3976  * @note Due to the way in which "WC-root-ness" is calculated, passing
3977  * a @a path of `.' to this function will always return @c TRUE.
3978  */
3979 svn_error_t *
3981  const char *path,
3982  svn_wc_adm_access_t *adm_access,
3983  apr_pool_t *pool);
3984 
3985 
3986 /** Conditionally split @a path into an @a anchor and @a target for the
3987  * purpose of updating and committing.
3988  *
3989  * @a anchor is the directory at which the update or commit editor
3990  * should be rooted.
3991  *
3992  * @a target is the actual subject (relative to the @a anchor) of the
3993  * update/commit, or "" if the @a anchor itself is the subject.
3994  *
3995  * Allocate @a anchor and @a target in @a pool.
3996  */
3997 svn_error_t *
3998 svn_wc_get_actual_target(const char *path,
3999  const char **anchor,
4000  const char **target,
4001  apr_pool_t *pool);
4002 
4003 
4004 
4005 /* Update and update-like functionality. */
4006 
4007 /**
4008  * Set @a *editor and @a *edit_baton to an editor and baton for updating a
4009  * working copy.
4010  *
4011  * If @a ti is non-NULL, record traversal info in @a ti, for use by
4012  * post-traversal accessors such as svn_wc_edited_externals().
4013  *
4014  * @a anchor is an access baton, with a write lock, for the local path to the
4015  * working copy which will be used as the root of our editor. Further
4016  * locks will be acquired if the update creates new directories. All
4017  * locks, both those in @a anchor and newly acquired ones, will be released
4018  * when the editor driver calls @c close_edit.
4019  *
4020  * @a target is the entry in @a anchor that will actually be updated, or
4021  * the empty string if all of @a anchor should be updated.
4022  *
4023  * The editor invokes @a notify_func with @a notify_baton as the update
4024  * progresses, if @a notify_func is non-NULL.
4025  *
4026  * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
4027  * @a cancel_baton as the update progresses to see if it should continue.
4028  *
4029  * If @a conflict_func is non-NULL, then invoke it with @a
4030  * conflict_baton whenever a conflict is encountered, giving the
4031  * callback a chance to resolve the conflict before the editor takes
4032  * more drastic measures (such as marking a file conflicted, or
4033  * bailing out of the update).
4034  *
4035  * If @a fetch_func is non-NULL, then use it (with @a fetch_baton) as
4036  * a fallback for retrieving repository files whenever 'copyfrom' args
4037  * are sent into editor->add_file().
4038  *
4039  * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
4040  * any merging; otherwise, use the built-in merge code.
4041  *
4042  * @a preserved_exts is an array of filename patterns which, when
4043  * matched against the extensions of versioned files, determine for
4044  * which such files any related generated conflict files will preserve
4045  * the original file's extension as their own. If a file's extension
4046  * does not match any of the patterns in @a preserved_exts (which is
4047  * certainly the case if @a preserved_exts is @c NULL or empty),
4048  * generated conflict files will carry Subversion's custom extensions.
4049  *
4050  * @a target_revision is a pointer to a revision location which, after
4051  * successful completion of the drive of this editor, will be
4052  * populated with the revision to which the working copy was updated.
4053  *
4054  * If @a use_commit_times is TRUE, then all edited/added files will
4055  * have their working timestamp set to the last-committed-time. If
4056  * FALSE, the working files will be touched with the 'now' time.
4057  *
4058  * If @a allow_unver_obstructions is TRUE, then allow unversioned
4059  * obstructions when adding a path.
4060  *
4061  * If @a depth is @c svn_depth_infinity, update fully recursively.
4062  * Else if it is @c svn_depth_immediates, update the uppermost
4063  * directory, its file entries, and the presence or absence of
4064  * subdirectories (but do not descend into the subdirectories).
4065  * Else if it is @c svn_depth_files, update the uppermost directory
4066  * and its immediate file entries, but not subdirectories.
4067  * Else if it is @c svn_depth_empty, update exactly the uppermost
4068  * target, and don't touch its entries.
4069  *
4070  * If @a depth_is_sticky is set and @a depth is not @c
4071  * svn_depth_unknown, then in addition to updating PATHS, also set
4072  * their sticky ambient depth value to @a depth.
4073  *
4074  * @since New in 1.5.
4075  */
4076 svn_error_t *
4077 svn_wc_get_update_editor3(svn_revnum_t *target_revision,
4078  svn_wc_adm_access_t *anchor,
4079  const char *target,
4080  svn_boolean_t use_commit_times,
4081  svn_depth_t depth,
4082  svn_boolean_t depth_is_sticky,
4083  svn_boolean_t allow_unver_obstructions,
4084  svn_wc_notify_func2_t notify_func,
4085  void *notify_baton,
4086  svn_cancel_func_t cancel_func,
4087  void *cancel_baton,
4088  svn_wc_conflict_resolver_func_t conflict_func,
4089  void *conflict_baton,
4090  svn_wc_get_file_t fetch_func,
4091  void *fetch_baton,
4092  const char *diff3_cmd,
4093  apr_array_header_t *preserved_exts,
4094  const svn_delta_editor_t **editor,
4095  void **edit_baton,
4097  apr_pool_t *pool);
4098 
4099 
4100 /**
4101  * Similar to svn_wc_get_update_editor3() but with the @a
4102  * allow_unver_obstructions parameter always set to FALSE, @a
4103  * conflict_func and baton set to NULL, @a fetch_func and baton set to
4104  * NULL, @a preserved_exts set to NULL, @a depth_is_sticky set to
4105  * FALSE, and @a depth set according to @a recurse: if @a recurse is
4106  * TRUE, pass @c svn_depth_infinity, if FALSE, pass @c
4107  * svn_depth_files.
4108  *
4109  * @deprecated Provided for backward compatibility with the 1.4 API.
4110  */
4112 svn_error_t *
4113 svn_wc_get_update_editor2(svn_revnum_t *target_revision,
4114  svn_wc_adm_access_t *anchor,
4115  const char *target,
4116  svn_boolean_t use_commit_times,
4117  svn_boolean_t recurse,
4118  svn_wc_notify_func2_t notify_func,
4119  void *notify_baton,
4120  svn_cancel_func_t cancel_func,
4121  void *cancel_baton,
4122  const char *diff3_cmd,
4123  const svn_delta_editor_t **editor,
4124  void **edit_baton,
4126  apr_pool_t *pool);
4127 
4128 /**
4129  * Similar to svn_wc_get_update_editor2(), but takes an svn_wc_notify_func_t
4130  * instead.
4131  *
4132  * @deprecated Provided for backward compatibility with the 1.1 API.
4133  */
4135 svn_error_t *
4136 svn_wc_get_update_editor(svn_revnum_t *target_revision,
4137  svn_wc_adm_access_t *anchor,
4138  const char *target,
4139  svn_boolean_t use_commit_times,
4140  svn_boolean_t recurse,
4141  svn_wc_notify_func_t notify_func,
4142  void *notify_baton,
4143  svn_cancel_func_t cancel_func,
4144  void *cancel_baton,
4145  const char *diff3_cmd,
4146  const svn_delta_editor_t **editor,
4147  void **edit_baton,
4149  apr_pool_t *pool);
4150 
4151 /**
4152  * A variant of svn_wc_get_update_editor().
4153  *
4154  * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
4155  * a working copy to a new @a switch_url. (Right now, this URL must be
4156  * within the same repository that the working copy already comes
4157  * from.) @a switch_url must not be @c NULL.
4158  *
4159  * If @a ti is non-NULL, record traversal info in @a ti, for use by
4160  * post-traversal accessors such as svn_wc_edited_externals().
4161  *
4162  * @a anchor is an access baton, with a write lock, for the local path to the
4163  * working copy which will be used as the root of our editor. Further
4164  * locks will be acquired if the switch creates new directories. All
4165  * locks, both those in @a anchor and newly acquired ones, will be released
4166  * when the editor driver calls @c close_edit.
4167  *
4168  * @a target is the entry in @a anchor that will actually be updated, or
4169  * empty if all of @a anchor should be updated.
4170  *
4171  * The editor invokes @a notify_func with @a notify_baton as the switch
4172  * progresses, if @a notify_func is non-NULL.
4173  *
4174  * If @a cancel_func is non-NULL, it will be called with @a cancel_baton as
4175  * the switch progresses to determine if it should continue.
4176  *
4177  * If @a conflict_func is non-NULL, then invoke it with @a
4178  * conflict_baton whenever a conflict is encountered, giving the
4179  * callback a chance to resolve the conflict before the editor takes
4180  * more drastic measures (such as marking a file conflicted, or
4181  * bailing out of the switch).
4182  *
4183  * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
4184  * any merging; otherwise, use the built-in merge code.
4185  *
4186  * @a preserved_exts is an array of filename patterns which, when
4187  * matched against the extensions of versioned files, determine for
4188  * which such files any related generated conflict files will preserve
4189  * the original file's extension as their own. If a file's extension
4190  * does not match any of the patterns in @a preserved_exts (which is
4191  * certainly the case if @a preserved_exts is @c NULL or empty),
4192  * generated conflict files will carry Subversion's custom extensions.
4193  *
4194  * @a target_revision is a pointer to a revision location which, after
4195  * successful completion of the drive of this editor, will be
4196  * populated with the revision to which the working copy was updated.
4197  *
4198  * If @a use_commit_times is TRUE, then all edited/added files will
4199  * have their working timestamp set to the last-committed-time. If
4200  * FALSE, the working files will be touched with the 'now' time.
4201  *
4202  * @a depth and @a depth_is_sticky behave as for svn_wc_get_update_editor3().
4203  *
4204  * If @a allow_unver_obstructions is TRUE, then allow unversioned
4205  * obstructions when adding a path.
4206  *
4207  * @since New in 1.5.
4208  */
4209 svn_error_t *
4210 svn_wc_get_switch_editor3(svn_revnum_t *target_revision,
4211  svn_wc_adm_access_t *anchor,
4212  const char *target,
4213  const char *switch_url,
4214  svn_boolean_t use_commit_times,
4215  svn_depth_t depth,
4216  svn_boolean_t depth_is_sticky,
4217  svn_boolean_t allow_unver_obstructions,
4218  svn_wc_notify_func2_t notify_func,
4219  void *notify_baton,
4220  svn_cancel_func_t cancel_func,
4221  void *cancel_baton,
4222  svn_wc_conflict_resolver_func_t conflict_func,
4223  void *conflict_baton,
4224  const char *diff3_cmd,
4225  apr_array_header_t *preserved_exts,
4226  const svn_delta_editor_t **editor,
4227  void **edit_baton,
4229  apr_pool_t *pool);
4230 
4231 /**
4232  * Similar to svn_wc_get_switch_editor3() but with the
4233  * @a allow_unver_obstructions parameter always set to FALSE,
4234  * @a preserved_exts set to NULL, @a conflict_func and baton set to NULL,
4235  * @a depth_is_sticky set to FALSE, and @a depth set according to @a
4236  * recurse: if @a recurse is TRUE, pass @c svn_depth_infinity, if
4237  * FALSE, pass @c svn_depth_files.
4238  *
4239  * @deprecated Provided for backward compatibility with the 1.4 API.
4240  */
4242 svn_error_t *
4243 svn_wc_get_switch_editor2(svn_revnum_t *target_revision,
4244  svn_wc_adm_access_t *anchor,
4245  const char *target,
4246  const char *switch_url,
4247  svn_boolean_t use_commit_times,
4248  svn_boolean_t recurse,
4249  svn_wc_notify_func2_t notify_func,
4250  void *notify_baton,
4251  svn_cancel_func_t cancel_func,
4252  void *cancel_baton,
4253  const char *diff3_cmd,
4254  const svn_delta_editor_t **editor,
4255  void **edit_baton,
4257  apr_pool_t *pool);
4258 
4259 /**
4260  * Similar to svn_wc_get_switch_editor2(), but takes an
4261  * @c svn_wc_notify_func_t instead.
4262  *
4263  * @deprecated Provided for backward compatibility with the 1.1 API.
4264  */
4266 svn_error_t *
4267 svn_wc_get_switch_editor(svn_revnum_t *target_revision,
4268  svn_wc_adm_access_t *anchor,
4269  const char *target,
4270  const char *switch_url,
4271  svn_boolean_t use_commit_times,
4272  svn_boolean_t recurse,
4273  svn_wc_notify_func_t notify_func,
4274  void *notify_baton,
4275  svn_cancel_func_t cancel_func,
4276  void *cancel_baton,
4277  const char *diff3_cmd,
4278  const svn_delta_editor_t **editor,
4279  void **edit_baton,
4281  apr_pool_t *pool);
4282 
4283 
4284 
4285 /* A word about the implementation of working copy property storage:
4286  *
4287  * Since properties are key/val pairs, you'd think we store them in
4288  * some sort of Berkeley DB-ish format, and even store pending changes
4289  * to them that way too.
4290  *
4291  * However, we already have libsvn_subr/hashdump.c working, and it
4292  * uses a human-readable format. That will be very handy when we're
4293  * debugging, and presumably we will not be dealing with any huge
4294  * properties or property lists initially. Therefore, we will
4295  * continue to use hashdump as the internal mechanism for storing and
4296  * reading from property lists, but note that the interface here is
4297  * _not_ dependent on that. We can swap in a DB-based implementation
4298  * at any time and users of this library will never know the
4299  * difference.
4300  */
4301 
4302 /** Set @a *props to a hash table mapping <tt>char *</tt> names onto
4303  * <tt>svn_string_t *</tt> values for all the regular properties of
4304  * @a path. Allocate the table, names, and values in @a pool. If
4305  * the node has no properties, or does not exist in the working copy,
4306  * then an empty hash is returned. @a adm_access is an access baton
4307  * set that contains @a path.
4308  */
4309 svn_error_t *
4310 svn_wc_prop_list(apr_hash_t **props,
4311  const char *path,
4312  svn_wc_adm_access_t *adm_access,
4313  apr_pool_t *pool);
4314 
4315 
4316 /** Set @a *value to the value of property @a name for @a path, allocating
4317  * @a *value in @a pool. If no such prop, set @a *value to @c NULL.
4318  * @a name may be a regular or wc property; if it is an entry property,
4319  * return the error @c SVN_ERR_BAD_PROP_KIND. @a adm_access is an access
4320  * baton set that contains @a path.
4321  */
4322 svn_error_t *
4323 svn_wc_prop_get(const svn_string_t **value,
4324  const char *name,
4325  const char *path,
4326  svn_wc_adm_access_t *adm_access,
4327  apr_pool_t *pool);
4328 
4329 /**
4330  * Set property @a name to @a value for @a path, or if @a value is
4331  * NULL, remove property @a name from @a path. @a adm_access is an
4332  * access baton with a write lock for @a path.
4333  *
4334  * If @a skip_checks is TRUE, do no validity checking. But if @a
4335  * skip_checks is FALSE, and @a name is not a valid property for @a
4336  * path, return an error, either @c SVN_ERR_ILLEGAL_TARGET (if the
4337  * property is not appropriate for @a path), or @c
4338  * SVN_ERR_BAD_MIME_TYPE (if @a name is "svn:mime-type", but @a value
4339  * is not a valid mime-type).
4340  *
4341  * @a name may be a wc property or a regular property; but if it is an
4342  * entry property, return the error @c SVN_ERR_BAD_PROP_KIND, even if
4343  * @a skip_checks is TRUE.
4344  *
4345  * For each file or directory operated on, @a notify_func will be called
4346  * with its path and the @a notify_baton. @a notify_func may be @c NULL
4347  * if you are not interested in this information.
4348  *
4349  * Use @a pool for temporary allocation.
4350  *
4351  * @since New in 1.6.
4352  */
4353 svn_error_t *
4354 svn_wc_prop_set3(const char *name,
4355  const svn_string_t *value,
4356  const char *path,
4357  svn_wc_adm_access_t *adm_access,
4358  svn_boolean_t skip_checks,
4359  svn_wc_notify_func2_t notify_func,
4360  void *notify_baton,
4361  apr_pool_t *pool);
4362 
4363 
4364 /**
4365  * Like svn_wc_prop_set3(), but without the notification callbacks.
4366  *
4367  * @since New in 1.2.
4368  */
4370 svn_error_t *
4371 svn_wc_prop_set2(const char *name,
4372  const svn_string_t *value,
4373  const char *path,
4374  svn_wc_adm_access_t *adm_access,
4375  svn_boolean_t skip_checks,
4376  apr_pool_t *pool);
4377 
4378 
4379 /**
4380  * Like svn_wc_prop_set2(), but with @a skip_checks always FALSE.
4381  *
4382  * @deprecated Provided for backward compatibility with the 1.1 API.
4383  */
4385 svn_error_t *
4386 svn_wc_prop_set(const char *name,
4387  const svn_string_t *value,
4388  const char *path,
4389  svn_wc_adm_access_t *adm_access,
4390  apr_pool_t *pool);
4391 
4392 
4393 /** Return TRUE iff @a name is a 'normal' property name. 'Normal' is
4394  * defined as a user-visible and user-tweakable property that shows up
4395  * when you fetch a proplist.
4396  *
4397  * The function currently parses the namespace like so:
4398  *
4399  * - 'svn:wc:' ==> a wcprop, stored/accessed separately via different API.
4400  *
4401  * - 'svn:entry:' ==> an "entry" prop, shunted into the 'entries' file.
4402  *
4403  * If these patterns aren't found, then the property is assumed to be
4404  * Normal.
4405  */
4407 svn_wc_is_normal_prop(const char *name);
4408 
4409 
4410 
4411 /** Return TRUE iff @a name is a 'wc' property name. */
4413 svn_wc_is_wc_prop(const char *name);
4414 
4415 /** Return TRUE iff @a name is a 'entry' property name. */
4417 svn_wc_is_entry_prop(const char *name);
4418 
4419 /** Callback type used by @c svn_wc_canonicalize_svn_prop.
4420  *
4421  * If @a mime_type is non-null, it sets @a *mime_type to the value of
4422  * @c SVN_PROP_MIME_TYPE for the path passed to @c
4423  * svn_wc_canonicalize_svn_prop (allocated from @a pool). If @a
4424  * stream is non-null, it writes the contents of the file to @a
4425  * stream.
4426  *
4427  * (Currently, this is used if you are attempting to set the @c
4428  * SVN_PROP_EOL_STYLE property, to make sure that the value matches
4429  * the mime type and contents.)
4430  */
4431 typedef svn_error_t *(*svn_wc_canonicalize_svn_prop_get_file_t)
4432  (const svn_string_t **mime_type,
4433  svn_stream_t *stream,
4434  void *baton,
4435  apr_pool_t *pool);
4436 
4437 
4438 /** Canonicalize the value of an svn:* property @a propname with
4439  * value @a propval.
4440  *
4441  * If the property is not appropriate for a node of kind @a kind, or
4442  * is otherwise invalid, throw an error. Otherwise, set @a *propval_p
4443  * to a canonicalized version of the property value. If @a
4444  * skip_some_checks is TRUE, only some validity checks are taken.
4445  *
4446  * Some validity checks require access to the contents and MIME type
4447  * of the target if it is a file; they will call @a prop_getter with @a
4448  * getter_baton, which then needs to set the MIME type and print the
4449  * contents of the file to the given stream.
4450  *
4451  * @a path should be the path of the file in question; it is only used
4452  * for error messages.
4453  *
4454  * ### This is not actually related to the WC, but it does need to call
4455  * ### svn_wc_parse_externals_description2.
4456  */
4457 svn_error_t *
4458 svn_wc_canonicalize_svn_prop(const svn_string_t **propval_p,
4459  const char *propname,
4460  const svn_string_t *propval,
4461  const char *path,
4462  svn_node_kind_t kind,
4463  svn_boolean_t skip_some_checks,
4465  void *getter_baton,
4466  apr_pool_t *pool);
4467 
4468 
4469 
4470 /* Diffs */
4471 
4472 
4473 /**
4474  * Return an @a editor/@a edit_baton for diffing a working copy against the
4475  * repository.
4476  *
4477  * @a anchor/@a target represent the base of the hierarchy to be compared.
4478  *
4479  * @a callbacks/@a callback_baton is the callback table to use when two
4480  * files are to be compared.
4481  *
4482  * If @a depth is @c svn_depth_empty, just diff exactly @a target or
4483  * @a anchor if @a target is empty. If @c svn_depth_files then do the same
4484  * and for top-level file entries as well (if any). If
4485  * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
4486  * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
4487  * then diff fully recursively. In the latter case, @a anchor should be part
4488  * of an access baton set for the @a target hierarchy.
4489  *
4490  * @a ignore_ancestry determines whether paths that have discontinuous node
4491  * ancestry are treated as delete/add or as simple modifications. If
4492  * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
4493  * result in the diff given as a full delete followed by an add.
4494  *
4495  * If @a use_text_base is TRUE, then compare the repository against
4496  * the working copy's text-base files, rather than the working files.
4497  *
4498  * Normally, the difference from repository->working_copy is shown.
4499  * If @a reverse_order is TRUE, then show working_copy->repository diffs.
4500  *
4501  * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
4502  * to periodically check if the client has canceled the operation.
4503  *
4504  * @a changelists is an array of <tt>const char *</tt> changelist
4505  * names, used as a restrictive filter on items whose differences are
4506  * reported; that is, don't generate diffs about any item unless
4507  * it's a member of one of those changelists. If @a changelists is
4508  * empty (or altogether @c NULL), no changelist filtering occurs.
4509  *
4510  * @since New in 1.6.
4511  */
4512 svn_error_t *
4514  const char *target,
4515  const svn_wc_diff_callbacks3_t *callbacks,
4516  void *callback_baton,
4517  svn_depth_t depth,
4518  svn_boolean_t ignore_ancestry,
4519  svn_boolean_t use_text_base,
4520  svn_boolean_t reverse_order,
4521  svn_cancel_func_t cancel_func,
4522  void *cancel_baton,
4523  const apr_array_header_t *changelists,
4524  const svn_delta_editor_t **editor,
4525  void **edit_baton,
4526  apr_pool_t *pool);
4527 
4528 /**
4529  * Similar to svn_wc_get_diff_editor5(), but with an
4530  * @c svn_wc_diff_callbacks2_t instead of @c svn_wc_diff_callbacks3_t.
4531  *
4532  * @deprecated Provided for backward compatibility with the 1.5 API.
4533  */
4535 svn_error_t *
4537  const char *target,
4538  const svn_wc_diff_callbacks2_t *callbacks,
4539  void *callback_baton,
4540  svn_depth_t depth,
4541  svn_boolean_t ignore_ancestry,
4542  svn_boolean_t use_text_base,
4543  svn_boolean_t reverse_order,
4544  svn_cancel_func_t cancel_func,
4545  void *cancel_baton,
4546  const apr_array_header_t *changelists,
4547  const svn_delta_editor_t **editor,
4548  void **edit_baton,
4549  apr_pool_t *pool);
4550 
4551 /**
4552  * Similar to svn_wc_get_diff_editor4(), but with @a changelists
4553  * passed as @c NULL, and @a depth set to @c svn_depth_infinity if @a
4554  * recurse is TRUE, or @c svn_depth_files if @a recurse is FALSE.
4555  *
4556  * @deprecated Provided for backward compatibility with the 1.4 API.
4557 
4558  * @since New in 1.2.
4559  */
4561 svn_error_t *
4563  const char *target,
4564  const svn_wc_diff_callbacks2_t *callbacks,
4565  void *callback_baton,
4566  svn_boolean_t recurse,
4567  svn_boolean_t ignore_ancestry,
4568  svn_boolean_t use_text_base,
4569  svn_boolean_t reverse_order,
4570  svn_cancel_func_t cancel_func,
4571  void *cancel_baton,
4572  const svn_delta_editor_t **editor,
4573  void **edit_baton,
4574  apr_pool_t *pool);
4575 
4576 
4577 /**
4578  * Similar to svn_wc_get_diff_editor3(), but with an
4579  * @c svn_wc_diff_callbacks_t instead of @c svn_wc_diff_callbacks2_t.
4580  *
4581  * @deprecated Provided for backward compatibility with the 1.1 API.
4582  */
4584 svn_error_t *
4586  const char *target,
4587  const svn_wc_diff_callbacks_t *callbacks,
4588  void *callback_baton,
4589  svn_boolean_t recurse,
4590  svn_boolean_t ignore_ancestry,
4591  svn_boolean_t use_text_base,
4592  svn_boolean_t reverse_order,
4593  svn_cancel_func_t cancel_func,
4594  void *cancel_baton,
4595  const svn_delta_editor_t **editor,
4596  void **edit_baton,
4597  apr_pool_t *pool);
4598 
4599 
4600 /**
4601  * Similar to svn_wc_get_diff_editor2(), but with @a ignore_ancestry
4602  * always set to @c FALSE.
4603  *
4604  * @deprecated Provided for backward compatibility with the 1.0 API.
4605  */
4607 svn_error_t *
4609  const char *target,
4610  const svn_wc_diff_callbacks_t *callbacks,
4611  void *callback_baton,
4612  svn_boolean_t recurse,
4613  svn_boolean_t use_text_base,
4614  svn_boolean_t reverse_order,
4615  svn_cancel_func_t cancel_func,
4616  void *cancel_baton,
4617  const svn_delta_editor_t **editor,
4618  void **edit_baton,
4619  apr_pool_t *pool);
4620 
4621 
4622 /**
4623  * Compare working copy against the text-base.
4624  *
4625  * @a anchor/@a target represent the base of the hierarchy to be compared.
4626  *
4627  * @a callbacks/@a callback_baton is the callback table to use when two
4628  * files are to be compared.
4629  *
4630  * If @a depth is @c svn_depth_empty, just diff exactly @a target or
4631  * @a anchor if @a target is empty. If @c svn_depth_files then do the same
4632  * and for top-level file entries as well (if any). If
4633  * @c svn_depth_immediates, do the same as @c svn_depth_files but also diff
4634  * top-level subdirectories at @c svn_depth_empty. If @c svn_depth_infinity,
4635  * then diff fully recursively. In the latter case, @a anchor should be part
4636  * of an access baton set for the @a target hierarchy.
4637  *
4638  * @a ignore_ancestry determines whether paths that have discontinuous node
4639  * ancestry are treated as delete/add or as simple modifications. If
4640  * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
4641  * result in the diff given as a full delete followed by an add.
4642  *
4643  * @a changelists is an array of <tt>const char *</tt> changelist
4644  * names, used as a restrictive filter on items whose differences are
4645  * reported; that is, don't generate diffs about any item unless
4646  * it's a member of one of those changelists. If @a changelists is
4647  * empty (or altogether @c NULL), no changelist filtering occurs.
4648  *
4649  * @since New in 1.6.
4650  */
4651 svn_error_t *
4653  const char *target,
4654  const svn_wc_diff_callbacks3_t *callbacks,
4655  void *callback_baton,
4656  svn_depth_t depth,
4657  svn_boolean_t ignore_ancestry,
4658  const apr_array_header_t *changelists,
4659  apr_pool_t *pool);
4660 
4661 /**
4662  * Similar to svn_wc_diff5(), but with a @c svn_wc_diff_callbacks2_t argument
4663  * instead of @c svn_wc_diff_callbacks3_t.
4664  *
4665  * @deprecated Provided for backward compatibility with the 1.5 API.
4666  */
4668 svn_error_t *
4670  const char *target,
4671  const svn_wc_diff_callbacks2_t *callbacks,
4672  void *callback_baton,
4673  svn_depth_t depth,
4674  svn_boolean_t ignore_ancestry,
4675  const apr_array_header_t *changelists,
4676  apr_pool_t *pool);
4677 
4678 
4679 /**
4680  * Similar to svn_wc_diff4(), but with @a changelists passed @c NULL,
4681  * and @a depth set to @c svn_depth_infinity if @a recurse is TRUE, or
4682  * @c svn_depth_files if @a recurse is FALSE.
4683  *
4684  * @deprecated Provided for backward compatibility with the 1.2 API.
4685  */
4687 svn_error_t *
4689  const char *target,
4690  const svn_wc_diff_callbacks2_t *callbacks,
4691  void *callback_baton,
4692  svn_boolean_t recurse,
4693  svn_boolean_t ignore_ancestry,
4694  apr_pool_t *pool);
4695 
4696 /**
4697  * Similar to svn_wc_diff3(), but with a @c svn_wc_diff_callbacks_t argument
4698  * instead of @c svn_wc_diff_callbacks2_t.
4699  *
4700  * @deprecated Provided for backward compatibility with the 1.1 API.
4701  */
4703 svn_error_t *
4705  const char *target,
4706  const svn_wc_diff_callbacks_t *callbacks,
4707  void *callback_baton,
4708  svn_boolean_t recurse,
4709  svn_boolean_t ignore_ancestry,
4710  apr_pool_t *pool);
4711 
4712 /**
4713  * Similar to svn_wc_diff2(), but with @a ignore_ancestry always set
4714  * to @c FALSE.
4715  *
4716  * @deprecated Provided for backward compatibility with the 1.0 API.
4717  */
4719 svn_error_t *
4721  const char *target,
4722  const svn_wc_diff_callbacks_t *callbacks,
4723  void *callback_baton,
4724  svn_boolean_t recurse,
4725  apr_pool_t *pool);
4726 
4727 
4728 /** Given a @a path to a file or directory under version control, discover
4729  * any local changes made to properties and/or the set of 'pristine'
4730  * properties. @a adm_access is an access baton set for @a path.
4731  *
4732  * If @a propchanges is non-@c NULL, return these changes as an array of
4733  * @c svn_prop_t structures stored in @a *propchanges. The structures and
4734  * array will be allocated in @a pool. If there are no local property
4735  * modifications on @a path, then set @a *propchanges to @c NULL.
4736  *
4737  * If @a original_props is non-@c NULL, then set @a *original_props to
4738  * hashtable (<tt>const char *name</tt> -> <tt>const svn_string_t *value</tt>)
4739  * that represents the 'pristine' property list of @a path. This hashtable is
4740  * allocated in @a pool, and can be used to compare old and new values of
4741  * properties.
4742  */
4743 svn_error_t *
4744 svn_wc_get_prop_diffs(apr_array_header_t **propchanges,
4745  apr_hash_t **original_props,
4746  const char *path,
4747  svn_wc_adm_access_t *adm_access,
4748  apr_pool_t *pool);
4749 
4750 
4751 /** The outcome of a merge carried out (or tried as a dry-run) by
4752  * svn_wc_merge()
4753  */
4755 {
4756  /** The working copy is (or would be) unchanged. The changes to be
4757  * merged were already present in the working copy
4758  */
4760 
4761  /** The working copy has been (or would be) changed. */
4763 
4764  /** The working copy has been (or would be) changed, but there was (or
4765  * would be) a conflict
4766  */
4768 
4769  /** No merge was performed, probably because the target file was
4770  * either absent or not under version control.
4771  */
4773 
4775 
4776 /** Given paths to three fulltexts, merge the differences between @a left
4777  * and @a right into @a merge_target. (It may help to know that @a left,
4778  * @a right, and @a merge_target correspond to "OLDER", "YOURS", and "MINE",
4779  * respectively, in the diff3 documentation.) Use @a pool for any
4780  * temporary allocation.
4781  *
4782  * @a adm_access is an access baton with a write lock for the directory
4783  * containing @a merge_target.
4784  *
4785  * This function assumes that @a left and @a right are in repository-normal
4786  * form (linefeeds, with keywords contracted); if necessary,
4787  * @a merge_target is temporarily converted to this form to receive the
4788  * changes, then translated back again.
4789  *
4790  * If @a merge_target is absent, or present but not under version
4791  * control, then set @a *merge_outcome to @c svn_wc_merge_no_merge and
4792  * return success without merging anything. (The reasoning is that if
4793  * the file is not versioned, then it is probably unrelated to the
4794  * changes being considered, so they should not be merged into it.)
4795  *
4796  * @a dry_run determines whether the working copy is modified. When it
4797  * is @c FALSE the merge will cause @a merge_target to be modified, when it
4798  * is @c TRUE the merge will be carried out to determine the result but
4799  * @a merge_target will not be modified.
4800  *
4801  * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
4802  * any merging; otherwise, use the built-in merge code. If @a
4803  * merge_options is non-NULL, either pass its elements to @a diff3_cmd or
4804  * parse it and use as options to the internal merge code (see
4805  * svn_diff_file_options_parse()). @a merge_options must contain
4806  * <tt>const char *</tt> elements.
4807  *
4808  * The outcome of the merge is returned in @a *merge_outcome. If there
4809  * is a conflict and @a dry_run is @c FALSE, then attempt to call @a
4810  * conflict_func with @a conflict_baton (if non-NULL). If the
4811  * conflict callback cannot resolve the conflict, then:
4812  *
4813  * * Put conflict markers around the conflicting regions in
4814  * @a merge_target, labeled with @a left_label, @a right_label, and
4815  * @a target_label. (If any of these labels are @c NULL, default
4816  * values will be used.)
4817  *
4818  * * Copy @a left, @a right, and the original @a merge_target to unique
4819  * names in the same directory as @a merge_target, ending with the
4820  * suffixes ".LEFT_LABEL", ".RIGHT_LABEL", and ".TARGET_LABEL"
4821  * respectively.
4822  *
4823  * * Mark the entry for @a merge_target as "conflicted", and track the
4824  * above mentioned backup files in the entry as well.
4825  *
4826  * Binary case:
4827  *
4828  * If @a merge_target is a binary file, then no merging is attempted,
4829  * the merge is deemed to be a conflict. If @a dry_run is @c FALSE the
4830  * working @a merge_target is untouched, and copies of @a left and
4831  * @a right are created next to it using @a left_label and @a right_label.
4832  * @a merge_target's entry is marked as "conflicted", and begins
4833  * tracking the two backup files. If @a dry_run is @c TRUE no files are
4834  * changed. The outcome of the merge is returned in @a *merge_outcome.
4835  *
4836  * @since New in 1.5.
4837  */
4838 svn_error_t *
4839 svn_wc_merge3(enum svn_wc_merge_outcome_t *merge_outcome,
4840  const char *left,
4841  const char *right,
4842  const char *merge_target,
4843  svn_wc_adm_access_t *adm_access,
4844  const char *left_label,
4845  const char *right_label,
4846  const char *target_label,
4847  svn_boolean_t dry_run,
4848  const char *diff3_cmd,
4849  const apr_array_header_t *merge_options,
4850  const apr_array_header_t *prop_diff,
4851  svn_wc_conflict_resolver_func_t conflict_func,
4852  void *conflict_baton,
4853  apr_pool_t *pool);
4854 
4855 /** Similar to svn_wc_merge3(), but with @a prop_diff, @a
4856  * conflict_func, @a conflict_baton set to NULL.
4857  *
4858  * @deprecated Provided for backwards compatibility with the 1.4 API.
4859  */
4861 svn_error_t *
4862 svn_wc_merge2(enum svn_wc_merge_outcome_t *merge_outcome,
4863  const char *left,
4864  const char *right,
4865  const char *merge_target,
4866  svn_wc_adm_access_t *adm_access,
4867  const char *left_label,
4868  const char *right_label,
4869  const char *target_label,
4870  svn_boolean_t dry_run,
4871  const char *diff3_cmd,
4872  const apr_array_header_t *merge_options,
4873  apr_pool_t *pool);
4874 
4875 
4876 /** Similar to svn_wc_merge2(), but with @a merge_options set to NULL.
4877  *
4878  * @deprecated Provided for backwards compatibility with the 1.3 API.
4879  */
4881 svn_error_t *
4882 svn_wc_merge(const char *left,
4883  const char *right,
4884  const char *merge_target,
4885  svn_wc_adm_access_t *adm_access,
4886  const char *left_label,
4887  const char *right_label,
4888  const char *target_label,
4889  svn_boolean_t dry_run,
4890  enum svn_wc_merge_outcome_t *merge_outcome,
4891  const char *diff3_cmd,
4892  apr_pool_t *pool);
4893 
4894 
4895 /** Given a @a path under version control, merge an array of @a
4896  * propchanges into the path's existing properties. @a propchanges is
4897  * an array of @c svn_prop_t objects, and @a baseprops is a hash
4898  * representing the original set of properties that @a propchanges is
4899  * working against. @a adm_access is an access baton for the directory
4900  * containing @a path.
4901  *
4902  * If @a base_merge is @c FALSE only the working properties will be changed,
4903  * if it is @c TRUE both the base and working properties will be changed.
4904  *
4905  * If @a state is non-NULL, set @a *state to the state of the properties
4906  * after the merge.
4907  *
4908  * If conflicts are found when merging working properties, they are
4909  * described in a temporary .prej file (or appended to an already-existing
4910  * .prej file), and the entry is marked "conflicted". Base properties
4911  * are changed unconditionally, if @a base_merge is @c TRUE, they never result
4912  * in a conflict.
4913  *
4914  * If @a path is not under version control, return the error
4915  * SVN_ERR_UNVERSIONED_RESOURCE and don't touch anyone's properties.
4916  *
4917  * @since New in 1.5.
4918  */
4919 svn_error_t *
4921  const char *path,
4922  svn_wc_adm_access_t *adm_access,
4923  apr_hash_t *baseprops,
4924  const apr_array_header_t *propchanges,
4925  svn_boolean_t base_merge,
4926  svn_boolean_t dry_run,
4927  svn_wc_conflict_resolver_func_t conflict_func,
4928  void *conflict_baton,
4929  apr_pool_t *pool);
4930 
4931 
4932 /**
4933  * Same as svn_wc_merge_props2(), but with a @a conflict_func (and
4934  * baton) of NULL.
4935  *
4936  * @deprecated Provided for backward compatibility with the 1.3 API.
4937  *
4938  */
4940 svn_error_t *
4942  const char *path,
4943  svn_wc_adm_access_t *adm_access,
4944  apr_hash_t *baseprops,
4945  const apr_array_header_t *propchanges,
4946  svn_boolean_t base_merge,
4947  svn_boolean_t dry_run,
4948  apr_pool_t *pool);
4949 
4950 
4951 /**
4952  * Similar to svn_wc_merge_props(), but no baseprops are given.
4953  * Instead, it's assumed that the incoming propchanges are based
4954  * against the working copy's own baseprops. While this assumption is
4955  * correct for 'svn update', it's incorrect for 'svn merge', and can
4956  * cause flawed behavior. (See issue #2035.)
4957  *
4958  * @deprecated Provided for backward compatibility with the 1.2 API.
4959  */
4961 svn_error_t *
4963  const char *path,
4964  svn_wc_adm_access_t *adm_access,
4965  const apr_array_header_t *propchanges,
4966  svn_boolean_t base_merge,
4967  svn_boolean_t dry_run,
4968  apr_pool_t *pool);
4969 
4970 
4971 /** Given a @a path to a wc file, return a stream to the @a contents of
4972  * the pristine copy of the file. This is needed so clients can do
4973  * diffs. If the WC has no text-base, return a @c NULL instead of a
4974  * stream.
4975  *
4976  * @since New in 1.6.
4977  */
4978 svn_error_t *
4980  const char *path,
4981  apr_pool_t *result_pool,
4982  apr_pool_t *scratch_pool);
4983 
4984 
4985 /** Returns a path to the pristine copy of @a path. Should use
4986  * svn_wc_get_pristine_contents() instead.
4987  *
4988  * @deprecated Provided for backwards compatibility with the 1.5 API.
4989  */
4991 svn_error_t *
4992 svn_wc_get_pristine_copy_path(const char *path,
4993  const char **pristine_path,
4994  apr_pool_t *pool);
4995 
4996 
4997 /**
4998  * Recurse from @a path, cleaning up unfinished log business. Perform
4999  * necessary allocations in @a pool. Any working copy locks under @a path
5000  * will be taken over and then cleared by this function. If @a diff3_cmd
5001  * is non-NULL, then use it as the diff3 command for any merging; otherwise,
5002  * use the built-in merge code.
5003  *
5004  * WARNING: there is no mechanism that will protect locks that are still
5005  * being used.
5006  *
5007  * If @a cancel_func is non-NULL, invoke it with @a cancel_baton at
5008  * various points during the operation. If it returns an error
5009  * (typically @c SVN_ERR_CANCELLED), return that error immediately.
5010  *
5011  * @since New in 1.2.
5012  */
5013 svn_error_t *
5014 svn_wc_cleanup2(const char *path,
5015  const char *diff3_cmd,
5016  svn_cancel_func_t cancel_func,
5017  void *cancel_baton,
5018  apr_pool_t *pool);
5019 
5020 /**
5021  * Similar to svn_wc_cleanup2(). @a optional_adm_access is an historic
5022  * relic and not used, it may be NULL.
5023  *
5024  * @deprecated Provided for backward compatibility with the 1.1 API.
5025  */
5027 svn_error_t *
5028 svn_wc_cleanup(const char *path,
5029  svn_wc_adm_access_t *optional_adm_access,
5030  const char *diff3_cmd,
5031  svn_cancel_func_t cancel_func,
5032  void *cancel_baton,
5033  apr_pool_t *pool);
5034 
5035 
5036 /** Relocation validation callback typedef.
5037  *
5038  * Called for each relocated file/directory. @a uuid, if non-NULL, contains
5039  * the expected repository UUID, @a url contains the tentative URL.
5040  *
5041  * @a baton is a closure object; it should be provided by the
5042  * implementation, and passed by the caller.
5043  *
5044  * If @a root is TRUE, then the implementation should make sure that @a url
5045  * is the repository root. Else, it can be an URL inside the repository.
5046  * @a pool may be used for temporary allocations.
5047  *
5048  * @since New in 1.5.
5049  */
5050 typedef svn_error_t *(*svn_wc_relocation_validator3_t)(void *baton,
5051  const char *uuid,
5052  const char *url,
5053  const char *root_url,
5054  apr_pool_t *pool);
5055 
5056 /** Similar to @c svn_wc_relocation_validator3_t, but without
5057  * the @a root_url arguments.
5058  *
5059  * @deprecated Provided for backwards compatibility with the 1.4 API.
5060  */
5061 typedef svn_error_t *(*svn_wc_relocation_validator2_t)(void *baton,
5062  const char *uuid,
5063  const char *url,
5064  svn_boolean_t root,
5065  apr_pool_t *pool);
5066 
5067 /** Similar to @c svn_wc_relocation_validator2_t, but without
5068  * the @a root and @a pool arguments. @a uuid will not be NULL in this version
5069  * of the function.
5070  *
5071  * @deprecated Provided for backwards compatibility with the 1.3 API.
5072  */
5073 typedef svn_error_t *(*svn_wc_relocation_validator_t)(void *baton,
5074  const char *uuid,
5075  const char *url);
5076 
5077 /** Change repository references at @a path that begin with @a from
5078  * to begin with @a to instead. Perform necessary allocations in @a pool.
5079  * If @a recurse is TRUE, do so. @a validator (and its baton,
5080  * @a validator_baton), will be called for each newly generated URL.
5081  *
5082  * @a adm_access is an access baton for the directory containing
5083  * @a path.
5084  *
5085  * @since New in 1.5.
5086  */
5087 svn_error_t *
5088 svn_wc_relocate3(const char *path,
5089  svn_wc_adm_access_t *adm_access,
5090  const char *from,
5091  const char *to,
5092  svn_boolean_t recurse,
5094  void *validator_baton,
5095  apr_pool_t *pool);
5096 
5097 /** Similar to svn_wc_relocate3(), but uses @c svn_wc_relocation_validator2_t.
5098  *
5099  * @deprecated Provided for backwards compatibility with the 1.4 API. */
5101 svn_error_t *
5102 svn_wc_relocate2(const char *path,
5103  svn_wc_adm_access_t *adm_access,
5104  const char *from,
5105  const char *to,
5106  svn_boolean_t recurse,
5108  void *validator_baton,
5109  apr_pool_t *pool);
5110 
5111 /** Similar to svn_wc_relocate2(), but uses @c svn_wc_relocation_validator_t.
5112  *
5113  * @deprecated Provided for backwards compatibility with the 1.3 API. */
5115 svn_error_t *
5116 svn_wc_relocate(const char *path,
5117  svn_wc_adm_access_t *adm_access,
5118  const char *from,
5119  const char *to,
5120  svn_boolean_t recurse,
5122  void *validator_baton,
5123  apr_pool_t *pool);
5124 
5125 
5126 /**
5127  * Revert changes to @a path. Perform necessary allocations in @a pool.
5128  *
5129  * @a parent_access is an access baton for the directory containing @a
5130  * path, unless @a path is a working copy root (as determined by @c
5131  * svn_wc_is_wc_root), in which case @a parent_access refers to @a
5132  * path itself.
5133  *
5134  * If @a depth is @c svn_depth_empty, revert just @a path (if a
5135  * directory, then revert just the properties on that directory).
5136  * Else if @c svn_depth_files, revert @a path and any files
5137  * directly under @a path if it is directory. Else if
5138  * @c svn_depth_immediates, revert all of the preceding plus
5139  * properties on immediate subdirectories; else if @c svn_depth_infinity,
5140  * revert path and everything under it fully recursively.
5141  *
5142  * @a changelists is an array of <tt>const char *</tt> changelist
5143  * names, used as a restrictive filter on items reverted; that is,
5144  * don't revert any item unless it's a member of one of those
5145  * changelists. If @a changelists is empty (or altogether @c NULL),
5146  * no changelist filtering occurs.
5147  *
5148  * If @a cancel_func is non-NULL, call it with @a cancel_baton at
5149  * various points during the reversion process. If it returns an
5150  * error (typically @c SVN_ERR_CANCELLED), return that error
5151  * immediately.
5152  *
5153  * If @a use_commit_times is TRUE, then all reverted working-files
5154  * will have their timestamp set to the last-committed-time. If
5155  * FALSE, the reverted working-files will be touched with the 'now' time.
5156  *
5157  * For each item reverted, @a notify_func will be called with @a notify_baton
5158  * and the path of the reverted item. @a notify_func may be @c NULL if this
5159  * notification is not needed.
5160  *
5161  * If @a path is not under version control, return the error
5162  * SVN_ERR_UNVERSIONED_RESOURCE.
5163  *
5164  * @since New in 1.5.
5165  */
5166 svn_error_t *
5167 svn_wc_revert3(const char *path,
5168  svn_wc_adm_access_t *parent_access,
5169  svn_depth_t depth,
5170  svn_boolean_t use_commit_times,
5171  const apr_array_header_t *changelists,
5172  svn_cancel_func_t cancel_func,
5173  void *cancel_baton,
5174  svn_wc_notify_func2_t notify_func,
5175  void *notify_baton,
5176  apr_pool_t *pool);
5177 
5178 /**
5179  * Similar to svn_wc_revert3(), but with @a changelists passed as @c
5180  * NULL, and @a depth set according to @a recursive: if @a recursive
5181  * is TRUE, @a depth is @c svn_depth_infinity; if FALSE, @a depth is
5182  * @c svn_depth_empty.
5183  *
5184  * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files;
5185  * revert is deliberately different.
5186  *
5187  * @deprecated Provided for backward compatibility with the 1.2 API.
5188  */
5190 svn_error_t *
5191 svn_wc_revert2(const char *path,
5192  svn_wc_adm_access_t *parent_access,
5193  svn_boolean_t recursive,
5194  svn_boolean_t use_commit_times,
5195  svn_cancel_func_t cancel_func,
5196  void *cancel_baton,
5197  svn_wc_notify_func2_t notify_func,
5198  void *notify_baton,
5199  apr_pool_t *pool);
5200 
5201 /**
5202  * Similar to svn_wc_revert2(), but takes an @c svn_wc_notify_func_t instead.
5203  *
5204  * @deprecated Provided for backward compatibility with the 1.1 API.
5205  */
5207 svn_error_t *
5208 svn_wc_revert(const char *path,
5209  svn_wc_adm_access_t *parent_access,
5210  svn_boolean_t recursive,
5211  svn_boolean_t use_commit_times,
5212  svn_cancel_func_t cancel_func,
5213  void *cancel_baton,
5214  svn_wc_notify_func_t notify_func,
5215  void *notify_baton,
5216  apr_pool_t *pool);
5217 
5218 
5219 /* Tmp files */
5220 
5221 /** Create a unique temporary file in administrative tmp/ area of
5222  * directory @a path. Return a handle in @a *fp and the path
5223  * in @a *new_name. Either @a fp or @a new_name can be NULL.
5224  *
5225  * The flags will be <tt>APR_WRITE | APR_CREATE | APR_EXCL</tt> and
5226  * optionally @c APR_DELONCLOSE (if the @a delete_when argument is
5227  * set to @c svn_io_file_del_on_close).
5228  *
5229  * This means that as soon as @a fp is closed, the tmp file will vanish.
5230  *
5231  * @since New in 1.4
5232  */
5233 svn_error_t *
5234 svn_wc_create_tmp_file2(apr_file_t **fp,
5235  const char **new_name,
5236  const char *path,
5237  svn_io_file_del_t delete_when,
5238  apr_pool_t *pool);
5239 
5240 
5241 /** Same as svn_wc_create_tmp_file2(), but with @a new_name set to @c NULL,
5242  * and without the ability to delete the file on pool cleanup.
5243  *
5244  * @deprecated For compatibility with 1.3 API
5245  */
5247 svn_error_t *
5248 svn_wc_create_tmp_file(apr_file_t **fp,
5249  const char *path,
5250  svn_boolean_t delete_on_close,
5251  apr_pool_t *pool);
5252 
5253 
5254 
5255 /* EOL conversion and keyword expansion. */
5256 
5257 /** Set @a xlated_path to a translated copy of @a src
5258  * or to @a src itself if no translation is necessary.
5259  * That is, if @a versioned_file's properties indicate newline conversion or
5260  * keyword expansion, point @a *xlated_path to a copy of @a src
5261  * whose newlines and keywords are converted using the translation
5262  * as requested by @a flags.
5263  *
5264  * When translating to the normal form, inconsistent eol styles will be
5265  * repaired when appropriate for the given setting. When translating
5266  * from normal form, no EOL repair is performed (consistency is assumed).
5267  * This behaviour can be overridden by specifying
5268  * @c SVN_WC_TRANSLATE_FORCE_EOL_REPAIR.
5269  *
5270  * The caller can explicitly request a new file to be returned by setting the
5271  * @c SVN_WC_TRANSLATE_FORCE_COPY flag in @a flags.
5272  *
5273  * This function is generally used to get a file that can be compared
5274  * meaningfully against @a versioned_file's text base, if
5275  * @c SVN_WC_TRANSLATE_TO_NF is specified, against @a versioned_file itself
5276  * if @c SVN_WC_TRANSLATE_FROM_NF is specified.
5277  *
5278  * Output files are created in the temp file area belonging to
5279  * @a versioned_file. By default they will be deleted at pool cleanup.
5280  *
5281  * If @c SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP is specified, the default
5282  * pool cleanup handler to remove @a *xlated_path is not registered.
5283  *
5284  * If an error is returned, the effect on @a *xlated_path is undefined.
5285  *
5286  * @since New in 1.4
5287  */
5288 svn_error_t *
5289 svn_wc_translated_file2(const char **xlated_path,
5290  const char *src,
5291  const char *versioned_file,
5292  svn_wc_adm_access_t *adm_access,
5293  apr_uint32_t flags,
5294  apr_pool_t *pool);
5295 
5296 
5297 /** Same as svn_wc_translated_file2, but will never clean up
5298  * temporary files.
5299  *
5300  * @deprecated Provided for compatibility with the 1.3 API
5301  */
5303 svn_error_t *
5304 svn_wc_translated_file(const char **xlated_p,
5305  const char *vfile,
5306  svn_wc_adm_access_t *adm_access,
5307  svn_boolean_t force_repair,
5308  apr_pool_t *pool);
5309 
5310 
5311 /** Returns a @a stream allocated in @a pool with access to the given
5312  * @a path taking the file properties from @a versioned_file using
5313  * @a adm_access.
5314  *
5315  * When translation from normal form is requested
5316  * (@c SVN_WC_TRANSLATE_FROM_NF is specified in @a flags), @a path
5317  * is used as target path and stream read operations are not supported.
5318  * Conversely, if translation to normal form is requested
5319  * (@c SVN_WC_TRANSLATE_TO_NF is specified in @a flags), @a path is
5320  * used as source path and stream write operations are not supported.
5321  *
5322  * The @a flags are the same constants as those used for
5323  * svn_wc_translated_file().
5324  *
5325  * @since New in 1.5.
5326  */
5327 svn_error_t *
5329  const char *path,
5330  const char *versioned_file,
5331  svn_wc_adm_access_t *adm_access,
5332  apr_uint32_t flags,
5333  apr_pool_t *pool);
5334 
5335 
5336 /* Text/Prop Deltas Using an Editor */
5337 
5338 
5339 /** Send the local modifications for versioned file @a path (with
5340  * matching @a file_baton) through @a editor, then close @a file_baton
5341  * afterwards. Use @a pool for any temporary allocation and
5342  * @a adm_access as an access baton for @a path.
5343  *
5344  * This process creates a copy of @a path with keywords and eol
5345  * untranslated. If @a tempfile is non-NULL, set @a *tempfile to the
5346  * path to this copy. Do not clean up the copy; caller can do that.
5347  * If @a digest is non-NULL, put the MD5 checksum of the
5348  * temporary file into @a digest, which must point to @c APR_MD5_DIGESTSIZE
5349  * bytes of storage. (The purpose of handing back the tmp copy is that
5350  * it is usually about to become the new text base anyway, but the
5351  * installation of the new text base is outside the scope of this
5352  * function.)
5353  *
5354  * If @a fulltext, send the untranslated copy of @a path through @a editor
5355  * as full-text; else send it as svndiff against the current text base.
5356  *
5357  * If sending a diff, and the recorded checksum for @a path's text-base
5358  * does not match the current actual checksum, then remove the tmp
5359  * copy (and set @a *tempfile to NULL if appropriate), and return the
5360  * error @c SVN_ERR_WC_CORRUPT_TEXT_BASE.
5361  *
5362  * @note This is intended for use with both infix and postfix
5363  * text-delta styled editor drivers.
5364  *
5365  * @since New in 1.4.
5366  */
5367 svn_error_t *
5368 svn_wc_transmit_text_deltas2(const char **tempfile,
5369  unsigned char digest[],
5370  const char *path,
5371  svn_wc_adm_access_t *adm_access,
5372  svn_boolean_t fulltext,
5373  const svn_delta_editor_t *editor,
5374  void *file_baton,
5375  apr_pool_t *pool);
5376 
5377 /** Similar to svn_wc_transmit_text_deltas2(), but with @a digest set to NULL.
5378  *
5379  * @deprecated Provided for backwards compatibility with the 1.3 API.
5380  */
5382 svn_error_t *
5383 svn_wc_transmit_text_deltas(const char *path,
5384  svn_wc_adm_access_t *adm_access,
5385  svn_boolean_t fulltext,
5386  const svn_delta_editor_t *editor,
5387  void *file_baton,
5388  const char **tempfile,
5389  apr_pool_t *pool);
5390 
5391 
5392 /** Given a @a path with its accompanying @a entry, transmit all local
5393  * property modifications using the appropriate @a editor method (in
5394  * conjunction with @a baton). @a adm_access is an access baton set
5395  * that contains @a path. Use @a pool for all allocations.
5396  *
5397  * If a temporary file remains after this function is finished, the
5398  * path to that file is returned in @a *tempfile (so the caller can
5399  * clean this up if it wishes to do so).
5400  *
5401  * @note Starting version 1.5, no tempfile will ever be returned
5402  * anymore. If @a *tempfile is passed, its value is set to @c NULL.
5403  */
5404 svn_error_t *
5405 svn_wc_transmit_prop_deltas(const char *path,
5406  svn_wc_adm_access_t *adm_access,
5407  const svn_wc_entry_t *entry,
5408  const svn_delta_editor_t *editor,
5409  void *baton,
5410  const char **tempfile,
5411  apr_pool_t *pool);
5412 
5413 
5414 /** Get the run-time configured list of ignore patterns from the
5415  * @c svn_config_t's in the @a config hash, and store them in @a *patterns.
5416  * Allocate @a *patterns and its contents in @a pool.
5417  */
5418 svn_error_t *
5419 svn_wc_get_default_ignores(apr_array_header_t **patterns,
5420  apr_hash_t *config,
5421  apr_pool_t *pool);
5422 
5423 /** Get the list of ignore patterns from the @c svn_config_t's in the
5424  * @a config hash and the local ignore patterns from the directory
5425  * in @a adm_access, and store them in @a *patterns.
5426  * Allocate @a *patterns and its contents in @a pool.
5427  *
5428  * @since New in 1.3.
5429  */
5430 svn_error_t *
5431 svn_wc_get_ignores(apr_array_header_t **patterns,
5432  apr_hash_t *config,
5433  svn_wc_adm_access_t *adm_access,
5434  apr_pool_t *pool);
5435 
5436 /** Return TRUE iff @a str matches any of the elements of @a list, a
5437  * list of zero or more ignore patterns.
5438  *
5439  * @since New in 1.5.
5440  */
5442 svn_wc_match_ignore_list(const char *str,
5443  apr_array_header_t *list,
5444  apr_pool_t *pool);
5445 
5446 
5447 /** Add @a lock to the working copy for @a path. @a adm_access must contain
5448  * a write lock for @a path. If @a path is read-only, due to locking
5449  * properties, make it writable. Perform temporary allocations in @a
5450  * pool. */
5451 svn_error_t *
5452 svn_wc_add_lock(const char *path,
5453  const svn_lock_t *lock,
5454  svn_wc_adm_access_t *adm_access,
5455  apr_pool_t *pool);
5456 
5457 /** Remove any lock from @a path. @a adm_access must contain a
5458  * write-lock for @a path. If @a path has a lock and the locking
5459  * so specifies, make the file read-only. Don't return an error if @a
5460  * path didn't have a lock. Perform temporary allocations in @a pool. */
5461 svn_error_t *
5462 svn_wc_remove_lock(const char *path,
5463  svn_wc_adm_access_t *adm_access,
5464  apr_pool_t *pool);
5465 
5466 
5467 /** A structure to report a summary of a working copy, including the
5468  * mix of revisions found within it, whether any parts are switched or
5469  * locally modified, and whether it is a sparse checkout.
5470  *
5471  * @note Fields may be added to the end of this structure in future
5472  * versions. Therefore, to preserve binary compatibility, users
5473  * should not directly allocate structures of this type.
5474  *
5475  * @since New in 1.4
5476  */
5478 {
5479  svn_revnum_t min_rev; /**< Lowest revision found */
5480  svn_revnum_t max_rev; /**< Highest revision found */
5481 
5482  svn_boolean_t switched; /**< Is anything switched? */
5483  svn_boolean_t modified; /**< Is anything modified? */
5484 
5485  /** Whether any WC paths are at a depth other than @c svn_depth_infinity.
5486  * @since New in 1.5.
5487  */
5490 
5491 /** Set @a *result_p to point to a new @c svn_wc_revision_status_t structure
5492  * containing a summary of the revision range and status of the working copy
5493  * at @a wc_path (not including "externals").
5494  *
5495  * Set @a (*result_p)->min_rev and @a (*result_p)->max_rev respectively to the
5496  * lowest and highest revision numbers in the working copy. If @a committed
5497  * is TRUE, summarize the last-changed revisions, else the base revisions.
5498  *
5499  * Set @a (*result_p)->switched to indicate whether any item in the WC is
5500  * switched relative to its parent. If @a trail_url is non-NULL, use it to
5501  * determine if @a wc_path itself is switched. It should be any trailing
5502  * portion of @a wc_path's expected URL, long enough to include any parts
5503  * that the caller considers might be changed by a switch. If it does not
5504  * match the end of @a wc_path's actual URL, then report a "switched"
5505  * status.
5506  *
5507  * Set @a (*result_p)->modified to indicate whether any item is locally
5508  * modified.
5509  *
5510  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
5511  * if the client has cancelled the operation.
5512  *
5513  * Allocate *result_p in @a pool.
5514  *
5515  * @since New in 1.4
5516  */
5517 svn_error_t *
5519  const char *wc_path,
5520  const char *trail_url,
5521  svn_boolean_t committed,
5522  svn_cancel_func_t cancel_func,
5523  void *cancel_baton,
5524  apr_pool_t *pool);
5525 
5526 
5527 /**
5528  * Set @a path's entry's 'changelist' attribute to @a changelist iff
5529  * @a changelist is not @c NULL; otherwise, remove any current
5530  * changelist assignment from @a path. @a changelist may not be the
5531  * empty string. @a adm_access is an access baton set that contains
5532  * @a path.
5533  *
5534  * If @a cancel_func is not @c NULL, call it with @a cancel_baton to
5535  * determine if the client has cancelled the operation.
5536  *
5537  * If @a notify_func is not @c NULL, call it with @a notify_baton to
5538  * report the change (using notification types @c
5539  * svn_wc_notify_changelist_set and @c svn_wc_notify_changelist_clear).
5540  *
5541  * @note For now, directories are NOT allowed to be associated with
5542  * changelists; there is confusion about whether they should behave
5543  * as depth-0 or depth-infinity objects. If @a path is a directory,
5544  * return @c SVN_ERR_UNSUPPORTED_FEATURE.
5545  *
5546  * @note This metadata is purely a client-side "bookkeeping"
5547  * convenience, and is entirely managed by the working copy.
5548  *
5549  * @since New in 1.5.
5550  */
5551 svn_error_t *
5552 svn_wc_set_changelist(const char *path,
5553  const char *changelist,
5554  svn_wc_adm_access_t *adm_access,
5555  svn_cancel_func_t cancel_func,
5556  void *cancel_baton,
5557  svn_wc_notify_func2_t notify_func,
5558  void *notify_baton,
5559  apr_pool_t *pool);
5560 
5561 /** Crop @a target according to @a depth.
5562  *
5563  * Remove any item that exceeds the boundary of @a depth (relative to
5564  * @a target) from revision control. Leave modified items behind
5565  * (unversioned), while removing unmodified ones completely.
5566  *
5567  * If @a target starts out with a shallower depth than @a depth, do not
5568  * upgrade it to @a depth (that would not be cropping); however, do
5569  * check children and crop them appropriately according to @a depth.
5570  *
5571  * Returns immediately with no error if @a target is not a directory,
5572  * or if @a depth is not restrictive (e.g., @c svn_depth_infinity).
5573  *
5574  * @a anchor is an access baton, with a tree lock, for the local path to the
5575  * working copy which will be used as the root of this operation. If
5576  * @a target is not empty, it represents an entry in the @a anchor path;
5577  * otherwise, the @a anchor path is the target. @a target may not be
5578  * @c NULL.
5579  *
5580  * If @a cancel_func is not @c NULL, call it with @a cancel_baton at
5581  * various points to determine if the client has cancelled the operation.
5582  *
5583  * If @a notify_func is not @c NULL, call it with @a notify_baton to
5584  * report changes as they are made.
5585  *
5586  * @note: svn_depth_exclude currently does nothing; passing it results
5587  * in immediate success with no side effects.
5588  *
5589  * @since New in 1.6
5590  */
5591 svn_error_t *
5593  const char *target,
5594  svn_depth_t depth,
5595  svn_wc_notify_func2_t notify_func,
5596  void *notify_baton,
5597  svn_cancel_func_t cancel_func,
5598  void *cancel_baton,
5599  apr_pool_t *pool);
5600 
5601 /** @} */
5602 
5603 #ifdef __cplusplus
5604 }
5605 #endif /* __cplusplus */
5606 
5607 #endif /* SVN_WC_H */