Subversion
svn_wc.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements. See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership. The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License. You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied. See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_wc.h
24  * @brief Subversion's working copy library
25  *
26  * Requires:
27  * - A working copy
28  *
29  * Provides:
30  * - Ability to manipulate working copy's versioned data.
31  * - Ability to manipulate working copy's administrative files.
32  *
33  * Used By:
34  * - Clients.
35  *
36  * Notes:
37  * The 'path' parameters to most of the older functions can be
38  * absolute or relative (relative to current working
39  * directory). If there are any cases where they are
40  * relative to the path associated with the
41  * 'svn_wc_adm_access_t *adm_access' baton passed along with the
42  * path, those cases should be explicitly documented, and if they
43  * are not, please fix it. All new functions introduced since
44  * Subversion 1.7 require absolute paths, unless explicitly
45  * documented otherwise.
46  *
47  * Starting with Subversion 1.7, several arguments are re-ordered
48  * to be more consistent through the api. The common ordering used
49  * is:
50  *
51  * Firsts:
52  * - Output arguments
53  * Then:
54  * - Working copy context
55  * - Local abspath
56  * Followed by:
57  * - Function specific arguments
58  * - Specific callbacks with their batons
59  * Finally:
60  * - Generic callbacks (with baton) from directly functional to
61  * just observing:
62  * - svn_wc_conflict_resolver_func2_t
63  * - svn_wc_external_update_t
64  * - svn_cancel_func_t
65  * - svn_wc_notify_func2_t
66  * - Result pool
67  * - Scratch pool.
68  */
69 
70 #ifndef SVN_WC_H
71 #define SVN_WC_H
72 
73 #include <apr.h>
74 #include <apr_pools.h>
75 #include <apr_tables.h>
76 #include <apr_hash.h>
77 #include <apr_time.h>
78 #include <apr_file_io.h>
79 
80 #include "svn_types.h"
81 #include "svn_string.h"
82 #include "svn_checksum.h"
83 #include "svn_io.h"
84 #include "svn_delta.h" /* for svn_stream_t */
85 #include "svn_opt.h"
86 #include "svn_ra.h" /* for svn_ra_reporter_t type */
87 
88 #ifdef __cplusplus
89 extern "C" {
90 #endif /* __cplusplus */
91 
92 ␌
93 /**
94  * Get libsvn_wc version information.
95  *
96  * @since New in 1.1.
97  */
98 const svn_version_t *
100 
101 
102 /**
103  * @defgroup svn_wc Working copy management
104  * @{
105  */
106 
107 
108 /** Flags for use with svn_wc_translated_file2() and svn_wc_translated_stream().
109  *
110  * @defgroup translate_flags Translation flags
111  * @{
112  */
113 
114  /** Translate from Normal Form.
115  *
116  * The working copy text bases and repository files are stored
117  * in normal form. Some files' contents - or ever representation -
118  * differs between the working copy and the normal form. This flag
119  * specifies to take the latter form as input and transform it
120  * to the former.
121  *
122  * Either this flag or #SVN_WC_TRANSLATE_TO_NF should be specified,
123  * but not both.
124  */
125 #define SVN_WC_TRANSLATE_FROM_NF 0x00000000
126 
127  /** Translate to Normal Form.
128  *
129  * Either this flag or #SVN_WC_TRANSLATE_FROM_NF should be specified,
130  * but not both.
131  */
132 #define SVN_WC_TRANSLATE_TO_NF 0x00000001
133 
134  /** Force repair of eol styles, making sure the output file consistently
135  * contains the one eol style as specified by the svn:eol-style
136  * property and the required translation direction.
137  *
138  */
139 #define SVN_WC_TRANSLATE_FORCE_EOL_REPAIR 0x00000002
140 
141  /** Don't register a pool cleanup to delete the output file */
142 #define SVN_WC_TRANSLATE_NO_OUTPUT_CLEANUP 0x00000004
143 
144  /** Guarantee a new file is created on successful return.
145  * The default shortcuts translation by returning the path
146  * of the untranslated file when no translation is required.
147  */
148 #define SVN_WC_TRANSLATE_FORCE_COPY 0x00000008
149 
150  /** Use a non-wc-local tmp directory for creating output files,
151  * instead of in the working copy admin tmp area which is the default.
152  *
153  * @since New in 1.4.
154  */
155 #define SVN_WC_TRANSLATE_USE_GLOBAL_TMP 0x00000010
156 
157 /** @} */
158 
159 
160 /**
161  * @defgroup svn_wc_context Working copy context
162  * @{
163  */
164 
165 /** The context for all working copy interactions.
166  *
167  * This is the client-facing datastructure API consumers are required
168  * to create and use when interacting with a working copy. Multiple
169  * contexts can be created for the same working copy simultaneously, within
170  * the same process or different processes. Context mutexing will be handled
171  * internally by the working copy library.
172  *
173  * @note: #svn_wc_context_t should be passed by non-const pointer in all
174  * APIs, even for read-only operations, as it contains mutable data (caching,
175  * etc.).
176  *
177  * @since New in 1.7.
178  */
179 typedef struct svn_wc_context_t svn_wc_context_t;
180 
181 /** Create a context for the working copy, and return it in @a *wc_ctx. This
182  * context is not associated with a particular working copy, but as operations
183  * are performed, will load the appropriate working copy information.
184  *
185  * @a config should hold the various configuration options that may apply to
186  * this context. It should live at least as long as @a result_pool. It may
187  * be @c NULL.
188  *
189  * The context will be allocated in @a result_pool, and will use @a
190  * result_pool for any internal allocations requiring the same longevity as
191  * the context. The context will be automatically destroyed, and its
192  * resources released, when @a result_pool is cleared, or it may be manually
193  * destroyed by invoking svn_wc_context_destroy().
194  *
195  * Use @a scratch_pool for temporary allocations. It may be cleared
196  * immediately upon returning from this function.
197  *
198  * @since New in 1.7.
199  */
200 svn_error_t *
202  const svn_config_t *config,
203  apr_pool_t *result_pool,
204  apr_pool_t *scratch_pool);
205 
206 
207 /** Destroy the working copy context described by @a wc_ctx, releasing any
208  * acquired resources.
209  *
210  * @since New in 1.7.
211  */
212 svn_error_t *
214 
215 
216 /** @} */
217 
218 
219 /**
220  * Locking/Opening/Closing using adm access batons.
221  *
222  * @defgroup svn_wc_adm_access Adm access batons (deprecated)
223  * @{
224  */
225 
226 /** Baton for access to a working copy administrative area.
227  *
228  * Access batons can be grouped into sets, by passing an existing open
229  * baton when opening a new baton. Given one baton in a set, other batons
230  * may be retrieved. This allows an entire hierarchy to be locked, and
231  * then the set of batons can be passed around by passing a single baton.
232  *
233  * @deprecated Provided for backward compatibility with the 1.6 API.
234  * New code should use a #svn_wc_context_t object to access the working
235  * copy.
236  */
238 
239 
240 /**
241  * Return, in @a *adm_access, a pointer to a new access baton for the working
242  * copy administrative area associated with the directory @a path. If
243  * @a write_lock is TRUE the baton will include a write lock, otherwise the
244  * baton can only be used for read access. If @a path refers to a directory
245  * that is already write locked then the error #SVN_ERR_WC_LOCKED will be
246  * returned. The error #SVN_ERR_WC_NOT_DIRECTORY will be returned if
247  * @a path is not a versioned directory.
248  *
249  * If @a associated is an open access baton then @a adm_access will be added
250  * to the set containing @a associated. @a associated can be @c NULL, in
251  * which case @a adm_access is the start of a new set.
252  *
253  * @a levels_to_lock specifies how far to lock. Zero means just the specified
254  * directory. Any negative value means to lock the entire working copy
255  * directory hierarchy under @a path. A positive value indicates the number of
256  * levels of directories to lock -- 1 means just immediate subdirectories, 2
257  * means immediate subdirectories and their subdirectories, etc. All the
258  * access batons will become part of the set containing @a adm_access. This
259  * is an all-or-nothing option, if it is not possible to lock all the
260  * requested directories then an error will be returned and @a adm_access will
261  * be invalid, with the exception that subdirectories of @a path that are
262  * missing from the physical filesystem will not be locked and will not cause
263  * an error. The error #SVN_ERR_WC_LOCKED will be returned if a
264  * subdirectory of @a path is already write locked.
265  *
266  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
267  * if the client has canceled the operation.
268  *
269  * @a pool will be used to allocate memory for the baton and any subsequently
270  * cached items. If @a adm_access has not been closed when the pool is
271  * cleared, it will be closed automatically at that point, and removed from
272  * its set. A baton closed in this way will not remove physical locks from
273  * the working copy if cleanup is required.
274  *
275  * The first baton in a set, with @a associated passed as @c NULL, must have
276  * the longest lifetime of all the batons in the set. This implies it must be
277  * the root of the hierarchy.
278  *
279  * @since New in 1.2.
280  * @deprecated Provided for backward compatibility with the 1.6 API.
281  * Callers should use a #svn_wc_context_t object to access the working
282  * copy.
283  */
285 svn_error_t *
287  svn_wc_adm_access_t *associated,
288  const char *path,
289  svn_boolean_t write_lock,
290  int levels_to_lock,
291  svn_cancel_func_t cancel_func,
292  void *cancel_baton,
293  apr_pool_t *pool);
294 
295 /**
296  * Similar to svn_wc_adm_open3(), but without cancellation support.
297  *
298  * @deprecated Provided for backward compatibility with the 1.1 API.
299  */
301 svn_error_t *
303  svn_wc_adm_access_t *associated,
304  const char *path,
305  svn_boolean_t write_lock,
306  int levels_to_lock,
307  apr_pool_t *pool);
308 
309 /**
310  * Similar to svn_wc_adm_open2(), but with @a tree_lock instead of
311  * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
312  * is @c TRUE, else 0.
313  *
314  * @deprecated Provided for backward compatibility with the 1.0 API.
315  */
317 svn_error_t *
319  svn_wc_adm_access_t *associated,
320  const char *path,
321  svn_boolean_t write_lock,
322  svn_boolean_t tree_lock,
323  apr_pool_t *pool);
324 
325 /**
326  * Checks the working copy to determine the node type of @a path. If
327  * @a path is a versioned directory then the behaviour is like that of
328  * svn_wc_adm_open3(), otherwise, if @a path is a file or does not
329  * exist, then the behaviour is like that of svn_wc_adm_open3() with
330  * @a path replaced by the parent directory of @a path. If @a path is
331  * an unversioned directory, the behaviour is also like that of
332  * svn_wc_adm_open3() on the parent, except that if the open fails,
333  * then the returned #SVN_ERR_WC_NOT_DIRECTORY error refers to @a path,
334  * not to @a path's parent.
335  *
336  * @since New in 1.2.
337  * @deprecated Provided for backward compatibility with the 1.6 API.
338  * Callers should use a #svn_wc_context_t object to access the working
339  * copy.
340  */
342 svn_error_t *
344  svn_wc_adm_access_t *associated,
345  const char *path,
346  svn_boolean_t write_lock,
347  int levels_to_lock,
348  svn_cancel_func_t cancel_func,
349  void *cancel_baton,
350  apr_pool_t *pool);
351 
352 /**
353  * Similar to svn_wc_adm_probe_open3() without the cancel
354  * functionality.
355  *
356  * @deprecated Provided for backward compatibility with the 1.1 API.
357  */
359 svn_error_t *
361  svn_wc_adm_access_t *associated,
362  const char *path,
363  svn_boolean_t write_lock,
364  int levels_to_lock,
365  apr_pool_t *pool);
366 
367 /**
368  * Similar to svn_wc_adm_probe_open2(), but with @a tree_lock instead of
369  * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
370  * is @c TRUE, else 0.
371  *
372  * @deprecated Provided for backward compatibility with the 1.0 API.
373  */
375 svn_error_t *
377  svn_wc_adm_access_t *associated,
378  const char *path,
379  svn_boolean_t write_lock,
380  svn_boolean_t tree_lock,
381  apr_pool_t *pool);
382 
383 /**
384  * Open access batons for @a path and return in @a *anchor_access and
385  * @a *target the anchor and target required to drive an editor. Return
386  * in @a *target_access the access baton for the target, which may be the
387  * same as @a *anchor_access (in which case @a *target is the empty
388  * string, never NULL). All the access batons will be in the
389  * @a *anchor_access set.
390  *
391  * @a levels_to_lock determines the levels_to_lock used when opening
392  * @a path if @a path is a versioned directory, @a levels_to_lock is
393  * ignored otherwise. If @a write_lock is @c TRUE the access batons
394  * will hold write locks.
395  *
396  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
397  * if the client has canceled the operation.
398  *
399  * This function is essentially a combination of svn_wc_adm_open3() and
400  * svn_wc_get_actual_target(), with the emphasis on reducing physical IO.
401  *
402  * @since New in 1.2.
403  * @deprecated Provided for backward compatibility with the 1.6 API.
404  * Callers should use a #svn_wc_context_t object to access the working
405  * copy.
406  */
408 svn_error_t *
410  svn_wc_adm_access_t **target_access,
411  const char **target,
412  const char *path,
413  svn_boolean_t write_lock,
414  int levels_to_lock,
415  svn_cancel_func_t cancel_func,
416  void *cancel_baton,
417  apr_pool_t *pool);
418 
419 /** Return, in @a *adm_access, a pointer to an existing access baton associated
420  * with @a path. @a path must be a directory that is locked as part of the
421  * set containing the @a associated access baton.
422  *
423  * If the requested access baton is marked as missing in, or is simply
424  * absent from, @a associated, return #SVN_ERR_WC_NOT_LOCKED.
425  *
426  * @a pool is used only for local processing, it is not used for the batons.
427  *
428  * @deprecated Provided for backward compatibility with the 1.6 API.
429  */
431 svn_error_t *
433  svn_wc_adm_access_t *associated,
434  const char *path,
435  apr_pool_t *pool);
436 
437 /** Check the working copy to determine the node type of @a path. If
438  * @a path is a versioned directory then the behaviour is like that of
439  * svn_wc_adm_retrieve(), otherwise, if @a path is a file, an unversioned
440  * directory, or does not exist, then the behaviour is like that of
441  * svn_wc_adm_retrieve() with @a path replaced by the parent directory of
442  * @a path.
443  *
444  * @deprecated Provided for backward compatibility with the 1.6 API.
445  */
447 svn_error_t *
449  svn_wc_adm_access_t *associated,
450  const char *path,
451  apr_pool_t *pool);
452 
453 /**
454  * Try various ways to obtain an access baton for @a path.
455  *
456  * First, try to obtain @a *adm_access via svn_wc_adm_probe_retrieve(),
457  * but if this fails because @a associated can't give a baton for
458  * @a path or @a path's parent, then try svn_wc_adm_probe_open3(),
459  * this time passing @a write_lock and @a levels_to_lock. If there is
460  * still no access because @a path is not a versioned directory, then
461  * just set @a *adm_access to NULL and return success. But if it is
462  * because @a path is locked, then return the error #SVN_ERR_WC_LOCKED,
463  * and the effect on @a *adm_access is undefined. (Or if the attempt
464  * fails for any other reason, return the corresponding error, and the
465  * effect on @a *adm_access is also undefined.)
466  *
467  * If svn_wc_adm_probe_open3() succeeds, then add @a *adm_access to
468  * @a associated.
469  *
470  * If @a cancel_func is non-NULL, call it with @a cancel_baton to determine
471  * if the client has canceled the operation.
472  *
473  * Use @a pool only for local processing, not to allocate @a *adm_access.
474  *
475  * @since New in 1.2.
476  * @deprecated Provided for backward compatibility with the 1.6 API.
477  */
479 svn_error_t *
481  svn_wc_adm_access_t *associated,
482  const char *path,
483  svn_boolean_t write_lock,
484  int levels_to_lock,
485  svn_cancel_func_t cancel_func,
486  void *cancel_baton,
487  apr_pool_t *pool);
488 
489 /**
490  * Similar to svn_wc_adm_probe_try3() without the cancel
491  * functionality.
492  *
493  * @deprecated Provided for backward compatibility with the 1.1 API.
494  */
496 svn_error_t *
498  svn_wc_adm_access_t *associated,
499  const char *path,
500  svn_boolean_t write_lock,
501  int levels_to_lock,
502  apr_pool_t *pool);
503 
504 /**
505  * Similar to svn_wc_adm_probe_try2(), but with @a tree_lock instead of
506  * @a levels_to_lock. @a levels_to_lock is set to -1 if @a tree_lock
507  * is @c TRUE, else 0.
508  *
509  * @deprecated Provided for backward compatibility with the 1.0 API.
510  */
512 svn_error_t *
514  svn_wc_adm_access_t *associated,
515  const char *path,
516  svn_boolean_t write_lock,
517  svn_boolean_t tree_lock,
518  apr_pool_t *pool);
519 
520 
521 /** Give up the access baton @a adm_access, and its lock if any. This will
522  * recursively close any batons in the same set that are direct
523  * subdirectories of @a adm_access. Any physical locks will be removed from
524  * the working copy. Lock removal is unconditional, there is no check to
525  * determine if cleanup is required.
526  *
527  * Any temporary allocations are performed using @a scratch_pool.
528  *
529  * @since New in 1.6
530  * @deprecated Provided for backward compatibility with the 1.6 API.
531  */
533 svn_error_t *
535  apr_pool_t *scratch_pool);
536 
537 /**
538  * Similar to svn_wc_adm_close2(), but with the internal pool of @a adm_access
539  * used for temporary allocations.
540  *
541  * @deprecated Provided for backward compatibility with the 1.5 API.
542  */
544 svn_error_t *
546 
547 /** Return the path used to open the access baton @a adm_access.
548  *
549  * @deprecated Provided for backward compatibility with the 1.6 API.
550  */
552 const char *
554 
555 /** Return the pool used by access baton @a adm_access.
556  *
557  * @deprecated Provided for backward compatibility with the 1.6 API.
558  */
560 apr_pool_t *
562 
563 /** Return @c TRUE is the access baton @a adm_access has a write lock,
564  * @c FALSE otherwise. Compared to svn_wc_locked() this is a cheap, fast
565  * function that doesn't access the filesystem.
566  *
567  * @deprecated Provided for backward compatibility with the 1.6 API.
568  * New code should use svn_wc_locked2() instead.
569  */
573 
574 /** @} */
575 
576 
577 /** Gets up to two booleans indicating whether a path is locked for
578  * writing.
579  *
580  * @a locked_here is set to TRUE when a write lock on @a local_abspath
581  * exists in @a wc_ctx. @a locked is set to TRUE when there is a
582  * write_lock on @a local_abspath
583  *
584  * @a locked_here and/or @a locked can be NULL when you are not
585  * interested in a specific value
586  *
587  * @since New in 1.7.
588  */
589 svn_error_t *
591  svn_boolean_t *locked,
592  svn_wc_context_t *wc_ctx,
593  const char *local_abspath,
594  apr_pool_t *scratch_pool);
595 
596 /** Set @a *locked to non-zero if @a path is locked, else set it to zero.
597  *
598  * New code should use svn_wc_locked2() instead.
599  *
600  * @deprecated Provided for backward compatibility with the 1.6 API.
601  */
603 svn_error_t *
605  const char *path,
606  apr_pool_t *pool);
607 
608 
609 /**
610  * @defgroup svn_wc_adm_dir_name Name of Subversion's admin dir
611  * @{
612  */
613 
614 /** The default name of the administrative subdirectory.
615  *
616  * Ideally, this would be completely private to wc internals (in fact,
617  * it used to be that adm_subdir() in adm_files.c was the only function
618  * who knew the adm subdir's name). However, import wants to protect
619  * against importing administrative subdirs, so now the name is a
620  * matter of public record.
621  *
622  * @deprecated Provided for backward compatibility with the 1.2 API.
623  */
624 #define SVN_WC_ADM_DIR_NAME ".svn"
625 
626 
627 /**
628  * Return @c TRUE if @a name is the name of the WC administrative
629  * directory. Use @a pool for any temporary allocations. Only works
630  * with base directory names, not paths or URIs.
631  *
632  * For compatibility, the default name (.svn) will always be treated
633  * as an admin dir name, even if the working copy is actually using an
634  * alternative name.
635  *
636  * @since New in 1.3.
637  */
639 svn_wc_is_adm_dir(const char *name, apr_pool_t *pool);
640 
641 
642 /**
643  * Return the name of the administrative directory.
644  * Use @a pool for any temporary allocations.
645  *
646  * The returned pointer will refer to either a statically allocated
647  * string, or to a string allocated in @a pool.
648  *
649  * @since New in 1.3.
650  */
651 const char *
652 svn_wc_get_adm_dir(apr_pool_t *pool);
653 
654 
655 /**
656  * Use @a name for the administrative directory in the working copy.
657  * Use @a pool for any temporary allocations.
658  *
659  * The list of valid names is limited. Currently only ".svn" (the
660  * default) and "_svn" are allowed.
661  *
662  * @note This function changes global (per-process) state and must be
663  * called in a single-threaded context during the initialization of a
664  * Subversion client.
665  *
666  * @since New in 1.3.
667  */
668 svn_error_t *
669 svn_wc_set_adm_dir(const char *name,
670  apr_pool_t *pool);
671 
672 /** @} */
673 
674 
675 /**
676  * @defgroup svn_wc_externals Externals
677  * @{
678  */
679 
680 /** Callback for external definitions updates
681  *
682  * @a local_abspath is the path on which the external definition was found.
683  * @a old_val and @a new_val are the before and after values of the
684  * SVN_PROP_EXTERNALS property. @a depth is the ambient depth of the
685  * working copy directory at @a local_abspath.
686  *
687  * @since New in 1.7. */
688 typedef svn_error_t *(*svn_wc_external_update_t)(void *baton,
689  const char *local_abspath,
690  const svn_string_t *old_val,
691  const svn_string_t *new_val,
692  svn_depth_t depth,
693  apr_pool_t *scratch_pool);
694 
695 /** Traversal information is information gathered by a working copy
696  * crawl or update. For example, the before and after values of the
697  * svn:externals property are important after an update, and since
698  * we're traversing the working tree anyway (a complete traversal
699  * during the initial crawl, and a traversal of changed paths during
700  * the checkout/update/switch), it makes sense to gather the
701  * property's values then instead of making a second pass.
702  *
703  * New code should use the svn_wc_external_update_t callback instead.
704  *
705  * @deprecated Provided for backward compatibility with the 1.6 API.
706  */
708 
709 
710 /** Return a new, empty traversal info object, allocated in @a pool.
711  *
712  * New code should use the svn_wc_external_update_t callback instead.
713  *
714  * @deprecated Provided for backward compatibility with the 1.6 API.
715  */
718 svn_wc_init_traversal_info(apr_pool_t *pool);
719 
720 /** Set @a *externals_old and @a *externals_new to hash tables representing
721  * changes to values of the svn:externals property on directories
722  * traversed by @a traversal_info.
723  *
724  * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
725  * only useful after it has been passed through another function, such
726  * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
727  * svn_wc_get_switch_editor(), etc.
728  *
729  * Each hash maps <tt>const char *</tt> directory names onto
730  * <tt>const char *</tt> values of the externals property for that directory.
731  * The dir names are full paths -- that is, anchor plus target, not target
732  * alone. The values are not parsed, they are simply copied raw, and are
733  * never NULL: directories that acquired or lost the property are
734  * simply omitted from the appropriate table. Directories whose value
735  * of the property did not change show the same value in each hash.
736  *
737  * The hashes, keys, and values have the same lifetime as @a traversal_info.
738  *
739  * New code should use the svn_wc_external_update_t callback instead.
740  *
741  * @deprecated Provided for backward compatibility with the 1.6 API.
742  */
744 void
745 svn_wc_edited_externals(apr_hash_t **externals_old,
746  apr_hash_t **externals_new,
747  svn_wc_traversal_info_t *traversal_info);
748 
749 
750 /** Set @a *depths to a hash table mapping <tt>const char *</tt>
751  * directory names (directories traversed by @a traversal_info) to
752  * <tt>const char *</tt> values (the depths of those directories, as
753  * converted by svn_depth_to_word()).
754  *
755  * @a traversal_info is obtained from svn_wc_init_traversal_info(), but is
756  * only useful after it has been passed through another function, such
757  * as svn_wc_crawl_revisions(), svn_wc_get_update_editor(),
758  * svn_wc_get_switch_editor(), etc.
759  *
760  * The dir names are full paths -- that is, anchor plus target, not target
761  * alone. The values are not allocated, they are static constant strings.
762  * Although the values are never NULL, not all directories traversed
763  * are necessarily listed. For example, directories which did not
764  * have an svn:externals property set or modified are not included.
765  *
766  * The hashes and keys have the same lifetime as @a traversal_info.
767  *
768  * New code should use the svn_wc_external_update_t callback instead.
769  *
770  * @since New in 1.5.
771  * @deprecated Provided for backward compatibility with the 1.6 API.
772  */
774 void
775 svn_wc_traversed_depths(apr_hash_t **depths,
776  svn_wc_traversal_info_t *traversal_info);
777 
778 
779 /** One external item. This usually represents one line from an
780  * svn:externals description but with the path and URL
781  * canonicalized.
782  *
783  * In order to avoid backwards compatibility problems clients should use
784  * svn_wc_external_item2_create() to allocate and initialize this structure
785  * instead of doing so themselves.
786  *
787  * @since New in 1.5.
788  */
790 {
791  /** The name of the subdirectory into which this external should be
792  checked out. This is relative to the parent directory that
793  holds this external item. (Note that these structs are often
794  stored in hash tables with the target dirs as keys, so this
795  field will often be redundant.) */
796  const char *target_dir;
797 
798  /** Where to check out from. This is possibly a relative external URL, as
799  * allowed in externals definitions, but without the peg revision. */
800  const char *url;
801 
802  /** What revision to check out. The only valid kinds for this are
803  svn_opt_revision_number, svn_opt_revision_date, and
804  svn_opt_revision_head. */
806 
807  /** The peg revision to use when checking out. The only valid kinds are
808  svn_opt_revision_number, svn_opt_revision_date, and
809  svn_opt_revision_head. */
811 
813 
814 /**
815  * Initialize an external item.
816  * Set @a *item to an external item object, allocated in @a pool.
817  *
818  * In order to avoid backwards compatibility problems, this function
819  * is used to initialize and allocate the #svn_wc_external_item2_t
820  * structure rather than doing so explicitly, as the size of this
821  * structure may change in the future.
822  *
823  * The current implementation never returns error, but callers should
824  * still check for error, for compatibility with future versions.
825  *
826  * @since New in 1.8.
827  */
828 svn_error_t *
830  apr_pool_t *pool);
831 
832 /** Same as svn_wc_external_item2_create() except the pointer to the new
833  * empty item is 'const' which is stupid since the next thing you need to do
834  * is fill in its fields.
835  *
836  * @deprecated Provided for backward compatibility with the 1.7 API.
837  * @since New in 1.5.
838  */
840 svn_error_t *
842  apr_pool_t *pool);
843 
844 /**
845  * Return a duplicate of @a item, allocated in @a pool. No part of the new
846  * item will be shared with @a item.
847  *
848  * @since New in 1.5.
849  */
852  apr_pool_t *pool);
853 
854 /**
855  * One external item. Similar to svn_wc_external_item2_t, except
856  * @a revision is interpreted as both the operational revision and the
857  * peg revision.
858  *
859  * @deprecated Provided for backward compatibility with the 1.4 API.
860  */
862 {
863  /** Same as #svn_wc_external_item2_t.target_dir */
864  const char *target_dir;
865 
866  /** Same as #svn_wc_external_item2_t.url */
867  const char *url;
868 
869  /** Same as #svn_wc_external_item2_t.revision */
871 
873 
874 /**
875  * Return a duplicate of @a item, allocated in @a pool. No part of the new
876  * item will be shared with @a item.
877  *
878  * @since New in 1.3.
879  *
880  * @deprecated Provided for backward compatibility with the 1.4 API.
881  */
885  apr_pool_t *pool);
886 
887 /**
888  * If @a externals_p is non-NULL, set @a *externals_p to an array of
889  * #svn_wc_external_item2_t * objects based on @a desc.
890  *
891  * If the format of @a desc is invalid, don't touch @a *externals_p and
892  * return #SVN_ERR_CLIENT_INVALID_EXTERNALS_DESCRIPTION. Thus, if
893  * you just want to check the validity of an externals description,
894  * and don't care about the parsed result, pass NULL for @a externals_p.
895  *
896  * The format of @a desc is the same as for values of the directory
897  * property #SVN_PROP_EXTERNALS. Look there for more details.
898  *
899  * If @a canonicalize_url is @c TRUE, canonicalize the @a url member
900  * of those objects. If the @a url member refers to an absolute URL,
901  * it will be canonicalized as URL consistent with the way URLs are
902  * canonicalized throughout the Subversion API. If, however, the
903  * @a url member makes use of the recognized (SVN-specific) relative
904  * URL syntax for svn:externals, "canonicalization" is an ill-defined
905  * concept which may even result in munging the relative URL syntax
906  * beyond recognition. You've been warned.
907  *
908  * Allocate the table, keys, and values in @a pool.
909  *
910  * @a defining_directory is the path or URL of the directory on which
911  * the svn:externals property corresponding to @a desc is set.
912  * @a defining_directory is only used when constructing error strings.
913  *
914  * @since New in 1.5.
915  */
916 svn_error_t *
917 svn_wc_parse_externals_description3(apr_array_header_t **externals_p,
918  const char *defining_directory,
919  const char *desc,
920  svn_boolean_t canonicalize_url,
921  apr_pool_t *pool);
922 
923 /**
924  * Similar to svn_wc_parse_externals_description3() with @a
925  * canonicalize_url set to @c TRUE, but returns an array of
926  * #svn_wc_external_item_t * objects instead of
927  * #svn_wc_external_item2_t * objects
928  *
929  * @since New in 1.1.
930  *
931  * @deprecated Provided for backward compatibility with the 1.4 API.
932  */
934 svn_error_t *
935 svn_wc_parse_externals_description2(apr_array_header_t **externals_p,
936  const char *parent_directory,
937  const char *desc,
938  apr_pool_t *pool);
939 
940 /**
941  * Similar to svn_wc_parse_externals_description2(), but returns the
942  * parsed externals in a hash instead of an array. This function
943  * should not be used, as storing the externals in a hash causes their
944  * order of evaluation to be not easily identifiable.
945  *
946  * @deprecated Provided for backward compatibility with the 1.0 API.
947  */
949 svn_error_t *
950 svn_wc_parse_externals_description(apr_hash_t **externals_p,
951  const char *parent_directory,
952  const char *desc,
953  apr_pool_t *pool);
954 
955 /** @} */
956 ␌
957 
958 /**
959  * @defgroup svn_wc_notifications Notification callback handling
960  * @{
961  *
962  * In many cases, the WC library will scan a working copy and make
963  * changes. The caller usually wants to know when each of these changes
964  * has been made, so that it can display some kind of notification to
965  * the user.
966  *
967  * These notifications have a standard callback function type, which
968  * takes the path of the file that was affected, and a caller-
969  * supplied baton.
970  *
971  * @note The callback is a 'void' return -- this is a simple
972  * reporting mechanism, rather than an opportunity for the caller to
973  * alter the operation of the WC library.
974  *
975  * @note Some of the actions are used across several
976  * different Subversion commands. For example, the update actions are
977  * also used for checkouts, switches, and merges.
978  */
979 
980 /** The type of action occurring. */
982 {
983  /** Adding a path to revision control. */
985 
986  /** Copying a versioned path. */
988 
989  /** Deleting a versioned path. */
991 
992  /** Restoring a missing path from the pristine text-base. */
994 
995  /** Reverting a modified path. */
997 
998  /** A revert operation has failed. */
1000 
1001  /** All conflicts on a path were marked as resolved.
1002  * @note As of 1.10, separate notifications are sent for individually
1003  * resolved text, property, and tree conflicts. This notification is used
1004  * only if all conflicts on a path were marked resolved at once. */
1006 
1007  /** Skipping a path. */
1009 
1010  /** Got a delete in an update. */
1012 
1013  /** Got an add in an update. */
1015 
1016  /** Got any other action in an update. */
1018 
1019  /** The last notification in an update (including updates of externals). */
1021 
1022  /** Updating an external module. */
1024 
1025  /** The last notification in a status (including status on externals). */
1027 
1028  /** Running status on an external module. */
1030 
1031  /** Committing a modification. */
1033 
1034  /** Committing an addition. */
1036 
1037  /** Committing a deletion. */
1039 
1040  /** Committing a replacement. */
1042 
1043  /** Transmitting post-fix text-delta data for a file. */
1045 
1046  /** Processed a single revision's blame. */
1048 
1049  /** Locking a path. @since New in 1.2. */
1051 
1052  /** Unlocking a path. @since New in 1.2. */
1054 
1055  /** Failed to lock a path. @since New in 1.2. */
1057 
1058  /** Failed to unlock a path. @since New in 1.2. */
1060 
1061  /** Tried adding a path that already exists. @since New in 1.5. */
1063 
1064  /** Changelist name set. @since New in 1.5. */
1066 
1067  /** Changelist name cleared. @since New in 1.5. */
1069 
1070  /** Warn user that a path has moved from one changelist to another.
1071  @since New in 1.5.
1072  @deprecated As of 1.7, separate clear and set notifications are sent. */
1074 
1075  /** A merge operation (to path) has begun. See #svn_wc_notify_t.merge_range.
1076  @since New in 1.5. */
1078 
1079  /** A merge operation (to path) from a foreign repository has begun.
1080  See #svn_wc_notify_t.merge_range. @since New in 1.5. */
1082 
1083  /** Replace notification. @since New in 1.5. */
1085 
1086  /** Property added. @since New in 1.6. */
1088 
1089  /** Property updated. @since New in 1.6. */
1091 
1092  /** Property deleted. @since New in 1.6. */
1094 
1095  /** Nonexistent property deleted. @since New in 1.6. */
1097 
1098  /** Revprop set. @since New in 1.6. */
1100 
1101  /** Revprop deleted. @since New in 1.6. */
1103 
1104  /** The last notification in a merge. @since New in 1.6. */
1106 
1107  /** The path is a tree-conflict victim of the intended action (*not*
1108  * a persistent tree-conflict from an earlier operation, but *this*
1109  * operation caused the tree-conflict). @since New in 1.6. */
1111 
1112  /** The path is a subdirectory referenced in an externals definition
1113  * which is unable to be operated on. @since New in 1.6. */
1115 
1116  /** Starting an update operation. @since New in 1.7. */
1118 
1119  /** An update tried to add a file or directory at a path where
1120  * a separate working copy was found. @since New in 1.7. */
1122 
1123  /** An explicit update tried to update a file or directory that
1124  * doesn't live in the repository and can't be brought in.
1125  * @since New in 1.7. */
1127 
1128  /** An update tried to update a file or directory to which access could
1129  * not be obtained. @since New in 1.7. */
1131 
1132  /** An update operation removed an external working copy.
1133  * @since New in 1.7. */
1135 
1136  /** A node below an existing node was added during update.
1137  * @since New in 1.7. */
1139 
1140  /** A node below an existing node was updated during update.
1141  * @since New in 1.7. */
1143 
1144  /** A node below an existing node was deleted during update.
1145  * @since New in 1.7. */
1147 
1148  /** The mergeinfo on path was updated. @since New in 1.7. */
1150 
1151  /** A working copy directory was upgraded to the latest format.
1152  * @since New in 1.7. */
1154 
1155  /** Mergeinfo describing a merge was recorded.
1156  * @since New in 1.7. */
1158 
1159  /** Mergeinfo was removed due to elision.
1160  * @since New in 1.7. */
1162 
1163  /** A file in the working copy was patched.
1164  * @since New in 1.7. */
1166 
1167  /** A hunk from a patch was applied.
1168  * @since New in 1.7. */
1170 
1171  /** A hunk from a patch was rejected.
1172  * @since New in 1.7. */
1174 
1175  /** A hunk from a patch was found to already be applied.
1176  * @since New in 1.7. */
1178 
1179  /** Committing a non-overwriting copy (path is the target of the
1180  * copy, not the source).
1181  * @since New in 1.7. */
1183 
1184  /** Committing an overwriting (replace) copy (path is the target of
1185  * the copy, not the source).
1186  * @since New in 1.7. */
1188 
1189  /** The server has instructed the client to follow a URL
1190  * redirection.
1191  * @since New in 1.7. */
1193 
1194  /** The operation was attempted on a path which doesn't exist.
1195  * @since New in 1.7. */
1197 
1198  /** Removing a path by excluding it.
1199  * @since New in 1.7. */
1201 
1202  /** Operation failed because the node remains in conflict
1203  * @since New in 1.7. */
1205 
1206  /** Operation failed because an added node is missing
1207  * @since New in 1.7. */
1209 
1210  /** Operation failed because a node is out of date
1211  * @since New in 1.7. */
1213 
1214  /** Operation failed because an added parent is not selected
1215  * @since New in 1.7. */
1217 
1218  /** Operation failed because a node is locked by another user and/or
1219  * working copy. @since New in 1.7. */
1221 
1222  /** Operation failed because the operation was forbidden by the server.
1223  * @since New in 1.7. */
1225 
1226  /** The operation skipped the path because it was conflicted.
1227  * @since New in 1.7. */
1229 
1230  /** Just the lock on a file was removed during update.
1231  * @since New in 1.8. */
1233 
1234  /** Operation failed because a node is obstructed.
1235  * @since New in 1.8. */
1237 
1238  /** Conflict resolver is starting.
1239  * This can be used by clients to detect when to display conflict summary
1240  * information, for example.
1241  * @since New in 1.8. */
1243 
1244  /** Conflict resolver is done.
1245  * This can be used by clients to detect when to display conflict summary
1246  * information, for example.
1247  * @since New in 1.8. */
1249 
1250  /** The current operation left local changes of something that was deleted
1251  * The changes are available on (and below) the notified path
1252  * @since New in 1.8. */
1254 
1255  /** A copy from a foreign repository has started
1256  * @since New in 1.8. */
1258 
1259  /** A move in the working copy has been broken, i.e. degraded into a
1260  * copy + delete. The notified path is the move source (the deleted path).
1261  * ### TODO: Provide path to move destination as well?
1262  * @since New in 1.8. */
1264 
1265  /** Running cleanup on an external module.
1266  * @since New in 1.9. */
1268 
1269  /** The operation failed because the operation (E.g. commit) is only valid
1270  * if the operation includes this path.
1271  * @since New in 1.9. */
1273 
1274  /** Running info on an external module.
1275  * @since New in 1.9. */
1277 
1278  /** Finalizing commit.
1279  * @since New in 1.9. */
1281 
1282  /** All text conflicts in a file were marked as resolved.
1283  * @since New in 1.10. */
1285 
1286  /** A property conflict on a path was marked as resolved.
1287  * The name of the property is specified in #svn_wc_notify_t.prop_name.
1288  * @since New in 1.10. */
1290 
1291  /** A tree conflict on a path was marked as resolved.
1292  * @since New in 1.10. */
1294 
1295  /** Starting to search the repository for details about a tree conflict.
1296  * @since New in 1.10. */
1298 
1299  /** Progressing in search of repository for details about a tree conflict.
1300  * The revision being searched is specified in #svn_wc_notify_t.revision.
1301  * @since New in 1.10. */
1303 
1304  /** Done searching the repository for details about a conflict.
1305  * @since New in 1.10. */
1307 
1309 
1310 
1311 /** The type of notification that is occurring. */
1313 {
1314  svn_wc_notify_state_inapplicable = 0,
1315 
1316  /** Notifier doesn't know or isn't saying. */
1318 
1319  /** The state did not change. */
1321 
1322  /** The item wasn't present. */
1324 
1325  /** An unversioned item obstructed work. */
1327 
1328  /** Pristine state was modified. */
1330 
1331  /** Modified state had mods merged in. */
1333 
1334  /** Modified state got conflicting mods. */
1336 
1337  /** The source to copy the file from is missing. */
1339 
1341 
1342 /**
1343  * What happened to a lock during an operation.
1344  *
1345  * @since New in 1.2.
1346  */
1348 {
1349  svn_wc_notify_lock_state_inapplicable = 0,
1350 
1351  svn_wc_notify_lock_state_unknown,
1352 
1353  /** The lock wasn't changed. */
1355 
1356  /** The item was locked. */
1358 
1359  /** The item was unlocked. */
1361 
1363 
1364 /**
1365  * Structure used in the #svn_wc_notify_func2_t function.
1366  *
1367  * @c kind, @c content_state, @c prop_state and @c lock_state are from
1368  * after @c action, not before.
1369  *
1370  * @note If @c action is #svn_wc_notify_update_completed, then @c path has
1371  * already been installed, so it is legitimate for an implementation of
1372  * #svn_wc_notify_func2_t to examine @c path in the working copy.
1373  *
1374  * @note The purpose of the @c kind, @c mime_type, @c content_state, and
1375  * @c prop_state fields is to provide "for free" information that an
1376  * implementation is likely to want, and which it would otherwise be
1377  * forced to deduce via expensive operations such as reading entries
1378  * and properties. However, if the caller does not have this
1379  * information, it will simply pass the corresponding `*_unknown'
1380  * values, and it is up to the implementation how to handle that
1381  * (i.e., whether to attempt deduction, or just to punt and
1382  * give a less informative notification).
1383  *
1384  * @note Callers of notification functions should use svn_wc_create_notify()
1385  * or svn_wc_create_notify_url() to create structures of this type to allow
1386  * for extensibility.
1387  *
1388  * @since New in 1.2.
1389  */
1390 typedef struct svn_wc_notify_t {
1391 
1392  /** Path, either absolute or relative to the current working directory
1393  * (i.e., not relative to an anchor). @c path is "." or another valid path
1394  * value for compatibility reasons when the real target is a url that
1395  * is available in @c url. */
1396  const char *path;
1397 
1398  /** Action that describes what happened to #svn_wc_notify_t.path. */
1400 
1401  /** Node kind of @c path. */
1403 
1404  /** If non-NULL, indicates the mime-type of @c path.
1405  * It is always @c NULL for directories. */
1406  const char *mime_type;
1407 
1408  /** Points to the lock structure received from the repository when
1409  * @c action is #svn_wc_notify_locked. For other actions, it is
1410  * @c NULL. */
1412 
1413  /** Points to an error describing the reason for the failure when @c
1414  * action is one of the following: #svn_wc_notify_failed_lock,
1415  * #svn_wc_notify_failed_unlock, #svn_wc_notify_failed_external.
1416  * Is @c NULL otherwise. */
1418 
1419  /** The type of notification that is occurring about node content. */
1421 
1422  /** The type of notification that is occurring about node properties. */
1424 
1425  /** Reflects the addition or removal of a lock token in the working copy. */
1427 
1428  /** When @c action is #svn_wc_notify_update_completed, target revision
1429  * of the update, or #SVN_INVALID_REVNUM if not available; when @c
1430  * action is #svn_wc_notify_blame_revision, processed revision; Since
1431  * Subversion 1.7 when action is #svn_wc_notify_update_update or
1432  * #svn_wc_notify_update_add, the target revision.
1433  * In all other cases, it is #SVN_INVALID_REVNUM.
1434  */
1436 
1437  /** If @c action pertains to a changelist, this is the changelist name.
1438  * In all other cases, it is @c NULL. @since New in 1.5 */
1439  const char *changelist_name;
1440 
1441  /** When @c action is #svn_wc_notify_merge_begin or
1442  * #svn_wc_notify_foreign_merge_begin or
1443  * #svn_wc_notify_merge_record_info_begin, and both the
1444  * left and right sides of the merge are from the same URL. In all
1445  * other cases, it is @c NULL. @since New in 1.5 */
1447 
1448  /** Similar to @c path, but if non-NULL the notification is about a url.
1449  * @since New in 1.6 */
1450  const char *url;
1451 
1452  /** If non-NULL, specifies an absolute path prefix that can be subtracted
1453  * from the start of the absolute path in @c path or @c url. Its purpose
1454  * is to allow notification to remove a common prefix from all the paths
1455  * displayed for an operation. @since New in 1.6 */
1456  const char *path_prefix;
1457 
1458  /** If @c action relates to properties, specifies the name of the property.
1459  * @since New in 1.6 */
1460  const char *prop_name;
1461 
1462  /** If @c action is #svn_wc_notify_blame_revision, contains a list of
1463  * revision properties for the specified revision
1464  * @since New in 1.6 */
1465  apr_hash_t *rev_props;
1466 
1467  /** If @c action is #svn_wc_notify_update_update or
1468  * #svn_wc_notify_update_add, contains the revision before the update.
1469  * In all other cases, it is #SVN_INVALID_REVNUM.
1470  * @since New in 1.7 */
1472 
1473  /** These fields are used by svn patch to identify the
1474  * hunk the notification is for. They are line-based
1475  * offsets and lengths parsed from the unidiff hunk header.
1476  * @since New in 1.7. */
1477  /* @{ */
1479  svn_linenum_t hunk_original_length;
1480  svn_linenum_t hunk_modified_start;
1481  svn_linenum_t hunk_modified_length;
1482  /* @} */
1483 
1484  /** The line at which a hunk was matched (and applied).
1485  * @since New in 1.7. */
1487 
1488  /** The fuzz factor the hunk was applied with.
1489  * @since New in 1.7 */
1491 
1492  /* NOTE: Add new fields at the end to preserve binary compatibility.
1493  Also, if you add fields here, you have to update svn_wc_create_notify
1494  and svn_wc_dup_notify. */
1496 
1497 /**
1498  * Allocate an #svn_wc_notify_t structure in @a pool, initialize and return
1499  * it.
1500  *
1501  * Set the @c path field of the created struct to @a path, and @c action to
1502  * @a action. Set all other fields to their @c _unknown, @c NULL or
1503  * invalid value, respectively. Make only a shallow copy of the pointer
1504  * @a path.
1505  *
1506  * @since New in 1.2.
1507  */
1509 svn_wc_create_notify(const char *path,
1510  svn_wc_notify_action_t action,
1511  apr_pool_t *pool);
1512 
1513 /**
1514  * Allocate an #svn_wc_notify_t structure in @a pool, initialize and return
1515  * it.
1516  *
1517  * Set the @c url field of the created struct to @a url, @c path to "." and @c
1518  * action to @a action. Set all other fields to their @c _unknown, @c NULL or
1519  * invalid value, respectively. Make only a shallow copy of the pointer
1520  * @a url.
1521  *
1522  * @since New in 1.6.
1523  */
1526  svn_wc_notify_action_t action,
1527  apr_pool_t *pool);
1528 
1529 /**
1530  * Return a deep copy of @a notify, allocated in @a pool.
1531  *
1532  * @since New in 1.2.
1533  */
1536  apr_pool_t *pool);
1537 
1538 /**
1539  * Notify the world that @a notify->action has happened to @a notify->path.
1540  *
1541  * Recommendation: callers of #svn_wc_notify_func2_t should avoid
1542  * invoking it multiple times on the same path within a given
1543  * operation, and implementations should not bother checking for such
1544  * duplicate calls. For example, in an update, the caller should not
1545  * invoke the notify func on receiving a prop change and then again
1546  * on receiving a text change. Instead, wait until all changes have
1547  * been received, and then invoke the notify func once (from within
1548  * an #svn_delta_editor_t's close_file(), for example), passing
1549  * the appropriate @a notify->content_state and @a notify->prop_state flags.
1550  *
1551  * @since New in 1.2.
1552  */
1553 typedef void (*svn_wc_notify_func2_t)(void *baton,
1554  const svn_wc_notify_t *notify,
1555  apr_pool_t *pool);
1556 
1557 /**
1558  * Similar to #svn_wc_notify_func2_t, but takes the information as arguments
1559  * instead of struct fields.
1560  *
1561  * @deprecated Provided for backward compatibility with the 1.1 API.
1562  */
1563 typedef void (*svn_wc_notify_func_t)(void *baton,
1564  const char *path,
1565  svn_wc_notify_action_t action,
1566  svn_node_kind_t kind,
1567  const char *mime_type,
1568  svn_wc_notify_state_t content_state,
1569  svn_wc_notify_state_t prop_state,
1570  svn_revnum_t revision);
1571 
1572 /** @} */
1573 
1574 ␌
1575 /**
1576  * Interactive conflict handling
1577  *
1578  * @defgroup svn_wc_conflict Conflict callback functionality
1579  * @{
1580  *
1581  * This API gives a Subversion client application the opportunity to
1582  * define a callback that allows the user to resolve conflicts
1583  * interactively during updates and merges.
1584  *
1585  * If a conflict is discovered, libsvn_wc invokes the callback with an
1586  * #svn_wc_conflict_description_t. This structure describes the
1587  * path in conflict, whether it's a text or property conflict, and may
1588  * also present up to three files that can be used to resolve the
1589  * conflict (perhaps by launching an editor or 3rd-party merging
1590  * tool). The structure also provides a possible fourth file (@c
1591  * merged_file) which, if not NULL, represents libsvn_wc's attempt to
1592  * contextually merge the first three files. (Note that libsvn_wc
1593  * will not attempt to merge a file that it believes is binary, and it
1594  * will only attempt to merge property values it believes to be a
1595  * series of multi-line text.)
1596  *
1597  * When the callback is finished interacting with the user, it
1598  * responds by returning a #svn_wc_conflict_result_t. This
1599  * structure indicates whether the user wants to postpone the conflict
1600  * for later (allowing libsvn_wc to mark the path "conflicted" as
1601  * usual), or whether the user wants libsvn_wc to use one of the four
1602  * files as the "final" state for resolving the conflict immediately.
1603  *
1604  * Note that the callback is at liberty (and encouraged) to merge the
1605  * three files itself. If it does so, it signals this to libsvn_wc by
1606  * returning a choice of #svn_wc_conflict_choose_merged. To return
1607  * the 'final' merged file to libsvn_wc, the callback has the option of
1608  * either:
1609  *
1610  * - editing the original @c merged_file in-place
1611  *
1612  * or, if libsvn_wc never supplied a merged_file in the
1613  * description structure (i.e. passed NULL for that field),
1614  *
1615  * - return the merged file in the #svn_wc_conflict_result_t.
1616  *
1617  */
1618 
1619 /** The type of action being attempted on an object.
1620  *
1621  * @since New in 1.5.
1622  */
1624 {
1625  svn_wc_conflict_action_edit, /**< attempting to change text or props */
1626  svn_wc_conflict_action_add, /**< attempting to add object */
1627  svn_wc_conflict_action_delete, /**< attempting to delete object */
1628  svn_wc_conflict_action_replace /**< attempting to replace object,
1629  @since New in 1.7 */
1631 
1632 
1633 /** The pre-existing condition which is causing a state of conflict.
1634  *
1635  * @since New in 1.5.
1636  */
1638 {
1639  /** Local edits are already present */
1641  /** Another object is in the way */
1643  /** Object is already schedule-delete */
1645  /** Object is unknown or missing */
1647  /** Object is unversioned */
1649  /** Object is already added or schedule-add. @since New in 1.6. */
1651  /** Object is already replaced. @since New in 1.7. */
1653  /** Object is moved away. @since New in 1.8. */
1655  /** Object is moved here. @since New in 1.8. */
1657 
1659 
1660 
1661 /** The type of conflict being described by an
1662  * #svn_wc_conflict_description2_t (see below).
1663  *
1664  * @since New in 1.5.
1665  */
1667 {
1668  /** textual conflict (on a file) */
1670  /** property conflict (on a file or dir) */
1672  /** tree conflict (on a dir) @since New in 1.6. */
1675 
1676 
1677 /** The user operation that exposed a conflict.
1678  *
1679  * @since New in 1.6.
1680  */
1682 {
1683  svn_wc_operation_none = 0,
1684  svn_wc_operation_update,
1685  svn_wc_operation_switch,
1686  svn_wc_operation_merge
1687 
1689 
1690 
1691 /** Info about one of the conflicting versions of a node. Each field may
1692  * have its respective null/invalid/unknown value if the corresponding
1693  * information is not relevant or not available.
1694  *
1695  * @todo Consider making some or all of the info mandatory, to reduce
1696  * complexity.
1697  *
1698  * @note Fields may be added to the end of this structure in future
1699  * versions. Therefore, to preserve binary compatibility, users
1700  * should not directly allocate structures of this type.
1701  *
1702  * @see svn_wc_conflict_version_create()
1703  * @see svn_wc_conflict_version_dup()
1704  *
1705  * @since New in 1.6.
1706 */
1708 {
1709  /** @name Where to find this node version in a repository */
1710  /**@{*/
1711 
1712  /** URL of repository root */
1713  const char *repos_url;
1714 
1715  /** revision at which to look up path_in_repos */
1717 
1718  /** path within repos; must not start with '/' */
1719  /* ### should have been called repos_relpath, but we can't change this. */
1720  const char *path_in_repos;
1721  /** @} */
1722 
1723  /** The node kind. Can be any kind, including 'none' or 'unknown'. */
1725 
1726  /** UUID of the repository (or NULL if unknown.)
1727  * @since New in 1.8. */
1728  const char *repos_uuid;
1729 
1730  /* @todo Add metadata about a local copy of the node, if and when
1731  * we store one. */
1732 
1733  /* Remember to update svn_wc_conflict_version_create() and
1734  * svn_wc_conflict_version_dup() in case you add fields to this struct. */
1736 
1737 /**
1738  * Allocate an #svn_wc_conflict_version_t structure in @a pool,
1739  * initialize to contain a conflict origin, and return it.
1740  *
1741  * Set the @c repos_url field of the created struct to @a repos_root_url,
1742  * the @c path_in_repos field to @a repos_relpath, the @c peg_rev field to
1743  * @a revision and the @c node_kind to @a kind. Make only shallow
1744  * copies of the pointer arguments.
1745  *
1746  * @a repos_root_url, @a repos_relpath and @a revision must be valid,
1747  * non-null values. @a repos_uuid should be a valid UUID, but can be
1748  * NULL if unknown. @a kind can be any kind, even 'none' or 'unknown'.
1749  *
1750  * @since New in 1.8.
1751  */
1753 svn_wc_conflict_version_create2(const char *repos_root_url,
1754  const char *repos_uuid,
1755  const char *repos_relpath,
1756  svn_revnum_t revision,
1757  svn_node_kind_t kind,
1758  apr_pool_t *result_pool);
1759 
1760 /** Similar to svn_wc_conflict_version_create2(), but doesn't set all
1761  * required values.
1762  *
1763  * @since New in 1.6.
1764  * @deprecated Provided for backward compatibility with the 1.7 API.
1765  */
1768 svn_wc_conflict_version_create(const char *repos_url,
1769  const char *path_in_repos,
1770  svn_revnum_t peg_rev,
1771  svn_node_kind_t node_kind,
1772  apr_pool_t *pool);
1773 
1774 /** Return a duplicate of @a version, allocated in @a pool.
1775  * No part of the new version will be shared with @a version.
1776  *
1777  * @since New in 1.6.
1778  */
1781  apr_pool_t *pool);
1782 
1783 
1784 /** A struct that describes a conflict that has occurred in the
1785  * working copy.
1786  *
1787  * The conflict described by this structure is one of:
1788  * - a conflict on the content of the file node @a local_abspath
1789  * - a conflict on the property @a property_name of @a local_abspath
1790  * - a tree conflict, of which @a local_abspath is the victim
1791  * Be aware that the victim of a tree conflict can be a non-existent node.
1792  * The three kinds of conflict are distinguished by @a kind.
1793  *
1794  * @note Fields may be added to the end of this structure in future
1795  * versions. Therefore, to preserve binary compatibility, users
1796  * should not directly allocate structures of this type but should use
1797  * svn_wc_conflict_description_create_text2() or
1798  * svn_wc_conflict_description_create_prop2() or
1799  * svn_wc_conflict_description_create_tree2() instead.
1800  *
1801  * @since New in 1.7.
1802  */
1804 {
1805  /** The path that is in conflict (for a tree conflict, it is the victim) */
1806  const char *local_abspath;
1807 
1808  /** The node type of the local node involved in this conflict.
1809  * For a tree conflict, this is the node kind of the tree conflict victim.
1810  * For the left/right node kinds of the incoming conflicting change see
1811  * src_left_version->node_kind and src_right_version->node_kind. */
1813 
1814  /** What sort of conflict are we describing? */
1816 
1817  /** The name of the property whose conflict is being described.
1818  * (Only if @a kind is 'property'; else undefined.) */
1819  const char *property_name;
1820 
1821  /** Whether svn thinks ('my' version of) @c path is a 'binary' file.
1822  * (Only if @c kind is 'text', else undefined.) */
1824 
1825  /** The svn:mime-type property of ('my' version of) @c path, if available,
1826  * else NULL.
1827  * (Only if @c kind is 'text', else undefined.) */
1828  const char *mime_type;
1829 
1830  /** The incoming action being attempted on the conflicted node or property.
1831  * When @c kind is 'text', this action must be 'edit', but generally it can
1832  * be any kind of possible change. */
1834 
1835  /** The local change or state of the target node or property, relative
1836  * to its merge-left source, that conflicts with the incoming action.
1837  * When @c kind is 'text', this must be 'edited', but generally it can
1838  * be any kind of possible change.
1839  * Note that 'local' does not always refer to a working copy. A change
1840  * can be local to the target branch of a merge operation, for example,
1841  * and is not necessarily visible in a working copy of the target branch
1842  * at any given revision. */
1844 
1845  /** If this is text-conflict and involves the merging of two files
1846  * descended from a common ancestor, here are the paths of up to
1847  * four fulltext files that can be used to interactively resolve the
1848  * conflict.
1849  *
1850  * @a base_abspath, @a their_abspath and @a my_abspath are absolute
1851  * paths.
1852  *
1853  * ### Is @a merged_file relative to some directory, or absolute?
1854  *
1855  * All four files will be in repository-normal form -- LF
1856  * line endings and contracted keywords. (If any of these files are
1857  * not available, they default to NULL.)
1858  *
1859  * On the other hand, if this is a property-conflict, then these
1860  * paths represent temporary files that contain the three different
1861  * property-values in conflict. The fourth path (@c merged_file)
1862  * may or may not be NULL; if set, it represents libsvn_wc's
1863  * attempt to merge the property values together. (Remember that
1864  * property values are technically binary values, and thus can't
1865  * always be merged.)
1866  */
1867  const char *base_abspath; /* common ancestor of the two files being merged */
1868 
1869  /** their version of the file */
1870  /* ### BH: For properties this field contains the reference to
1871  the property rejection (.prej) file */
1872  const char *their_abspath;
1873 
1874  /** my locally-edited version of the file */
1875  const char *my_abspath;
1876 
1877  /** merged version; may contain conflict markers
1878  * ### For property conflicts, this contains 'their_abspath'. */
1879  const char *merged_file;
1880 
1881  /** The operation that exposed the conflict.
1882  * Used only for tree conflicts.
1883  */
1885 
1886  /** Info on the "merge-left source" or "older" version of incoming change. */
1888 
1889  /** Info on the "merge-right source" or "their" version of incoming change. */
1891 
1892  /** For property conflicts, the absolute path to the .prej file.
1893  * @since New in 1.9. */
1894  const char *prop_reject_abspath;
1895 
1896  /** For property conflicts, the local base value of the property, i.e. the
1897  * value of the property as of the BASE revision of the working copy.
1898  * For conflicts created during update/switch this contains the
1899  * post-update/switch property value. The pre-update/switch value can
1900  * be found in prop_value_incoming_old.
1901  * Only set if available, so might be @c NULL.
1902  * @since New in 1.9. */
1904 
1905  /** For property conflicts, the local working value of the property,
1906  * i.e. the value of the property in the working copy, possibly with
1907  * local modiciations.
1908  * Only set if available, so might be @c NULL.
1909  * @since New in 1.9. */
1911 
1912  /** For property conflicts, the incoming old value of the property,
1913  * i.e. the value the property had at @c src_left_version.
1914  * Only set if available, so might be @c NULL.
1915  * @since New in 1.9 */
1917 
1918  /** For property conflicts, the incoming new value of the property,
1919  * i.e. the value the property had at @c src_right_version.
1920  * Only set if available, so might be @c NULL.
1921  * @since New in 1.9 */
1923 
1924 /* NOTE: Add new fields at the end to preserve binary compatibility.
1925  Also, if you add fields here, you have to update
1926  svn_wc_conflict_description2_dup and perhaps
1927  svn_wc_conflict_description_create_text2,
1928  svn_wc_conflict_description_create_prop2, and
1929  svn_wc_conflict_description_create_tree2. */
1931 
1932 
1933 /** Similar to #svn_wc_conflict_description2_t, but with relative paths and
1934  * adm_access batons. Passed to #svn_wc_conflict_resolver_func_t.
1935  *
1936  * @since New in 1.5.
1937  * @deprecated Provided for backward compatibility with the 1.6 API.
1938  */
1940 {
1941  /** The path that is in conflict (for a tree conflict, it is the victim) */
1942  const char *path;
1943 
1944  /** The local node type of the path being operated on (for a tree conflict,
1945  * this specifies the local node kind, which may be (and typically is)
1946  * different than the left and right kind) */
1948 
1949  /** What sort of conflict are we describing? */
1951 
1952  /** The name of the property whose conflict is being described.
1953  * (Only if @a kind is 'property'; else undefined.) */
1954  const char *property_name;
1955 
1956  /** Whether svn thinks ('my' version of) @c path is a 'binary' file.
1957  * (Only if @c kind is 'text', else undefined.) */
1959 
1960  /** The svn:mime-type property of ('my' version of) @c path, if available,
1961  * else NULL.
1962  * (Only if @c kind is 'text', else undefined.) */
1963  const char *mime_type;
1964 
1965  /** If not NULL, an open working copy access baton to either the
1966  * path itself (if @c path is a directory), or to the parent
1967  * directory (if @c path is a file.)
1968  * For a tree conflict, this will always be an access baton
1969  * to the parent directory of the path, even if the path is
1970  * a directory. */
1972 
1973  /** The action being attempted on the conflicted node or property.
1974  * (When @c kind is 'text', this action must be 'edit'.) */
1976 
1977  /** The state of the target node or property, relative to its merge-left
1978  * source, that is the reason for the conflict.
1979  * (When @c kind is 'text', this reason must be 'edited'.) */
1981 
1982  /** If this is text-conflict and involves the merging of two files
1983  * descended from a common ancestor, here are the paths of up to
1984  * four fulltext files that can be used to interactively resolve the
1985  * conflict. All four files will be in repository-normal form -- LF
1986  * line endings and contracted keywords. (If any of these files are
1987  * not available, they default to NULL.)
1988  *
1989  * On the other hand, if this is a property-conflict, then these
1990  * paths represent temporary files that contain the three different
1991  * property-values in conflict. The fourth path (@c merged_file)
1992  * may or may not be NULL; if set, it represents libsvn_wc's
1993  * attempt to merge the property values together. (Remember that
1994  * property values are technically binary values, and thus can't
1995  * always be merged.)
1996  */
1997  const char *base_file; /* common ancestor of the two files being merged */
1998 
1999  /** their version of the file */
2000  const char *their_file;
2001 
2002  /** my locally-edited version of the file */
2003  const char *my_file;
2004 
2005  /** merged version; may contain conflict markers */
2006  const char *merged_file;
2007 
2008  /** The operation that exposed the conflict.
2009  * Used only for tree conflicts.
2010  *
2011  * @since New in 1.6.
2012  */
2014 
2015  /** Info on the "merge-left source" or "older" version of incoming change.
2016  * @since New in 1.6. */
2018 
2019  /** Info on the "merge-right source" or "their" version of incoming change.
2020  * @since New in 1.6. */
2022 
2024 
2025 /**
2026  * Allocate an #svn_wc_conflict_description2_t structure in @a result_pool,
2027  * initialize to represent a text conflict, and return it.
2028  *
2029  * Set the @c local_abspath field of the created struct to @a local_abspath
2030  * (which must be an absolute path), the @c kind field to
2031  * #svn_wc_conflict_kind_text, the @c node_kind to #svn_node_file,
2032  * the @c action to #svn_wc_conflict_action_edit, and the @c reason to
2033  * #svn_wc_conflict_reason_edited.
2034  *
2035  * @note It is the caller's responsibility to set the other required fields
2036  * (such as the four file names and @c mime_type and @c is_binary).
2037  *
2038  * @since New in 1.7.
2039  */
2042  apr_pool_t *result_pool);
2043 
2044 
2045 /** Similar to svn_wc_conflict_description_create_text2(), but returns
2046  * a #svn_wc_conflict_description_t *.
2047  *
2048  * @since New in 1.6.
2049  * @deprecated Provided for backward compatibility with the 1.6 API.
2050  */
2054  svn_wc_adm_access_t *adm_access,
2055  apr_pool_t *pool);
2056 
2057 /**
2058  * Allocate an #svn_wc_conflict_description2_t structure in @a result_pool,
2059  * initialize to represent a property conflict, and return it.
2060  *
2061  * Set the @c local_abspath field of the created struct to @a local_abspath
2062  * (which must be an absolute path), the @c kind field
2063  * to #svn_wc_conflict_kind_property, the @c node_kind to @a node_kind, and
2064  * the @c property_name to @a property_name.
2065  *
2066  * @note: It is the caller's responsibility to set the other required fields
2067  * (such as the four file names and @c action and @c reason).
2068  *
2069  * @since New in 1.7.
2070  */
2073  svn_node_kind_t node_kind,
2074  const char *property_name,
2075  apr_pool_t *result_pool);
2076 
2077 /** Similar to svn_wc_conflict_descriptor_create_prop(), but returns
2078  * a #svn_wc_conflict_description_t *.
2079  *
2080  * @since New in 1.6.
2081  * @deprecated Provided for backward compatibility with the 1.6 API.
2082  */
2086  svn_wc_adm_access_t *adm_access,
2087  svn_node_kind_t node_kind,
2088  const char *property_name,
2089  apr_pool_t *pool);
2090 
2091 /**
2092  * Allocate an #svn_wc_conflict_description2_t structure in @a pool,
2093  * initialize to represent a tree conflict, and return it.
2094  *
2095  * Set the @c local_abspath field of the created struct to @a local_abspath
2096  * (which must be an absolute path), the @c kind field to
2097  * #svn_wc_conflict_kind_tree, the @c node_kind to @a node_kind,
2098  * the @c operation to @a operation, the @c src_left_version field to
2099  * @a src_left_version, and the @c src_right_version field to
2100  * @a src_right_version.
2101  *
2102  * @note: It is the caller's responsibility to set the other required fields
2103  * (such as the four file names and @c action and @c reason).
2104  *
2105  * @since New in 1.7.
2106  */
2109  const char *local_abspath,
2110  svn_node_kind_t node_kind,
2111  svn_wc_operation_t operation,
2112  const svn_wc_conflict_version_t *src_left_version,
2113  const svn_wc_conflict_version_t *src_right_version,
2114  apr_pool_t *result_pool);
2115 
2116 
2117 /** Similar to svn_wc_conflict_description_create_tree(), but returns
2118  * a #svn_wc_conflict_description_t *.
2119  *
2120  * @since New in 1.6.
2121  * @deprecated Provided for backward compatibility with the 1.6 API.
2122  */
2126  const char *path,
2127  svn_wc_adm_access_t *adm_access,
2128  svn_node_kind_t node_kind,
2129  svn_wc_operation_t operation,
2130  /* non-const */ svn_wc_conflict_version_t *src_left_version,
2131  /* non-const */ svn_wc_conflict_version_t *src_right_version,
2132  apr_pool_t *pool);
2133 
2134 
2135 /** Return a duplicate of @a conflict, allocated in @a result_pool.
2136  * A deep copy of all members will be made.
2137  *
2138  * @since New in 1.9.
2139  */
2142  const svn_wc_conflict_description2_t *conflict,
2143  apr_pool_t *result_pool);
2144 
2145 
2146 /** Like svn_wc_conflict_description2_dup(), but is improperly named
2147  * as a private function when it is intended to be a public API.
2148  *
2149  * @since New in 1.7.
2150  * @deprecated Provided for backward compatibility with the 1.8 API.
2151  */
2155  const svn_wc_conflict_description2_t *conflict,
2156  apr_pool_t *result_pool);
2157 
2158 
2159 /** The way in which the conflict callback chooses a course of action.
2160  *
2161  * @since New in 1.5.
2162  */
2164 {
2165  /** Undefined; for private use only.
2166  This value must never be returned in svn_wc_conflict_result_t,
2167  but a separate value, unequal to all other pre-defined values may
2168  be useful in conflict resolver implementations to signal that no
2169  choice is made yet.
2170  * @since New in 1.9
2171  */
2173 
2174  /** Don't resolve the conflict now. Let libsvn_wc mark the path
2175  'conflicted', so user can run 'svn resolved' later. */
2177 
2178  /** If there were files to choose from, select one as a way of
2179  resolving the conflict here and now. libsvn_wc will then do the
2180  work of "installing" the chosen file.
2181  */
2182  svn_wc_conflict_choose_base, /**< original version */
2183  svn_wc_conflict_choose_theirs_full, /**< incoming version */
2185  svn_wc_conflict_choose_theirs_conflict, /**< incoming (for conflicted hunks) */
2186  svn_wc_conflict_choose_mine_conflict, /**< own (for conflicted hunks) */
2187  svn_wc_conflict_choose_merged, /**< merged version */
2188 
2189  /** @since New in 1.8. */
2190  svn_wc_conflict_choose_unspecified /**< undecided */
2191 
2193 
2194 
2195 /** The final result returned by #svn_wc_conflict_resolver_func_t.
2196  *
2197  * @note Fields may be added to the end of this structure in future
2198  * versions. Therefore, to preserve binary compatibility, users
2199  * should not directly allocate structures of this type. Instead,
2200  * construct this structure using svn_wc_create_conflict_result()
2201  * below.
2202  *
2203  * @since New in 1.5.
2204  */
2206 {
2207  /** A choice to either delay the conflict resolution or select a
2208  particular file to resolve the conflict. */
2210 
2211  /** If not NULL, this is a path to a file which contains the client's
2212  (or more likely, the user's) merging of the three values in
2213  conflict. libsvn_wc accepts this file if (and only if) @c choice
2214  is set to #svn_wc_conflict_choose_merged.*/
2215  const char *merged_file;
2216 
2217  /** If true, save a backup copy of merged_file (or the original
2218  merged_file from the conflict description, if merged_file is
2219  NULL) in the user's working copy. */
2221 
2222  /** If not NULL, this is the new merged property, used when choosing
2223  * #svn_wc_conflict_choose_merged. This value is prefered over using
2224  * merged_file.
2225  *
2226  * @since New in 1.9.
2227  */
2229 
2231 
2232 
2233 /**
2234  * Allocate an #svn_wc_conflict_result_t structure in @a pool,
2235  * initialize and return it.
2236  *
2237  * Set the @c choice field of the structure to @a choice, @c merged_file
2238  * to @a merged_file, and @c save_merged to false. Make only a shallow
2239  * copy of the pointer argument @a merged_file. @a merged_file may be
2240  * NULL if setting merged_file is not needed.
2241  *
2242  * @since New in 1.5.
2243  */
2246  const char *merged_file,
2247  apr_pool_t *pool);
2248 
2249 
2250 /** A callback used in merge, update and switch for resolving conflicts
2251  * during the application of a tree delta to a working copy.
2252  *
2253  * @a description describes the exact nature of the conflict, and
2254  * provides information to help resolve it. @a baton is a closure
2255  * object; it should be provided by the implementation, and passed by
2256  * the caller. When finished, the callback signals its resolution by
2257  * returning a structure in @a *result, which should be allocated in
2258  * @a result_pool. (See #svn_wc_conflict_result_t.) @a scratch_pool
2259  * should be used for any temporary allocations.
2260  *
2261  * The values #svn_wc_conflict_choose_mine_conflict and
2262  * #svn_wc_conflict_choose_theirs_conflict are not legal for conflicts
2263  * in binary files or binary properties.
2264  *
2265  * Implementations of this callback are free to present the conflict
2266  * using any user interface. This may include simple contextual
2267  * conflicts in a file's text or properties, or more complex
2268  * 'tree'-based conflicts related to obstructed additions, deletions,
2269  * and edits. The callback implementation is free to decide which
2270  * sorts of conflicts to handle; it's also free to decide which types
2271  * of conflicts are automatically resolvable and which require user
2272  * interaction.
2273  *
2274  * @since New in 1.7.
2275  */
2276 typedef svn_error_t *(*svn_wc_conflict_resolver_func2_t)(
2277  svn_wc_conflict_result_t **result,
2278  const svn_wc_conflict_description2_t *description,
2279  void *baton,
2280  apr_pool_t *result_pool,
2281  apr_pool_t *scratch_pool);
2282 
2283 
2284 /** Similar to #svn_wc_conflict_resolver_func2_t, but using
2285  * #svn_wc_conflict_description_t instead of
2286  * #svn_wc_conflict_description2_t
2287  *
2288  * @since New in 1.5.
2289  * @deprecated Provided for backward compatibility with the 1.6 API.
2290  */
2291 typedef svn_error_t *(*svn_wc_conflict_resolver_func_t)(
2292  svn_wc_conflict_result_t **result,
2293  const svn_wc_conflict_description_t *description,
2294  void *baton,
2295  apr_pool_t *pool);
2296 
2297 /** @} */
2298 
2299 
2300 ␌
2301 /**
2302  * A callback vtable invoked by our diff-editors, as they receive diffs
2303  * from the server. 'svn diff' and 'svn merge' implement their own versions
2304  * of this vtable.
2305  *
2306  * Common parameters:
2307  *
2308  * If @a state is non-NULL, set @a *state to the state of the item
2309  * after the operation has been performed. (In practice, this is only
2310  * useful with merge, not diff; diff callbacks will probably set
2311  * @a *state to #svn_wc_notify_state_unknown, since they do not change
2312  * the state and therefore do not bother to know the state after the
2313  * operation.) By default, @a state refers to the item's content
2314  * state. Functions concerned with property state have separate
2315  * @a contentstate and @a propstate arguments.
2316  *
2317  * If @a tree_conflicted is non-NULL, set @a *tree_conflicted to true if
2318  * this operation caused a tree conflict, else to false. (Like with @a
2319  * state, this is only useful with merge, not diff; diff callbacks
2320  * should set this to false.)
2321  *
2322  * @since New in 1.7.
2323  */
2325 {
2326  /**
2327  * This function is called before @a file_changed to allow callbacks to
2328  * skip the most expensive processing of retrieving the file data.
2329  *
2330  */
2331  svn_error_t *(*file_opened)(svn_boolean_t *tree_conflicted,
2332  svn_boolean_t *skip,
2333  const char *path,
2334  svn_revnum_t rev,
2335  void *diff_baton,
2336  apr_pool_t *scratch_pool);
2337 
2338  /**
2339  * A file @a path has changed. If @a tmpfile2 is non-NULL, the
2340  * contents have changed and those changes can be seen by comparing
2341  * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2 of
2342  * the file, respectively.
2343  *
2344  * If known, the @c svn:mime-type value of each file is passed into
2345  * @a mimetype1 and @a mimetype2; either or both of the values can
2346  * be NULL. The implementor can use this information to decide if
2347  * (or how) to generate differences.
2348  *
2349  * @a propchanges is an array of (#svn_prop_t) structures. If it contains
2350  * any elements, the original list of properties is provided in
2351  * @a originalprops, which is a hash of #svn_string_t values, keyed on the
2352  * property name.
2353  *
2354  */
2355  svn_error_t *(*file_changed)(svn_wc_notify_state_t *contentstate,
2356  svn_wc_notify_state_t *propstate,
2357  svn_boolean_t *tree_conflicted,
2358  const char *path,
2359  const char *tmpfile1,
2360  const char *tmpfile2,
2361  svn_revnum_t rev1,
2362  svn_revnum_t rev2,
2363  const char *mimetype1,
2364  const char *mimetype2,
2365  const apr_array_header_t *propchanges,
2366  apr_hash_t *originalprops,
2367  void *diff_baton,
2368  apr_pool_t *scratch_pool);
2369 
2370  /**
2371  * A file @a path was added. The contents can be seen by comparing
2372  * @a tmpfile1 and @a tmpfile2, which represent @a rev1 and @a rev2
2373  * of the file, respectively. (If either file is empty, the rev
2374  * will be 0.)
2375  *
2376  * If known, the @c svn:mime-type value of each file is passed into
2377  * @a mimetype1 and @a mimetype2; either or both of the values can
2378  * be NULL. The implementor can use this information to decide if
2379  * (or how) to generate differences.
2380  *
2381  * @a propchanges is an array of (#svn_prop_t) structures. If it contains
2382  * any elements, the original list of properties is provided in
2383  * @a originalprops, which is a hash of #svn_string_t values, keyed on the
2384  * property name.
2385  * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a
2386  * copy), and the origin of the copy may be recorded as
2387  * @a copyfrom_path under @a copyfrom_revision.
2388  */
2389  svn_error_t *(*file_added)(svn_wc_notify_state_t *contentstate,
2390  svn_wc_notify_state_t *propstate,
2391  svn_boolean_t *tree_conflicted,
2392  const char *path,
2393  const char *tmpfile1,
2394  const char *tmpfile2,
2395  svn_revnum_t rev1,
2396  svn_revnum_t rev2,
2397  const char *mimetype1,
2398  const char *mimetype2,
2399  const char *copyfrom_path,
2400  svn_revnum_t copyfrom_revision,
2401  const apr_array_header_t *propchanges,
2402  apr_hash_t *originalprops,
2403  void *diff_baton,
2404  apr_pool_t *scratch_pool);
2405 
2406  /**
2407  * A file @a path was deleted. The [loss of] contents can be seen by
2408  * comparing @a tmpfile1 and @a tmpfile2. @a originalprops provides
2409  * the properties of the file.
2410  * ### Some existing callers include WC "entry props" in @a originalprops.
2411  *
2412  * If known, the @c svn:mime-type value of each file is passed into
2413  * @a mimetype1 and @a mimetype2; either or both of the values can
2414  * be NULL. The implementor can use this information to decide if
2415  * (or how) to generate differences.
2416  */
2417  svn_error_t *(*file_deleted)(svn_wc_notify_state_t *state,
2418  svn_boolean_t *tree_conflicted,
2419  const char *path,
2420  const char *tmpfile1,
2421  const char *tmpfile2,
2422  const char *mimetype1,
2423  const char *mimetype2,
2424  apr_hash_t *originalprops,
2425  void *diff_baton,
2426  apr_pool_t *scratch_pool);
2427 
2428  /**
2429  * A directory @a path was deleted.
2430  */
2431  svn_error_t *(*dir_deleted)(svn_wc_notify_state_t *state,
2432  svn_boolean_t *tree_conflicted,
2433  const char *path,
2434  void *diff_baton,
2435  apr_pool_t *scratch_pool);
2436  /**
2437  * A directory @a path has been opened. @a rev is the revision that the
2438  * directory came from.
2439  *
2440  * This function is called for any existing directory @a path before any
2441  * of the callbacks are called for a child of @a path.
2442  *
2443  * If the callback returns @c TRUE in @a *skip_children, children
2444  * of this directory will be skipped.
2445  */
2446  svn_error_t *(*dir_opened)(svn_boolean_t *tree_conflicted,
2447  svn_boolean_t *skip,
2448  svn_boolean_t *skip_children,
2449  const char *path,
2450  svn_revnum_t rev,
2451  void *diff_baton,
2452  apr_pool_t *scratch_pool);
2453 
2454  /**
2455  * A directory @a path was added. @a rev is the revision that the
2456  * directory came from.
2457  *
2458  * This function is called for any new directory @a path before any
2459  * of the callbacks are called for a child of @a path.
2460  *
2461  * If @a copyfrom_path is non-@c NULL, this add has history (i.e., is a
2462  * copy), and the origin of the copy may be recorded as
2463  * @a copyfrom_path under @a copyfrom_revision.
2464  */
2465  svn_error_t *(*dir_added)(svn_wc_notify_state_t *state,
2466  svn_boolean_t *tree_conflicted,
2467  svn_boolean_t *skip,
2468  svn_boolean_t *skip_children,
2469  const char *path,
2470  svn_revnum_t rev,
2471  const char *copyfrom_path,
2472  svn_revnum_t copyfrom_revision,
2473  void *diff_baton,
2474  apr_pool_t *scratch_pool);
2475 
2476  /**
2477  * A list of property changes (@a propchanges) was applied to the
2478  * directory @a path.
2479  *
2480  * The array is a list of (#svn_prop_t) structures.
2481  *
2482  * @a dir_was_added is set to #TRUE if the directory was added, and
2483  * to #FALSE if the directory pre-existed.
2484  */
2485  svn_error_t *(*dir_props_changed)(svn_wc_notify_state_t *propstate,
2486  svn_boolean_t *tree_conflicted,
2487  const char *path,
2488  svn_boolean_t dir_was_added,
2489  const apr_array_header_t *propchanges,
2490  apr_hash_t *original_props,
2491  void *diff_baton,
2492  apr_pool_t *scratch_pool);
2493 
2494  /**
2495  * A directory @a path which has been opened with @a dir_opened or @a
2496  * dir_added has been closed.
2497  *
2498  * @a dir_was_added is set to #TRUE if the directory was added, and
2499  * to #FALSE if the directory pre-existed.
2500  */
2501  svn_error_t *(*dir_closed)(svn_wc_notify_state_t *contentstate,
2502  svn_wc_notify_state_t *propstate,
2503  svn_boolean_t *tree_conflicted,
2504  const char *path,
2505  svn_boolean_t dir_was_added,
2506  void *diff_baton,
2507  apr_pool_t *scratch_pool);
2508 
2510 
2511 
2512 /**
2513  * Similar to #svn_wc_diff_callbacks4_t, but without @a copyfrom_path and
2514  * @a copyfrom_revision arguments to @c file_added and @c dir_added functions.
2515  *
2516  * @since New in 1.6.
2517  * @deprecated Provided for backward compatibility with the 1.6 API.
2518  */
2520 {
2521  /** The same as #svn_wc_diff_callbacks4_t.file_changed. */
2522  svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
2523  svn_wc_notify_state_t *contentstate,
2524  svn_wc_notify_state_t *propstate,
2525  svn_boolean_t *tree_conflicted,
2526  const char *path,
2527  const char *tmpfile1,
2528  const char *tmpfile2,
2529  svn_revnum_t rev1,
2530  svn_revnum_t rev2,
2531  const char *mimetype1,
2532  const char *mimetype2,
2533  const apr_array_header_t *propchanges,
2534  apr_hash_t *originalprops,
2535  void *diff_baton);
2536 
2537  /** Similar to #svn_wc_diff_callbacks4_t.file_added but without
2538  * @a copyfrom_path and @a copyfrom_revision arguments. */
2539  svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
2540  svn_wc_notify_state_t *contentstate,
2541  svn_wc_notify_state_t *propstate,
2542  svn_boolean_t *tree_conflicted,
2543  const char *path,
2544  const char *tmpfile1,
2545  const char *tmpfile2,
2546  svn_revnum_t rev1,
2547  svn_revnum_t rev2,
2548  const char *mimetype1,
2549  const char *mimetype2,
2550  const apr_array_header_t *propchanges,
2551  apr_hash_t *originalprops,
2552  void *diff_baton);
2553 
2554  /** The same as #svn_wc_diff_callbacks4_t.file_deleted. */
2555  svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
2556  svn_wc_notify_state_t *state,
2557  svn_boolean_t *tree_conflicted,
2558  const char *path,
2559  const char *tmpfile1,
2560  const char *tmpfile2,
2561  const char *mimetype1,
2562  const char *mimetype2,
2563  apr_hash_t *originalprops,
2564  void *diff_baton);
2565 
2566  /** Similar to #svn_wc_diff_callbacks4_t.dir_added but without
2567  * @a copyfrom_path and @a copyfrom_revision arguments. */
2568  svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
2569  svn_wc_notify_state_t *state,
2570  svn_boolean_t *tree_conflicted,
2571  const char *path,
2572  svn_revnum_t rev,
2573  void *diff_baton);
2574 
2575  /** The same as #svn_wc_diff_callbacks4_t.dir_deleted. */
2576  svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
2577  svn_wc_notify_state_t *state,
2578  svn_boolean_t *tree_conflicted,
2579  const char *path,
2580  void *diff_baton);
2581 
2582  /** The same as #svn_wc_diff_callbacks4_t.dir_props_changed. */
2583  svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access,
2584  svn_wc_notify_state_t *propstate,
2585  svn_boolean_t *tree_conflicted,
2586  const char *path,
2587  const apr_array_header_t *propchanges,
2588  apr_hash_t *original_props,
2589  void *diff_baton);
2590 
2591  /** The same as #svn_wc_diff_callbacks4_t.dir_opened. */
2592  svn_error_t *(*dir_opened)(svn_wc_adm_access_t *adm_access,
2593  svn_boolean_t *tree_conflicted,
2594  const char *path,
2595  svn_revnum_t rev,
2596  void *diff_baton);
2597 
2598  /** The same as #svn_wc_diff_callbacks4_t.dir_closed. */
2599  svn_error_t *(*dir_closed)(svn_wc_adm_access_t *adm_access,
2600  svn_wc_notify_state_t *contentstate,
2601  svn_wc_notify_state_t *propstate,
2602  svn_boolean_t *tree_conflicted,
2603  const char *path,
2604  void *diff_baton);
2605 
2607 
2608 /**
2609  * Similar to #svn_wc_diff_callbacks3_t, but without the @c dir_opened
2610  * and @c dir_closed functions, and without the @a tree_conflicted argument
2611  * to the functions.
2612  *
2613  * @deprecated Provided for backward compatibility with the 1.2 API.
2614  */
2616 {
2617  /** The same as @c file_changed in #svn_wc_diff_callbacks3_t. */
2618  svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
2619  svn_wc_notify_state_t *contentstate,
2620  svn_wc_notify_state_t *propstate,
2621  const char *path,
2622  const char *tmpfile1,
2623  const char *tmpfile2,
2624  svn_revnum_t rev1,
2625  svn_revnum_t rev2,
2626  const char *mimetype1,
2627  const char *mimetype2,
2628  const apr_array_header_t *propchanges,
2629  apr_hash_t *originalprops,
2630  void *diff_baton);
2631 
2632  /** The same as @c file_added in #svn_wc_diff_callbacks3_t. */
2633  svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
2634  svn_wc_notify_state_t *contentstate,
2635  svn_wc_notify_state_t *propstate,
2636  const char *path,
2637  const char *tmpfile1,
2638  const char *tmpfile2,
2639  svn_revnum_t rev1,
2640  svn_revnum_t rev2,
2641  const char *mimetype1,
2642  const char *mimetype2,
2643  const apr_array_header_t *propchanges,
2644  apr_hash_t *originalprops,
2645  void *diff_baton);
2646 
2647  /** The same as @c file_deleted in #svn_wc_diff_callbacks3_t. */
2648  svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
2649  svn_wc_notify_state_t *state,
2650  const char *path,
2651  const char *tmpfile1,
2652  const char *tmpfile2,
2653  const char *mimetype1,
2654  const char *mimetype2,
2655  apr_hash_t *originalprops,
2656  void *diff_baton);
2657 
2658  /** The same as @c dir_added in #svn_wc_diff_callbacks3_t. */
2659  svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
2660  svn_wc_notify_state_t *state,
2661  const char *path,
2662  svn_revnum_t rev,
2663  void *diff_baton);
2664 
2665  /** The same as @c dir_deleted in #svn_wc_diff_callbacks3_t. */
2666  svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
2667  svn_wc_notify_state_t *state,
2668  const char *path,
2669  void *diff_baton);
2670 
2671  /** The same as @c dir_props_changed in #svn_wc_diff_callbacks3_t. */
2672  svn_error_t *(*dir_props_changed)(svn_wc_adm_access_t *adm_access,
2673  svn_wc_notify_state_t *state,
2674  const char *path,
2675  const apr_array_header_t *propchanges,
2676  apr_hash_t *original_props,
2677  void *diff_baton);
2678 
2680 
2681 /**
2682  * Similar to #svn_wc_diff_callbacks2_t, but with file additions/content
2683  * changes and property changes split into different functions.
2684  *
2685  * @deprecated Provided for backward compatibility with the 1.1 API.
2686  */
2688 {
2689  /** Similar to @c file_changed in #svn_wc_diff_callbacks2_t, but without
2690  * property change information. @a tmpfile2 is never NULL. @a state applies
2691  * to the file contents. */
2692  svn_error_t *(*file_changed)(svn_wc_adm_access_t *adm_access,
2693  svn_wc_notify_state_t *state,
2694  const char *path,
2695  const char *tmpfile1,
2696  const char *tmpfile2,
2697  svn_revnum_t rev1,
2698  svn_revnum_t rev2,
2699  const char *mimetype1,
2700  const char *mimetype2,
2701  void *diff_baton);
2702 
2703  /** Similar to @c file_added in #svn_wc_diff_callbacks2_t, but without
2704  * property change information. @a *state applies to the file contents. */
2705  svn_error_t *(*file_added)(svn_wc_adm_access_t *adm_access,
2706  svn_wc_notify_state_t *state,
2707  const char *path,
2708  const char *tmpfile1,
2709  const char *tmpfile2,
2710  svn_revnum_t rev1,
2711  svn_revnum_t rev2,
2712  const char *mimetype1,
2713  const char *mimetype2,
2714  void *diff_baton);
2715 
2716  /** Similar to @c file_deleted in #svn_wc_diff_callbacks2_t, but without
2717  * the properties. */
2718  svn_error_t *(*file_deleted)(svn_wc_adm_access_t *adm_access,
2719  svn_wc_notify_state_t *state,
2720  const char *path,
2721  const char *tmpfile1,
2722  const char *tmpfile2,
2723  const char *mimetype1,
2724  const char *mimetype2,
2725  void *diff_baton);
2726 
2727  /** The same as @c dir_added in #svn_wc_diff_callbacks2_t. */
2728  svn_error_t *(*dir_added)(svn_wc_adm_access_t *adm_access,
2729  svn_wc_notify_state_t *state,
2730  const char *path,
2731  svn_revnum_t rev,
2732  void *diff_baton);
2733 
2734  /** The same as @c dir_deleted in #svn_wc_diff_callbacks2_t. */
2735  svn_error_t *(*dir_deleted)(svn_wc_adm_access_t *adm_access,
2736  svn_wc_notify_state_t *state,
2737  const char *path,
2738  void *diff_baton);
2739 
2740  /** Similar to @c dir_props_changed in #svn_wc_diff_callbacks2_t, but this
2741  * function is called for files as well as directories. */
2742  svn_error_t *(*props_changed)(svn_wc_adm_access_t *adm_access,
2743  svn_wc_notify_state_t *state,
2744  const char *path,
2745  const apr_array_header_t *propchanges,
2746  apr_hash_t *original_props,
2747  void *diff_baton);
2748 
2750 
2751 ␌
2752 /* Asking questions about a working copy. */
2753 
2754 /** Set @a *wc_format to @a local_abspath's working copy format version
2755  * number if @a local_abspath is a valid working copy directory, else set it
2756  * to 0.
2757  *
2758  * Return error @c APR_ENOENT if @a local_abspath does not exist at all.
2759  *
2760  * @since New in 1.7.
2761  */
2762 svn_error_t *
2763 svn_wc_check_wc2(int *wc_format,
2764  svn_wc_context_t *wc_ctx,
2765  const char *local_abspath,
2766  apr_pool_t *scratch_pool);
2767 
2768 /**
2769  * Similar to svn_wc_check_wc2(), but with a relative path and no supplied
2770  * working copy context.
2771  *
2772  * @deprecated Provided for backward compatibility with the 1.6 API.
2773  */
2775 svn_error_t *
2776 svn_wc_check_wc(const char *path,
2777  int *wc_format,
2778  apr_pool_t *pool);
2779 
2780 
2781 /** Set @a *has_binary_prop to @c TRUE iff @a path has been marked
2782  * with a property indicating that it is non-text (in other words, binary).
2783  * @a adm_access is an access baton set that contains @a path.
2784  *
2785  * @deprecated Provided for backward compatibility with the 1.6 API. As a
2786  * replacement for this functionality, @see svn_mime_type_is_binary and
2787  * #SVN_PROP_MIME_TYPE.
2788  */
2790 svn_error_t *
2792  const char *path,
2793  svn_wc_adm_access_t *adm_access,
2794  apr_pool_t *pool);
2795 
2796 ␌
2797 /* Detecting modification. */
2798 
2799 /** Set @a *modified_p to non-zero if @a local_abspath's text is modified
2800  * with regard to the base revision, else set @a *modified_p to zero.
2801  * @a local_abspath is the absolute path to the file.
2802  *
2803  * This function uses some heuristics to avoid byte-by-byte comparisons
2804  * against the base text (eg. file size and its modification time).
2805  *
2806  * If @a local_abspath does not exist, consider it unmodified. If it exists
2807  * but is not under revision control (not even scheduled for
2808  * addition), return the error #SVN_ERR_ENTRY_NOT_FOUND.
2809  *
2810  * @a unused is ignored.
2811  *
2812  * @since New in 1.7.
2813  */
2814 svn_error_t *
2816  svn_wc_context_t *wc_ctx,
2817  const char *local_abspath,
2818  svn_boolean_t unused,
2819  apr_pool_t *scratch_pool);
2820 
2821 /** Similar to svn_wc_text_modified_p2(), but with a relative path and
2822  * adm_access baton?
2823  *
2824  * @deprecated Provided for backward compatibility with the 1.6 API.
2825  */
2827 svn_error_t *
2829  const char *filename,
2830  svn_boolean_t force_comparison,
2831  svn_wc_adm_access_t *adm_access,
2832  apr_pool_t *pool);
2833 
2834 /** Set @a *modified_p to non-zero if @a path's properties are modified
2835  * with regard to the base revision, else set @a modified_p to zero.
2836  * @a adm_access must be an access baton for @a path.
2837  *
2838  * @since New in 1.7.
2839  */
2840 svn_error_t *
2842  svn_wc_context_t *wc_ctx,
2843  const char *local_abspath,
2844  apr_pool_t *scratch_pool);
2845 
2846 /** Similar to svn_wc_props_modified_p2(), but with a relative path and
2847  * adm_access baton.
2848  *
2849  * @deprecated Provided for backward compatibility with the 1.6 API.
2850  */
2852 svn_error_t *
2854  const char *path,
2855  svn_wc_adm_access_t *adm_access,
2856  apr_pool_t *pool);
2857 
2858 
2859 /**
2860 ␌* @defgroup svn_wc_entries Entries and status (deprecated)
2861  * @{
2862  */
2863 
2864 /** The schedule states an entry can be in.
2865  * @deprecated Provided for backward compatibility with the 1.6 API. */
2866 typedef enum svn_wc_schedule_t
2867 {
2868  /** Nothing special here */
2870 
2871  /** Slated for addition */
2873 
2874  /** Slated for deletion */
2876 
2877  /** Slated for replacement (delete + add) */
2879 
2881 
2882 
2883 /**
2884  * Values for the working_size field in svn_wc_entry_t
2885  * when it isn't set to the actual size value of the unchanged
2886  * working file.
2887  *
2888  * The value of the working size is unknown (hasn't been
2889  * calculated and stored in the past for whatever reason).
2890  *
2891  * @since New in 1.5
2892  * @deprecated Provided for backward compatibility with the 1.6 API.
2893  */
2894 #define SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN (-1)
2895 
2896 /** A working copy entry -- that is, revision control information about
2897  * one versioned entity.
2898  *
2899  * @deprecated Provided for backward compatibility with the 1.6 API.
2900  */
2901 /* SVN_DEPRECATED */
2902 typedef struct svn_wc_entry_t
2903 {
2904  /* IMPORTANT: If you extend this structure, add new fields to the end. */
2905 
2906  /* General Attributes */
2907 
2908  /** entry's name */
2909  const char *name;
2910 
2911  /** base revision */
2913 
2914  /** url in repository */
2915  const char *url;
2916 
2917  /** canonical repository URL or NULL if not known */
2918  const char *repos;
2919 
2920  /** repository uuid */
2921  const char *uuid;
2922 
2923  /** node kind (file, dir, ...) */
2925 
2926  /* State information */
2927 
2928  /** scheduling (add, delete, replace ...) */
2930 
2931  /** in a copied state (possibly because the entry is a child of a
2932  * path that is #svn_wc_schedule_add or #svn_wc_schedule_replace,
2933  * when the entry itself is #svn_wc_schedule_normal).
2934  * COPIED is true for nodes under a directory that was copied, but
2935  * COPYFROM_URL is null there. They are both set for the root
2936  * destination of the copy.
2937  */
2939 
2940  /** The directory containing this entry had a versioned child of this
2941  * name, but this entry represents a different revision or a switched
2942  * path at which no item exists in the repository. This typically
2943  * arises from committing or updating to a deletion of this entry
2944  * without committing or updating the parent directory.
2945  *
2946  * The schedule can be 'normal' or 'add'. */
2948 
2949  /** absent -- we know an entry of this name exists, but that's all
2950  (usually this happens because of authz restrictions) */
2952 
2953  /** for THIS_DIR entry, implies whole entries file is incomplete */
2955 
2956  /** copyfrom location */
2957  const char *copyfrom_url;
2958 
2959  /** copyfrom revision */
2961 
2962  /** old version of conflicted file. A file basename, relative to the
2963  * user's directory that the THIS_DIR entry refers to. */
2964  const char *conflict_old;
2965 
2966  /** new version of conflicted file. A file basename, relative to the
2967  * user's directory that the THIS_DIR entry refers to. */
2968  const char *conflict_new;
2969 
2970  /** working version of conflicted file. A file basename, relative to the
2971  * user's directory that the THIS_DIR entry refers to. */
2972  const char *conflict_wrk;
2973 
2974  /** property reject file. A file basename, relative to the user's
2975  * directory that the THIS_DIR entry refers to. */
2976  const char *prejfile;
2977 
2978  /** last up-to-date time for text contents (0 means no information available)
2979  */
2980  apr_time_t text_time;
2981 
2982  /** last up-to-date time for properties (0 means no information available)
2983  *
2984  * @deprecated This value will always be 0 in version 1.4 and later.
2985  */
2986  apr_time_t prop_time;
2987 
2988  /** Hex MD5 checksum for the untranslated text base file,
2989  * can be @c NULL for backwards compatibility.
2990  */
2991  const char *checksum;
2992 
2993  /* "Entry props" */
2994 
2995  /** last revision this was changed */
2997 
2998  /** last date this was changed */
2999  apr_time_t cmt_date;
3000 
3001  /** last commit author of this item */
3002  const char *cmt_author;
3003 
3004  /** lock token or NULL if path not locked in this WC
3005  * @since New in 1.2.
3006  */
3007  const char *lock_token;
3008 
3009  /** lock owner, or NULL if not locked in this WC
3010  * @since New in 1.2.
3011  */
3012  const char *lock_owner;
3013 
3014  /** lock comment or NULL if not locked in this WC or no comment
3015  * @since New in 1.2.
3016  */
3017  const char *lock_comment;
3018 
3019  /** Lock creation date or 0 if not locked in this WC
3020  * @since New in 1.2.
3021  */
3023 
3024  /** Whether this entry has any working properties.
3025  * False if this information is not stored in the entry.
3026  *
3027  * @since New in 1.4. */
3029 
3030  /** Whether this entry has property modifications.
3031  *
3032  * @note For working copies in older formats, this flag is not valid.
3033  *
3034  * @see svn_wc_props_modified_p().
3035  *
3036  * @since New in 1.4. */
3038 
3039  /** A space-separated list of all properties whose presence/absence is cached
3040  * in this entry.
3041  *
3042  * @see @c present_props.
3043  *
3044  * @since New in 1.4.
3045  * @deprecated This value will always be "" in version 1.7 and later. */
3046  const char *cachable_props;
3047 
3048  /** Cached property existence for this entry.
3049  * This is a space-separated list of property names. If a name exists in
3050  * @c cachable_props but not in this list, this entry does not have that
3051  * property. If a name exists in both lists, the property is present on this
3052  * entry.
3053  *
3054  * @since New in 1.4.
3055  * @deprecated This value will always be "" in version 1.7 and later. */
3056  const char *present_props;
3057 
3058  /** which changelist this item is part of, or NULL if not part of any.
3059  * @since New in 1.5.
3060  */
3061  const char *changelist;
3062 
3063  /** Size of the file after being translated into local
3064  * representation, or #SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN if
3065  * unknown.
3066  *
3067  * @since New in 1.5.
3068  */
3069  apr_off_t working_size;
3070 
3071  /** Whether a local copy of this entry should be kept in the working copy
3072  * after a deletion has been committed, Only valid for the this-dir entry
3073  * when it is scheduled for deletion.
3074  *
3075  * @since New in 1.5. */
3077 
3078  /** The depth of this entry.
3079  *
3080  * ### It's a bit annoying that we only use this on this_dir
3081  * ### entries, yet it will exist (with value svn_depth_infinity) on
3082  * ### all entries. Maybe some future extensibility would make this
3083  * ### field meaningful on entries besides this_dir.
3084  *
3085  * @since New in 1.5. */
3087 
3088  /** Serialized data for all of the tree conflicts detected in this_dir.
3089  *
3090  * @since New in 1.6. */
3091  const char *tree_conflict_data;
3092 
3093  /** The entry is a intra-repository file external and this is the
3094  * repository root relative path to the file specified in the
3095  * externals definition, otherwise NULL if the entry is not a file
3096  * external.
3097  *
3098  * @since New in 1.6. */
3099  const char *file_external_path;
3100 
3101  /** The entry is a intra-repository file external and this is the
3102  * peg revision number specified in the externals definition. This
3103  * field is only valid when the file_external_path field is
3104  * non-NULL. The only permissible values are
3105  * svn_opt_revision_unspecified if the entry is not an external,
3106  * svn_opt_revision_head if the external revision is unspecified or
3107  * specified with -r HEAD or svn_opt_revision_number for a specific
3108  * revision number.
3109  *
3110  * @since New in 1.6. */
3112 
3113  /** The entry is an intra-repository file external and this is the
3114  * operative revision number specified in the externals definition.
3115  * This field is only valid when the file_external_path field is
3116  * non-NULL. The only permissible values are
3117  * svn_opt_revision_unspecified if the entry is not an external,
3118  * svn_opt_revision_head if the external revision is unspecified or
3119  * specified with -r HEAD or svn_opt_revision_number for a specific
3120  * revision number.
3121  *
3122  * @since New in 1.6. */
3124 
3125  /* IMPORTANT: If you extend this structure, check the following functions in
3126  * subversion/libsvn_wc/entries.c, to see if you need to extend them as well.
3127  *
3128  * svn_wc__atts_to_entry()
3129  * svn_wc_entry_dup()
3130  * alloc_entry()
3131  * read_entry()
3132  * write_entry()
3133  * fold_entry()
3134  */
3136 
3137 
3138 /** How an entries file's owner dir is named in the entries file.
3139  * @deprecated Provided for backward compatibility with the 1.6 API. */
3140 #define SVN_WC_ENTRY_THIS_DIR ""
3141 
3142 
3143 /** Set @a *entry to an entry for @a path, allocated in the access baton pool.
3144  * If @a show_hidden is TRUE, return the entry even if it's in 'excluded',
3145  * 'deleted' or 'absent' state. Excluded entries are those with their depth
3146  * set to #svn_depth_exclude. If @a path is not under revision control, or
3147  * if entry is hidden, not scheduled for re-addition, and @a show_hidden is @c
3148  * FALSE, then set @a *entry to @c NULL.
3149  *
3150  * @a *entry should not be modified, since doing so modifies the entries
3151  * cache in @a adm_access without changing the entries file on disk.
3152  *
3153  * If @a path is not a directory then @a adm_access must be an access baton
3154  * for the parent directory of @a path. To avoid needing to know whether
3155  * @a path is a directory or not, if @a path is a directory @a adm_access