]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/subversion/subversion/include/svn_client.h
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / subversion / subversion / include / svn_client.h
1 /**
2  * @copyright
3  * ====================================================================
4  *    Licensed to the Apache Software Foundation (ASF) under one
5  *    or more contributor license agreements.  See the NOTICE file
6  *    distributed with this work for additional information
7  *    regarding copyright ownership.  The ASF licenses this file
8  *    to you under the Apache License, Version 2.0 (the
9  *    "License"); you may not use this file except in compliance
10  *    with the License.  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *    Unless required by applicable law or agreed to in writing,
15  *    software distributed under the License is distributed on an
16  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  *    KIND, either express or implied.  See the License for the
18  *    specific language governing permissions and limitations
19  *    under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_client.h
24  * @brief Subversion's client library
25  *
26  * Requires:  The working copy library and repository access library.
27  * Provides:  Broad wrappers around working copy library functionality.
28  * Used By:   Client programs.
29  */
30
31 #ifndef SVN_CLIENT_H
32 #define SVN_CLIENT_H
33
34 #include <apr.h>
35 #include <apr_pools.h>
36 #include <apr_hash.h>
37 #include <apr_tables.h>
38 #include <apr_getopt.h>
39 #include <apr_file_io.h>
40 #include <apr_time.h>
41
42 #include "svn_types.h"
43 #include "svn_string.h"
44 #include "svn_wc.h"
45 #include "svn_opt.h"
46 #include "svn_ra.h"
47 #include "svn_diff.h"
48 #include "svn_auth.h"
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif /* __cplusplus */
53
54
55
56 /**
57  * Get libsvn_client version information.
58  *
59  * @since New in 1.1.
60  */
61 const svn_version_t *
62 svn_client_version(void);
63
64 /** Client supporting functions
65  *
66  * @defgroup clnt_support Client supporting subsystem
67  *
68  * @{
69  */
70
71 \f
72 /*** Authentication stuff ***/
73
74 /**  The new authentication system allows the RA layer to "pull"
75  *   information as needed from libsvn_client.
76  *
77  *   @deprecated Replaced by the svn_auth_* functions.
78  *   @see auth_fns
79  *
80  *   @defgroup auth_fns_depr (deprecated) AuthZ client subsystem
81  *
82  *   @{
83  */
84
85 /** Create and return @a *provider, an authentication provider of type
86  * svn_auth_cred_simple_t that gets information by prompting the user
87  * with @a prompt_func and @a prompt_baton.  Allocate @a *provider in
88  * @a pool.
89  *
90  * If both #SVN_AUTH_PARAM_DEFAULT_USERNAME and
91  * #SVN_AUTH_PARAM_DEFAULT_PASSWORD are defined as runtime
92  * parameters in the @c auth_baton, then @a *provider will return the
93  * default arguments when svn_auth_first_credentials() is called.  If
94  * svn_auth_first_credentials() fails, then @a *provider will
95  * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
96  * For infinite retries, set @a retry_limit to value less than 0.
97  *
98  * @deprecated Provided for backward compatibility with the 1.3 API.
99  * Use svn_auth_get_simple_prompt_provider() instead.
100  */
101 SVN_DEPRECATED
102 void
103 svn_client_get_simple_prompt_provider(
104   svn_auth_provider_object_t **provider,
105   svn_auth_simple_prompt_func_t prompt_func,
106   void *prompt_baton,
107   int retry_limit,
108   apr_pool_t *pool);
109
110
111 /** Create and return @a *provider, an authentication provider of type
112  * #svn_auth_cred_username_t that gets information by prompting the
113  * user with @a prompt_func and @a prompt_baton.  Allocate @a *provider
114  * in @a pool.
115  *
116  * If #SVN_AUTH_PARAM_DEFAULT_USERNAME is defined as a runtime
117  * parameter in the @c auth_baton, then @a *provider will return the
118  * default argument when svn_auth_first_credentials() is called.  If
119  * svn_auth_first_credentials() fails, then @a *provider will
120  * re-prompt @a retry_limit times (via svn_auth_next_credentials()).
121  * For infinite retries, set @a retry_limit to value less than 0.
122  *
123  * @deprecated Provided for backward compatibility with the 1.3 API.
124  * Use svn_auth_get_username_prompt_provider() instead.
125  */
126 SVN_DEPRECATED
127 void
128 svn_client_get_username_prompt_provider(
129   svn_auth_provider_object_t **provider,
130   svn_auth_username_prompt_func_t prompt_func,
131   void *prompt_baton,
132   int retry_limit,
133   apr_pool_t *pool);
134
135
136 /** Create and return @a *provider, an authentication provider of type
137  * #svn_auth_cred_simple_t that gets/sets information from the user's
138  * ~/.subversion configuration directory.  Allocate @a *provider in
139  * @a pool.
140  *
141  * If a default username or password is available, @a *provider will
142  * honor them as well, and return them when
143  * svn_auth_first_credentials() is called.  (see
144  * #SVN_AUTH_PARAM_DEFAULT_USERNAME and #SVN_AUTH_PARAM_DEFAULT_PASSWORD).
145  *
146  * @deprecated Provided for backward compatibility with the 1.3 API.
147  * Use svn_auth_get_simple_provider2() instead.
148  */
149 SVN_DEPRECATED
150 void
151 svn_client_get_simple_provider(svn_auth_provider_object_t **provider,
152                                apr_pool_t *pool);
153
154
155 #if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN) || defined(CTYPESGEN) || defined(SWIG)
156 /**
157  * Create and return @a *provider, an authentication provider of type
158  * #svn_auth_cred_simple_t that gets/sets information from the user's
159  * ~/.subversion configuration directory.  Allocate @a *provider in
160  * @a pool.
161  *
162  * This is like svn_client_get_simple_provider(), except that, when
163  * running on Window 2000 or newer (or any other Windows version that
164  * includes the CryptoAPI), the provider encrypts the password before
165  * storing it to disk. On earlier versions of Windows, the provider
166  * does nothing.
167  *
168  * @since New in 1.2.
169  * @note This function is only available on Windows.
170  *
171  * @note An administrative password reset may invalidate the account's
172  * secret key. This function will detect that situation and behave as
173  * if the password were not cached at all.
174  *
175  * @deprecated Provided for backward compatibility with the 1.3 API.
176  * Use svn_auth_get_windows_simple_provider() instead.
177  */
178 SVN_DEPRECATED
179 void
180 svn_client_get_windows_simple_provider(svn_auth_provider_object_t **provider,
181                                        apr_pool_t *pool);
182 #endif /* WIN32 && !__MINGW32__ || DOXYGEN || CTYPESGEN || SWIG */
183
184 /** Create and return @a *provider, an authentication provider of type
185  * #svn_auth_cred_username_t that gets/sets information from a user's
186  * ~/.subversion configuration directory.  Allocate @a *provider in
187  * @a pool.
188  *
189  * If a default username is available, @a *provider will honor it,
190  * and return it when svn_auth_first_credentials() is called.  (see
191  * #SVN_AUTH_PARAM_DEFAULT_USERNAME).
192  *
193  * @deprecated Provided for backward compatibility with the 1.3 API.
194  * Use svn_auth_get_username_provider() instead.
195  */
196 SVN_DEPRECATED
197 void
198 svn_client_get_username_provider(svn_auth_provider_object_t **provider,
199                                  apr_pool_t *pool);
200
201
202 /** Create and return @a *provider, an authentication provider of type
203  * #svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
204  *
205  * @a *provider retrieves its credentials from the configuration
206  * mechanism.  The returned credential is used to override SSL
207  * security on an error.
208  *
209  * @deprecated Provided for backward compatibility with the 1.3 API.
210  * Use svn_auth_get_ssl_server_trust_file_provider() instead.
211  */
212 SVN_DEPRECATED
213 void
214 svn_client_get_ssl_server_trust_file_provider(
215   svn_auth_provider_object_t **provider,
216   apr_pool_t *pool);
217
218
219 /** Create and return @a *provider, an authentication provider of type
220  * #svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
221  *
222  * @a *provider retrieves its credentials from the configuration
223  * mechanism.  The returned credential is used to load the appropriate
224  * client certificate for authentication when requested by a server.
225  *
226  * @deprecated Provided for backward compatibility with the 1.3 API.
227  * Use svn_auth_get_ssl_client_cert_file_provider() instead.
228  */
229 SVN_DEPRECATED
230 void
231 svn_client_get_ssl_client_cert_file_provider(
232   svn_auth_provider_object_t **provider,
233   apr_pool_t *pool);
234
235
236 /** Create and return @a *provider, an authentication provider of type
237  * #svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool.
238  *
239  * @a *provider retrieves its credentials from the configuration
240  * mechanism.  The returned credential is used when a loaded client
241  * certificate is protected by a passphrase.
242  *
243  * @deprecated Provided for backward compatibility with the 1.3 API.
244  * Use svn_auth_get_ssl_client_cert_pw_file_provider2() instead.
245  */
246 SVN_DEPRECATED
247 void
248 svn_client_get_ssl_client_cert_pw_file_provider(
249   svn_auth_provider_object_t **provider,
250   apr_pool_t *pool);
251
252
253 /** Create and return @a *provider, an authentication provider of type
254  * #svn_auth_cred_ssl_server_trust_t, allocated in @a pool.
255  *
256  * @a *provider retrieves its credentials by using the @a prompt_func
257  * and @a prompt_baton.  The returned credential is used to override
258  * SSL security on an error.
259  *
260  * @deprecated Provided for backward compatibility with the 1.3 API.
261  * Use svn_auth_get_ssl_server_trust_prompt_provider() instead.
262  */
263 SVN_DEPRECATED
264 void
265 svn_client_get_ssl_server_trust_prompt_provider(
266   svn_auth_provider_object_t **provider,
267   svn_auth_ssl_server_trust_prompt_func_t prompt_func,
268   void *prompt_baton,
269   apr_pool_t *pool);
270
271
272 /** Create and return @a *provider, an authentication provider of type
273  * #svn_auth_cred_ssl_client_cert_t, allocated in @a pool.
274  *
275  * @a *provider retrieves its credentials by using the @a prompt_func
276  * and @a prompt_baton.  The returned credential is used to load the
277  * appropriate client certificate for authentication when requested by
278  * a server.  The prompt will be retried @a retry_limit times.
279  * For infinite retries, set @a retry_limit to value less than 0.
280  *
281  * @deprecated Provided for backward compatibility with the 1.3 API.
282  * Use svn_auth_get_ssl_client_cert_prompt_provider() instead.
283  */
284 SVN_DEPRECATED
285 void
286 svn_client_get_ssl_client_cert_prompt_provider(
287   svn_auth_provider_object_t **provider,
288   svn_auth_ssl_client_cert_prompt_func_t prompt_func,
289   void *prompt_baton,
290   int retry_limit,
291   apr_pool_t *pool);
292
293
294 /** Create and return @a *provider, an authentication provider of type
295  * #svn_auth_cred_ssl_client_cert_pw_t, allocated in @a pool.
296  *
297  * @a *provider retrieves its credentials by using the @a prompt_func
298  * and @a prompt_baton.  The returned credential is used when a loaded
299  * client certificate is protected by a passphrase.  The prompt will
300  * be retried @a retry_limit times. For infinite retries, set @a retry_limit
301  * to value less than 0.
302  *
303  * @deprecated Provided for backward compatibility with the 1.3 API.
304  * Use svn_auth_get_ssl_client_cert_pw_prompt_provider() instead.
305  */
306 SVN_DEPRECATED
307 void
308 svn_client_get_ssl_client_cert_pw_prompt_provider(
309   svn_auth_provider_object_t **provider,
310   svn_auth_ssl_client_cert_pw_prompt_func_t prompt_func,
311   void *prompt_baton,
312   int retry_limit,
313   apr_pool_t *pool);
314
315 /** @} */
316
317 /**
318  * Revisions and Peg Revisions
319  *
320  * @defgroup clnt_revisions Revisions and Peg Revisions
321  *
322  * A brief word on operative and peg revisions.
323  *
324  * If the kind of the peg revision is #svn_opt_revision_unspecified, then it
325  * defaults to #svn_opt_revision_head for URLs and #svn_opt_revision_working
326  * for local paths.
327  *
328  * For deeper insight, please see the
329  * <a href="http://svnbook.red-bean.com/nightly/en/svn.advanced.pegrevs.html">
330  * Peg and Operative Revisions</a> section of the Subversion Book.
331  */
332
333 /**
334  * Commit operations
335  *
336  * @defgroup clnt_commit Client commit subsystem
337  *
338  * @{
339  */
340
341 /** This is a structure which stores a filename and a hash of property
342  * names and values.
343  *
344  * @deprecated Provided for backward compatibility with the 1.4 API.
345  */
346 typedef struct svn_client_proplist_item_t
347 {
348   /** The name of the node on which these properties are set. */
349   svn_stringbuf_t *node_name;
350
351   /** A hash of (const char *) property names, and (svn_string_t *) property
352    * values. */
353   apr_hash_t *prop_hash;
354
355 } svn_client_proplist_item_t;
356
357 /**
358  * The callback invoked by svn_client_proplist4().  Each invocation
359  * provides the regular and/or inherited properties of @a path, which is
360  * either a working copy path or a URL.  If @a prop_hash is not @c NULL, then
361  * it maps explicit <tt>const char *</tt> property names to
362  * <tt>svn_string_t *</tt> explicit property values.  If @a inherited_props
363  * is not @c NULL, then it is a depth-first ordered array of
364  * #svn_prop_inherited_item_t * structures representing the
365  * properties inherited by @a path.  Use @a scratch_pool for all temporary
366  * allocations.
367  *
368  * The #svn_prop_inherited_item_t->path_or_url members of the
369  * #svn_prop_inherited_item_t * structures in @a inherited_props are
370  * URLs if @a path is a URL or if @a path is a working copy path but the
371  * property represented by the structure is above the working copy root (i.e.
372  * the inherited property is from the cache).  In all other cases the
373  * #svn_prop_inherited_item_t->path_or_url members are absolute working copy
374  * paths.
375  *
376  * @since New in 1.8.
377  */
378 typedef svn_error_t *(*svn_proplist_receiver2_t)(
379   void *baton,
380   const char *path,
381   apr_hash_t *prop_hash,
382   apr_array_header_t *inherited_props,
383   apr_pool_t *scratch_pool);
384
385 /**
386  * Similar to #svn_proplist_receiver2_t, but doesn't return inherited
387  * properties.
388  *
389  * @deprecated Provided for backward compatibility with the 1.7 API.
390  *
391  * @since New in 1.5.
392  */
393 typedef svn_error_t *(*svn_proplist_receiver_t)(
394   void *baton,
395   const char *path,
396   apr_hash_t *prop_hash,
397   apr_pool_t *pool);
398
399 /**
400  * Return a duplicate of @a item, allocated in @a pool. No part of the new
401  * structure will be shared with @a item.
402  *
403  * @since New in 1.3.
404  *
405  * @deprecated Provided for backward compatibility with the 1.4 API.
406  */
407 SVN_DEPRECATED
408 svn_client_proplist_item_t *
409 svn_client_proplist_item_dup(const svn_client_proplist_item_t *item,
410                              apr_pool_t *pool);
411
412 /** Information about commits passed back to client from this module.
413  *
414  * @deprecated Provided for backward compatibility with the 1.2 API.
415  */
416 typedef struct svn_client_commit_info_t
417 {
418   /** just-committed revision. */
419   svn_revnum_t revision;
420
421   /** server-side date of the commit. */
422   const char *date;
423
424   /** author of the commit. */
425   const char *author;
426
427 } svn_client_commit_info_t;
428
429
430 /**
431  * @name Commit state flags
432  * @brief State flags for use with the #svn_client_commit_item3_t structure
433  * (see the note about the namespace for that structure, which also
434  * applies to these flags).
435  * @{
436  */
437 #define SVN_CLIENT_COMMIT_ITEM_ADD         0x01
438 #define SVN_CLIENT_COMMIT_ITEM_DELETE      0x02
439 #define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS   0x04
440 #define SVN_CLIENT_COMMIT_ITEM_PROP_MODS   0x08
441 #define SVN_CLIENT_COMMIT_ITEM_IS_COPY     0x10
442 /** One of the flags for a commit item.  The node has a lock token that
443  * should be released after a successful commit and, if the node is also
444  * modified, transferred to the server as part of the commit process.
445  *
446  * @since New in 1.2. */
447 #define SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN  0x20
448 /** One of the flags for a commit item.  The node is the 'moved here'
449  * side of a local move.  This is used to check and enforce that the
450  * other side of the move is also included in the commit.
451  *
452  * @since New in 1.8. */
453 #define SVN_CLIENT_COMMIT_ITEM_MOVED_HERE  0x40
454 /** @} */
455
456 /** The commit candidate structure.
457  *
458  * In order to avoid backwards compatibility problems clients should use
459  * svn_client_commit_item3_create() to allocate and initialize this
460  * structure instead of doing so themselves.
461  *
462  * @since New in 1.5.
463  */
464 typedef struct svn_client_commit_item3_t
465 {
466   /* IMPORTANT: If you extend this structure, add new fields to the end. */
467
468   /** absolute working-copy path of item */
469   const char *path;
470
471   /** node kind (dir, file) */
472   svn_node_kind_t kind;
473
474   /** commit URL for this item */
475   const char *url;
476
477   /** revision of textbase */
478   svn_revnum_t revision;
479
480   /** copyfrom-url or NULL if not a copied item */
481   const char *copyfrom_url;
482
483   /** copyfrom-rev, valid when copyfrom_url != NULL */
484   svn_revnum_t copyfrom_rev;
485
486   /** state flags */
487   apr_byte_t state_flags;
488
489   /** An array of #svn_prop_t *'s, which are incoming changes from
490    * the repository to WC properties.  These changes are applied
491    * post-commit.
492    *
493    * When adding to this array, allocate the #svn_prop_t and its
494    * contents in @c incoming_prop_changes->pool, so that it has the
495    * same lifetime as this data structure.
496    *
497    * See http://subversion.tigris.org/issues/show_bug.cgi?id=806 for a
498    * description of what would happen if the post-commit process
499    * didn't group these changes together with all other changes to the
500    * item.
501    */
502   apr_array_header_t *incoming_prop_changes;
503
504   /** An array of #svn_prop_t *'s, which are outgoing changes to
505    * make to properties in the repository.  These extra property
506    * changes are declared pre-commit, and applied to the repository as
507    * part of a commit.
508    *
509    * When adding to this array, allocate the #svn_prop_t and its
510    * contents in @c outgoing_prop_changes->pool, so that it has the
511    * same lifetime as this data structure.
512    */
513   apr_array_header_t *outgoing_prop_changes;
514
515   /**
516    * When processing the commit this contains the relative path for
517    * the commit session. #NULL until the commit item is preprocessed.
518    * @since New in 1.7.
519    */
520   const char *session_relpath;
521
522   /**
523    * When committing a move, this contains the absolute path where
524    * the node was directly moved from. (If an ancestor at the original
525    * location was moved then it points to where the node itself was
526    * moved from; not the original location.)
527    * @since New in 1.8.
528    */
529   const char *moved_from_abspath;
530
531 } svn_client_commit_item3_t;
532
533 /** The commit candidate structure.
534  *
535  * @deprecated Provided for backward compatibility with the 1.4 API.
536  */
537 typedef struct svn_client_commit_item2_t
538 {
539   /** absolute working-copy path of item */
540   const char *path;
541
542   /** node kind (dir, file) */
543   svn_node_kind_t kind;
544
545   /** commit URL for this item */
546   const char *url;
547
548   /** revision of textbase */
549   svn_revnum_t revision;
550
551   /** copyfrom-url or NULL if not a copied item */
552   const char *copyfrom_url;
553
554   /** copyfrom-rev, valid when copyfrom_url != NULL */
555   svn_revnum_t copyfrom_rev;
556
557   /** state flags */
558   apr_byte_t state_flags;
559
560   /** Analogous to the #svn_client_commit_item3_t.incoming_prop_changes
561    * field.
562    */
563   apr_array_header_t *wcprop_changes;
564 } svn_client_commit_item2_t;
565
566 /** The commit candidate structure.
567  *
568  * @deprecated Provided for backward compatibility with the 1.2 API.
569  */
570 typedef struct svn_client_commit_item_t
571 {
572   /** absolute working-copy path of item */
573   const char *path;
574
575   /** node kind (dir, file) */
576   svn_node_kind_t kind;
577
578   /** commit URL for this item */
579   const char *url;
580
581   /** revision (copyfrom-rev if _IS_COPY) */
582   svn_revnum_t revision;
583
584   /** copyfrom-url */
585   const char *copyfrom_url;
586
587   /** state flags */
588   apr_byte_t state_flags;
589
590   /** Analogous to the #svn_client_commit_item3_t.incoming_prop_changes
591    * field.
592    */
593   apr_array_header_t *wcprop_changes;
594
595 } svn_client_commit_item_t;
596
597 /** Return a new commit item object, allocated in @a pool.
598  *
599  * In order to avoid backwards compatibility problems, this function
600  * is used to initialize and allocate the #svn_client_commit_item3_t
601  * structure rather than doing so explicitly, as the size of this
602  * structure may change in the future.
603  *
604  * @since New in 1.6.
605  */
606 svn_client_commit_item3_t *
607 svn_client_commit_item3_create(apr_pool_t *pool);
608
609 /** Like svn_client_commit_item3_create() but with a stupid "const"
610  * qualifier on the returned structure, and it returns an error that
611  * will never happen.
612  *
613  * @deprecated Provided for backward compatibility with the 1.5 API.
614  */
615 SVN_DEPRECATED
616 svn_error_t *
617 svn_client_commit_item_create(const svn_client_commit_item3_t **item,
618                               apr_pool_t *pool);
619
620 /**
621  * Return a duplicate of @a item, allocated in @a pool. No part of the
622  * new structure will be shared with @a item, except for the adm_access
623  * member.
624  *
625  * @since New in 1.5.
626  */
627 svn_client_commit_item3_t *
628 svn_client_commit_item3_dup(const svn_client_commit_item3_t *item,
629                             apr_pool_t *pool);
630
631 /**
632  * Return a duplicate of @a item, allocated in @a pool. No part of the new
633  * structure will be shared with @a item.
634  *
635  * @deprecated Provided for backward compatibility with the 1.4 API.
636  */
637 SVN_DEPRECATED
638 svn_client_commit_item2_t *
639 svn_client_commit_item2_dup(const svn_client_commit_item2_t *item,
640                             apr_pool_t *pool);
641
642 /** Callback type used by commit-y operations to get a commit log message
643  * from the caller.
644  *
645  * Set @a *log_msg to the log message for the commit, allocated in @a
646  * pool, or @c NULL if wish to abort the commit process.  Set @a *tmp_file
647  * to the path of any temporary file which might be holding that log
648  * message, or @c NULL if no such file exists (though, if @a *log_msg is
649  * @c NULL, this value is undefined).  The log message MUST be a UTF8
650  * string with LF line separators.
651  *
652  * @a commit_items is a read-only array of #svn_client_commit_item3_t
653  * structures, which may be fully or only partially filled-in,
654  * depending on the type of commit operation.
655  *
656  * @a baton is provided along with the callback for use by the handler.
657  *
658  * All allocations should be performed in @a pool.
659  *
660  * @since New in 1.5.
661  */
662 typedef svn_error_t *(*svn_client_get_commit_log3_t)(
663   const char **log_msg,
664   const char **tmp_file,
665   const apr_array_header_t *commit_items,
666   void *baton,
667   apr_pool_t *pool);
668
669 /** Callback type used by commit-y operations to get a commit log message
670  * from the caller.
671  *
672  * Set @a *log_msg to the log message for the commit, allocated in @a
673  * pool, or @c NULL if wish to abort the commit process.  Set @a *tmp_file
674  * to the path of any temporary file which might be holding that log
675  * message, or @c NULL if no such file exists (though, if @a *log_msg is
676  * @c NULL, this value is undefined).  The log message MUST be a UTF8
677  * string with LF line separators.
678  *
679  * @a commit_items is a read-only array of #svn_client_commit_item2_t
680  * structures, which may be fully or only partially filled-in,
681  * depending on the type of commit operation.
682  *
683  * @a baton is provided along with the callback for use by the handler.
684  *
685  * All allocations should be performed in @a pool.
686  *
687  * @deprecated Provided for backward compatibility with the 1.3 API.
688  */
689 typedef svn_error_t *(*svn_client_get_commit_log2_t)(
690   const char **log_msg,
691   const char **tmp_file,
692   const apr_array_header_t *commit_items,
693   void *baton,
694   apr_pool_t *pool);
695
696 /** Callback type used by commit-y operations to get a commit log message
697  * from the caller.
698  *
699  * Set @a *log_msg to the log message for the commit, allocated in @a
700  * pool, or @c NULL if wish to abort the commit process.  Set @a *tmp_file
701  * to the path of any temporary file which might be holding that log
702  * message, or @c NULL if no such file exists (though, if @a *log_msg is
703  * @c NULL, this value is undefined).  The log message MUST be a UTF8
704  * string with LF line separators.
705  *
706  * @a commit_items is a read-only array of #svn_client_commit_item_t
707  * structures, which may be fully or only partially filled-in,
708  * depending on the type of commit operation.
709  *
710  * @a baton is provided along with the callback for use by the handler.
711  *
712  * All allocations should be performed in @a pool.
713  *
714  * @deprecated Provided for backward compatibility with the 1.2 API.
715  */
716 typedef svn_error_t *(*svn_client_get_commit_log_t)(
717   const char **log_msg,
718   const char **tmp_file,
719   apr_array_header_t *commit_items,
720   void *baton,
721   apr_pool_t *pool);
722
723 /** @} */
724
725 /**
726  * Client blame
727  *
728  * @defgroup clnt_blame Client blame functionality
729  *
730  * @{
731  */
732
733 /** Callback type used by svn_client_blame5() to notify the caller
734  * that line @a line_no of the blamed file was last changed in @a revision
735  * which has the revision properties @a rev_props, and that the contents were
736  * @a line.
737  *
738  * @a start_revnum and @a end_revnum contain the start and end revision
739  * number of the entire blame operation, as determined from the repository
740  * inside svn_client_blame5(). This can be useful for the blame receiver
741  * to format the blame output.
742  *
743  * If svn_client_blame5() was called with @a include_merged_revisions set to
744  * TRUE, @a merged_revision, @a merged_rev_props and @a merged_path will be
745  * set, otherwise they will be NULL. @a merged_path will be set to the
746  * absolute repository path.
747  *
748  * All allocations should be performed in @a pool.
749  *
750  * @note If there is no blame information for this line, @a revision will be
751  * invalid and @a rev_props will be NULL. In this case @a local_change
752  * will be true if the reason there is no blame information is that the line
753  * was modified locally. In all other cases @a local_change will be false.
754  *
755  * @since New in 1.7.
756  */
757 typedef svn_error_t *(*svn_client_blame_receiver3_t)(
758   void *baton,
759   svn_revnum_t start_revnum,
760   svn_revnum_t end_revnum,
761   apr_int64_t line_no,
762   svn_revnum_t revision,
763   apr_hash_t *rev_props,
764   svn_revnum_t merged_revision,
765   apr_hash_t *merged_rev_props,
766   const char *merged_path,
767   const char *line,
768   svn_boolean_t local_change,
769   apr_pool_t *pool);
770
771 /**
772  * Similar to #svn_client_blame_receiver3_t, but with separate author and
773  * date revision properties instead of all revision properties, and without
774  * information about local changes.
775  *
776  * @deprecated Provided for backward compatibility with the 1.6 API.
777  *
778  * @since New in 1.5.
779  */
780 typedef svn_error_t *(*svn_client_blame_receiver2_t)(
781   void *baton,
782   apr_int64_t line_no,
783   svn_revnum_t revision,
784   const char *author,
785   const char *date,
786   svn_revnum_t merged_revision,
787   const char *merged_author,
788   const char *merged_date,
789   const char *merged_path,
790   const char *line,
791   apr_pool_t *pool);
792
793 /**
794  * Similar to #svn_client_blame_receiver2_t, but without @a merged_revision,
795  * @a merged_author, @a merged_date, or @a merged_path members.
796  *
797  * @note New in 1.4 is that the line is defined to contain only the line
798  * content (and no [partial] EOLs; which was undefined in older versions).
799  * Using this callback with svn_client_blame() or svn_client_blame2()
800  * will still give you the old behaviour.
801  *
802  * @deprecated Provided for backward compatibility with the 1.4 API.
803  */
804 typedef svn_error_t *(*svn_client_blame_receiver_t)(
805   void *baton,
806   apr_int64_t line_no,
807   svn_revnum_t revision,
808   const char *author,
809   const char *date,
810   const char *line,
811   apr_pool_t *pool);
812
813
814 /** @} */
815
816 /**
817  * Client diff
818  *
819  * @defgroup clnt_diff Client diff functionality
820  *
821  * @{
822  */
823 /** The difference type in an svn_diff_summarize_t structure.
824  *
825  * @since New in 1.4.
826  */
827 typedef enum svn_client_diff_summarize_kind_t
828 {
829   /** An item with no text modifications */
830   svn_client_diff_summarize_kind_normal,
831
832   /** An added item */
833   svn_client_diff_summarize_kind_added,
834
835   /** An item with text modifications */
836   svn_client_diff_summarize_kind_modified,
837
838   /** A deleted item */
839   svn_client_diff_summarize_kind_deleted
840 } svn_client_diff_summarize_kind_t;
841
842
843 /** A struct that describes the diff of an item. Passed to
844  * #svn_client_diff_summarize_func_t.
845  *
846  * @note Fields may be added to the end of this structure in future
847  * versions.  Therefore, users shouldn't allocate structures of this
848  * type, to preserve binary compatibility.
849  *
850  * @since New in 1.4.
851  */
852 typedef struct svn_client_diff_summarize_t
853 {
854   /** Path relative to the target.  If the target is a file, path is
855    * the empty string. */
856   const char *path;
857
858   /** Change kind */
859   svn_client_diff_summarize_kind_t summarize_kind;
860
861   /** Properties changed?  For consistency with 'svn status' output,
862    * this should be false if summarize_kind is _added or _deleted. */
863   svn_boolean_t prop_changed;
864
865   /** File or dir */
866   svn_node_kind_t node_kind;
867 } svn_client_diff_summarize_t;
868
869 /**
870  * Return a duplicate of @a diff, allocated in @a pool. No part of the new
871  * structure will be shared with @a diff.
872  *
873  * @since New in 1.4.
874  */
875 svn_client_diff_summarize_t *
876 svn_client_diff_summarize_dup(const svn_client_diff_summarize_t *diff,
877                               apr_pool_t *pool);
878
879
880 /** A callback used in svn_client_diff_summarize2() and
881  * svn_client_diff_summarize_peg2() for reporting a @a diff summary.
882  *
883  * All allocations should be performed in @a pool.
884  *
885  * @a baton is a closure object; it should be provided by the implementation,
886  * and passed by the caller.
887  *
888  * @since New in 1.4.
889  */
890 typedef svn_error_t *(*svn_client_diff_summarize_func_t)(
891   const svn_client_diff_summarize_t *diff,
892   void *baton,
893   apr_pool_t *pool);
894
895
896
897 /** @} */
898
899
900 /**
901  * Client context
902  *
903  * @defgroup clnt_ctx Client context management
904  *
905  * @{
906  */
907
908 /** A client context structure, which holds client specific callbacks,
909  * batons, serves as a cache for configuration options, and other various
910  * and sundry things.  In order to avoid backwards compatibility problems
911  * clients should use svn_client_create_context() to allocate and
912  * initialize this structure instead of doing so themselves.
913  */
914 typedef struct svn_client_ctx_t
915 {
916   /** main authentication baton. */
917   svn_auth_baton_t *auth_baton;
918
919   /** notification callback function.
920    * This will be called by notify_func2() by default.
921    * @deprecated Provided for backward compatibility with the 1.1 API.
922    * Use @c notify_func2 instead. */
923   svn_wc_notify_func_t notify_func;
924
925   /** notification callback baton for notify_func()
926    * @deprecated Provided for backward compatibility with the 1.1 API.
927    * Use @c notify_baton2 instead */
928   void *notify_baton;
929
930   /** Log message callback function.  NULL means that Subversion
931     * should try not attempt to fetch a log message.
932     * @deprecated Provided for backward compatibility with the 1.2 API.
933     * Use @c log_msg_func2 instead. */
934   svn_client_get_commit_log_t log_msg_func;
935
936   /** log message callback baton
937     * @deprecated Provided for backward compatibility with the 1.2 API.
938     * Use @c log_msg_baton2 instead. */
939   void *log_msg_baton;
940
941   /** a hash mapping of <tt>const char *</tt> configuration file names to
942    * #svn_config_t *'s. For example, the '~/.subversion/config' file's
943    * contents should have the key "config".  May be left unset (or set to
944    * NULL) to use the built-in default settings and not use any configuration.
945    */
946   apr_hash_t *config;
947
948   /** a callback to be used to see if the client wishes to cancel the running
949    * operation. */
950   svn_cancel_func_t cancel_func;
951
952   /** a baton to pass to the cancellation callback. */
953   void *cancel_baton;
954
955   /** notification function, defaulting to a function that forwards
956    * to notify_func().  If @c NULL, it will not be invoked.
957    * @since New in 1.2. */
958   svn_wc_notify_func2_t notify_func2;
959
960   /** notification baton for notify_func2().
961    * @since New in 1.2. */
962   void *notify_baton2;
963
964   /** Log message callback function. NULL means that Subversion
965    *   should try log_msg_func.
966    * @since New in 1.3. */
967   svn_client_get_commit_log2_t log_msg_func2;
968
969   /** callback baton for log_msg_func2
970    * @since New in 1.3. */
971   void *log_msg_baton2;
972
973   /** Notification callback for network progress information.
974    * May be NULL if not used.
975    * @since New in 1.3. */
976   svn_ra_progress_notify_func_t progress_func;
977
978   /** Callback baton for progress_func.
979    * @since New in 1.3. */
980   void *progress_baton;
981
982   /** Log message callback function. NULL means that Subversion
983    *   should try @c log_msg_func2, then @c log_msg_func.
984    * @since New in 1.5. */
985   svn_client_get_commit_log3_t log_msg_func3;
986
987   /** The callback baton for @c log_msg_func3.
988    * @since New in 1.5. */
989   void *log_msg_baton3;
990
991   /** MIME types map.
992    * @since New in 1.5. */
993   apr_hash_t *mimetypes_map;
994
995   /** Conflict resolution callback and baton, if available.
996    * @since New in 1.5. */
997   svn_wc_conflict_resolver_func_t conflict_func;
998   void *conflict_baton;
999
1000   /** Custom client name string, or @c NULL.
1001    * @since New in 1.5. */
1002   const char *client_name;
1003
1004   /** Conflict resolution callback and baton, if available. NULL means that
1005    * subversion should try @c conflict_func.
1006    * @since New in 1.7. */
1007   svn_wc_conflict_resolver_func2_t conflict_func2;
1008   void *conflict_baton2;
1009
1010   /** A working copy context for the client operation to use.
1011    * This is initialized by svn_client_create_context() and should never
1012    * be @c NULL.
1013    *
1014    * @since New in 1.7.  */
1015   svn_wc_context_t *wc_ctx;
1016
1017 } svn_client_ctx_t;
1018
1019 /** Initialize a client context.
1020  * Set @a *ctx to a client context object, allocated in @a pool, that
1021  * represents a particular instance of an svn client. @a cfg_hash is used
1022  * to initialise the config member of the returned context object and should
1023  * remain valid for the lifetime of the object. @a cfg_hash may be @c NULL,
1024  * in which case it is ignored.
1025  *
1026  * In order to avoid backwards compatibility problems, clients must
1027  * use this function to initialize and allocate the
1028  * #svn_client_ctx_t structure rather than doing so themselves, as
1029  * the size of this structure may change in the future.
1030  *
1031  * The current implementation never returns error, but callers should
1032  * still check for error, for compatibility with future versions.
1033  *
1034  * @since New in 1.8.
1035  */
1036 svn_error_t *
1037 svn_client_create_context2(svn_client_ctx_t **ctx,
1038                            apr_hash_t *cfg_hash,
1039                            apr_pool_t *pool);
1040
1041
1042 /** Similar to svn_client_create_context2 but passes a NULL @a cfg_hash.
1043  *
1044  * @deprecated Provided for backward compatibility with the 1.7 API.
1045  */
1046 SVN_DEPRECATED
1047 svn_error_t *
1048 svn_client_create_context(svn_client_ctx_t **ctx,
1049                           apr_pool_t *pool);
1050
1051 /** @} end group: Client context management */
1052
1053 /**
1054  * @name Authentication information file names
1055  *
1056  * Names of files that contain authentication information.
1057  *
1058  * These filenames are decided by libsvn_client, since this library
1059  * implements all the auth-protocols;  libsvn_wc does nothing but
1060  * blindly store and retrieve these files from protected areas.
1061  *
1062  * @defgroup clnt_auth_filenames Client authentication file names
1063  * @{
1064  */
1065 #define SVN_CLIENT_AUTH_USERNAME            "username"
1066 #define SVN_CLIENT_AUTH_PASSWORD            "password"
1067 /** @} group end: Authentication information file names */
1068
1069 /** Client argument processing
1070  *
1071  * @defgroup clnt_cmdline Client command-line processing
1072  *
1073  * @{
1074  */
1075
1076 /**
1077  * Pull remaining target arguments from @a os into @a *targets_p,
1078  * converting them to UTF-8, followed by targets from @a known_targets
1079  * (which might come from, for example, the "--targets" command line option).
1080  *
1081  * Process each target in one of the following ways.  For a repository-
1082  * relative URL: resolve to a full URL, contacting the repository if
1083  * necessary to do so, and then treat as a full URL.  For a URL: do some
1084  * IRI-to-URI encoding and some auto-escaping, and canonicalize.  For a
1085  * local path: canonicalize case and path separators.
1086  *
1087  * If @a keep_last_origpath_on_truepath_collision is TRUE, and there are
1088  * exactly two targets which both case-canonicalize to the same path, the last
1089  * target will be returned in the original non-case-canonicalized form.
1090  *
1091  * Allocate @a *targets_p and its elements in @a pool.
1092  *
1093  * @a ctx is required for possible repository authentication.
1094  *
1095  * If a path has the same name as a Subversion working copy
1096  * administrative directory, return #SVN_ERR_RESERVED_FILENAME_SPECIFIED;
1097  * if multiple reserved paths are encountered, return a chain of
1098  * errors, all of which are #SVN_ERR_RESERVED_FILENAME_SPECIFIED.  Do
1099  * not return this type of error in a chain with any other type of
1100  * error, and if this is the only type of error encountered, complete
1101  * the operation before returning the error(s).
1102  *
1103  * @since New in 1.7
1104  */
1105 svn_error_t *
1106 svn_client_args_to_target_array2(apr_array_header_t **targets_p,
1107                                  apr_getopt_t *os,
1108                                  const apr_array_header_t *known_targets,
1109                                  svn_client_ctx_t *ctx,
1110                                  svn_boolean_t keep_last_origpath_on_truepath_collision,
1111                                  apr_pool_t *pool);
1112
1113 /**
1114  * Similar to svn_client_args_to_target_array2() but with
1115  * @a keep_last_origpath_on_truepath_collision always set to FALSE.
1116  *
1117  * @deprecated Provided for backward compatibility with the 1.6 API.
1118  */
1119 SVN_DEPRECATED
1120 svn_error_t *
1121 svn_client_args_to_target_array(apr_array_header_t **targets_p,
1122                                 apr_getopt_t *os,
1123                                 const apr_array_header_t *known_targets,
1124                                 svn_client_ctx_t *ctx,
1125                                 apr_pool_t *pool);
1126
1127 /** @} group end: Client command-line processing */
1128
1129 /** @} */
1130 \f
1131 /**
1132  * Client working copy management functions
1133  *
1134  * @defgroup clnt_wc Client working copy management
1135  *
1136  * @{
1137  */
1138
1139 /**
1140  * @defgroup clnt_wc_checkout Checkout
1141  *
1142  * @{
1143  */
1144
1145
1146 /**
1147  * Checkout a working copy from a repository.
1148  *
1149  * @param[out] result_rev   If non-NULL, the value of the revision checked
1150  *              out from the repository.
1151  * @param[in] URL       The repository URL of the checkout source.
1152  * @param[in] path      The root of the new working copy.
1153  * @param[in] peg_revision  The peg revision.
1154  * @param[in] revision  The operative revision.
1155  * @param[in] depth     The depth of the operation.  If #svn_depth_unknown,
1156  *              then behave as if for #svn_depth_infinity, except in the case
1157  *              of resuming a previous checkout of @a path (i.e., updating),
1158  *              in which case use the depth of the existing working copy.
1159  * @param[in] ignore_externals  If @c TRUE, don't process externals
1160  *              definitions as part of this operation.
1161  * @param[in] allow_unver_obstructions  If @c TRUE, then tolerate existing
1162  *              unversioned items that obstruct incoming paths.  Only
1163  *              obstructions of the same type (file or dir) as the added
1164  *              item are tolerated.  The text of obstructing files is left
1165  *              as-is, effectively treating it as a user modification after
1166  *              the checkout.  Working properties of obstructing items are
1167  *              set equal to the base properties. <br>
1168  *              If @c FALSE, then abort if there are any unversioned
1169  *              obstructing items.
1170  * @param[in] ctx   The standard client context, used for authentication and
1171  *              notification.
1172  * @param[in] pool  Used for any temporary allocation.
1173  *
1174  * @return A pointer to an #svn_error_t of the type (this list is not
1175  *         exhaustive): <br>
1176  *         #SVN_ERR_UNSUPPORTED_FEATURE if @a URL refers to a file rather
1177  *         than a directory; <br>
1178  *         #SVN_ERR_RA_ILLEGAL_URL if @a URL does not exist; <br>
1179  *         #SVN_ERR_CLIENT_BAD_REVISION if @a revision is not one of
1180  *         #svn_opt_revision_number, #svn_opt_revision_head, or
1181  *         #svn_opt_revision_date. <br>
1182  *         If no error occurred, return #SVN_NO_ERROR.
1183  *
1184  * @since New in 1.5.
1185  *
1186  * @see #svn_depth_t <br> #svn_client_ctx_t <br> @ref clnt_revisions for
1187  *      a discussion of operative and peg revisions.
1188  */
1189 svn_error_t *
1190 svn_client_checkout3(svn_revnum_t *result_rev,
1191                      const char *URL,
1192                      const char *path,
1193                      const svn_opt_revision_t *peg_revision,
1194                      const svn_opt_revision_t *revision,
1195                      svn_depth_t depth,
1196                      svn_boolean_t ignore_externals,
1197                      svn_boolean_t allow_unver_obstructions,
1198                      svn_client_ctx_t *ctx,
1199                      apr_pool_t *pool);
1200
1201
1202 /**
1203  * Similar to svn_client_checkout3() but with @a allow_unver_obstructions
1204  * always set to FALSE, and @a depth set according to @a recurse: if
1205  * @a recurse is TRUE, @a depth is #svn_depth_infinity, if @a recurse
1206  * is FALSE, @a depth is #svn_depth_files.
1207  *
1208  * @deprecated Provided for backward compatibility with the 1.4 API.
1209  */
1210 SVN_DEPRECATED
1211 svn_error_t *
1212 svn_client_checkout2(svn_revnum_t *result_rev,
1213                      const char *URL,
1214                      const char *path,
1215                      const svn_opt_revision_t *peg_revision,
1216                      const svn_opt_revision_t *revision,
1217                      svn_boolean_t recurse,
1218                      svn_boolean_t ignore_externals,
1219                      svn_client_ctx_t *ctx,
1220                      apr_pool_t *pool);
1221
1222
1223 /**
1224  * Similar to svn_client_checkout2(), but with @a peg_revision
1225  * always set to #svn_opt_revision_unspecified and
1226  * @a ignore_externals always set to FALSE.
1227  *
1228  * @deprecated Provided for backward compatibility with the 1.1 API.
1229  */
1230 SVN_DEPRECATED
1231 svn_error_t *
1232 svn_client_checkout(svn_revnum_t *result_rev,
1233                     const char *URL,
1234                     const char *path,
1235                     const svn_opt_revision_t *revision,
1236                     svn_boolean_t recurse,
1237                     svn_client_ctx_t *ctx,
1238                     apr_pool_t *pool);
1239 /** @} */
1240
1241 /**
1242  * @defgroup Update Bring a working copy up-to-date with a repository
1243  *
1244  * @{
1245  *
1246  */
1247
1248 /**
1249  * Update working trees @a paths to @a revision, authenticating with the
1250  * authentication baton cached in @a ctx.  @a paths is an array of const
1251  * char * paths to be updated.  Unversioned paths that are direct children
1252  * of a versioned path will cause an update that attempts to add that path;
1253  * other unversioned paths are skipped.  If @a result_revs is not NULL,
1254  * @a *result_revs will be set to an array of svn_revnum_t with each
1255  * element set to the revision to which @a revision was resolved for the
1256  * corresponding element of @a paths.
1257  *
1258  * @a revision must be of kind #svn_opt_revision_number,
1259  * #svn_opt_revision_head, or #svn_opt_revision_date.  If @a
1260  * revision does not meet these requirements, return the error
1261  * #SVN_ERR_CLIENT_BAD_REVISION.
1262  *
1263  * The paths in @a paths can be from multiple working copies from multiple
1264  * repositories, but even if they all come from the same repository there
1265  * is no guarantee that revision represented by #svn_opt_revision_head
1266  * will remain the same as each path is updated.
1267  *
1268  * If @a ignore_externals is set, don't process externals definitions
1269  * as part of this operation.
1270  *
1271  * If @a depth is #svn_depth_infinity, update fully recursively.
1272  * Else if it is #svn_depth_immediates or #svn_depth_files, update
1273  * each target and its file entries, but not its subdirectories.  Else
1274  * if #svn_depth_empty, update exactly each target, nonrecursively
1275  * (essentially, update the target's properties).
1276  *
1277  * If @a depth is #svn_depth_unknown, take the working depth from
1278  * @a paths and then behave as described above.
1279  *
1280  * If @a depth_is_sticky is set and @a depth is not
1281  * #svn_depth_unknown, then in addition to updating PATHS, also set
1282  * their sticky ambient depth value to @a depth.
1283  *
1284  * If @a allow_unver_obstructions is TRUE then the update tolerates
1285  * existing unversioned items that obstruct added paths.  Only
1286  * obstructions of the same type (file or dir) as the added item are
1287  * tolerated.  The text of obstructing files is left as-is, effectively
1288  * treating it as a user modification after the update.  Working
1289  * properties of obstructing items are set equal to the base properties.
1290  * If @a allow_unver_obstructions is FALSE then the update will abort
1291  * if there are any unversioned obstructing items.
1292  *
1293  * If @a adds_as_modification is TRUE, a local addition at the same path
1294  * as an incoming addition of the same node kind results in a normal node
1295  * with a possible local modification, instead of a tree conflict.
1296  *
1297  * If @a make_parents is TRUE, create any non-existent parent
1298  * directories also by checking them out at depth=empty.
1299  *
1300  * If @a ctx->notify_func2 is non-NULL, invoke @a ctx->notify_func2 with
1301  * @a ctx->notify_baton2 for each item handled by the update, and also for
1302  * files restored from text-base.  If @a ctx->cancel_func is non-NULL, invoke
1303  * it passing @a ctx->cancel_baton at various places during the update.
1304  *
1305  * Use @a pool for any temporary allocation.
1306  *
1307  *  @todo  Multiple Targets
1308  *  - Up for debate:  an update on multiple targets is *not* atomic.
1309  *  Right now, svn_client_update only takes one path.  What's
1310  *  debatable is whether this should ever change.  On the one hand,
1311  *  it's kind of losing to have the client application loop over
1312  *  targets and call svn_client_update() on each one;  each call to
1313  *  update initializes a whole new repository session (network
1314  *  overhead, etc.)  On the other hand, it's a very simple
1315  *  implementation, and allows for the possibility that different
1316  *  targets may come from different repositories.
1317  *
1318  * @since New in 1.7.
1319  */
1320 svn_error_t *
1321 svn_client_update4(apr_array_header_t **result_revs,
1322                    const apr_array_header_t *paths,
1323                    const svn_opt_revision_t *revision,
1324                    svn_depth_t depth,
1325                    svn_boolean_t depth_is_sticky,
1326                    svn_boolean_t ignore_externals,
1327                    svn_boolean_t allow_unver_obstructions,
1328                    svn_boolean_t adds_as_modification,
1329                    svn_boolean_t make_parents,
1330                    svn_client_ctx_t *ctx,
1331                    apr_pool_t *pool);
1332
1333 /**
1334  * Similar to svn_client_update4() but with @a make_parents always set
1335  * to FALSE and @a adds_as_modification set to TRUE.
1336  *
1337  * @deprecated Provided for backward compatibility with the 1.6 API.
1338  * @since New in 1.5.
1339  */
1340 SVN_DEPRECATED
1341 svn_error_t *
1342 svn_client_update3(apr_array_header_t **result_revs,
1343                    const apr_array_header_t *paths,
1344                    const svn_opt_revision_t *revision,
1345                    svn_depth_t depth,
1346                    svn_boolean_t depth_is_sticky,
1347                    svn_boolean_t ignore_externals,
1348                    svn_boolean_t allow_unver_obstructions,
1349                    svn_client_ctx_t *ctx,
1350                    apr_pool_t *pool);
1351
1352 /**
1353  * Similar to svn_client_update3() but with @a allow_unver_obstructions
1354  * always set to FALSE, @a depth_is_sticky to FALSE, and @a depth set
1355  * according to @a recurse: if @a recurse is TRUE, set @a depth to
1356  * #svn_depth_infinity, if @a recurse is FALSE, set @a depth to
1357  * #svn_depth_files.
1358  *
1359  * @deprecated Provided for backward compatibility with the 1.4 API.
1360  */
1361 SVN_DEPRECATED
1362 svn_error_t *
1363 svn_client_update2(apr_array_header_t **result_revs,
1364                    const apr_array_header_t *paths,
1365                    const svn_opt_revision_t *revision,
1366                    svn_boolean_t recurse,
1367                    svn_boolean_t ignore_externals,
1368                    svn_client_ctx_t *ctx,
1369                    apr_pool_t *pool);
1370
1371 /**
1372  * Similar to svn_client_update2() except that it accepts only a single
1373  * target in @a path, returns a single revision if @a result_rev is
1374  * not NULL, and @a ignore_externals is always set to FALSE.
1375  *
1376  * @deprecated Provided for backward compatibility with the 1.1 API.
1377  */
1378 SVN_DEPRECATED
1379 svn_error_t *
1380 svn_client_update(svn_revnum_t *result_rev,
1381                   const char *path,
1382                   const svn_opt_revision_t *revision,
1383                   svn_boolean_t recurse,
1384                   svn_client_ctx_t *ctx,
1385                   apr_pool_t *pool);
1386 /** @} */
1387
1388 /**
1389  * @defgroup Switch Switch a working copy to another location.
1390  *
1391  * @{
1392  */
1393
1394 /**
1395  * Switch an existing working copy directory to a different repository
1396  * location.
1397  *
1398  * This is normally used to switch a working copy directory over to another
1399  * line of development, such as a branch or a tag.  Switching an existing
1400  * working copy directory is more efficient than checking out @a url from
1401  * scratch.
1402  *
1403  * @param[out] result_rev   If non-NULL, the value of the revision to which
1404  *                          the working copy was actually switched.
1405  * @param[in] path      The directory to be switched.  This need not be the
1406  *              root of a working copy.
1407  * @param[in] url       The repository URL to switch to.
1408  * @param[in] peg_revision  The peg revision.
1409  * @param[in] revision  The operative revision.
1410  * @param[in] depth     The depth of the operation.  If #svn_depth_infinity,
1411  *                      switch fully recursively.  Else if #svn_depth_immediates,
1412  *                      switch @a path and its file children (if any), and
1413  *                      switch subdirectories but do not update them.  Else if
1414  *                      #svn_depth_files, switch just file children, ignoring
1415  *                      subdirectories completely.  Else if #svn_depth_empty,
1416  *                      switch just @a path and touch nothing underneath it.
1417  * @param[in] depth_is_sticky   If @c TRUE, and @a depth is not
1418  *              #svn_depth_unknown, then in addition to switching @a path, also
1419  *              set its sticky ambient depth value to @a depth.
1420  * @param[in] ignore_externals  If @c TRUE, don't process externals
1421  *              definitions as part of this operation.
1422  * @param[in] allow_unver_obstructions  If @c TRUE, then tolerate existing
1423  *              unversioned items that obstruct incoming paths.  Only
1424  *              obstructions of the same type (file or dir) as the added
1425  *              item are tolerated.  The text of obstructing files is left
1426  *              as-is, effectively treating it as a user modification after
1427  *              the checkout.  Working properties of obstructing items are
1428  *              set equal to the base properties. <br>
1429  *              If @c FALSE, then abort if there are any unversioned
1430  *              obstructing items.
1431  * @param[in] ignore_ancestry  If @c FALSE, then verify that the file
1432  *              or directory at @a path shares some common version control
1433  *              ancestry with the switch URL location (represented by the
1434  *              combination of @a url, @a peg_revision, and @a revision),
1435  *              and returning #SVN_ERR_CLIENT_UNRELATED_RESOURCES if they
1436  *              do not. If @c TRUE, no such sanity checks are performed.
1437  *
1438  * @param[in] ctx   The standard client context, used for authentication and
1439  *              notification.  The notifier is invoked for paths affected by
1440  *              the switch, and also for files which may be restored from the
1441  *              pristine store after being previously removed from the working
1442  *              copy.
1443  * @param[in] pool  Used for any temporary allocation.
1444  *
1445  * @return A pointer to an #svn_error_t of the type (this list is not
1446  *         exhaustive): <br>
1447  *         #SVN_ERR_CLIENT_BAD_REVISION if @a revision is not one of
1448  *         #svn_opt_revision_number, #svn_opt_revision_head, or
1449  *         #svn_opt_revision_date. <br>
1450  *         If no error occurred, return #SVN_NO_ERROR.
1451  *
1452  * @since New in 1.7.
1453  *
1454  * @see #svn_depth_t <br> #svn_client_ctx_t <br> @ref clnt_revisions for
1455  *      a discussion of operative and peg revisions.
1456  */
1457 svn_error_t *
1458 svn_client_switch3(svn_revnum_t *result_rev,
1459                    const char *path,
1460                    const char *url,
1461                    const svn_opt_revision_t *peg_revision,
1462                    const svn_opt_revision_t *revision,
1463                    svn_depth_t depth,
1464                    svn_boolean_t depth_is_sticky,
1465                    svn_boolean_t ignore_externals,
1466                    svn_boolean_t allow_unver_obstructions,
1467                    svn_boolean_t ignore_ancestry,
1468                    svn_client_ctx_t *ctx,
1469                    apr_pool_t *pool);
1470
1471
1472 /**
1473  * Similar to svn_client_switch3() but with @a ignore_ancestry always
1474  * set to TRUE.
1475  *
1476  * @since New in 1.5.
1477  * @deprecated Provided for backward compatibility with the 1.4 API.
1478  */
1479 SVN_DEPRECATED
1480 svn_error_t *
1481 svn_client_switch2(svn_revnum_t *result_rev,
1482                    const char *path,
1483                    const char *url,
1484                    const svn_opt_revision_t *peg_revision,
1485                    const svn_opt_revision_t *revision,
1486                    svn_depth_t depth,
1487                    svn_boolean_t depth_is_sticky,
1488                    svn_boolean_t ignore_externals,
1489                    svn_boolean_t allow_unver_obstructions,
1490                    svn_client_ctx_t *ctx,
1491                    apr_pool_t *pool);
1492
1493
1494 /**
1495  * Similar to svn_client_switch2() but with @a allow_unver_obstructions,
1496  * @a ignore_externals, and @a depth_is_sticky always set to FALSE,
1497  * and @a depth set according to @a recurse: if @a recurse is TRUE,
1498  * set @a depth to #svn_depth_infinity, if @a recurse is FALSE, set
1499  * @a depth to #svn_depth_files.
1500  *
1501  * @deprecated Provided for backward compatibility with the 1.4 API.
1502  */
1503 SVN_DEPRECATED
1504 svn_error_t *
1505 svn_client_switch(svn_revnum_t *result_rev,
1506                   const char *path,
1507                   const char *url,
1508                   const svn_opt_revision_t *revision,
1509                   svn_boolean_t recurse,
1510                   svn_client_ctx_t *ctx,
1511                   apr_pool_t *pool);
1512
1513 /** @} */
1514
1515 /**
1516  * @defgroup Add Begin versioning files/directories in a working copy.
1517  *
1518  * @{
1519  */
1520
1521 /**
1522  * Schedule a working copy @a path for addition to the repository.
1523  *
1524  * If @a depth is #svn_depth_empty, add just @a path and nothing
1525  * below it.  If #svn_depth_files, add @a path and any file
1526  * children of @a path.  If #svn_depth_immediates, add @a path, any
1527  * file children, and any immediate subdirectories (but nothing
1528  * underneath those subdirectories).  If #svn_depth_infinity, add
1529  * @a path and everything under it fully recursively.
1530  *
1531  * @a path's parent must be under revision control already (unless
1532  * @a add_parents is TRUE), but @a path is not.
1533  *
1534  * If @a force is not set and @a path is already under version
1535  * control, return the error #SVN_ERR_ENTRY_EXISTS.  If @a force is
1536  * set, do not error on already-versioned items.  When used on a
1537  * directory in conjunction with a @a depth value greater than
1538  * #svn_depth_empty, this has the effect of scheduling for addition
1539  * any unversioned files and directories scattered within even a
1540  * versioned tree (up to @a depth).
1541  *
1542  * If @a ctx->notify_func2 is non-NULL, then for each added item, call
1543  * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the
1544  * added item.
1545  *
1546  * If @a no_ignore is FALSE, don't add any file or directory (or recurse
1547  * into any directory) that is unversioned and found by recursion (as
1548  * opposed to being the explicit target @a path) and whose name matches the
1549  * svn:ignore property on its parent directory or the global-ignores list in
1550  * @a ctx->config. If @a no_ignore is TRUE, do include such files and
1551  * directories. (Note that an svn:ignore property can influence this
1552  * behaviour only when recursing into an already versioned directory with @a
1553  * force.)
1554  *
1555  * If @a no_autoprops is TRUE, don't set any autoprops on added files. If
1556  * @a no_autoprops is FALSE then all added files have autprops set as per
1557  * the auto-props list in @a ctx->config and the value of any
1558  * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by the nearest
1559  * parents of @a path which are already under version control.
1560  *
1561  * If @a add_parents is TRUE, recurse up @a path's directory and look for
1562  * a versioned directory.  If found, add all intermediate paths between it
1563  * and @a path.  If not found, return #SVN_ERR_CLIENT_NO_VERSIONED_PARENT.
1564  *
1565  * @a scratch_pool is used for temporary allocations only.
1566  *
1567  * @par Important:
1568  * This is a *scheduling* operation.  No changes will
1569  * happen to the repository until a commit occurs.  This scheduling
1570  * can be removed with svn_client_revert2().
1571  *
1572  * @since New in 1.8.
1573  */
1574 svn_error_t *
1575 svn_client_add5(const char *path,
1576                 svn_depth_t depth,
1577                 svn_boolean_t force,
1578                 svn_boolean_t no_ignore,
1579                 svn_boolean_t no_autoprops,
1580                 svn_boolean_t add_parents,
1581                 svn_client_ctx_t *ctx,
1582                 apr_pool_t *scratch_pool);
1583
1584 /**
1585  * Similar to svn_client_add5(), but with @a no_autoprops always set to
1586  * FALSE.
1587  *
1588  * @deprecated Provided for backward compatibility with the 1.7 API.
1589  */
1590 SVN_DEPRECATED
1591 svn_error_t *
1592 svn_client_add4(const char *path,
1593                 svn_depth_t depth,
1594                 svn_boolean_t force,
1595                 svn_boolean_t no_ignore,
1596                 svn_boolean_t add_parents,
1597                 svn_client_ctx_t *ctx,
1598                 apr_pool_t *pool);
1599
1600 /**
1601  * Similar to svn_client_add4(), but with @a add_parents always set to
1602  * FALSE and @a depth set according to @a recursive: if TRUE, then
1603  * @a depth is #svn_depth_infinity, if FALSE, then #svn_depth_empty.
1604  *
1605  * @deprecated Provided for backward compatibility with the 1.4 API.
1606  */
1607 SVN_DEPRECATED
1608 svn_error_t *
1609 svn_client_add3(const char *path,
1610                 svn_boolean_t recursive,
1611                 svn_boolean_t force,
1612                 svn_boolean_t no_ignore,
1613                 svn_client_ctx_t *ctx,
1614                 apr_pool_t *pool);
1615
1616 /**
1617  * Similar to svn_client_add3(), but with @a no_ignore always set to
1618  * FALSE.
1619  *
1620  * @deprecated Provided for backward compatibility with the 1.2 API.
1621  */
1622 SVN_DEPRECATED
1623 svn_error_t *
1624 svn_client_add2(const char *path,
1625                 svn_boolean_t recursive,
1626                 svn_boolean_t force,
1627                 svn_client_ctx_t *ctx,
1628                 apr_pool_t *pool);
1629
1630 /**
1631  * Similar to svn_client_add2(), but with @a force always set to FALSE.
1632  *
1633  * @deprecated Provided for backward compatibility with the 1.0 API.
1634  */
1635 SVN_DEPRECATED
1636 svn_error_t *
1637 svn_client_add(const char *path,
1638                svn_boolean_t recursive,
1639                svn_client_ctx_t *ctx,
1640                apr_pool_t *pool);
1641
1642 /** @} */
1643
1644 /**
1645  * @defgroup Mkdir Create directories in a working copy or repository.
1646  *
1647  * @{
1648  */
1649
1650 /** Create a directory, either in a repository or a working copy.
1651  *
1652  * @a paths is an array of (const char *) paths, either all local WC paths
1653  * or all URLs.
1654  *
1655  * If @a paths contains URLs, use the authentication baton in @a ctx
1656  * and @a message to immediately attempt to commit the creation of the
1657  * directories in @a paths in the repository.
1658  *
1659  * Else, create the directories on disk, and attempt to schedule them
1660  * for addition (using svn_client_add(), whose docstring you should
1661  * read).
1662  *
1663  * If @a make_parents is TRUE, create any non-existent parent directories
1664  * also.
1665  *
1666  * If non-NULL, @a revprop_table is a hash table holding additional,
1667  * custom revision properties (<tt>const char *</tt> names mapped to
1668  * <tt>svn_string_t *</tt> values) to be set on the new revision in
1669  * the event that this is a committing operation.  This table cannot
1670  * contain any standard Subversion properties.
1671  *
1672  * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton
1673  * combo that this function can use to query for a commit log message
1674  * when one is needed.
1675  *
1676  * If @a ctx->notify_func2 is non-NULL, when the directory has been created
1677  * (successfully) in the working copy, call @a ctx->notify_func2 with
1678  * @a ctx->notify_baton2 and the path of the new directory.  Note that this is
1679  * only called for items added to the working copy.
1680  *
1681  * If @a commit_callback is non-NULL, then for each successful commit, call
1682  * @a commit_callback with @a commit_baton and a #svn_commit_info_t for
1683  * the commit.
1684  *
1685  * @since New in 1.7.
1686  */
1687 svn_error_t *
1688 svn_client_mkdir4(const apr_array_header_t *paths,
1689                   svn_boolean_t make_parents,
1690                   const apr_hash_t *revprop_table,
1691                   svn_commit_callback2_t commit_callback,
1692                   void *commit_baton,
1693                   svn_client_ctx_t *ctx,
1694                   apr_pool_t *pool);
1695
1696 /**
1697  * Similar to svn_client_mkdir4(), but returns the commit info in
1698  * @a *commit_info_p rather than through a callback function.
1699  *
1700  * @since New in 1.5.
1701  * @deprecated Provided for backward compatibility with the 1.6 API.
1702  */
1703 SVN_DEPRECATED
1704 svn_error_t *
1705 svn_client_mkdir3(svn_commit_info_t **commit_info_p,
1706                   const apr_array_header_t *paths,
1707                   svn_boolean_t make_parents,
1708                   const apr_hash_t *revprop_table,
1709                   svn_client_ctx_t *ctx,
1710                   apr_pool_t *pool);
1711
1712
1713 /**
1714  * Same as svn_client_mkdir3(), but with @a make_parents always FALSE,
1715  * and @a revprop_table always NULL.
1716  *
1717  * @since New in 1.3.
1718  * @deprecated Provided for backward compatibility with the 1.4 API.
1719  */
1720 SVN_DEPRECATED
1721 svn_error_t *
1722 svn_client_mkdir2(svn_commit_info_t **commit_info_p,
1723                   const apr_array_header_t *paths,
1724                   svn_client_ctx_t *ctx,
1725                   apr_pool_t *pool);
1726
1727 /**
1728  * Same as svn_client_mkdir2(), but takes the #svn_client_commit_info_t
1729  * type for @a commit_info_p.
1730  *
1731  * @deprecated Provided for backward compatibility with the 1.2 API.
1732  */
1733 SVN_DEPRECATED
1734 svn_error_t *
1735 svn_client_mkdir(svn_client_commit_info_t **commit_info_p,
1736                  const apr_array_header_t *paths,
1737                  svn_client_ctx_t *ctx,
1738                  apr_pool_t *pool);
1739
1740 /** @} */
1741
1742 /**
1743  * @defgroup Delete Remove files/directories from a working copy or repository.
1744  *
1745  * @{
1746  */
1747
1748 /** Delete items from a repository or working copy.
1749  *
1750  * @a paths is an array of (const char *) paths, either all local WC paths
1751  * or all URLs.
1752  *
1753  * If the paths in @a paths are URLs, use the authentication baton in
1754  * @a ctx and @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to
1755  * immediately attempt to commit a deletion of the URLs from the
1756  * repository.  Every path must belong to the same repository.
1757  *
1758  * Else, schedule the working copy paths in @a paths for removal from
1759  * the repository.  Each path's parent must be under revision control.
1760  * This is just a *scheduling* operation.  No changes will happen to
1761  * the repository until a commit occurs.  This scheduling can be
1762  * removed with svn_client_revert2(). If a path is a file it is
1763  * immediately removed from the working copy. If the path is a
1764  * directory it will remain in the working copy but all the files, and
1765  * all unversioned items, it contains will be removed. If @a force is
1766  * not set then this operation will fail if any path contains locally
1767  * modified and/or unversioned items. If @a force is set such items
1768  * will be deleted.
1769  *
1770  * If the paths are working copy paths and @a keep_local is TRUE then
1771  * the paths will not be removed from the working copy, only scheduled
1772  * for removal from the repository.  Once the scheduled deletion is
1773  * committed, they will appear as unversioned paths in the working copy.
1774  *
1775  * If non-NULL, @a revprop_table is a hash table holding additional,
1776  * custom revision properties (<tt>const char *</tt> names mapped to
1777  * <tt>svn_string_t *</tt> values) to be set on the new revision in
1778  * the event that this is a committing operation.  This table cannot
1779  * contain any standard Subversion properties.
1780  *
1781  * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton
1782  * combo that this function can use to query for a commit log message
1783  * when one is needed.
1784  *
1785  * If @a ctx->notify_func2 is non-NULL, then for each item deleted, call
1786  * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the deleted
1787  * item.
1788  *
1789  * If @a commit_callback is non-NULL, then for each successful commit, call
1790  * @a commit_callback with @a commit_baton and a #svn_commit_info_t for
1791  * the commit.
1792  *
1793  * @since New in 1.7.
1794  */
1795 svn_error_t *
1796 svn_client_delete4(const apr_array_header_t *paths,
1797                    svn_boolean_t force,
1798                    svn_boolean_t keep_local,
1799                    const apr_hash_t *revprop_table,
1800                    svn_commit_callback2_t commit_callback,
1801                    void *commit_baton,
1802                    svn_client_ctx_t *ctx,
1803                    apr_pool_t *pool);
1804
1805 /**
1806  * Similar to svn_client_delete4(), but returns the commit info in
1807  * @a *commit_info_p rather than through a callback function.
1808  *
1809  * @since New in 1.5.
1810  * @deprecated Provided for backward compatibility with the 1.6 API.
1811  */
1812 SVN_DEPRECATED
1813 svn_error_t *
1814 svn_client_delete3(svn_commit_info_t **commit_info_p,
1815                    const apr_array_header_t *paths,
1816                    svn_boolean_t force,
1817                    svn_boolean_t keep_local,
1818                    const apr_hash_t *revprop_table,
1819                    svn_client_ctx_t *ctx,
1820                    apr_pool_t *pool);
1821
1822 /**
1823  * Similar to svn_client_delete3(), but with @a keep_local always set
1824  * to FALSE, and @a revprop_table passed as NULL.
1825  *
1826  * @deprecated Provided for backward compatibility with the 1.4 API.
1827  */
1828 SVN_DEPRECATED
1829 svn_error_t *
1830 svn_client_delete2(svn_commit_info_t **commit_info_p,
1831                    const apr_array_header_t *paths,
1832                    svn_boolean_t force,
1833                    svn_client_ctx_t *ctx,
1834                    apr_pool_t *pool);
1835
1836 /**
1837  * Similar to svn_client_delete2(), but takes the #svn_client_commit_info_t
1838  * type for @a commit_info_p.
1839  *
1840  * @deprecated Provided for backward compatibility with the 1.2 API.
1841  */
1842 SVN_DEPRECATED
1843 svn_error_t *
1844 svn_client_delete(svn_client_commit_info_t **commit_info_p,
1845                   const apr_array_header_t *paths,
1846                   svn_boolean_t force,
1847                   svn_client_ctx_t *ctx,
1848                   apr_pool_t *pool);
1849
1850
1851 /** @} */
1852
1853 /**
1854  * @defgroup Import Import files into the repository.
1855  *
1856  * @{
1857  */
1858
1859 /**
1860  * The callback invoked by svn_client_import5() before adding a node to the
1861  * list of nodes to be imported.
1862  *
1863  * @a baton is the value passed to @a svn_client_import5 as filter_baton.
1864  *
1865  * The callback receives the @a local_abspath for each node and the @a dirent
1866  * for it when walking the directory tree. Only the kind of node, including
1867  * special status is available in @a dirent.
1868  *
1869  * Implementations can set @a *filtered to TRUE, to make the import
1870  * process omit the node and (if the node is a directory) all its
1871  * descendants.
1872  *
1873  * @a scratch_pool can be used for temporary allocations.
1874  *
1875  * @since New in 1.8.
1876  */
1877 typedef svn_error_t *(*svn_client_import_filter_func_t)(
1878   void *baton,
1879   svn_boolean_t *filtered,
1880   const char *local_abspath,
1881   const svn_io_dirent2_t *dirent,
1882   apr_pool_t *scratch_pool);
1883
1884 /** Import file or directory @a path into repository directory @a url at
1885  * head, authenticating with the authentication baton cached in @a ctx,
1886  * and using @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to get a log message
1887  * for the (implied) commit.  If some components of @a url do not exist
1888  * then create parent directories as necessary.
1889  *
1890  * This function reads an unversioned tree from disk and skips any ".svn"
1891  * directories. Even if a file or directory being imported is part of an
1892  * existing WC, this function sees it as unversioned and does not notice any
1893  * existing Subversion properties in it.
1894  *
1895  * If @a path is a directory, the contents of that directory are
1896  * imported directly into the directory identified by @a url.  Note that the
1897  * directory @a path itself is not imported -- that is, the basename of
1898  * @a path is not part of the import.
1899  *
1900  * If @a path is a file, then the dirname of @a url is the directory
1901  * receiving the import.  The basename of @a url is the filename in the
1902  * repository.  In this case if @a url already exists, return error.
1903  *
1904  * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with
1905  * @a ctx->notify_baton2 as the import progresses, with any of the following
1906  * actions: #svn_wc_notify_commit_added,
1907  * #svn_wc_notify_commit_postfix_txdelta.
1908  *
1909  * Use @a scratch_pool for any temporary allocation.
1910  *
1911  * If non-NULL, @a revprop_table is a hash table holding additional,
1912  * custom revision properties (<tt>const char *</tt> names mapped to
1913  * <tt>svn_string_t *</tt> values) to be set on the new revision.
1914  * This table cannot contain any standard Subversion properties.
1915  *
1916  * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton
1917  * combo that this function can use to query for a commit log message
1918  * when one is needed.
1919  *
1920  * If @a depth is #svn_depth_empty, import just @a path and nothing
1921  * below it.  If #svn_depth_files, import @a path and any file
1922  * children of @a path.  If #svn_depth_immediates, import @a path, any
1923  * file children, and any immediate subdirectories (but nothing
1924  * underneath those subdirectories).  If #svn_depth_infinity, import
1925  * @a path and everything under it fully recursively.
1926  *
1927  * If @a no_ignore is @c FALSE, don't import any file or directory (or
1928  * recurse into any directory) that is found by recursion (as opposed to
1929  * being the explicit target @a path) and whose name matches the
1930  * global-ignores list in @a ctx->config. If @a no_ignore is @c TRUE, do
1931  * include such files and directories. (Note that svn:ignore properties are
1932  * not involved, as auto-props cannot set properties on directories and even
1933  * if the target is part of a WC the import ignores any existing
1934  * properties.)
1935  *
1936  * If @a no_autoprops is TRUE, don't set any autoprops on imported files. If
1937  * @a no_autoprops is FALSE then all imported files have autprops set as per
1938  * the auto-props list in @a ctx->config and the value of any
1939  * @c SVN_PROP_INHERITABLE_AUTO_PROPS properties inherited by and explicitly set
1940  * on @a url if @a url is already under versioned control, or the nearest parents
1941  * of @a path which are already under version control if not.
1942  *
1943  * If @a ignore_unknown_node_types is @c FALSE, ignore files of which the
1944  * node type is unknown, such as device files and pipes.
1945  *
1946  * If @a filter_callback is non-NULL, call it for each node that isn't ignored
1947  * for other reasons with @a filter_baton, to allow third party to ignore
1948  * specific nodes during importing.
1949  *
1950  * If @a commit_callback is non-NULL, then for each successful commit, call
1951  * @a commit_callback with @a commit_baton and a #svn_commit_info_t for
1952  * the commit.
1953  *
1954  * @since New in 1.8.
1955  */
1956 svn_error_t *
1957 svn_client_import5(const char *path,
1958                    const char *url,
1959                    svn_depth_t depth,
1960                    svn_boolean_t no_ignore,
1961                    svn_boolean_t no_autoprops,
1962                    svn_boolean_t ignore_unknown_node_types,
1963                    const apr_hash_t *revprop_table,
1964                    svn_client_import_filter_func_t filter_callback,
1965                    void *filter_baton,
1966                    svn_commit_callback2_t commit_callback,
1967                    void *commit_baton,
1968                    svn_client_ctx_t *ctx,
1969                    apr_pool_t *scratch_pool);
1970
1971 /**
1972  * Similar to svn_client_import5(), but without support for an optional
1973  * @a filter_callback and @a no_autoprops always set to FALSE.
1974  *
1975  * @since New in 1.7.
1976  * @deprecated Provided for backward compatibility with the 1.7 API.
1977  */
1978 SVN_DEPRECATED
1979 svn_error_t *
1980 svn_client_import4(const char *path,
1981                    const char *url,
1982                    svn_depth_t depth,
1983                    svn_boolean_t no_ignore,
1984                    svn_boolean_t ignore_unknown_node_types,
1985                    const apr_hash_t *revprop_table,
1986                    svn_commit_callback2_t commit_callback,
1987                    void *commit_baton,
1988                    svn_client_ctx_t *ctx,
1989                    apr_pool_t *pool);
1990
1991 /**
1992  * Similar to svn_client_import4(), but returns the commit info in
1993  * @a *commit_info_p rather than through a callback function.
1994  *
1995  * @since New in 1.5.
1996  * @deprecated Provided for backward compatibility with the 1.6 API.
1997  */
1998 SVN_DEPRECATED
1999 svn_error_t *
2000 svn_client_import3(svn_commit_info_t **commit_info_p,
2001                    const char *path,
2002                    const char *url,
2003                    svn_depth_t depth,
2004                    svn_boolean_t no_ignore,
2005                    svn_boolean_t ignore_unknown_node_types,
2006                    const apr_hash_t *revprop_table,
2007                    svn_client_ctx_t *ctx,
2008                    apr_pool_t *pool);
2009
2010 /**
2011  * Similar to svn_client_import3(), but with @a ignore_unknown_node_types
2012  * always set to @c FALSE, @a revprop_table passed as NULL, and @a
2013  * depth set according to @a nonrecursive: if TRUE, then @a depth is
2014  * #svn_depth_files, else #svn_depth_infinity.
2015  *
2016  * @since New in 1.3.
2017  *
2018  * @deprecated Provided for backward compatibility with the 1.4 API
2019  */
2020 SVN_DEPRECATED
2021 svn_error_t *
2022 svn_client_import2(svn_commit_info_t **commit_info_p,
2023                    const char *path,
2024                    const char *url,
2025                    svn_boolean_t nonrecursive,
2026                    svn_boolean_t no_ignore,
2027                    svn_client_ctx_t *ctx,
2028                    apr_pool_t *pool);
2029
2030 /**
2031  * Similar to svn_client_import2(), but with @a no_ignore always set
2032  * to FALSE and using the #svn_client_commit_info_t type for
2033  * @a commit_info_p.
2034  *
2035  * @deprecated Provided for backward compatibility with the 1.2 API.
2036  */
2037 SVN_DEPRECATED
2038 svn_error_t *
2039 svn_client_import(svn_client_commit_info_t **commit_info_p,
2040                   const char *path,
2041                   const char *url,
2042                   svn_boolean_t nonrecursive,
2043                   svn_client_ctx_t *ctx,
2044                   apr_pool_t *pool);
2045
2046 /** @} */
2047
2048 /**
2049  * @defgroup Commit Commit local modifications to the repository.
2050  *
2051  * @{
2052  */
2053
2054 /**
2055  * Commit files or directories into repository, authenticating with
2056  * the authentication baton cached in @a ctx, and using
2057  * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to obtain the log message.
2058  * Set @a *commit_info_p to the results of the commit, allocated in @a pool.
2059  *
2060  * @a targets is an array of <tt>const char *</tt> paths to commit.  They
2061  * need not be canonicalized nor condensed; this function will take care of
2062  * that.  If @a targets has zero elements, then do nothing and return
2063  * immediately without error.
2064  *
2065  * If non-NULL, @a revprop_table is a hash table holding additional,
2066  * custom revision properties (<tt>const char *</tt> names mapped to
2067  * <tt>svn_string_t *</tt> values) to be set on the new revision.
2068  * This table cannot contain any standard Subversion properties.
2069  *
2070  * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with
2071  * @a ctx->notify_baton2 as the commit progresses, with any of the following
2072  * actions: #svn_wc_notify_commit_modified, #svn_wc_notify_commit_added,
2073  * #svn_wc_notify_commit_deleted, #svn_wc_notify_commit_replaced,
2074  * #svn_wc_notify_commit_copied, #svn_wc_notify_commit_copied_replaced,
2075  * #svn_wc_notify_commit_postfix_txdelta.
2076  *
2077  * If @a depth is #svn_depth_infinity, commit all changes to and
2078  * below named targets.  If @a depth is #svn_depth_empty, commit
2079  * only named targets (that is, only property changes on named
2080  * directory targets, and property and content changes for named file
2081  * targets).  If @a depth is #svn_depth_files, behave as above for
2082  * named file targets, and for named directory targets, commit
2083  * property changes on a named directory and all changes to files
2084  * directly inside that directory.  If #svn_depth_immediates, behave
2085  * as for #svn_depth_files, and for subdirectories of any named
2086  * directory target commit as though for #svn_depth_empty.
2087  *
2088  * Unlock paths in the repository, unless @a keep_locks is TRUE.
2089  *
2090  * @a changelists is an array of <tt>const char *</tt> changelist
2091  * names, used as a restrictive filter on items that are committed;
2092  * that is, don't commit anything unless it's a member of one of those
2093  * changelists.  After the commit completes successfully, remove
2094  * changelist associations from the targets, unless @a
2095  * keep_changelists is set.  If @a changelists is
2096  * empty (or altogether @c NULL), no changelist filtering occurs.
2097  *
2098  * If @a commit_as_operations is set to FALSE, when a copy is committed
2099  * all changes below the copy are always committed at the same time
2100  * (independent of the value of @a depth). If @a commit_as_operations is
2101  * #TRUE, changes to descendants are only committed if they are itself
2102  * included via @a depth and targets.
2103  *
2104  * If @a include_file_externals and/or @a include_dir_externals are #TRUE,
2105  * also commit all file and/or dir externals (respectively) that are reached
2106  * by recursion, except for those externals which:
2107  *     - have a fixed revision, or
2108  *     - come from a different repository root URL (dir externals).
2109  * These flags affect only recursion; externals that directly appear in @a
2110  * targets are always included in the commit.
2111  *
2112  * ### TODO: currently, file externals hidden inside an unversioned dir are
2113  *     skipped deliberately, because we can't commit those yet.
2114  *     See STMT_SELECT_COMMITTABLE_EXTERNALS_BELOW.
2115  *
2116  * ### TODO: With @c depth_immediates, this function acts as if
2117  *     @a include_dir_externals was passed #FALSE, but caller expects
2118  *     immediate child dir externals to be included @c depth_empty.
2119  *
2120  * When @a commit_as_operations is #TRUE it is possible to delete a node and
2121  * all its descendants by selecting just the root of the deletion. If it is
2122  * set to #FALSE this will raise an error.
2123  *
2124  * If @a commit_callback is non-NULL, then for each successful commit, call
2125  * @a commit_callback with @a commit_baton and a #svn_commit_info_t for
2126  * the commit.
2127  *
2128  * @note #svn_depth_unknown and #svn_depth_exclude must not be passed
2129  * for @a depth.
2130  *
2131  * Use @a pool for any temporary allocations.
2132  *
2133  * @since New in 1.8.
2134  */
2135 svn_error_t *
2136 svn_client_commit6(const apr_array_header_t *targets,
2137                    svn_depth_t depth,
2138                    svn_boolean_t keep_locks,
2139                    svn_boolean_t keep_changelists,
2140                    svn_boolean_t commit_as_operations,
2141                    svn_boolean_t include_file_externals,
2142                    svn_boolean_t include_dir_externals,
2143                    const apr_array_header_t *changelists,
2144                    const apr_hash_t *revprop_table,
2145                    svn_commit_callback2_t commit_callback,
2146                    void *commit_baton,
2147                    svn_client_ctx_t *ctx,
2148                    apr_pool_t *pool);
2149
2150 /**
2151  * Similar to svn_client_commit6(), but passes @a include_file_externals as
2152  * FALSE and @a include_dir_externals as FALSE.
2153  *
2154  * @since New in 1.7.
2155  * @deprecated Provided for backward compatibility with the 1.7 API.
2156  */
2157 SVN_DEPRECATED
2158 svn_error_t *
2159 svn_client_commit5(const apr_array_header_t *targets,
2160                    svn_depth_t depth,
2161                    svn_boolean_t keep_locks,
2162                    svn_boolean_t keep_changelists,
2163                    svn_boolean_t commit_as_operations,
2164                    const apr_array_header_t *changelists,
2165                    const apr_hash_t *revprop_table,
2166                    svn_commit_callback2_t commit_callback,
2167                    void *commit_baton,
2168                    svn_client_ctx_t *ctx,
2169                    apr_pool_t *pool);
2170
2171 /**
2172  * Similar to svn_client_commit5(), but returns the commit info in
2173  * @a *commit_info_p rather than through a callback function.  Does not use
2174  * #svn_wc_notify_commit_copied or #svn_wc_notify_commit_copied_replaced
2175  * (preferring #svn_wc_notify_commit_added and
2176  * #svn_wc_notify_commit_replaced, respectively, instead).
2177  *
2178  * Also, if no error is returned and @a (*commit_info_p)->revision is set to
2179  * #SVN_INVALID_REVNUM, then the commit was a no-op; nothing needed to
2180  * be committed.
2181  *
2182  * Sets @a commit_as_operations to FALSE to match Subversion 1.6's behavior.
2183  *
2184  * @since New in 1.5.
2185  * @deprecated Provided for backward compatibility with the 1.6 API.
2186  */
2187 SVN_DEPRECATED
2188 svn_error_t *
2189 svn_client_commit4(svn_commit_info_t **commit_info_p,
2190                    const apr_array_header_t *targets,
2191                    svn_depth_t depth,
2192                    svn_boolean_t keep_locks,
2193                    svn_boolean_t keep_changelists,
2194                    const apr_array_header_t *changelists,
2195                    const apr_hash_t *revprop_table,
2196                    svn_client_ctx_t *ctx,
2197                    apr_pool_t *pool);
2198
2199 /**
2200  * Similar to svn_client_commit4(), but always with NULL for
2201  * @a changelist_name, FALSE for @a keep_changelist, NULL for @a
2202  * revprop_table, and @a depth set according to @a recurse: if @a
2203  * recurse is TRUE, use #svn_depth_infinity, else #svn_depth_empty.
2204  *
2205  * @deprecated Provided for backward compatibility with the 1.4 API.
2206  *
2207  * @since New in 1.3.
2208  */
2209 SVN_DEPRECATED
2210 svn_error_t *
2211 svn_client_commit3(svn_commit_info_t **commit_info_p,
2212                    const apr_array_header_t *targets,
2213                    svn_boolean_t recurse,
2214                    svn_boolean_t keep_locks,
2215                    svn_client_ctx_t *ctx,
2216                    apr_pool_t *pool);
2217
2218 /**
2219  * Similar to svn_client_commit3(), but uses #svn_client_commit_info_t
2220  * for @a commit_info_p.
2221  *
2222  * @deprecated Provided for backward compatibility with the 1.2 API.
2223  *
2224  * @since New in 1.2.
2225  */
2226 SVN_DEPRECATED
2227 svn_error_t *
2228 svn_client_commit2(svn_client_commit_info_t **commit_info_p,
2229                    const apr_array_header_t *targets,
2230                    svn_boolean_t recurse,
2231                    svn_boolean_t keep_locks,
2232                    svn_client_ctx_t *ctx,
2233                    apr_pool_t *pool);
2234
2235 /**
2236  * Similar to svn_client_commit2(), but with @a keep_locks set to
2237  * TRUE and @a nonrecursive instead of @a recurse.
2238  *
2239  * @deprecated Provided for backward compatibility with the 1.1 API.
2240  */
2241 SVN_DEPRECATED
2242 svn_error_t *
2243 svn_client_commit(svn_client_commit_info_t **commit_info_p,
2244                   const apr_array_header_t *targets,
2245                   svn_boolean_t nonrecursive,
2246                   svn_client_ctx_t *ctx,
2247                   apr_pool_t *pool);
2248
2249 /** @} */
2250
2251 /**
2252  * @defgroup Status Report interesting information about paths in the \
2253  *                  working copy.
2254  *
2255  * @{
2256  */
2257
2258 /**
2259  * Structure for holding the "status" of a working copy item.
2260  *
2261  * @note Fields may be added to the end of this structure in future
2262  * versions.  Therefore, to preserve binary compatibility, users
2263  * should not directly allocate structures of this type.
2264  *
2265  * @since New in 1.7.
2266  */
2267 typedef struct svn_client_status_t
2268 {
2269   /** The kind of node as recorded in the working copy */
2270   svn_node_kind_t kind;
2271
2272   /** The absolute path to the node */
2273   const char *local_abspath;
2274
2275   /** The actual size of the working file on disk, or SVN_INVALID_FILESIZE
2276    * if unknown (or if the item isn't a file at all). */
2277   svn_filesize_t filesize;
2278
2279   /** If the path is under version control, versioned is TRUE, otherwise
2280    * FALSE. */
2281   svn_boolean_t versioned;
2282
2283   /** Set to TRUE if the node is the victim of some kind of conflict. */
2284   svn_boolean_t conflicted;
2285
2286   /** The status of the node, based on the restructuring changes and if the
2287    * node has no restructuring changes the text and prop status. */
2288   enum svn_wc_status_kind node_status;
2289
2290   /** The status of the text of the node, not including restructuring changes.
2291    * Valid values are: svn_wc_status_none, svn_wc_status_normal,
2292    * svn_wc_status_modified and svn_wc_status_conflicted. */
2293   enum svn_wc_status_kind text_status;
2294
2295   /** The status of the node's properties.
2296    * Valid values are: svn_wc_status_none, svn_wc_status_normal,
2297    * svn_wc_status_modified and svn_wc_status_conflicted. */
2298   enum svn_wc_status_kind prop_status;
2299
2300   /** A node can be 'locked' if a working copy update is in progress or
2301    * was interrupted. */
2302   svn_boolean_t wc_is_locked;
2303
2304   /** A file or directory can be 'copied' if it's scheduled for
2305    * addition-with-history (or part of a subtree that is scheduled as such.).
2306    */
2307   svn_boolean_t copied;
2308
2309   /** The URL of the repository root. */
2310   const char *repos_root_url;
2311
2312   /** The UUID of the repository */
2313   const char *repos_uuid;
2314
2315   /** The in-repository path relative to the repository root. */
2316   const char *repos_relpath;
2317
2318   /** Base revision. */
2319   svn_revnum_t revision;
2320
2321   /** Last revision this was changed */
2322   svn_revnum_t changed_rev;
2323
2324   /** Date of last commit. */
2325   apr_time_t changed_date;
2326
2327   /** Last commit author of this item */
2328   const char *changed_author;
2329
2330   /** A file or directory can be 'switched' if the switch command has been
2331    * used.  If this is TRUE, then file_external will be FALSE.
2332    */
2333   svn_boolean_t switched;
2334
2335   /** If the item is a file that was added to the working copy with an
2336    * svn:externals; if file_external is TRUE, then switched is always
2337    * FALSE.
2338    */
2339   svn_boolean_t file_external;
2340
2341   /** The locally present lock. (Values of path, token, owner, comment and
2342    * are available if a lock is present) */
2343   const svn_lock_t *lock;
2344
2345   /** Which changelist this item is part of, or NULL if not part of any. */
2346   const char *changelist;
2347
2348   /** The depth of the node as recorded in the working copy
2349    * (#svn_depth_unknown for files or when no depth is recorded) */
2350   svn_depth_t depth;
2351
2352   /**
2353    * @defgroup svn_wc_status_ood WC out-of-date info from the repository
2354    * @{
2355    *
2356    * When the working copy item is out-of-date compared to the
2357    * repository, the following fields represent the state of the
2358    * youngest revision of the item in the repository.  If the working
2359    * copy is not out of date, the fields are initialized as described
2360    * below.
2361    */
2362
2363   /** Set to the node kind of the youngest commit, or #svn_node_none
2364    * if not out of date. */
2365   svn_node_kind_t ood_kind;
2366
2367   /** The status of the node, based on the text status if the node has no
2368    * restructuring changes */
2369   enum svn_wc_status_kind repos_node_status;
2370
2371   /** The node's text status in the repository. */
2372   enum svn_wc_status_kind repos_text_status;
2373
2374   /** The node's property status in the repository. */
2375   enum svn_wc_status_kind repos_prop_status;
2376
2377   /** The node's lock in the repository, if any. */
2378   const svn_lock_t *repos_lock;
2379
2380   /** Set to the youngest committed revision, or #SVN_INVALID_REVNUM
2381    * if not out of date. */
2382   svn_revnum_t ood_changed_rev;
2383
2384   /** Set to the most recent commit date, or @c 0 if not out of date. */
2385   apr_time_t ood_changed_date;
2386
2387   /** Set to the user name of the youngest commit, or @c NULL if not
2388    * out of date or non-existent.  Because a non-existent @c
2389    * svn:author property has the same behavior as an out-of-date
2390    * working copy, examine @c ood_changed_rev to determine whether
2391    * the working copy is out of date. */
2392   const char *ood_changed_author;
2393
2394   /** @} */
2395
2396   /** Reserved for libsvn_client's internal use; this value is only to be used
2397    * for libsvn_client backwards compatibility wrappers. This value may be NULL
2398    * or to other data in future versions. */
2399   const void *backwards_compatibility_baton;
2400
2401   /** Set to the local absolute path that this node was moved from, if this
2402    * file or directory has been moved here locally and is the root of that
2403    * move. Otherwise set to NULL.
2404    *
2405    * This will be NULL for moved-here nodes that are just part of a subtree
2406    * that was moved along (and are not themselves a root of a different move
2407    * operation).
2408    *
2409    * @since New in 1.8. */
2410   const char *moved_from_abspath;
2411
2412   /** Set to the local absolute path that this node was moved to, if this file
2413    * or directory has been moved away locally and corresponds to the root
2414    * of the destination side of the move. Otherwise set to NULL.
2415    *
2416    * Note: Saying just "root" here could be misleading. For example:
2417    *   svn mv A AA;
2418    *   svn mv AA/B BB;
2419    * creates a situation where A/B is moved-to BB, but one could argue that
2420    * the move source's root actually was AA/B. Note that, as far as the
2421    * working copy is concerned, above case is exactly identical to:
2422    *   svn mv A/B BB;
2423    *   svn mv A AA;
2424    * In both situations, @a moved_to_abspath would be set for nodes A (moved
2425    * to AA) and A/B (moved to BB), only.
2426    *
2427    * This will be NULL for moved-away nodes that were just part of a subtree
2428    * that was moved along (and are not themselves a root of a different move
2429    * operation).
2430    *
2431    * @since New in 1.8. */
2432   const char *moved_to_abspath;
2433
2434   /* NOTE! Please update svn_client_status_dup() when adding new fields here. */
2435 } svn_client_status_t;
2436
2437 /**
2438  * Return a duplicate of @a status, allocated in @a result_pool. No part of the new
2439  * structure will be shared with @a status.
2440  *
2441  * @since New in 1.7.
2442  */
2443 svn_client_status_t *
2444 svn_client_status_dup(const svn_client_status_t *status,
2445                       apr_pool_t *result_pool);
2446
2447 /**
2448  * A callback for reporting a @a status about @a path (which may be an
2449  * absolute or relative path).
2450  *
2451  * @a baton is a closure object; it should be provided by the
2452  * implementation, and passed by the caller.
2453  *
2454  * @a scratch_pool will be cleared between invocations to the callback.
2455  *
2456  * @since New in 1.7.
2457  */
2458 typedef svn_error_t *(*svn_client_status_func_t)(
2459                                             void *baton,
2460                                             const char *path,
2461                                             const svn_client_status_t *status,
2462                                             apr_pool_t *scratch_pool);
2463
2464 /**
2465  * Given @a path to a working copy directory (or single file), call
2466  * @a status_func/status_baton with a set of #svn_wc_status_t *
2467  * structures which describe the status of @a path, and its children
2468  * (recursing according to @a depth).
2469  *
2470  *    - If @a get_all is set, retrieve all entries; otherwise,
2471  *      retrieve only "interesting" entries (local mods and/or
2472  *      out of date).
2473  *
2474  *    - If @a update is set, contact the repository and augment the
2475  *      status structures with information about out-of-dateness (with
2476  *      respect to @a revision).  Also, if @a result_rev is not @c NULL,
2477  *      set @a *result_rev to the actual revision against which the
2478  *      working copy was compared (@a *result_rev is not meaningful unless
2479  *      @a update is set).
2480  *
2481  * If @a no_ignore is @c FALSE, don't report any file or directory (or
2482  * recurse into any directory) that is found by recursion (as opposed to
2483  * being the explicit target @a path) and whose name matches the
2484  * svn:ignore property on its parent directory or the global-ignores
2485  * list in @a ctx->config. If @a no_ignore is @c TRUE, report each such
2486  * file or directory with the status code #svn_wc_status_ignored.
2487  *
2488  * If @a ignore_externals is not set, then recurse into externals
2489  * definitions (if any exist) after handling the main target.  This
2490  * calls the client notification function (in @a ctx) with the
2491  * #svn_wc_notify_status_external action before handling each externals
2492  * definition, and with #svn_wc_notify_status_completed
2493  * after each.
2494  *
2495  * If @a depth_as_sticky is set and @a depth is not
2496  * #svn_depth_unknown, then the status is calculated as if depth_is_sticky
2497  * was passed to an equivalent update command.
2498  *
2499  * @a changelists is an array of <tt>const char *</tt> changelist
2500  * names, used as a restrictive filter on items whose statuses are
2501  * reported; that is, don't report status about any item unless
2502  * it's a member of one of those changelists.  If @a changelists is
2503  * empty (or altogether @c NULL), no changelist filtering occurs.
2504  *
2505  * If @a path is an absolute path then the @c path parameter passed in each
2506  * call to @a status_func will be an absolute path.
2507  *
2508  * All temporary allocations are performed in @a scratch_pool.
2509  *
2510  * @since New in 1.7.
2511  */
2512 svn_error_t *
2513 svn_client_status5(svn_revnum_t *result_rev,
2514                    svn_client_ctx_t *ctx,
2515                    const char *path,
2516                    const svn_opt_revision_t *revision,
2517                    svn_depth_t depth,
2518                    svn_boolean_t get_all,
2519                    svn_boolean_t update,
2520                    svn_boolean_t no_ignore,
2521                    svn_boolean_t ignore_externals,
2522                    svn_boolean_t depth_as_sticky,
2523                    const apr_array_header_t *changelists,
2524                    svn_client_status_func_t status_func,
2525                    void *status_baton,
2526                    apr_pool_t *scratch_pool);
2527
2528 /**
2529  * Same as svn_client_status5(), but using #svn_wc_status_func3_t
2530  * instead of #svn_client_status_func_t and depth_as_sticky set to TRUE.
2531  *
2532  * @since New in 1.6.
2533  * @deprecated Provided for backward compatibility with the 1.6 API.
2534  */
2535 SVN_DEPRECATED
2536 svn_error_t *
2537 svn_client_status4(svn_revnum_t *result_rev,
2538                    const char *path,
2539                    const svn_opt_revision_t *revision,
2540                    svn_wc_status_func3_t status_func,
2541                    void *status_baton,
2542                    svn_depth_t depth,
2543                    svn_boolean_t get_all,
2544                    svn_boolean_t update,
2545                    svn_boolean_t no_ignore,
2546                    svn_boolean_t ignore_externals,
2547                    const apr_array_header_t *changelists,
2548                    svn_client_ctx_t *ctx,
2549                    apr_pool_t *pool);
2550
2551 /**
2552  * Same as svn_client_status4(), but using an #svn_wc_status_func2_t
2553  * instead of an #svn_wc_status_func3_t.
2554  *
2555  * @since New in 1.5.
2556  * @deprecated Provided for backward compatibility with the 1.5 API.
2557  */
2558 SVN_DEPRECATED
2559 svn_error_t *
2560 svn_client_status3(svn_revnum_t *result_rev,
2561                    const char *path,
2562                    const svn_opt_revision_t *revision,
2563                    svn_wc_status_func2_t status_func,
2564                    void *status_baton,
2565                    svn_depth_t depth,
2566                    svn_boolean_t get_all,
2567                    svn_boolean_t update,
2568                    svn_boolean_t no_ignore,
2569                    svn_boolean_t ignore_externals,
2570                    const apr_array_header_t *changelists,
2571                    svn_client_ctx_t *ctx,
2572                    apr_pool_t *pool);
2573
2574 /**
2575  * Like svn_client_status3(), except with @a changelists passed as @c
2576  * NULL, and with @a recurse instead of @a depth.  If @a recurse is
2577  * TRUE, behave as if for #svn_depth_infinity; else if @a recurse is
2578  * FALSE, behave as if for #svn_depth_immediates.
2579  *
2580  * @since New in 1.2.
2581  * @deprecated Provided for backward compatibility with the 1.4 API.
2582  */
2583 SVN_DEPRECATED
2584 svn_error_t *
2585 svn_client_status2(svn_revnum_t *result_rev,
2586                    const char *path,
2587                    const svn_opt_revision_t *revision,
2588                    svn_wc_status_func2_t status_func,
2589                    void *status_baton,
2590                    svn_boolean_t recurse,
2591                    svn_boolean_t get_all,
2592                    svn_boolean_t update,
2593                    svn_boolean_t no_ignore,
2594                    svn_boolean_t ignore_externals,
2595                    svn_client_ctx_t *ctx,
2596                    apr_pool_t *pool);
2597
2598
2599 /**
2600  * Similar to svn_client_status2(), but with @a ignore_externals
2601  * always set to FALSE, taking the #svn_wc_status_func_t type
2602  * instead of the #svn_wc_status_func2_t type for @a status_func,
2603  * and requiring @a *revision to be non-const even though it is
2604  * treated as constant.
2605  *
2606  * @deprecated Provided for backward compatibility with the 1.1 API.
2607  */
2608 SVN_DEPRECATED
2609 svn_error_t *
2610 svn_client_status(svn_revnum_t *result_rev,
2611                   const char *path,
2612                   svn_opt_revision_t *revision,
2613                   svn_wc_status_func_t status_func,
2614                   void *status_baton,
2615                   svn_boolean_t recurse,
2616                   svn_boolean_t get_all,
2617                   svn_boolean_t update,
2618                   svn_boolean_t no_ignore,
2619                   svn_client_ctx_t *ctx,
2620                   apr_pool_t *pool);
2621
2622 /** @} */
2623
2624 /**
2625  * @defgroup Log View information about previous revisions of an object.
2626  *
2627  * @{
2628  */
2629
2630 /**
2631  * Invoke @a receiver with @a receiver_baton on each log message from
2632  * each (#svn_opt_revision_range_t *) range in @a revision_ranges in turn,
2633  * inclusive (but never invoke @a receiver on a given log message more
2634  * than once).
2635  *
2636  * @a targets contains either a URL followed by zero or more relative
2637  * paths, or 1 working copy path, as <tt>const char *</tt>, for which log
2638  * messages are desired.  @a receiver is invoked only on messages whose
2639  * revisions involved a change to some path in @a targets.  @a peg_revision
2640  * indicates in which revision @a targets are valid.  If @a peg_revision is
2641  * #svn_opt_revision_unspecified, it defaults to #svn_opt_revision_head
2642  * for URLs or #svn_opt_revision_working for WC paths.
2643  *
2644  * If @a limit is non-zero only invoke @a receiver on the first @a limit
2645  * logs.
2646  *
2647  * If @a discover_changed_paths is set, then the @c changed_paths and @c
2648  * changed_paths2 fields in the @c log_entry argument to @a receiver will be
2649  * populated on each invocation.  @note The @c text_modified and @c
2650  * props_modified fields of the changed paths structure may have the value
2651  * #svn_tristate_unknown if the repository does not report that information.
2652  *
2653  * If @a strict_node_history is set, copy history (if any exists) will
2654  * not be traversed while harvesting revision logs for each target.
2655  *
2656  * If @a include_merged_revisions is set, log information for revisions
2657  * which have been merged to @a targets will also be returned.
2658  *
2659  * If @a revprops is NULL, retrieve all revision properties; else, retrieve
2660  * only the revision properties named by the (const char *) array elements
2661  * (i.e. retrieve none if the array is empty).
2662  *
2663  * Use @a pool for any temporary allocation.
2664  *
2665  * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2/baton2
2666  * with a 'skip' signal on any unversioned targets.
2667  *
2668  * @since New in 1.6.
2669  */
2670 svn_error_t *
2671 svn_client_log5(const apr_array_header_t *targets,
2672                 const svn_opt_revision_t *peg_revision,
2673                 const apr_array_header_t *revision_ranges,
2674                 int limit,
2675                 svn_boolean_t discover_changed_paths,
2676                 svn_boolean_t strict_node_history,
2677                 svn_boolean_t include_merged_revisions,
2678                 const apr_array_header_t *revprops,
2679                 svn_log_entry_receiver_t receiver,
2680                 void *receiver_baton,
2681                 svn_client_ctx_t *ctx,
2682                 apr_pool_t *pool);
2683
2684 /**
2685  * Similar to svn_client_log5(), but takes explicit start and end parameters
2686  * instead of an array of revision ranges.
2687  *
2688  * @deprecated Provided for compatibility with the 1.5 API.
2689  * @since New in 1.5.
2690  */
2691 SVN_DEPRECATED
2692 svn_error_t *
2693 svn_client_log4(const apr_array_header_t *targets,
2694                 const svn_opt_revision_t *peg_revision,
2695                 const svn_opt_revision_t *start,
2696                 const svn_opt_revision_t *end,
2697                 int limit,
2698                 svn_boolean_t discover_changed_paths,
2699                 svn_boolean_t strict_node_history,
2700                 svn_boolean_t include_merged_revisions,
2701                 const apr_array_header_t *revprops,
2702                 svn_log_entry_receiver_t receiver,
2703                 void *receiver_baton,
2704                 svn_client_ctx_t *ctx,
2705                 apr_pool_t *pool);
2706
2707 /**
2708  * Similar to svn_client_log4(), but using #svn_log_message_receiver_t
2709  * instead of #svn_log_entry_receiver_t.  Also, @a
2710  * include_merged_revisions is set to @c FALSE and @a revprops is
2711  * svn:author, svn:date, and svn:log.
2712  *
2713  * @deprecated Provided for compatibility with the 1.4 API.
2714  * @since New in 1.4.
2715  */
2716 SVN_DEPRECATED
2717 svn_error_t *
2718 svn_client_log3(const apr_array_header_t *targets,
2719                 const svn_opt_revision_t *peg_revision,
2720                 const svn_opt_revision_t *start,
2721                 const svn_opt_revision_t *end,
2722                 int limit,
2723                 svn_boolean_t discover_changed_paths,
2724                 svn_boolean_t strict_node_history,
2725                 svn_log_message_receiver_t receiver,
2726                 void *receiver_baton,
2727                 svn_client_ctx_t *ctx,
2728                 apr_pool_t *pool);
2729
2730
2731 /**
2732  * Similar to svn_client_log3(), but with the @c kind field of
2733  * @a peg_revision set to #svn_opt_revision_unspecified.
2734  *
2735  * @par Important:
2736  * A special case for the revision range HEAD:1, which was present
2737  * in svn_client_log(), has been removed from svn_client_log2().  Instead, it
2738  * is expected that callers will specify the range HEAD:0, to avoid a
2739  * #SVN_ERR_FS_NO_SUCH_REVISION error when invoked against an empty repository
2740  * (i.e. one not containing a revision 1).
2741  *
2742  * @deprecated Provided for compatibility with the 1.3 API.
2743  * @since New in 1.2.
2744  */
2745 SVN_DEPRECATED
2746 svn_error_t *
2747 svn_client_log2(const apr_array_header_t *targets,
2748                 const svn_opt_revision_t *start,
2749                 const svn_opt_revision_t *end,
2750                 int limit,
2751                 svn_boolean_t discover_changed_paths,
2752                 svn_boolean_t strict_node_history,
2753                 svn_log_message_receiver_t receiver,
2754                 void *receiver_baton,
2755                 svn_client_ctx_t *ctx,
2756                 apr_pool_t *pool);
2757
2758
2759 /**
2760  * Similar to svn_client_log2(), but with @a limit set to 0, and the
2761  * following special case:
2762  *
2763  * Special case for repositories at revision 0:
2764  *
2765  * If @a start->kind is #svn_opt_revision_head, and @a end->kind is
2766  * #svn_opt_revision_number && @a end->number is @c 1, then handle an
2767  * empty (no revisions) repository specially: instead of erroring
2768  * because requested revision 1 when the highest revision is 0, just
2769  * invoke @a receiver on revision 0, passing @c NULL for changed paths and
2770  * empty strings for the author and date.  This is because that
2771  * particular combination of @a start and @a end usually indicates the
2772  * common case of log invocation -- the user wants to see all log
2773  * messages from youngest to oldest, where the oldest commit is
2774  * revision 1.  That works fine, except when there are no commits in
2775  * the repository, hence this special case.
2776  *
2777  * @deprecated Provided for backward compatibility with the 1.1 API.
2778  */
2779 SVN_DEPRECATED
2780 svn_error_t *
2781 svn_client_log(const apr_array_header_t *targets,
2782                const svn_opt_revision_t *start,
2783                const svn_opt_revision_t *end,
2784                svn_boolean_t discover_changed_paths,
2785                svn_boolean_t strict_node_history,
2786                svn_log_message_receiver_t receiver,
2787                void *receiver_baton,
2788                svn_client_ctx_t *ctx,
2789                apr_pool_t *pool);
2790
2791 /** @} */
2792
2793 /**
2794  * @defgroup Blame Show modification information about lines in a file.
2795  *
2796  * @{
2797  */
2798
2799 /**
2800  * Invoke @a receiver with @a receiver_baton on each line-blame item
2801  * associated with revision @a end of @a path_or_url, using @a start
2802  * as the default source of all blame.  @a peg_revision indicates in
2803  * which revision @a path_or_url is valid.  If @a peg_revision->kind
2804  * is #svn_opt_revision_unspecified, then it defaults to
2805  * #svn_opt_revision_head for URLs or #svn_opt_revision_working for
2806  * WC targets.
2807  *
2808  * If @a start->kind or @a end->kind is #svn_opt_revision_unspecified,
2809  * return the error #SVN_ERR_CLIENT_BAD_REVISION.  If either are
2810  * #svn_opt_revision_working, return the error
2811  * #SVN_ERR_UNSUPPORTED_FEATURE.  If any of the revisions of @a
2812  * path_or_url have a binary mime-type, return the error
2813  * #SVN_ERR_CLIENT_IS_BINARY_FILE, unless @a ignore_mime_type is TRUE,
2814  * in which case blame information will be generated regardless of the
2815  * MIME types of the revisions.
2816  *
2817  * Use @a diff_options to determine how to compare different revisions of the
2818  * target.
2819  *
2820  * If @a include_merged_revisions is TRUE, also return data based upon
2821  * revisions which have been merged to @a path_or_url.
2822  *
2823  * Use @a pool for any temporary allocation.
2824  *
2825  * @since New in 1.7.
2826  */
2827 svn_error_t *
2828 svn_client_blame5(const char *path_or_url,
2829                   const svn_opt_revision_t *peg_revision,
2830                   const svn_opt_revision_t *start,
2831                   const svn_opt_revision_t *end,
2832                   const svn_diff_file_options_t *diff_options,
2833                   svn_boolean_t ignore_mime_type,
2834                   svn_boolean_t include_merged_revisions,
2835                   svn_client_blame_receiver3_t receiver,
2836                   void *receiver_baton,
2837                   svn_client_ctx_t *ctx,
2838                   apr_pool_t *pool);
2839
2840
2841 /**
2842  * Similar to svn_client_blame5(), but with #svn_client_blame_receiver3_t
2843  * as the receiver.
2844  *
2845  * @deprecated Provided for backwards compatibility with the 1.6 API.
2846  *
2847  * @since New in 1.5.
2848  */
2849 SVN_DEPRECATED
2850 svn_error_t *
2851 svn_client_blame4(const char *path_or_url,
2852                   const svn_opt_revision_t *peg_revision,
2853                   const svn_opt_revision_t *start,
2854                   const svn_opt_revision_t *end,
2855                   const svn_diff_file_options_t *diff_options,
2856                   svn_boolean_t ignore_mime_type,
2857                   svn_boolean_t include_merged_revisions,
2858                   svn_client_blame_receiver2_t receiver,
2859                   void *receiver_baton,
2860                   svn_client_ctx_t *ctx,
2861                   apr_pool_t *pool);
2862
2863 /**
2864  * Similar to svn_client_blame4(), but with @a include_merged_revisions set
2865  * to FALSE, and using a #svn_client_blame_receiver2_t as the receiver.
2866  *
2867  * @deprecated Provided for backwards compatibility with the 1.4 API.
2868  *
2869  * @since New in 1.4.
2870  */
2871 SVN_DEPRECATED
2872 svn_error_t *
2873 svn_client_blame3(const char *path_or_url,
2874                   const svn_opt_revision_t *peg_revision,
2875                   const svn_opt_revision_t *start,
2876                   const svn_opt_revision_t *end,
2877                   const svn_diff_file_options_t *diff_options,
2878                   svn_boolean_t ignore_mime_type,
2879                   svn_client_blame_receiver_t receiver,
2880                   void *receiver_baton,
2881                   svn_client_ctx_t *ctx,
2882                   apr_pool_t *pool);
2883
2884 /**
2885  * Similar to svn_client_blame3(), but with @a diff_options set to
2886  * default options as returned by svn_diff_file_options_parse() and
2887  * @a ignore_mime_type set to FALSE.
2888  *
2889  * @deprecated Provided for backwards compatibility with the 1.3 API.
2890  *
2891  * @since New in 1.2.
2892  */
2893 SVN_DEPRECATED
2894 svn_error_t *
2895 svn_client_blame2(const char *path_or_url,
2896                   const svn_opt_revision_t *peg_revision,
2897                   const svn_opt_revision_t *start,
2898                   const svn_opt_revision_t *end,
2899                   svn_client_blame_receiver_t receiver,
2900                   void *receiver_baton,
2901                   svn_client_ctx_t *ctx,
2902                   apr_pool_t *pool);
2903
2904 /**
2905  * Similar to svn_client_blame2() except that @a peg_revision is always
2906  * the same as @a end.
2907  *
2908  * @deprecated Provided for backward compatibility with the 1.1 API.
2909  */
2910 SVN_DEPRECATED
2911 svn_error_t *
2912 svn_client_blame(const char *path_or_url,
2913                  const svn_opt_revision_t *start,
2914                  const svn_opt_revision_t *end,
2915                  svn_client_blame_receiver_t receiver,
2916                  void *receiver_baton,
2917                  svn_client_ctx_t *ctx,
2918                  apr_pool_t *pool);
2919
2920 /** @} */
2921
2922 /**
2923  * @defgroup Diff Generate differences between paths.
2924  *
2925  * @{
2926  */
2927
2928 /**
2929  * Produce diff output which describes the delta between
2930  * @a path_or_url1/@a revision1 and @a path_or_url2/@a revision2.  Print
2931  * the output of the diff to @a outstream, and any errors to @a
2932  * errstream.  @a path_or_url1 and @a path_or_url2 can be either
2933  * working-copy paths or URLs.
2934  *
2935  * If @a relative_to_dir is not @c NULL, the original path and
2936  * modified path will have the @a relative_to_dir stripped from the
2937  * front of the respective paths.  If @a relative_to_dir is @c NULL,
2938  * paths will not be modified.  If @a relative_to_dir is not
2939  * @c NULL but @a relative_to_dir is not a parent path of the target,
2940  * an error is returned. Finally, if @a relative_to_dir is a URL, an
2941  * error will be returned.
2942  *
2943  * If either @a revision1 or @a revision2 has an `unspecified' or
2944  * unrecognized `kind', return #SVN_ERR_CLIENT_BAD_REVISION.
2945  *
2946  * @a path_or_url1 and @a path_or_url2 must both represent the same node
2947  * kind -- that is, if @a path_or_url1 is a directory, @a path_or_url2
2948  * must also be, and if @a path_or_url1 is a file, @a path_or_url2 must
2949  * also be.
2950  *
2951  * If @a depth is #svn_depth_infinity, diff fully recursively.
2952  * Else if it is #svn_depth_immediates, diff the named paths and
2953  * their file children (if any), and diff properties of
2954  * subdirectories, but do not descend further into the subdirectories.
2955  * Else if #svn_depth_files, behave as if for #svn_depth_immediates
2956  * except don't diff properties of subdirectories.  If
2957  * #svn_depth_empty, diff exactly the named paths but nothing
2958  * underneath them.
2959  *
2960  * Use @a ignore_ancestry to control whether or not items being
2961  * diffed will be checked for relatedness first.  Unrelated items
2962  * are typically transmitted to the editor as a deletion of one thing
2963  * and the addition of another, but if this flag is TRUE, unrelated
2964  * items will be diffed as if they were related.
2965  *
2966  * If @a no_diff_added is TRUE, then no diff output will be generated
2967  * on added files.
2968  *
2969  * If @a no_diff_deleted is TRUE, then no diff output will be
2970  * generated on deleted files.
2971  *
2972  * If @a show_copies_as_adds is TRUE, then copied files will not be diffed
2973  * against their copyfrom source, and will appear in the diff output
2974  * in their entirety, as if they were newly added.
2975  * ### BUGS: For a repos-repos diff, this is ignored. Instead, a file is
2976  *     diffed against its copyfrom source iff the file is the diff target
2977  *     and not if some parent directory is the diff target. For a repos-WC
2978  *     diff, this is ignored if the file is the diff target.
2979  *
2980  * If @a use_git_diff_format is TRUE, then the git's extended diff format
2981  * will be used.
2982  * ### Do we need to say more about the format? A reference perhaps?
2983  *
2984  * If @a ignore_properties is TRUE, do not show property differences.
2985  * If @a properties_only is TRUE, show only property changes.
2986  * The above two options are mutually exclusive. It is an error to set
2987  * both to TRUE.
2988  *
2989  * Generated headers are encoded using @a header_encoding.
2990  *
2991  * Diff output will not be generated for binary files, unless @a
2992  * ignore_content_type is TRUE, in which case diffs will be shown
2993  * regardless of the content types.
2994  *
2995  * @a diff_options (an array of <tt>const char *</tt>) is used to pass
2996  * additional command line options to the diff processes invoked to compare
2997  * files. @a diff_options is allowed to be @c NULL, in which case a value
2998  * for this option might still be obtained from the Subversion configuration
2999  * file via client context @a ctx.
3000  *
3001  * The authentication baton cached in @a ctx is used to communicate with
3002  * the repository.
3003  *
3004  * @a changelists is an array of <tt>const char *</tt> changelist
3005  * names, used as a restrictive filter on items whose differences are
3006  * reported; that is, don't generate diffs about any item unless
3007  * it's a member of one of those changelists.  If @a changelists is
3008  * empty (or altogether @c NULL), no changelist filtering occurs.
3009  *
3010  * @note Changelist filtering only applies to diffs in which at least
3011  * one side of the diff represents working copy data.
3012  *
3013  * @note @a header_encoding doesn't affect headers generated by external
3014  * diff programs.
3015  *
3016  * @note @a relative_to_dir doesn't affect the path index generated by
3017  * external diff programs.
3018  *
3019  * @since New in 1.8.
3020  */
3021 svn_error_t *
3022 svn_client_diff6(const apr_array_header_t *diff_options,
3023                  const char *path_or_url1,
3024                  const svn_opt_revision_t *revision1,
3025                  const char *path_or_url2,
3026                  const svn_opt_revision_t *revision2,
3027                  const char *relative_to_dir,
3028                  svn_depth_t depth,
3029                  svn_boolean_t ignore_ancestry,
3030                  svn_boolean_t no_diff_added,
3031                  svn_boolean_t no_diff_deleted,
3032                  svn_boolean_t show_copies_as_adds,
3033                  svn_boolean_t ignore_content_type,
3034                  svn_boolean_t ignore_properties,
3035                  svn_boolean_t properties_only,
3036                  svn_boolean_t use_git_diff_format,
3037                  const char *header_encoding,
3038                  svn_stream_t *outstream,
3039                  svn_stream_t *errstream,
3040                  const apr_array_header_t *changelists,
3041                  svn_client_ctx_t *ctx,
3042                  apr_pool_t *pool);
3043
3044 /** Similar to svn_client_diff6(), but with @a outfile and @a errfile,
3045  * instead of @a outstream and @a errstream, and with @a
3046  * no_diff_added, @a ignore_properties, and @a properties_only always
3047  * passed as @c FALSE (which means that additions and property changes
3048  * are always transmitted).
3049  *
3050  * @deprecated Provided for backward compatibility with the 1.7 API.
3051  * @since New in 1.7.
3052  */
3053 SVN_DEPRECATED
3054 svn_error_t *
3055 svn_client_diff5(const apr_array_header_t *diff_options,
3056                  const char *path1,
3057                  const svn_opt_revision_t *revision1,
3058                  const char *path2,
3059                  const svn_opt_revision_t *revision2,
3060                  const char *relative_to_dir,
3061                  svn_depth_t depth,
3062                  svn_boolean_t ignore_ancestry,
3063                  svn_boolean_t no_diff_deleted,
3064                  svn_boolean_t show_copies_as_adds,
3065                  svn_boolean_t ignore_content_type,
3066                  svn_boolean_t use_git_diff_format,
3067                  const char *header_encoding,
3068                  apr_file_t *outfile,
3069                  apr_file_t *errfile,
3070                  const apr_array_header_t *changelists,
3071                  svn_client_ctx_t *ctx,
3072                  apr_pool_t *pool);
3073
3074 /**
3075  * Similar to svn_client_diff5(), but with @a show_copies_as_adds set to
3076  * @c FALSE and @a use_git_diff_format set to @c FALSE.
3077  *
3078  * @deprecated Provided for backward compatibility with the 1.6 API.
3079  * @since New in 1.5.
3080  */
3081 SVN_DEPRECATED
3082 svn_error_t *
3083 svn_client_diff4(const apr_array_header_t *diff_options,
3084                  const char *path1,
3085                  const svn_opt_revision_t *revision1,
3086                  const char *path2,
3087                  const svn_opt_revision_t *revision2,
3088                  const char *relative_to_dir,
3089                  svn_depth_t depth,
3090                  svn_boolean_t ignore_ancestry,
3091                  svn_boolean_t no_diff_deleted,
3092                  svn_boolean_t ignore_content_type,
3093                  const char *header_encoding,
3094                  apr_file_t *outfile,
3095                  apr_file_t *errfile,
3096                  const apr_array_header_t *changelists,
3097                  svn_client_ctx_t *ctx,
3098                  apr_pool_t *pool);
3099
3100 /**
3101  * Similar to svn_client_diff4(), but with @a changelists passed as @c
3102  * NULL, and @a depth set according to @a recurse: if @a recurse is
3103  * TRUE, set @a depth to #svn_depth_infinity, if @a recurse is
3104  * FALSE, set @a depth to #svn_depth_empty.
3105  *
3106  * @deprecated Provided for backward compatibility with the 1.4 API.
3107  * @since New in 1.3.
3108  */
3109 SVN_DEPRECATED
3110 svn_error_t *
3111 svn_client_diff3(const apr_array_header_t *diff_options,
3112                  const char *path1,
3113                  const svn_opt_revision_t *revision1,
3114                  const char *path2,
3115                  const svn_opt_revision_t *revision2,
3116                  svn_boolean_t recurse,
3117                  svn_boolean_t ignore_ancestry,
3118                  svn_boolean_t no_diff_deleted,
3119                  svn_boolean_t ignore_content_type,
3120                  const char *header_encoding,
3121                  apr_file_t *outfile,
3122                  apr_file_t *errfile,
3123                  svn_client_ctx_t *ctx,
3124                  apr_pool_t *pool);
3125
3126
3127 /**
3128  * Similar to svn_client_diff3(), but with @a header_encoding set to
3129  * @c APR_LOCALE_CHARSET.
3130  *
3131  * @deprecated Provided for backward compatibility with the 1.2 API.
3132  * @since New in 1.2.
3133  */
3134 SVN_DEPRECATED
3135 svn_error_t *
3136 svn_client_diff2(const apr_array_header_t *diff_options,
3137                  const char *path1,
3138                  const svn_opt_revision_t *revision1,
3139                  const char *path2,
3140                  const svn_opt_revision_t *revision2,
3141                  svn_boolean_t recurse,
3142                  svn_boolean_t ignore_ancestry,
3143                  svn_boolean_t no_diff_deleted,
3144                  svn_boolean_t ignore_content_type,
3145                  apr_file_t *outfile,
3146                  apr_file_t *errfile,
3147                  svn_client_ctx_t *ctx,
3148                  apr_pool_t *pool);
3149
3150 /**
3151  * Similar to svn_client_diff2(), but with @a ignore_content_type
3152  * always set to FALSE.
3153  *
3154  * @deprecated Provided for backward compatibility with the 1.1 API.
3155  */
3156 SVN_DEPRECATED
3157 svn_error_t *
3158 svn_client_diff(const apr_array_header_t *diff_options,
3159                 const char *path1,
3160                 const svn_opt_revision_t *revision1,
3161                 const char *path2,
3162                 const svn_opt_revision_t *revision2,
3163                 svn_boolean_t recurse,
3164                 svn_boolean_t ignore_ancestry,
3165                 svn_boolean_t no_diff_deleted,
3166                 apr_file_t *outfile,
3167                 apr_file_t *errfile,
3168                 svn_client_ctx_t *ctx,
3169                 apr_pool_t *pool);
3170
3171 /**
3172  * Produce diff output which describes the delta between the filesystem
3173  * object @a path_or_url in peg revision @a peg_revision, as it changed
3174  * between @a start_revision and @a end_revision.  @a path_or_url can
3175  * be either a working-copy path or URL.
3176  *
3177  * If @a peg_revision is #svn_opt_revision_unspecified, behave
3178  * identically to svn_client_diff6(), using @a path_or_url for both of that
3179  * function's @a path_or_url1 and @a path_or_url2 arguments.
3180  *
3181  * All other options are handled identically to svn_client_diff6().
3182  *
3183  * @since New in 1.8.
3184  */
3185 svn_error_t *
3186 svn_client_diff_peg6(const apr_array_header_t *diff_options,
3187                      const char *path_or_url,
3188                      const svn_opt_revision_t *peg_revision,
3189                      const svn_opt_revision_t *start_revision,
3190                      const svn_opt_revision_t *end_revision,
3191                      const char *relative_to_dir,
3192                      svn_depth_t depth,
3193                      svn_boolean_t ignore_ancestry,
3194                      svn_boolean_t no_diff_added,
3195                      svn_boolean_t no_diff_deleted,
3196                      svn_boolean_t show_copies_as_adds,
3197                      svn_boolean_t ignore_content_type,
3198                      svn_boolean_t ignore_properties,
3199                      svn_boolean_t properties_only,
3200                      svn_boolean_t use_git_diff_format,
3201                      const char *header_encoding,
3202                      svn_stream_t *outstream,
3203                      svn_stream_t *errstream,
3204                      const apr_array_header_t *changelists,
3205                      svn_client_ctx_t *ctx,
3206                      apr_pool_t *pool);
3207
3208 /** Similar to svn_client_diff6_peg6(), but with @a outfile and @a errfile,
3209  * instead of @a outstream and @a errstream, and with @a
3210  * no_diff_added, @a ignore_properties, and @a properties_only always
3211  * passed as @c FALSE (which means that additions and property changes
3212  * are always transmitted).
3213  *
3214  * @deprecated Provided for backward compatibility with the 1.7 API.
3215  * @since New in 1.7.
3216  */
3217 SVN_DEPRECATED
3218 svn_error_t *
3219 svn_client_diff_peg5(const apr_array_header_t *diff_options,
3220                      const char *path,
3221                      const svn_opt_revision_t *peg_revision,
3222                      const svn_opt_revision_t *start_revision,
3223                      const svn_opt_revision_t *end_revision,
3224                      const char *relative_to_dir,
3225                      svn_depth_t depth,
3226                      svn_boolean_t ignore_ancestry,
3227                      svn_boolean_t no_diff_deleted,
3228                      svn_boolean_t show_copies_as_adds,
3229                      svn_boolean_t ignore_content_type,
3230                      svn_boolean_t use_git_diff_format,
3231                      const char *header_encoding,
3232                      apr_file_t *outfile,
3233                      apr_file_t *errfile,
3234                      const apr_array_header_t *changelists,
3235                      svn_client_ctx_t *ctx,
3236                      apr_pool_t *pool);
3237
3238 /**
3239  * Similar to svn_client_diff_peg5(), but with @a show_copies_as_adds set to
3240  * @c FALSE and @a use_git_diff_format set to @c FALSE.
3241  *
3242  * @since New in 1.5.
3243  * @deprecated Provided for backward compatibility with the 1.6 API.
3244  */
3245 SVN_DEPRECATED
3246 svn_error_t *
3247 svn_client_diff_peg4(const apr_array_header_t *diff_options,
3248                      const char *path,
3249                      const svn_opt_revision_t *peg_revision,
3250                      const svn_opt_revision_t *start_revision,
3251                      const svn_opt_revision_t *end_revision,
3252                      const char *relative_to_dir,
3253                      svn_depth_t depth,
3254                      svn_boolean_t ignore_ancestry,
3255                      svn_boolean_t no_diff_deleted,
3256                      svn_boolean_t ignore_content_type,
3257                      const char *header_encoding,
3258                      apr_file_t *outfile,
3259                      apr_file_t *errfile,
3260                      const apr_array_header_t *changelists,
3261                      svn_client_ctx_t *ctx,
3262                      apr_pool_t *pool);
3263
3264 /**
3265  * Similar to svn_client_diff_peg4(), but with @a changelists passed
3266  * as @c NULL, and @a depth set according to @a recurse: if @a recurse
3267  * is TRUE, set @a depth to #svn_depth_infinity, if @a recurse is
3268  * FALSE, set @a depth to #svn_depth_files.
3269  *
3270  * @deprecated Provided for backward compatibility with the 1.4 API.
3271  * @since New in 1.3.
3272  */
3273 SVN_DEPRECATED
3274 svn_error_t *
3275 svn_client_diff_peg3(const apr_array_header_t *diff_options,
3276                      const char *path,
3277                      const svn_opt_revision_t *peg_revision,
3278                      const svn_opt_revision_t *start_revision,
3279                      const svn_opt_revision_t *end_revision,
3280                      svn_boolean_t recurse,
3281                      svn_boolean_t ignore_ancestry,
3282                      svn_boolean_t no_diff_deleted,
3283                      svn_boolean_t ignore_content_type,
3284                      const char *header_encoding,
3285                      apr_file_t *outfile,
3286                      apr_file_t *errfile,
3287                      svn_client_ctx_t *ctx,
3288                      apr_pool_t *pool);
3289
3290 /**
3291  * Similar to svn_client_diff_peg3(), but with @a header_encoding set to
3292  * @c APR_LOCALE_CHARSET.
3293  *
3294  * @deprecated Provided for backward compatibility with the 1.2 API.
3295  * @since New in 1.2.
3296  */
3297 SVN_DEPRECATED
3298 svn_error_t *
3299 svn_client_diff_peg2(const apr_array_header_t *diff_options,
3300                      const char *path,
3301                      const svn_opt_revision_t *peg_revision,
3302                      const svn_opt_revision_t *start_revision,
3303                      const svn_opt_revision_t *end_revision,
3304                      svn_boolean_t recurse,
3305                      svn_boolean_t ignore_ancestry,
3306                      svn_boolean_t no_diff_deleted,
3307                      svn_boolean_t ignore_content_type,
3308                      apr_file_t *outfile,
3309                      apr_file_t *errfile,
3310                      svn_client_ctx_t *ctx,
3311                      apr_pool_t *pool);
3312
3313 /**
3314  * Similar to svn_client_diff_peg2(), but with @a ignore_content_type
3315  * always set to FALSE.
3316  *
3317  * @since New in 1.1.
3318  * @deprecated Provided for backward compatibility with the 1.1 API.
3319  */
3320 SVN_DEPRECATED
3321 svn_error_t *
3322 svn_client_diff_peg(const apr_array_header_t *diff_options,
3323                     const char *path,
3324                     const svn_opt_revision_t *peg_revision,
3325                     const svn_opt_revision_t *start_revision,
3326                     const svn_opt_revision_t *end_revision,
3327                     svn_boolean_t recurse,
3328                     svn_boolean_t ignore_ancestry,
3329                     svn_boolean_t no_diff_deleted,
3330                     apr_file_t *outfile,
3331                     apr_file_t *errfile,
3332                     svn_client_ctx_t *ctx,
3333                     apr_pool_t *pool);
3334
3335 /**
3336  * Produce a diff summary which lists the changed items between
3337  * @a path_or_url1/@a revision1 and @a path_or_url2/@a revision2 without
3338  * creating text deltas. @a path_or_url1 and @a path_or_url2 can be
3339  * either working-copy paths or URLs.
3340  *
3341  * The function may report false positives if @a ignore_ancestry is false,
3342  * since a file might have been modified between two revisions, but still
3343  * have the same contents.
3344  *
3345  * Calls @a summarize_func with @a summarize_baton for each difference
3346  * with a #svn_client_diff_summarize_t structure describing the difference.
3347  *
3348  * See svn_client_diff6() for a description of the other parameters.
3349  *
3350  * @since New in 1.5.
3351  */
3352 svn_error_t *
3353 svn_client_diff_summarize2(const char *path_or_url1,
3354                            const svn_opt_revision_t *revision1,
3355                            const char *path_or_url2,
3356                            const svn_opt_revision_t *revision2,
3357                            svn_depth_t depth,
3358                            svn_boolean_t ignore_ancestry,
3359                            const apr_array_header_t *changelists,
3360                            svn_client_diff_summarize_func_t summarize_func,
3361                            void *summarize_baton,
3362                            svn_client_ctx_t *ctx,
3363                            apr_pool_t *pool);
3364
3365 /**
3366  * Similar to svn_client_diff_summarize2(), but with @a changelists
3367  * passed as @c NULL, and @a depth set according to @a recurse: if @a
3368  * recurse is TRUE, set @a depth to #svn_depth_infinity, if @a
3369  * recurse is FALSE, set @a depth to #svn_depth_files.
3370  *
3371  * @deprecated Provided for backward compatibility with the 1.4 API.
3372  *
3373  * @since New in 1.4.
3374  */
3375 SVN_DEPRECATED
3376 svn_error_t *
3377 svn_client_diff_summarize(const char *path1,
3378                           const svn_opt_revision_t *revision1,
3379                           const char *path2,
3380                           const svn_opt_revision_t *revision2,
3381                           svn_boolean_t recurse,
3382                           svn_boolean_t ignore_ancestry,
3383                           svn_client_diff_summarize_func_t summarize_func,
3384                           void *summarize_baton,
3385                           svn_client_ctx_t *ctx,
3386                           apr_pool_t *pool);
3387
3388 /**
3389  * Produce a diff summary which lists the changed items between the
3390  * filesystem object @a path_or_url in peg revision @a peg_revision, as it
3391  * changed between @a start_revision and @a end_revision. @a path_or_url can
3392  * be either a working-copy path or URL.
3393  *
3394  * If @a peg_revision is #svn_opt_revision_unspecified, behave
3395  * identically to svn_client_diff_summarize2(), using @a path_or_url for
3396  * both of that function's @a path_or_url1 and @a path_or_url2 arguments.
3397  *
3398  * The function may report false positives if @a ignore_ancestry is false,
3399  * as described in the documentation for svn_client_diff_summarize2().
3400  *
3401  * Call @a summarize_func with @a summarize_baton for each difference
3402  * with a #svn_client_diff_summarize_t structure describing the difference.
3403  *
3404  * See svn_client_diff_peg5() for a description of the other parameters.
3405  *
3406  * @since New in 1.5.
3407  */
3408 svn_error_t *
3409 svn_client_diff_summarize_peg2(const char *path_or_url,
3410                                const svn_opt_revision_t *peg_revision,
3411                                const svn_opt_revision_t *start_revision,
3412                                const svn_opt_revision_t *end_revision,
3413                                svn_depth_t depth,
3414                                svn_boolean_t ignore_ancestry,
3415                                const apr_array_header_t *changelists,
3416                                svn_client_diff_summarize_func_t summarize_func,
3417                                void *summarize_baton,
3418                                svn_client_ctx_t *ctx,
3419                                apr_pool_t *pool);
3420
3421 /**
3422  * Similar to svn_client_diff_summarize_peg2(), but with @a
3423  * changelists passed as @c NULL, and @a depth set according to @a
3424  * recurse: if @a recurse is TRUE, set @a depth to
3425  * #svn_depth_infinity, if @a recurse is FALSE, set @a depth to
3426  * #svn_depth_files.
3427  *
3428  * @deprecated Provided for backward compatibility with the 1.4 API.
3429  *
3430  * @since New in 1.4.
3431  */
3432 SVN_DEPRECATED
3433 svn_error_t *
3434 svn_client_diff_summarize_peg(const char *path,
3435                               const svn_opt_revision_t *peg_revision,
3436                               const svn_opt_revision_t *start_revision,
3437                               const svn_opt_revision_t *end_revision,
3438                               svn_boolean_t recurse,
3439                               svn_boolean_t ignore_ancestry,
3440                               svn_client_diff_summarize_func_t summarize_func,
3441                               void *summarize_baton,
3442                               svn_client_ctx_t *ctx,
3443                               apr_pool_t *pool);
3444
3445 /** @} */
3446
3447 /**
3448  * @defgroup Merge Merge changes between branches.
3449  *
3450  * @{
3451  */
3452
3453 /** Get information about the state of merging between two branches.
3454  *
3455  * The source is specified by @a source_path_or_url at @a source_revision.
3456  * The target is specified by @a target_path_or_url at @a target_revision,
3457  * which refers to either a WC or a repository location.
3458  *
3459  * Set @a *needs_reintegration to true if an automatic merge from source
3460  * to target would be a reintegration merge: that is, if the last automatic
3461  * merge was in the opposite direction; or to false otherwise.
3462  *
3463  * Set @a *yca_url, @a *yca_rev, @a *base_url, @a *base_rev, @a *right_url,
3464  * @a *right_rev, @a *target_url, @a *target_rev to the repository locations
3465  * of, respectively: the youngest common ancestor of the branches, the base
3466  * chosen for 3-way merge, the right-hand side of the source diff, and the
3467  * target.
3468  *
3469  * Set @a repos_root_url to the URL of the repository root.  This is a
3470  * common prefix of all four URL outputs.
3471  *
3472  * Allocate the results in @a result_pool.  Any of the output pointers may
3473  * be NULL if not wanted.
3474  *
3475  * @since New in 1.8.
3476  */
3477 svn_error_t *
3478 svn_client_get_merging_summary(svn_boolean_t *needs_reintegration,
3479                                const char **yca_url, svn_revnum_t *yca_rev,
3480                                const char **base_url, svn_revnum_t *base_rev,
3481                                const char **right_url, svn_revnum_t *right_rev,
3482                                const char **target_url, svn_revnum_t *target_rev,
3483                                const char **repos_root_url,
3484                                const char *source_path_or_url,
3485                                const svn_opt_revision_t *source_revision,
3486                                const char *target_path_or_url,
3487                                const svn_opt_revision_t *target_revision,
3488                                svn_client_ctx_t *ctx,
3489                                apr_pool_t *result_pool,
3490                                apr_pool_t *scratch_pool);
3491
3492
3493 /** Merge changes from @a source1/@a revision1 to @a source2/@a revision2 into
3494  * the working-copy path @a target_wcpath.
3495  *
3496  * @a source1 and @a source2 are either URLs that refer to entries in the
3497  * repository, or paths to entries in the working copy.
3498  *
3499  * By "merging", we mean:  apply file differences using
3500  * svn_wc_merge(), and schedule additions & deletions when appropriate.
3501  *
3502  * @a source1 and @a source2 must both represent the same node kind -- that
3503  * is, if @a source1 is a directory, @a source2 must also be, and if @a source1
3504  * is a file, @a source2 must also be.
3505  *
3506  * If either @a revision1 or @a revision2 has an `unspecified' or
3507  * unrecognized `kind', return #SVN_ERR_CLIENT_BAD_REVISION.
3508  *
3509  * If @a depth is #svn_depth_infinity, merge fully recursively.
3510  * Else if #svn_depth_immediates, merge changes at most to files
3511  * that are immediate children of @a target_wcpath and to directory
3512  * properties of @a target_wcpath and its immediate subdirectory children.
3513  * Else if #svn_depth_files, merge at most to immediate file
3514  * children of @a target_wcpath and to @a target_wcpath itself.
3515  * Else if #svn_depth_empty, apply changes only to @a target_wcpath
3516  * (i.e., directory property changes only)
3517  *
3518  * If @a depth is #svn_depth_unknown, use the depth of @a target_wcpath.
3519  *
3520  * If @a ignore_mergeinfo is true, disable merge tracking, by treating the
3521  * two sources as unrelated even if they actually have a common ancestor.
3522  *
3523  * If @a diff_ignore_ancestry is true, diff unrelated nodes as if related:
3524  * that is, diff the 'left' and 'right' versions of a node as if they were
3525  * related (if they are the same kind) even if they are not related.
3526  * Otherwise, diff unrelated items as a deletion of one thing and the
3527  * addition of another.
3528  *
3529  * If @a force_delete is false and the merge involves deleting a file whose
3530  * content differs from the source-left version, or a locally modified
3531  * directory, or an unversioned item, then the operation will fail.  If
3532  * @a force_delete is true then all such items will be deleted.
3533  *
3534  * @a merge_options (an array of <tt>const char *</tt>), if non-NULL,
3535  * is used to pass additional command line arguments to the merge
3536  * processes (internal or external).  @see
3537  * svn_diff_file_options_parse().
3538  *
3539  * If @a ctx->notify_func2 is non-NULL, then call @a ctx->notify_func2 with @a
3540  * ctx->notify_baton2 once for each merged target, passing the target's local
3541  * path.
3542  *
3543  * If @a record_only is TRUE, the merge is performed, but is limited only to
3544  * mergeinfo property changes on existing paths in @a target_wcpath.
3545  *
3546  * If @a dry_run is TRUE, the merge is carried out, and full notification
3547  * feedback is provided, but the working copy is not modified.
3548  *
3549  * If allow_mixed_rev is @c FALSE, and @a merge_target is a mixed-revision
3550  * working copy, raise @c SVN_ERR_CLIENT_MERGE_UPDATE_REQUIRED.
3551  * Because users rarely intend to merge into mixed-revision working copies,
3552  * it is recommended to set this parameter to FALSE by default unless the
3553  * user has explicitly requested a merge into a mixed-revision working copy.
3554  *
3555  * The authentication baton cached in @a ctx is used to communicate with the
3556  * repository.
3557  *
3558  * @since New in 1.8.
3559  */
3560 svn_error_t *
3561 svn_client_merge5(const char *source1,
3562                   const svn_opt_revision_t *revision1,
3563                   const char *source2,
3564                   const svn_opt_revision_t *revision2,
3565                   const char *target_wcpath,
3566                   svn_depth_t depth,
3567                   svn_boolean_t ignore_mergeinfo,
3568                   svn_boolean_t diff_ignore_ancestry,
3569                   svn_boolean_t force_delete,
3570                   svn_boolean_t record_only,
3571                   svn_boolean_t dry_run,
3572                   svn_boolean_t allow_mixed_rev,
3573                   const apr_array_header_t *merge_options,
3574                   svn_client_ctx_t *ctx,
3575                   apr_pool_t *pool);
3576
3577 /**
3578  * Similar to svn_client_merge5(), but the single @a ignore_ancestry
3579  * parameter maps to both @c ignore_mergeinfo and @c diff_ignore_ancestry.
3580  *
3581  * @deprecated Provided for backward compatibility with the 1.7 API.
3582  * @since New in 1.7.
3583  */
3584 SVN_DEPRECATED
3585 svn_error_t *
3586 svn_client_merge4(const char *source1,
3587                   const svn_opt_revision_t *revision1,
3588                   const char *source2,
3589                   const svn_opt_revision_t *revision2,
3590                   const char *target_wcpath,
3591                   svn_depth_t depth,
3592                   svn_boolean_t ignore_ancestry,
3593                   svn_boolean_t force_delete,
3594                   svn_boolean_t record_only,
3595                   svn_boolean_t dry_run,
3596                   svn_boolean_t allow_mixed_rev,
3597                   const apr_array_header_t *merge_options,
3598                   svn_client_ctx_t *ctx,
3599                   apr_pool_t *pool);
3600
3601 /**
3602  * Similar to svn_client_merge4(), but with @a allow_mixed_rev set to
3603  * @c TRUE.  The @a force parameter maps to the @c force_delete parameter
3604  * of svn_client_merge4().
3605  *
3606  * @deprecated Provided for backward compatibility with the 1.6 API.
3607  *
3608  * @since New in 1.5.
3609  */
3610 SVN_DEPRECATED
3611 svn_error_t *
3612 svn_client_merge3(const char *source1,
3613                   const svn_opt_revision_t *revision1,
3614                   const char *source2,
3615                   const svn_opt_revision_t *revision2,
3616                   const char *target_wcpath,
3617                   svn_depth_t depth,
3618                   svn_boolean_t ignore_ancestry,
3619                   svn_boolean_t force,
3620                   svn_boolean_t record_only,
3621                   svn_boolean_t dry_run,
3622                   const apr_array_header_t *merge_options,
3623                   svn_client_ctx_t *ctx,
3624                   apr_pool_t *pool);
3625
3626 /**
3627  * Similar to svn_client_merge3(), but with @a record_only set to @c
3628  * FALSE, and @a depth set according to @a recurse: if @a recurse is
3629  * TRUE, set @a depth to #svn_depth_infinity, if @a recurse is
3630  * FALSE, set @a depth to #svn_depth_files.
3631  *
3632  * @deprecated Provided for backward compatibility with the 1.4 API.
3633  *
3634  * @since New in 1.4.
3635  */
3636 SVN_DEPRECATED
3637 svn_error_t *
3638 svn_client_merge2(const char *source1,
3639                   const svn_opt_revision_t *revision1,
3640                   const char *source2,
3641                   const svn_opt_revision_t *revision2,
3642                   const char *target_wcpath,
3643                   svn_boolean_t recurse,
3644                   svn_boolean_t ignore_ancestry,
3645                   svn_boolean_t force,
3646                   svn_boolean_t dry_run,
3647                   const apr_array_header_t *merge_options,
3648                   svn_client_ctx_t *ctx,
3649                   apr_pool_t *pool);
3650
3651
3652 /**
3653  * Similar to svn_client_merge2(), but with @a merge_options set to NULL.
3654  *
3655  * @deprecated Provided for backwards compatibility with the 1.3 API.
3656  */
3657 SVN_DEPRECATED
3658 svn_error_t *
3659 svn_client_merge(const char *source1,
3660                  const svn_opt_revision_t *revision1,
3661                  const char *source2,
3662                  const svn_opt_revision_t *revision2,
3663                  const char *target_wcpath,
3664                  svn_boolean_t recurse,
3665                  svn_boolean_t ignore_ancestry,
3666                  svn_boolean_t force,
3667                  svn_boolean_t dry_run,
3668                  svn_client_ctx_t *ctx,
3669                  apr_pool_t *pool);
3670
3671
3672 /**
3673  * Perform a reintegration merge of @a source_path_or_url at @a source_peg_revision
3674  * into @a target_wcpath.
3675  * @a target_wcpath must be a single-revision, #svn_depth_infinity,
3676  * pristine, unswitched working copy -- in other words, it must
3677  * reflect a single revision tree, the "target".  The mergeinfo on @a
3678  * source_path_or_url must reflect that all of the target has been merged into it.
3679  * Then this behaves like a merge with svn_client_merge5() from the
3680  * target's URL to the source.
3681  *
3682  * All other options are handled identically to svn_client_merge5().
3683  * The depth of the merge is always #svn_depth_infinity.
3684  *
3685  * @since New in 1.5.
3686  * @deprecated Provided for backwards compatibility with the 1.7 API.
3687  */
3688 SVN_DEPRECATED
3689 svn_error_t *
3690 svn_client_merge_reintegrate(const char *source_path_or_url,
3691                              const svn_opt_revision_t *source_peg_revision,
3692                              const char *target_wcpath,
3693                              svn_boolean_t dry_run,
3694                              const apr_array_header_t *merge_options,
3695                              svn_client_ctx_t *ctx,
3696                              apr_pool_t *pool);
3697
3698 /**
3699  * Merge changes from the source branch identified by
3700  * @a source_path_or_url in peg revision @a source_peg_revision,
3701  * into the target branch working copy at @a target_wcpath.
3702  *
3703  * If @a ranges_to_merge is NULL then perform an automatic merge of
3704  * all the eligible changes up to @a source_peg_revision.  If the merge
3705  * required is a reintegrate merge, then return an error if the WC has
3706  * mixed revisions, local modifications and/or switched subtrees; if
3707  * the merge is determined to be of the non-reintegrate kind, then
3708  * return an error if @a allow_mixed_rev is false and the WC contains
3709  * mixed revisions.
3710  *
3711  * If @a ranges_to_merge is not NULL then merge the changes specified
3712  * by the revision ranges in @a ranges_to_merge, or, when honouring
3713  * mergeinfo, only the eligible parts of those revision ranges.
3714  * @a ranges_to_merge is an array of <tt>svn_opt_revision_range_t
3715  * *</tt> ranges.  These ranges may describe additive and/or
3716  * subtractive merge ranges, they may overlap fully or partially,
3717  * and/or they may partially or fully negate each other.  This
3718  * rangelist is not required to be sorted.  If any revision in the
3719  * list of provided ranges has an `unspecified' or unrecognized
3720  * `kind', return #SVN_ERR_CLIENT_BAD_REVISION.
3721  *
3722  * If @a ranges_to_merge is an empty array, then do nothing.
3723  *
3724  * All other options are handled identically to svn_client_merge5().
3725  *
3726  * @since New in 1.8.
3727  */
3728 svn_error_t *
3729 svn_client_merge_peg5(const char *source_path_or_url,
3730                       const apr_array_header_t *ranges_to_merge,
3731                       const svn_opt_revision_t *source_peg_revision,
3732                       const char *target_wcpath,
3733                       svn_depth_t depth,
3734                       svn_boolean_t ignore_mergeinfo,
3735                       svn_boolean_t diff_ignore_ancestry,
3736                       svn_boolean_t force_delete,
3737                       svn_boolean_t record_only,
3738                       svn_boolean_t dry_run,
3739                       svn_boolean_t allow_mixed_rev,
3740                       const apr_array_header_t *merge_options,
3741                       svn_client_ctx_t *ctx,
3742                       apr_pool_t *pool);
3743
3744 /**
3745  * Similar to svn_client_merge_peg5(), but automatic merge is not available
3746  * (@a ranges_to_merge must not be NULL), and the single @a ignore_ancestry
3747  * parameter maps to both @c ignore_mergeinfo and @c diff_ignore_ancestry.
3748  *
3749  * @deprecated Provided for backward compatibility with the 1.7 API.
3750  * @since New in 1.7.
3751  */
3752 SVN_DEPRECATED
3753 svn_error_t *
3754 svn_client_merge_peg4(const char *source_path_or_url,
3755                       const apr_array_header_t *ranges_to_merge,
3756                       const svn_opt_revision_t *source_peg_revision,
3757                       const char *target_wcpath,
3758                       svn_depth_t depth,
3759                       svn_boolean_t ignore_ancestry,
3760                       svn_boolean_t force_delete,
3761                       svn_boolean_t record_only,
3762                       svn_boolean_t dry_run,
3763                       svn_boolean_t allow_mixed_rev,
3764                       const apr_array_header_t *merge_options,
3765                       svn_client_ctx_t *ctx,
3766                       apr_pool_t *pool);
3767
3768 /**
3769  * Similar to svn_client_merge_peg4(), but with @a allow_mixed_rev set to
3770  * @c TRUE.  The @a force parameter maps to the @c force_delete parameter
3771  * of svn_client_merge_peg4().
3772  *
3773  * @deprecated Provided for backward compatibility with the 1.6 API.
3774  *
3775  * @since New in 1.5.
3776  */
3777 SVN_DEPRECATED
3778 svn_error_t *
3779 svn_client_merge_peg3(const char *source,
3780                       const apr_array_header_t *ranges_to_merge,
3781                       const svn_opt_revision_t *peg_revision,
3782                       const char *target_wcpath,
3783                       svn_depth_t depth,
3784                       svn_boolean_t ignore_ancestry,
3785                       svn_boolean_t force,
3786                       svn_boolean_t record_only,
3787                       svn_boolean_t dry_run,
3788                       const apr_array_header_t *merge_options,
3789                       svn_client_ctx_t *ctx,
3790                       apr_pool_t *pool);
3791
3792 /**
3793  * Similar to svn_client_merge_peg3(), but with @a record_only set to
3794  * @c FALSE, and @a depth set according to @a recurse: if @a recurse
3795  * is TRUE, set @a depth to #svn_depth_infinity, if @a recurse is
3796  * FALSE, set @a depth to #svn_depth_files.
3797  *
3798  * @deprecated Provided for backwards compatibility with the 1.4 API.
3799  *
3800  * @since New in 1.4.
3801  */
3802 SVN_DEPRECATED
3803 svn_error_t *
3804 svn_client_merge_peg2(const char *source,
3805                       const svn_opt_revision_t *revision1,
3806                       const svn_opt_revision_t *revision2,
3807                       const svn_opt_revision_t *peg_revision,
3808                       const char *target_wcpath,
3809                       svn_boolean_t recurse,
3810                       svn_boolean_t ignore_ancestry,
3811                       svn_boolean_t force,
3812                       svn_boolean_t dry_run,
3813                       const apr_array_header_t *merge_options,
3814                       svn_client_ctx_t *ctx,
3815                       apr_pool_t *pool);
3816
3817 /**
3818  * Similar to svn_client_merge_peg2(), but with @a merge_options set to
3819  * NULL.
3820  *
3821  * @deprecated Provided for backwards compatibility with the 1.3 API.
3822  *
3823  * @since New in 1.1.
3824  */
3825 SVN_DEPRECATED
3826 svn_error_t *
3827 svn_client_merge_peg(const char *source,
3828                      const svn_opt_revision_t *revision1,
3829                      const svn_opt_revision_t *revision2,
3830                      const svn_opt_revision_t *peg_revision,
3831                      const char *target_wcpath,
3832                      svn_boolean_t recurse,
3833                      svn_boolean_t ignore_ancestry,
3834                      svn_boolean_t force,
3835                      svn_boolean_t dry_run,
3836                      svn_client_ctx_t *ctx,
3837                      apr_pool_t *pool);
3838
3839
3840 /** Set @a suggestions to an ordered array of @c const char *
3841  * potential merge sources (expressed as full repository URLs) for @a
3842  * path_or_url at @a peg_revision.  @a path_or_url is a working copy
3843  * path or repository URL.  @a ctx is a context used for
3844  * authentication in the repository case.  Use @a pool for all
3845  * allocations.
3846  *
3847  * @since New in 1.5.
3848  */
3849 svn_error_t *
3850 svn_client_suggest_merge_sources(apr_array_header_t **suggestions,
3851                                  const char *path_or_url,
3852                                  const svn_opt_revision_t *peg_revision,
3853                                  svn_client_ctx_t *ctx,
3854                                  apr_pool_t *pool);
3855
3856
3857 /**
3858  * Get the mergeinfo for a single target node (ignoring any subtrees).
3859  *
3860  * Set @a *mergeinfo to a hash mapping <tt>const char *</tt> merge source
3861  * URLs to <tt>svn_rangelist_t *</tt> rangelists describing the ranges which
3862  * have been merged into @a path_or_url as of @a peg_revision, per
3863  * @a path_or_url's explicit mergeinfo or inherited mergeinfo if no
3864  * explicit mergeinfo if found.  If no explicit or inherited mergeinfo
3865  * is found, then set @a *mergeinfo to NULL.
3866  *
3867  * Use @a pool for all necessary allocations.
3868  *
3869  * If the server doesn't support retrieval of mergeinfo (which will
3870  * never happen for file:// URLs), return an
3871  * #SVN_ERR_UNSUPPORTED_FEATURE error.
3872  *
3873  * @note Unlike most APIs which deal with mergeinfo, this one returns
3874  * data where the keys of the hash are absolute repository URLs rather
3875  * than repository filesystem paths.
3876  *
3877  * @since New in 1.5.
3878  */
3879 svn_error_t *
3880 svn_client_mergeinfo_get_merged(apr_hash_t **mergeinfo,
3881                                 const char *path_or_url,
3882                                 const svn_opt_revision_t *peg_revision,
3883                                 svn_client_ctx_t *ctx,
3884                                 apr_pool_t *pool);
3885
3886
3887 /**
3888  * Describe the revisions that either have or have not been merged from
3889  * one source branch (or subtree) into another.
3890  *
3891  * If @a finding_merged is TRUE, then drive log entry callbacks
3892  * @a receiver / @a receiver_baton with the revisions merged from
3893  * @a source_path_or_url (as of @a source_peg_revision) into
3894  * @a target_path_or_url (as of @a target_peg_revision).  If @a
3895  * finding_merged is FALSE then find the revisions eligible for merging.
3896  *
3897  * If both @a source_start_revision and @a source_end_revision are
3898  * unspecified (that is, of kind @c svn_opt_revision_unspecified),
3899  * @a receiver will be called the requested revisions from 0 to
3900  * @a source_peg_revision and in that order (that is, oldest to
3901  * youngest).  Otherwise, both @a source_start_revision and
3902  * @a source_end_revision must be specified, which has two effects:
3903  *
3904  *   - @a receiver will be called only with revisions which fall
3905  *     within range of @a source_start_revision to
3906  *     @a source_end_revision, inclusive, and
3907  *
3908  *   - those revisions will be ordered in the same "direction" as the
3909  *     walk from @a source_start_revision to @a source_end_revision.
3910  *     (If @a source_start_revision is the younger of the two, @a
3911  *     receiver will be called with revisions in youngest-to-oldest
3912  *     order; otherwise, the reverse occurs.)
3913  *
3914  * If @a depth is #svn_depth_empty consider only the explicit or
3915  * inherited mergeinfo on @a target_path_or_url when calculating merged
3916  * revisions from @a source_path_or_url.  If @a depth is #svn_depth_infinity
3917  * then also consider the explicit subtree mergeinfo under @a
3918  * target_path_or_url.
3919  * If a depth other than #svn_depth_empty or #svn_depth_infinity is
3920  * requested then return a #SVN_ERR_UNSUPPORTED_FEATURE error.
3921  *
3922  * @a discover_changed_paths and @a revprops are the same as for
3923  * svn_client_log5().  Use @a scratch_pool for all temporary allocations.
3924  *
3925  * @a ctx is a context used for authentication.
3926  *
3927  * If the server doesn't support retrieval of mergeinfo, return an
3928  * #SVN_ERR_UNSUPPORTED_FEATURE error.
3929  *
3930  * @since New in 1.8.
3931  */
3932 svn_error_t *
3933 svn_client_mergeinfo_log2(svn_boolean_t finding_merged,
3934                           const char *target_path_or_url,
3935                           const svn_opt_revision_t *target_peg_revision,
3936                           const char *source_path_or_url,
3937                           const svn_opt_revision_t *source_peg_revision,
3938                           const svn_opt_revision_t *source_start_revision,
3939                           const svn_opt_revision_t *source_end_revision,
3940                           svn_log_entry_receiver_t receiver,
3941                           void *receiver_baton,
3942                           svn_boolean_t discover_changed_paths,
3943                           svn_depth_t depth,
3944                           const apr_array_header_t *revprops,
3945                           svn_client_ctx_t *ctx,
3946                           apr_pool_t *scratch_pool);
3947
3948 /**
3949  * Similar to svn_client_mergeinfo_log2(), but with @a source_start_revision
3950  * and @a source_end_revision always of kind @c svn_opt_revision_unspecified;
3951  *
3952  * @deprecated Provided for backwards compatibility with the 1.7 API.
3953  * @since New in 1.7.
3954  */
3955 SVN_DEPRECATED
3956 svn_error_t *
3957 svn_client_mergeinfo_log(svn_boolean_t finding_merged,
3958                          const char *target_path_or_url,
3959                          const svn_opt_revision_t *target_peg_revision,
3960                          const char *source_path_or_url,
3961                          const svn_opt_revision_t *source_peg_revision,
3962                          svn_log_entry_receiver_t receiver,
3963                          void *receiver_baton,
3964                          svn_boolean_t discover_changed_paths,
3965                          svn_depth_t depth,
3966                          const apr_array_header_t *revprops,
3967                          svn_client_ctx_t *ctx,
3968                          apr_pool_t *scratch_pool);
3969
3970 /**
3971  * Similar to svn_client_mergeinfo_log(), but finds only merged revisions
3972  * and always operates at @a depth #svn_depth_empty.
3973  *
3974  * @deprecated Provided for backwards compatibility with the 1.6 API. Use
3975  * svn_client_mergeinfo_log() instead.
3976  * @since New in 1.5.
3977  */
3978 SVN_DEPRECATED
3979 svn_error_t *
3980 svn_client_mergeinfo_log_merged(const char *path_or_url,
3981                                 const svn_opt_revision_t *peg_revision,
3982                                 const char *merge_source_path_or_url,
3983                                 const svn_opt_revision_t *src_peg_revision,
3984                                 svn_log_entry_receiver_t receiver,
3985                                 void *receiver_baton,
3986                                 svn_boolean_t discover_changed_paths,
3987                                 const apr_array_header_t *revprops,
3988                                 svn_client_ctx_t *ctx,
3989                                 apr_pool_t *pool);
3990
3991 /**
3992  * Similar to svn_client_mergeinfo_log(), but finds only eligible revisions
3993  * and always operates at @a depth #svn_depth_empty.
3994  *
3995  * @deprecated Provided for backwards compatibility with the 1.6 API. Use
3996  * svn_client_mergeinfo_log() instead.
3997  * @since New in 1.5.
3998  */
3999 SVN_DEPRECATED
4000 svn_error_t *
4001 svn_client_mergeinfo_log_eligible(const char *path_or_url,
4002                                   const svn_opt_revision_t *peg_revision,
4003                                   const char *merge_source_path_or_url,
4004                                   const svn_opt_revision_t *src_peg_revision,
4005                                   svn_log_entry_receiver_t receiver,
4006                                   void *receiver_baton,
4007                                   svn_boolean_t discover_changed_paths,
4008                                   const apr_array_header_t *revprops,
4009                                   svn_client_ctx_t *ctx,
4010                                   apr_pool_t *pool);
4011
4012 /** @} */
4013
4014 /**
4015  * @defgroup Cleanup Cleanup an abnormally terminated working copy.
4016  *
4017  * @{
4018  */
4019
4020 /** Recursively cleanup a working copy directory @a dir, finishing any
4021  * incomplete operations, removing lockfiles, etc.
4022  *
4023  * If @a ctx->cancel_func is non-NULL, invoke it with @a
4024  * ctx->cancel_baton at various points during the operation.  If it
4025  * returns an error (typically #SVN_ERR_CANCELLED), return that error
4026  * immediately.
4027  *
4028  * Use @a scratch_pool for any temporary allocations.
4029  */
4030 svn_error_t *
4031 svn_client_cleanup(const char *dir,
4032                    svn_client_ctx_t *ctx,
4033                    apr_pool_t *scratch_pool);
4034
4035
4036 /** @} */
4037
4038 /**
4039  * @defgroup Upgrade Upgrade a working copy.
4040  *
4041  * @{
4042  */
4043
4044 /** Recursively upgrade a working copy from any older format to the current
4045  * WC metadata storage format.  @a wcroot_dir is the path to the WC root.
4046  *
4047  * Use @a scratch_pool for any temporary allocations.
4048  *
4049  * @since New in 1.7.
4050  */
4051 svn_error_t *
4052 svn_client_upgrade(const char *wcroot_dir,
4053                    svn_client_ctx_t *ctx,
4054                    apr_pool_t *scratch_pool);
4055
4056
4057 /** @} */
4058
4059 /**
4060  * @defgroup Relocate Switch a working copy to a different repository.
4061  *
4062  * @{
4063  */
4064
4065 /**
4066  * Recursively modify a working copy rooted at @a wcroot_dir, changing
4067  * any repository URLs that begin with @a from_prefix to begin with @a
4068  * to_prefix instead.
4069  *
4070  * @param wcroot_dir Working copy root directory
4071  * @param from_prefix Original URL
4072  * @param to_prefix New URL
4073  * @param ignore_externals If not set, recurse into external working
4074  *        copies after relocating the primary working copy
4075  * @param ctx svn_client_ctx_t
4076  * @param pool The pool from which to perform memory allocations
4077  *
4078  * @since New in 1.7
4079  */
4080 svn_error_t *
4081 svn_client_relocate2(const char *wcroot_dir,
4082                      const char *from_prefix,
4083                      const char *to_prefix,
4084                      svn_boolean_t ignore_externals,
4085                      svn_client_ctx_t *ctx,
4086                      apr_pool_t *pool);
4087
4088 /**
4089  * Similar to svn_client_relocate2(), but with @a ignore_externals
4090  * always TRUE.
4091  *
4092  * @note As of the 1.7 API, @a dir is required to be a working copy
4093  * root directory, and @a recurse is required to be TRUE.
4094  *
4095  * @deprecated Provided for limited backwards compatibility with the
4096  * 1.6 API.
4097  */
4098 SVN_DEPRECATED
4099 svn_error_t *
4100 svn_client_relocate(const char *dir,
4101                     const char *from_prefix,
4102                     const char *to_prefix,
4103                     svn_boolean_t recurse,
4104                     svn_client_ctx_t *ctx,
4105                     apr_pool_t *pool);
4106
4107 /** @} */
4108
4109 /**
4110  * @defgroup Revert Remove local changes in a repository.
4111  *
4112  * @{
4113  */
4114
4115 /**
4116  * Restore the pristine version of working copy @a paths,
4117  * effectively undoing any local mods.  For each path in @a paths,
4118  * revert it if it is a file.  Else if it is a directory, revert
4119  * according to @a depth:
4120  *
4121  * @a paths is an array of (const char *) local WC paths.
4122  *
4123  * If @a depth is #svn_depth_empty, revert just the properties on
4124  * the directory; else if #svn_depth_files, revert the properties
4125  * and any files immediately under the directory; else if
4126  * #svn_depth_immediates, revert all of the preceding plus
4127  * properties on immediate subdirectories; else if #svn_depth_infinity,
4128  * revert path and everything under it fully recursively.
4129  *
4130  * @a changelists is an array of <tt>const char *</tt> changelist
4131  * names, used as a restrictive filter on items reverted; that is,
4132  * don't revert any item unless it's a member of one of those
4133  * changelists.  If @a changelists is empty (or altogether @c NULL),
4134  * no changelist filtering occurs.
4135  *
4136  * If @a ctx->notify_func2 is non-NULL, then for each item reverted,
4137  * call @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of
4138  * the reverted item.
4139  *
4140  * If an item specified for reversion is not under version control,
4141  * then do not error, just invoke @a ctx->notify_func2 with @a
4142  * ctx->notify_baton2, using notification code #svn_wc_notify_skip.
4143  *
4144  * @since New in 1.5.
4145  */
4146 svn_error_t *
4147 svn_client_revert2(const apr_array_header_t *paths,
4148                    svn_depth_t depth,
4149                    const apr_array_header_t *changelists,
4150                    svn_client_ctx_t *ctx,
4151                    apr_pool_t *pool);
4152
4153
4154 /**
4155  * Similar to svn_client_revert2(), but with @a changelists passed as
4156  * @c NULL, and @a depth set according to @a recurse: if @a recurse is
4157  * TRUE, @a depth is #svn_depth_infinity, else if @a recurse is
4158  * FALSE, @a depth is #svn_depth_empty.
4159  *
4160  * @note Most APIs map @a recurse==FALSE to @a depth==svn_depth_files;
4161  * revert is deliberately different.
4162  *
4163  * @deprecated Provided for backwards compatibility with the 1.0 API.
4164  */
4165 SVN_DEPRECATED
4166 svn_error_t *
4167 svn_client_revert(const apr_array_header_t *paths,
4168                   svn_boolean_t recursive,
4169                   svn_client_ctx_t *ctx,
4170                   apr_pool_t *pool);
4171
4172
4173 /** @} */
4174
4175 /**
4176  * @defgroup Resolved Mark conflicted paths as resolved.
4177  *
4178  * @{
4179  */
4180
4181 /**
4182  * Similar to svn_client_resolve(), but without automatic conflict
4183  * resolution support.
4184  *
4185  * @deprecated Provided for backward compatibility with the 1.4 API.
4186  * Use svn_client_resolve() with @a conflict_choice == @c
4187  * svn_wc_conflict_choose_merged instead.
4188  */
4189 SVN_DEPRECATED
4190 svn_error_t *
4191 svn_client_resolved(const char *path,
4192                     svn_boolean_t recursive,
4193                     svn_client_ctx_t *ctx,
4194                     apr_pool_t *pool);
4195
4196 /** Perform automatic conflict resolution on a working copy @a path.
4197  *
4198  * If @a conflict_choice is
4199  *
4200  *   - #svn_wc_conflict_choose_base:
4201  *     resolve the conflict with the old file contents
4202  *
4203  *   - #svn_wc_conflict_choose_mine_full:
4204  *     use the original working contents
4205  *
4206  *   - #svn_wc_conflict_choose_theirs_full:
4207  *     use the new contents
4208  *
4209  *   - #svn_wc_conflict_choose_merged:
4210  *     don't change the contents at all, just remove the conflict
4211  *     status, which is the pre-1.5 behavior.
4212  *
4213  *   - #svn_wc_conflict_choose_theirs_conflict
4214  *     ###...
4215  *
4216  *   - #svn_wc_conflict_choose_mine_conflict
4217  *     ###...
4218  *
4219  *   - svn_wc_conflict_choose_unspecified
4220  *     invoke @a ctx->conflict_func2 with @a ctx->conflict_baton2 to obtain
4221  *     a resolution decision for each conflict.  This can be used to
4222  *     implement interactive conflict resolution.
4223  *
4224  * #svn_wc_conflict_choose_theirs_conflict and
4225  * #svn_wc_conflict_choose_mine_conflict are not legal for binary
4226  * files or properties.
4227  *
4228  * If @a path is not in a state of conflict to begin with, do nothing.
4229  * If @a path's conflict state is removed and @a ctx->notify_func2 is non-NULL,
4230  * call @a ctx->notify_func2 with @a ctx->notify_baton2 and @a path.
4231  * ### with what notification parameters?
4232  *
4233  * If @a depth is #svn_depth_empty, act only on @a path; if
4234  * #svn_depth_files, resolve @a path and its conflicted file
4235  * children (if any); if #svn_depth_immediates, resolve @a path and
4236  * all its immediate conflicted children (both files and directories,
4237  * if any); if #svn_depth_infinity, resolve @a path and every
4238  * conflicted file or directory anywhere beneath it.
4239  *
4240  * Note that this operation will try to lock the parent directory of
4241  * @a path in order to be able to resolve tree-conflicts on @a path.
4242  *
4243  * @since New in 1.5.
4244  */
4245 svn_error_t *
4246 svn_client_resolve(const char *path,
4247                    svn_depth_t depth,
4248                    svn_wc_conflict_choice_t conflict_choice,
4249                    svn_client_ctx_t *ctx,
4250                    apr_pool_t *pool);
4251
4252
4253 /** @} */
4254
4255 /**
4256  * @defgroup Copy Copy paths in the working copy and repository.
4257  *
4258  * @{
4259  */
4260
4261 /**
4262  * A structure which describes the source of a copy operation--its path,
4263  * revision, and peg revision.
4264  *
4265  * @since New in 1.5.
4266  */
4267 typedef struct svn_client_copy_source_t
4268 {
4269     /** The source path or URL. */
4270     const char *path;
4271
4272     /** The source operational revision. */
4273     const svn_opt_revision_t *revision;
4274
4275     /** The source peg revision. */
4276     const svn_opt_revision_t *peg_revision;
4277 } svn_client_copy_source_t;
4278
4279 /** Copy each source in @a sources to @a dst_path.
4280  *
4281  * If multiple @a sources are given, @a dst_path must be a directory,
4282  * and @a sources will be copied as children of @a dst_path.
4283  *
4284  * @a sources is an array of <tt>svn_client_copy_source_t *</tt> elements,
4285  * either all referring to local WC items or all referring to versioned
4286  * items in the repository.
4287  *
4288  * If @a sources has only one item, attempt to copy it to @a dst_path.  If
4289  * @a copy_as_child is TRUE and @a dst_path already exists, attempt to copy the
4290  * item as a child of @a dst_path.  If @a copy_as_child is FALSE and
4291  * @a dst_path already exists, fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path
4292  * is a working copy path and #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a
4293  * URL.
4294  *
4295  * If @a sources has multiple items, and @a copy_as_child is TRUE, all
4296  * @a sources are copied as children of @a dst_path.  If any child of
4297  * @a dst_path already exists with the same name any item in @a sources,
4298  * fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path is a working copy path and
4299  * #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a URL.
4300  *
4301  * If @a sources has multiple items, and @a copy_as_child is FALSE, fail
4302  * with #SVN_ERR_CLIENT_MULTIPLE_SOURCES_DISALLOWED.
4303  *
4304  * If @a dst_path is a URL, use the authentication baton
4305  * in @a ctx and @a ctx->log_msg_func3/@a ctx->log_msg_baton3 to immediately
4306  * attempt to commit the copy action in the repository.
4307  *
4308  * If @a dst_path is not a URL, then this is just a variant of
4309  * svn_client_add(), where the @a sources are scheduled for addition
4310  * as copies.  No changes will happen to the repository until a commit occurs.
4311  * This scheduling can be removed with svn_client_revert2().
4312  *
4313  * If @a make_parents is TRUE, create any non-existent parent directories
4314  * also.  Otherwise the parent of @a dst_path must already exist.
4315  *
4316  * If @a ignore_externals is set, don't process externals definitions
4317  * as part of this operation.
4318  *
4319  * If non-NULL, @a revprop_table is a hash table holding additional,
4320  * custom revision properties (<tt>const char *</tt> names mapped to
4321  * <tt>svn_string_t *</tt> values) to be set on the new revision in
4322  * the event that this is a committing operation.  This table cannot
4323  * contain any standard Subversion properties.
4324  *
4325  * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton combo
4326  * that this function can use to query for a commit log message when one is
4327  * needed.
4328  *
4329  * If @a ctx->notify_func2 is non-NULL, invoke it with @a ctx->notify_baton2
4330  * for each item added at the new location, passing the new, relative path of
4331  * the added item.
4332  *
4333  * If @a commit_callback is non-NULL, then for each successful commit, call
4334  * @a commit_callback with @a commit_baton and a #svn_commit_info_t for
4335  * the commit.
4336  *
4337  * @since New in 1.7.
4338  */
4339 svn_error_t *
4340 svn_client_copy6(const apr_array_header_t *sources,
4341                  const char *dst_path,
4342                  svn_boolean_t copy_as_child,
4343                  svn_boolean_t make_parents,
4344                  svn_boolean_t ignore_externals,
4345                  const apr_hash_t *revprop_table,
4346                  svn_commit_callback2_t commit_callback,
4347                  void *commit_baton,
4348                  svn_client_ctx_t *ctx,
4349                  apr_pool_t *pool);
4350
4351 /**
4352  * Similar to svn_client_copy6(), but returns the commit info in
4353  * @a *commit_info_p rather than through a callback function.
4354  *
4355  * @since New in 1.6.
4356  * @deprecated Provided for backward compatibility with the 1.6 API.
4357  */
4358 SVN_DEPRECATED
4359 svn_error_t *
4360 svn_client_copy5(svn_commit_info_t **commit_info_p,
4361                  const apr_array_header_t *sources,
4362                  const char *dst_path,
4363                  svn_boolean_t copy_as_child,
4364                  svn_boolean_t make_parents,
4365                  svn_boolean_t ignore_externals,
4366                  const apr_hash_t *revprop_table,
4367                  svn_client_ctx_t *ctx,
4368                  apr_pool_t *pool);
4369
4370 /**
4371  * Similar to svn_client_copy5(), with @a ignore_externals set to @c FALSE.
4372  *
4373  * @since New in 1.5.
4374  *
4375  * @deprecated Provided for backward compatibility with the 1.5 API.
4376  */
4377 SVN_DEPRECATED
4378 svn_error_t *
4379 svn_client_copy4(svn_commit_info_t **commit_info_p,
4380                  const apr_array_header_t *sources,
4381                  const char *dst_path,
4382                  svn_boolean_t copy_as_child,
4383                  svn_boolean_t make_parents,
4384                  const apr_hash_t *revprop_table,
4385                  svn_client_ctx_t *ctx,
4386                  apr_pool_t *pool);
4387
4388 /**
4389  * Similar to svn_client_copy4(), with only one @a src_path, @a
4390  * copy_as_child set to @c FALSE, @a revprop_table passed as NULL, and
4391  * @a make_parents set to @c FALSE.  Also, use @a src_revision as both
4392  * the operational and peg revision.
4393  *
4394  * @since New in 1.4.
4395  *
4396  * @deprecated Provided for backward compatibility with the 1.4 API.
4397  */
4398 SVN_DEPRECATED
4399 svn_error_t *
4400 svn_client_copy3(svn_commit_info_t **commit_info_p,
4401                  const char *src_path,
4402                  const svn_opt_revision_t *src_revision,
4403                  const char *dst_path,
4404                  svn_client_ctx_t *ctx,
4405                  apr_pool_t *pool);
4406
4407
4408 /**
4409  * Similar to svn_client_copy3(), with the difference that if @a dst_path
4410  * already exists and is a directory, copy the item into that directory,
4411  * keeping its name (the last component of @a src_path).
4412  *
4413  * @since New in 1.3.
4414  *
4415  * @deprecated Provided for backward compatibility with the 1.3 API.
4416  */
4417 SVN_DEPRECATED
4418 svn_error_t *
4419 svn_client_copy2(svn_commit_info_t **commit_info_p,
4420                  const char *src_path,
4421                  const svn_opt_revision_t *src_revision,
4422                  const char *dst_path,
4423                  svn_client_ctx_t *ctx,
4424                  apr_pool_t *pool);
4425
4426
4427 /**
4428  * Similar to svn_client_copy2(), but uses #svn_client_commit_info_t
4429  * for @a commit_info_p.
4430  *
4431  * @deprecated Provided for backward compatibility with the 1.2 API.
4432  */
4433 SVN_DEPRECATED
4434 svn_error_t *
4435 svn_client_copy(svn_client_commit_info_t **commit_info_p,
4436                 const char *src_path,
4437                 const svn_opt_revision_t *src_revision,
4438                 const char *dst_path,
4439                 svn_client_ctx_t *ctx,
4440                 apr_pool_t *pool);
4441
4442
4443 /** @} */
4444
4445 /**
4446  * @defgroup Move Move paths in the working copy or repository.
4447  *
4448  * @{
4449  */
4450
4451 /**
4452  * Move @a src_paths to @a dst_path.
4453  *
4454  * @a src_paths is an array of (const char *) paths -- either all WC paths
4455  * or all URLs -- of versioned items.  If multiple @a src_paths are given,
4456  * @a dst_path must be a directory and @a src_paths will be moved as
4457  * children of @a dst_path.
4458  *
4459  * If @a src_paths are repository URLs:
4460  *
4461  *   - @a dst_path must also be a repository URL.
4462  *
4463  *   - The authentication baton in @a ctx and @a ctx->log_msg_func/@a
4464  *     ctx->log_msg_baton are used to commit the move.
4465  *
4466  *   - The move operation will be immediately committed.
4467  *
4468  * If @a src_paths are working copy paths:
4469  *
4470  *   - @a dst_path must also be a working copy path.
4471  *
4472  *   - @a ctx->log_msg_func3 and @a ctx->log_msg_baton3 are ignored.
4473  *
4474  *   - This is a scheduling operation.  No changes will happen to the
4475  *     repository until a commit occurs.  This scheduling can be removed
4476  *     with svn_client_revert2().  If one of @a src_paths is a file it is
4477  *     removed from the working copy immediately.  If one of @a src_path
4478  *     is a directory it will remain in the working copy but all the files,
4479  *     and unversioned items, it contains will be removed.
4480  *
4481  * If @a src_paths has only one item, attempt to move it to @a dst_path.  If
4482  * @a move_as_child is TRUE and @a dst_path already exists, attempt to move the
4483  * item as a child of @a dst_path.  If @a move_as_child is FALSE and
4484  * @a dst_path already exists, fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path
4485  * is a working copy path and #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a
4486  * URL.
4487  *
4488  * If @a src_paths has multiple items, and @a move_as_child is TRUE, all
4489  * @a src_paths are moved as children of @a dst_path.  If any child of
4490  * @a dst_path already exists with the same name any item in @a src_paths,
4491  * fail with #SVN_ERR_ENTRY_EXISTS if @a dst_path is a working copy path and
4492  * #SVN_ERR_FS_ALREADY_EXISTS if @a dst_path is a URL.
4493  *
4494  * If @a src_paths has multiple items, and @a move_as_child is FALSE, fail
4495  * with #SVN_ERR_CLIENT_MULTIPLE_SOURCES_DISALLOWED.
4496  *
4497  * If @a make_parents is TRUE, create any non-existent parent directories
4498  * also.  Otherwise, the parent of @a dst_path must already exist.
4499  *
4500  * If @a allow_mixed_revisions is @c FALSE, #SVN_ERR_WC_MIXED_REVISIONS
4501  * will be raised if the move source is a mixed-revision subtree.
4502  * If @a allow_mixed_revisions is TRUE, a mixed-revision move source is
4503  * allowed but the move will degrade to a copy and a delete without local
4504  * move tracking. This parameter should be set to FALSE except where backwards
4505  * compatibility to svn_client_move6() is required.
4506  *
4507  * If @a metadata_only is @c TRUE and moving a file in a working copy,
4508  * everything in the metadata is updated as if the node is moved, but the
4509  * actual disk move operation is not performed. This feature is useful for
4510  * clients that want to keep the working copy in sync while the actual working
4511  * copy is updated by some other task.
4512  *
4513  * If non-NULL, @a revprop_table is a hash table holding additional,
4514  * custom revision properties (<tt>const char *</tt> names mapped to
4515  * <tt>svn_string_t *</tt> values) to be set on the new revision in
4516  * the event that this is a committing operation.  This table cannot
4517  * contain any standard Subversion properties.
4518  *
4519  * @a ctx->log_msg_func3/@a ctx->log_msg_baton3 are a callback/baton combo that
4520  * this function can use to query for a commit log message when one is needed.
4521  *
4522  * If @a ctx->notify_func2 is non-NULL, then for each item moved, call
4523  * @a ctx->notify_func2 with the @a ctx->notify_baton2 twice, once to indicate
4524  * the deletion of the moved thing, and once to indicate the addition of
4525  * the new location of the thing.
4526  *
4527  * ### Is this really true?  What about svn_wc_notify_commit_replaced()? ###
4528  *
4529  * If @a commit_callback is non-NULL, then for each successful commit, call
4530  * @a commit_callback with @a commit_baton and a #svn_commit_info_t for
4531  * the commit.
4532  *
4533  * @since New in 1.8.
4534  */
4535 svn_error_t *
4536 svn_client_move7(const apr_array_header_t *src_paths,
4537                  const char *dst_path,
4538                  svn_boolean_t move_as_child,
4539                  svn_boolean_t make_parents,
4540                  svn_boolean_t allow_mixed_revisions,
4541                  svn_boolean_t metadata_only,
4542                  const apr_hash_t *revprop_table,
4543                  svn_commit_callback2_t commit_callback,
4544                  void *commit_baton,
4545                  svn_client_ctx_t *ctx,
4546                  apr_pool_t *pool);
4547
4548 /**
4549  * Similar to svn_client_move7(), but with @a allow_mixed_revisions always
4550  * set to @c TRUE and @a metadata_only always to @c FALSE.
4551  *
4552  * @since New in 1.7.
4553  * @deprecated Provided for backward compatibility with the 1.7 API.
4554  */
4555 SVN_DEPRECATED
4556 svn_error_t *
4557 svn_client_move6(const apr_array_header_t *src_paths,
4558                  const char *dst_path,
4559                  svn_boolean_t move_as_child,
4560                  svn_boolean_t make_parents,
4561                  const apr_hash_t *revprop_table,
4562                  svn_commit_callback2_t commit_callback,
4563                  void *commit_baton,
4564                  svn_client_ctx_t *ctx,
4565                  apr_pool_t *pool);
4566
4567 /**
4568  * Similar to svn_client_move6(), but returns the commit info in
4569  * @a *commit_info_p rather than through a callback function.
4570  *
4571  * A WC-to-WC move will include any modified and/or unversioned children.
4572  * @a force is ignored.
4573  *
4574  * @since New in 1.5.
4575  * @deprecated Provided for backward compatibility with the 1.6 API.
4576  */
4577 SVN_DEPRECATED
4578 svn_error_t *
4579 svn_client_move5(svn_commit_info_t **commit_info_p,
4580                  const apr_array_header_t *src_paths,
4581                  const char *dst_path,
4582                  svn_boolean_t force,
4583                  svn_boolean_t move_as_child,
4584                  svn_boolean_t make_parents,
4585                  const apr_hash_t *revprop_table,
4586                  svn_client_ctx_t *ctx,
4587                  apr_pool_t *pool);
4588
4589 /**
4590  * Similar to svn_client_move5(), with only one @a src_path, @a
4591  * move_as_child set to @c FALSE, @a revprop_table passed as NULL, and
4592  * @a make_parents set to @c FALSE.
4593  *
4594  * Note: The behaviour of @a force changed in 1.5 (r860885 and r861421), when
4595  * the 'move' semantics were improved to just move the source including any
4596  * modified and/or unversioned items in it.  Before that, @a force
4597  * controlled what happened to such items, but now @a force is ignored.
4598  *
4599  * @since New in 1.4.
4600  *
4601  * @deprecated Provided for backward compatibility with the 1.4 API.
4602  */
4603 SVN_DEPRECATED
4604 svn_error_t *
4605 svn_client_move4(svn_commit_info_t **commit_info_p,
4606                  const char *src_path,
4607                  const char *dst_path,
4608                  svn_boolean_t force,
4609                  svn_client_ctx_t *ctx,
4610                  apr_pool_t *pool);
4611
4612 /**
4613  * Similar to svn_client_move4(), with the difference that if @a dst_path
4614  * already exists and is a directory, move the item into that directory,
4615  * keeping its name (the last component of @a src_path).
4616  *
4617  * @since New in 1.3.
4618  *
4619  * @deprecated Provided for backward compatibility with the 1.3 API.
4620  */
4621 SVN_DEPRECATED
4622 svn_error_t *
4623 svn_client_move3(svn_commit_info_t **commit_info_p,
4624                  const char *src_path,
4625                  const char *dst_path,
4626                  svn_boolean_t force,
4627                  svn_client_ctx_t *ctx,
4628                  apr_pool_t *pool);
4629
4630 /**
4631  * Similar to svn_client_move3(), but uses #svn_client_commit_info_t
4632  * for @a commit_info_p.
4633  *
4634  * @deprecated Provided for backward compatibility with the 1.2 API.
4635  *
4636  * @since New in 1.2.
4637  */
4638 SVN_DEPRECATED
4639 svn_error_t *
4640 svn_client_move2(svn_client_commit_info_t **commit_info_p,
4641                  const char *src_path,
4642                  const char *dst_path,
4643                  svn_boolean_t force,
4644                  svn_client_ctx_t *ctx,
4645                  apr_pool_t *pool);
4646
4647 /**
4648  * Similar to svn_client_move2(), but an extra argument @a src_revision
4649  * must be passed.  This has no effect, but must be of kind
4650  * #svn_opt_revision_unspecified or #svn_opt_revision_head,
4651  * otherwise error #SVN_ERR_UNSUPPORTED_FEATURE is returned.
4652  *
4653  * @deprecated Provided for backward compatibility with the 1.1 API.
4654  */
4655 SVN_DEPRECATED
4656 svn_error_t *
4657 svn_client_move(svn_client_commit_info_t **commit_info_p,
4658                 const char *src_path,
4659                 const svn_opt_revision_t *src_revision,
4660                 const char *dst_path,
4661                 svn_boolean_t force,
4662                 svn_client_ctx_t *ctx,
4663                 apr_pool_t *pool);
4664
4665 /** @} */
4666
4667 \f
4668 /** Properties
4669  *
4670  * Note that certain svn-controlled properties must always have their
4671  * values set and stored in UTF8 with LF line endings.  When
4672  * retrieving these properties, callers must convert the values back
4673  * to native locale and native line-endings before displaying them to
4674  * the user.  For help with this task, see
4675  * svn_prop_needs_translation(), svn_subst_translate_string(),  and
4676  * svn_subst_detranslate_string().
4677  *
4678  * @defgroup svn_client_prop_funcs Property functions
4679  * @{
4680  */
4681
4682
4683 /**
4684  * Set @a propname to @a propval on @a url.  A @a propval of @c NULL will
4685  * delete the property.
4686  *
4687  * Immediately attempt to commit the property change in the repository,
4688  * using the authentication baton in @a ctx and @a
4689  * ctx->log_msg_func3/@a ctx->log_msg_baton3.
4690  *
4691  * If the property has changed on @a url since revision
4692  * @a base_revision_for_url (which must not be #SVN_INVALID_REVNUM), no
4693  * change will be made and an error will be returned.
4694  *
4695  * If non-NULL, @a revprop_table is a hash table holding additional,
4696  * custom revision properties (<tt>const char *</tt> names mapped to
4697  * <tt>svn_string_t *</tt> values) to be set on the new revision.  This
4698  * table cannot contain any standard Subversion properties.
4699  *
4700  * If @a commit_callback is non-NULL, then call @a commit_callback with
4701  * @a commit_baton and a #svn_commit_info_t for the commit.
4702  *
4703  * If @a propname is an svn-controlled property (i.e. prefixed with
4704  * #SVN_PROP_PREFIX), then the caller is responsible for ensuring that
4705  * the value is UTF8-encoded and uses LF line-endings.
4706  *
4707  * If @a skip_checks is TRUE, do no validity checking.  But if @a
4708  * skip_checks is FALSE, and @a propname is not a valid property for @a
4709  * url, return an error, either #SVN_ERR_ILLEGAL_TARGET (if the property is
4710  * not appropriate for @a url), or * #SVN_ERR_BAD_MIME_TYPE (if @a propname
4711  * is "svn:mime-type", but @a propval is not a valid mime-type).
4712  *
4713  * Use @a scratch_pool for all memory allocation.
4714  *
4715  * @since New in 1.7.
4716  */
4717 svn_error_t *
4718 svn_client_propset_remote(const char *propname,
4719                           const svn_string_t *propval,
4720                           const char *url,
4721                           svn_boolean_t skip_checks,
4722                           svn_revnum_t base_revision_for_url,
4723                           const apr_hash_t *revprop_table,
4724                           svn_commit_callback2_t commit_callback,
4725                           void *commit_baton,
4726                           svn_client_ctx_t *ctx,
4727                           apr_pool_t *scratch_pool);
4728
4729 /**
4730  * Set @a propname to @a propval on each (const char *) target in @a
4731  * targets.  The targets must be all working copy paths.  A @a propval
4732  * of @c NULL will delete the property.
4733  *
4734  * If @a depth is #svn_depth_empty, set the property on each member of
4735  * @a targets only; if #svn_depth_files, set it on @a targets and their
4736  * file children (if any); if #svn_depth_immediates, on @a targets and all
4737  * of their immediate children (both files and directories); if
4738  * #svn_depth_infinity, on @a targets and everything beneath them.
4739  *
4740  * @a changelists is an array of <tt>const char *</tt> changelist
4741  * names, used as a restrictive filter on items whose properties are
4742  * set; that is, don't set properties on any item unless it's a member
4743  * of one of those changelists.  If @a changelists is empty (or
4744  * altogether @c NULL), no changelist filtering occurs.
4745  *
4746  * If @a propname is an svn-controlled property (i.e. prefixed with
4747  * #SVN_PROP_PREFIX), then the caller is responsible for ensuring that
4748  * the value is UTF8-encoded and uses LF line-endings.
4749  *
4750  * If @a skip_checks is TRUE, do no validity checking.  But if @a
4751  * skip_checks is FALSE, and @a propname is not a valid property for @a
4752  * targets, return an error, either #SVN_ERR_ILLEGAL_TARGET (if the
4753  * property is not appropriate for @a targets), or
4754  * #SVN_ERR_BAD_MIME_TYPE (if @a propname is "svn:mime-type", but @a
4755  * propval is not a valid mime-type).
4756  *
4757  * If @a ctx->cancel_func is non-NULL, invoke it passing @a
4758  * ctx->cancel_baton at various places during the operation.
4759  *
4760  * Use @a scratch_pool for all memory allocation.
4761  *
4762  * @since New in 1.7.
4763  */
4764 svn_error_t *
4765 svn_client_propset_local(const char *propname,
4766                          const svn_string_t *propval,
4767                          const apr_array_header_t *targets,
4768                          svn_depth_t depth,
4769                          svn_boolean_t skip_checks,
4770                          const apr_array_header_t *changelists,
4771                          svn_client_ctx_t *ctx,
4772                          apr_pool_t *scratch_pool);
4773
4774 /**
4775  * An amalgamation of svn_client_propset_local() and
4776  * svn_client_propset_remote() that takes only a single target, and
4777  * returns the commit info in @a *commit_info_p rather than through a
4778  * callback function.
4779  *
4780  * @since New in 1.5.
4781  * @deprecated Provided for backward compatibility with the 1.6 API.
4782  */
4783 SVN_DEPRECATED
4784 svn_error_t *
4785 svn_client_propset3(svn_commit_info_t **commit_info_p,
4786                     const char *propname,
4787                     const svn_string_t *propval,
4788                     const char *target,
4789                     svn_depth_t depth,
4790                     svn_boolean_t skip_checks,
4791                     svn_revnum_t base_revision_for_url,
4792                     const apr_array_header_t *changelists,
4793                     const apr_hash_t *revprop_table,
4794                     svn_client_ctx_t *ctx,
4795                     apr_pool_t *pool);
4796
4797 /**
4798  * Like svn_client_propset3(), but with @a base_revision_for_url
4799  * always #SVN_INVALID_REVNUM; @a commit_info_p always @c NULL; @a
4800  * changelists always @c NULL; @a revprop_table always @c NULL; and @a
4801  * depth set according to @a recurse: if @a recurse is TRUE, @a depth
4802  * is #svn_depth_infinity, else #svn_depth_empty.
4803  *
4804  * @deprecated Provided for backward compatibility with the 1.4 API.
4805  */
4806 SVN_DEPRECATED
4807 svn_error_t *
4808 svn_client_propset2(const char *propname,
4809                     const svn_string_t *propval,
4810                     const char *target,
4811                     svn_boolean_t recurse,
4812                     svn_boolean_t skip_checks,
4813                     svn_client_ctx_t *ctx,
4814                     apr_pool_t *pool);
4815
4816 /**
4817  * Like svn_client_propset2(), but with @a skip_checks always FALSE and a
4818  * newly created @a ctx.
4819  *
4820  * @deprecated Provided for backward compatibility with the 1.1 API.
4821  */
4822 SVN_DEPRECATED
4823 svn_error_t *
4824 svn_client_propset(const char *propname,
4825                    const svn_string_t *propval,
4826                    const char *target,
4827                    svn_boolean_t recurse,
4828                    apr_pool_t *pool);
4829
4830 /** Set @a propname to @a propval on revision @a revision in the repository
4831  * represented by @a URL.  Use the authentication baton in @a ctx for
4832  * authentication, and @a pool for all memory allocation.  Return the actual
4833  * rev affected in @a *set_rev.  A @a propval of @c NULL will delete the
4834  * property.
4835  *
4836  * If @a original_propval is non-NULL, then just before setting the
4837  * new value, check that the old value matches @a original_propval;
4838  * if they do not match, return the error #SVN_ERR_RA_OUT_OF_DATE.
4839  * This is to help clients support interactive editing of revprops:
4840  * without this check, the window during which the property may change
4841  * underneath the user is as wide as the amount of time the user
4842  * spends editing the property.  With this check, the window is
4843  * reduced to a small, constant amount of time right before we set the
4844  * new value.  (To check that an old value is still non-existent, set
4845  * @a original_propval->data to NULL, and @a original_propval->len is
4846  * ignored.)
4847  * If the server advertises #SVN_RA_CAPABILITY_ATOMIC_REVPROPS, the
4848  * check of @a original_propval is done atomically.
4849  *
4850  * Note: the representation of "property is not set" in @a
4851  * original_propval differs from the representation in other APIs
4852  * (such as svn_fs_change_rev_prop2() and svn_ra_change_rev_prop2()).
4853  *
4854  * If @a force is TRUE, allow newlines in the author property.
4855  *
4856  * If @a propname is an svn-controlled property (i.e. prefixed with
4857  * #SVN_PROP_PREFIX), then the caller is responsible for ensuring that
4858  * the value UTF8-encoded and uses LF line-endings.
4859  *
4860  * Note that unlike its cousin svn_client_propset3(), this routine
4861  * doesn't affect the working copy at all;  it's a pure network
4862  * operation that changes an *unversioned* property attached to a
4863  * revision.  This can be used to tweak log messages, dates, authors,
4864  * and the like.  Be careful:  it's a lossy operation.
4865
4866  * @a ctx->notify_func2 and @a ctx->notify_baton2 are the notification
4867  * functions and baton which are called upon successful setting of the
4868  * property.
4869  *
4870  * Also note that unless the administrator creates a
4871  * pre-revprop-change hook in the repository, this feature will fail.
4872  *
4873  * @since New in 1.6.
4874  */
4875 svn_error_t *
4876 svn_client_revprop_set2(const char *propname,
4877                         const svn_string_t *propval,
4878                         const svn_string_t *original_propval,
4879                         const char *URL,
4880                         const svn_opt_revision_t *revision,
4881                         svn_revnum_t *set_rev,
4882                         svn_boolean_t force,
4883                         svn_client_ctx_t *ctx,
4884                         apr_pool_t *pool);
4885
4886 /**
4887  * Similar to svn_client_revprop_set2(), but with @a original_propval
4888  * always @c NULL.
4889  *
4890  * @deprecated Provided for backward compatibility with the 1.5 API.
4891  */
4892 SVN_DEPRECATED
4893 svn_error_t *
4894 svn_client_revprop_set(const char *propname,
4895                        const svn_string_t *propval,
4896                        const char *URL,
4897                        const svn_opt_revision_t *revision,
4898                        svn_revnum_t *set_rev,
4899                        svn_boolean_t force,
4900                        svn_client_ctx_t *ctx,
4901                        apr_pool_t *pool);
4902
4903 /**
4904  * Set @a *props to a hash table whose keys are absolute paths or URLs
4905  * of items on which property @a propname is explicitly set, and whose
4906  * values are <tt>svn_string_t *</tt> representing the property value for
4907  * @a propname at that path.
4908  *
4909  * If @a inherited_props is not @c NULL, then set @a *inherited_props to a
4910  * depth-first ordered array of #svn_prop_inherited_item_t * structures
4911  * representing the properties inherited by @a target.  If @a target is a
4912  * working copy path, then properties inherited by @a target as far as the
4913  * root of the working copy are obtained from the working copy's actual
4914  * property values.  Properties inherited from above the working copy root
4915  * come from the inherited properties cache.  If @a target is a URL, then
4916  * the inherited properties come from the repository.  If @a inherited_props
4917  * is not @c NULL and no inheritable properties are found, then set
4918  * @a *inherited_props to an empty array.
4919  *
4920  * The #svn_prop_inherited_item_t->path_or_url members of the
4921  * #svn_prop_inherited_item_t * structures in @a *inherited_props are
4922  * URLs if @a target is a URL or if @a target is a working copy path but the
4923  * property represented by the structure is above the working copy root (i.e.
4924  * the inherited property is from the cache).  In all other cases the
4925  * #svn_prop_inherited_item_t->path_or_url members are absolute working copy
4926  * paths.
4927  *
4928  * Allocate @a *props (including keys and values) and @a *inherited_props
4929  * (including its elements) in @a result_pool, use @a scratch_pool for
4930  * temporary allocations.
4931  *
4932  * @a target is a WC absolute path or a URL.
4933  *
4934  * Don't store any path, not even @a target, if it does not have a
4935  * property named @a propname.
4936  *
4937  * If @a revision->kind is #svn_opt_revision_unspecified, then: get
4938  * properties from the working copy if @a target is a working copy
4939  * path, or from the repository head if @a target is a URL.  Else get
4940  * the properties as of @a revision.  The actual node revision
4941  * selected is determined by the path as it exists in @a peg_revision.
4942  * If @a peg_revision->kind is #svn_opt_revision_unspecified, then
4943  * it defaults to #svn_opt_revision_head for URLs or
4944  * #svn_opt_revision_working for WC targets.  Use the authentication
4945  * baton in @a ctx for authentication if contacting the repository.
4946  * If @a actual_revnum is not @c NULL, the actual revision number used
4947  * for the fetch is stored in @a *actual_revnum.
4948  *
4949  * If @a depth is #svn_depth_empty, fetch the property from
4950  * @a target only; if #svn_depth_files, fetch from @a target and its
4951  * file children (if any); if #svn_depth_immediates, from @a target
4952  * and all of its immediate children (both files and directories); if
4953  * #svn_depth_infinity, from @a target and everything beneath it.
4954  *
4955  * @a changelists is an array of <tt>const char *</tt> changelist
4956  * names, used as a restrictive filter on items whose properties are
4957  * gotten; that is, don't get @a propname on any item unless it's a member
4958  * of one of those changelists.  If @a changelists is empty (or
4959  * altogether @c NULL), no changelist filtering occurs.
4960  *
4961  * If error, don't touch @a *props, otherwise @a *props is a hash table
4962  * even if empty.
4963  *
4964  * This function returns SVN_ERR_UNVERSIONED_RESOURCE when it is called on
4965  * unversioned nodes.
4966  *
4967  * @since New in 1.8.
4968  */
4969 svn_error_t *
4970 svn_client_propget5(apr_hash_t **props,
4971                     apr_array_header_t **inherited_props,
4972                     const char *propname,
4973                     const char *target,  /* abspath or URL */
4974                     const svn_opt_revision_t *peg_revision,
4975                     const svn_opt_revision_t *revision,
4976                     svn_revnum_t *actual_revnum,
4977                     svn_depth_t depth,
4978                     const apr_array_header_t *changelists,
4979                     svn_client_ctx_t *ctx,
4980                     apr_pool_t *result_pool,
4981                     apr_pool_t *scratch_pool);
4982
4983 /**
4984  * Similar to svn_client_propget5 but with @a inherited_props always
4985  * passed as NULL.
4986  *
4987  * @since New in 1.7.
4988  * @deprecated Provided for backward compatibility with the 1.7 API.
4989  */
4990 SVN_DEPRECATED
4991 svn_error_t *
4992 svn_client_propget4(apr_hash_t **props,
4993                     const char *propname,
4994                     const char *target,  /* abspath or URL */
4995                     const svn_opt_revision_t *peg_revision,
4996                     const svn_opt_revision_t *revision,
4997                     svn_revnum_t *actual_revnum,
4998                     svn_depth_t depth,
4999                     const apr_array_header_t *changelists,
5000                     svn_client_ctx_t *ctx,
5001                     apr_pool_t *result_pool,
5002                     apr_pool_t *scratch_pool);
5003
5004 /**
5005  * Similar to svn_client_propget4(), but with the following change to the
5006  * output hash keys:  keys are `<tt>char *</tt>' paths, prefixed by
5007  * @a target, which is a working copy path or a URL.
5008  *
5009  * This function returns SVN_ERR_ENTRY_NOT_FOUND where svn_client_propget4
5010  * would return SVN_ERR_UNVERSIONED_RESOURCE.
5011  *
5012  * @since New in 1.5.
5013  * @deprecated Provided for backward compatibility with the 1.6 API.
5014  */
5015 SVN_DEPRECATED
5016 svn_error_t *
5017 svn_client_propget3(apr_hash_t **props,
5018                     const char *propname,
5019                     const char *target,
5020                     const svn_opt_revision_t *peg_revision,
5021                     const svn_opt_revision_t *revision,
5022                     svn_revnum_t *actual_revnum,
5023                     svn_depth_t depth,
5024                     const apr_array_header_t *changelists,
5025                     svn_client_ctx_t *ctx,
5026                     apr_pool_t *pool);
5027
5028 /**
5029  * Similar to svn_client_propget3(), except that @a actual_revnum and
5030  * @a changelists are always @c NULL, and @a depth is set according to
5031  * @a recurse: if @a recurse is TRUE, then @a depth is
5032  * #svn_depth_infinity, else #svn_depth_empty.
5033  *
5034  * @deprecated Provided for backward compatibility with the 1.4 API.
5035  */
5036 SVN_DEPRECATED
5037 svn_error_t *
5038 svn_client_propget2(apr_hash_t **props,
5039                     const char *propname,
5040                     const char *target,
5041                     const svn_opt_revision_t *peg_revision,
5042                     const svn_opt_revision_t *revision,
5043                     svn_boolean_t recurse,
5044                     svn_client_ctx_t *ctx,
5045                     apr_pool_t *pool);
5046
5047 /**
5048  * Similar to svn_client_propget2(), except that @a peg_revision is
5049  * always the same as @a revision.
5050  *
5051  * @deprecated Provided for backward compatibility with the 1.1 API.
5052  */
5053 SVN_DEPRECATED
5054 svn_error_t *
5055 svn_client_propget(apr_hash_t **props,
5056                    const char *propname,
5057                    const char *target,
5058                    const svn_opt_revision_t *revision,
5059                    svn_boolean_t recurse,
5060                    svn_client_ctx_t *ctx,
5061                    apr_pool_t *pool);
5062
5063 /** Set @a *propval to the value of @a propname on revision @a revision
5064  * in the repository represented by @a URL.  Use the authentication baton
5065  * in @a ctx for authentication, and @a pool for all memory allocation.
5066  * Return the actual rev queried in @a *set_rev.
5067  *
5068  * Note that unlike its cousin svn_client_propget(), this routine
5069  * doesn't affect the working copy at all; it's a pure network
5070  * operation that queries an *unversioned* property attached to a
5071  * revision.  This can query log messages, dates, authors, and the
5072  * like.
5073  */
5074 svn_error_t *
5075 svn_client_revprop_get(const char *propname,
5076                        svn_string_t **propval,
5077                        const char *URL,
5078                        const svn_opt_revision_t *revision,
5079                        svn_revnum_t *set_rev,
5080                        svn_client_ctx_t *ctx,
5081                        apr_pool_t *pool);
5082
5083 /**
5084  * Invoke @a receiver with @a receiver_baton to return the regular explicit, and
5085  * possibly the inherited, properties of @a target, a URL or working copy path.
5086  * @a receiver will be called for each path encountered.
5087  *
5088  * @a target is a WC path or a URL.
5089  *
5090  * If @a revision->kind is #svn_opt_revision_unspecified, then get the
5091  * explicit (and possibly the inherited) properties from the working copy,
5092  * if @a target is a working copy path, or from the repository head if
5093  * @a target is a URL.  Else get the properties as of @a revision.
5094  * The actual node revision selected is determined by the path as it exists
5095  * in @a peg_revision.  If @a peg_revision->kind is
5096  * #svn_opt_revision_unspecified, then it defaults to #svn_opt_revision_head
5097  * for URLs or #svn_opt_revision_working for WC targets.  Use the
5098  * authentication baton cached in @a ctx for authentication if contacting
5099  * the repository.
5100  *
5101  * If @a depth is #svn_depth_empty, list only the properties of
5102  * @a target itself.  If @a depth is #svn_depth_files, and
5103  * @a target is a directory, list the properties of @a target
5104  * and its file entries.  If #svn_depth_immediates, list the properties
5105  * of its immediate file and directory entries.  If #svn_depth_infinity,
5106  * list the properties of its file entries and recurse (with
5107  * #svn_depth_infinity) on directory entries.  #svn_depth_unknown is
5108  * equivalent to #svn_depth_empty.  All other values produce undefined
5109  * results.
5110  *
5111  * @a changelists is an array of <tt>const char *</tt> changelist
5112  * names, used as a restrictive filter on items whose properties are
5113  * listed; that is, don't list properties on any item unless it's a member
5114  * of one of those changelists.  If @a changelists is empty (or
5115  * altogether @c NULL), no changelist filtering occurs.
5116  *
5117  * If @a get_target_inherited_props is true, then also return any inherited
5118  * properties when @a receiver is called for @a target.  If @a target is a
5119  * working copy path, then properties inherited by @a target as far as the
5120  * root of the working copy are obtained from the working copy's actual
5121  * property values.  Properties inherited from above the working copy
5122  * root come from the inherited properties cache.  If @a target is a URL,
5123  * then the inherited properties come from the repository.
5124  * If @a get_target_inherited_props is false, then no inherited properties
5125  * are returned to @a receiver.
5126  *
5127  * If @a target is not found, return the error #SVN_ERR_ENTRY_NOT_FOUND.
5128  *
5129  * @since New in 1.8.
5130  */
5131 svn_error_t *
5132 svn_client_proplist4(const char *target,
5133                      const svn_opt_revision_t *peg_revision,
5134                      const svn_opt_revision_t *revision,
5135                      svn_depth_t depth,
5136                      const apr_array_header_t *changelists,
5137                      svn_boolean_t get_target_inherited_props,
5138                      svn_proplist_receiver2_t receiver,
5139                      void *receiver_baton,
5140                      svn_client_ctx_t *ctx,
5141                      apr_pool_t *scratch_pool);
5142
5143 /**
5144  * Similar to svn_client_proplist4(), except that the @a receiver type
5145  * is a #svn_proplist_receiver_t, @a get_target_inherited_props is
5146  * always passed NULL, and there is no separate scratch pool.
5147  *
5148  * @since New in 1.5.
5149  * @deprecated Provided for backward compatibility with the 1.7 API.
5150  */
5151 SVN_DEPRECATED
5152 svn_error_t *
5153 svn_client_proplist3(const char *target,
5154                      const svn_opt_revision_t *peg_revision,
5155                      const svn_opt_revision_t *revision,
5156                      svn_depth_t depth,
5157                      const apr_array_header_t *changelists,
5158                      svn_proplist_receiver_t receiver,
5159                      void *receiver_baton,
5160                      svn_client_ctx_t *ctx,
5161                      apr_pool_t *pool);
5162
5163 /**
5164  * Similar to svn_client_proplist3(), except the properties are
5165  * returned as an array of #svn_client_proplist_item_t * structures
5166  * instead of by invoking the receiver function, there's no support
5167  * for @a changelists filtering, and @a recurse is used instead of a
5168  * #svn_depth_t parameter (FALSE corresponds to #svn_depth_empty,
5169  * and TRUE to #svn_depth_infinity).
5170  *
5171  * @since New in 1.2.
5172  *
5173  * @deprecated Provided for backward compatibility with the 1.4 API.
5174  */
5175 SVN_DEPRECATED
5176 svn_error_t *
5177 svn_client_proplist2(apr_array_header_t **props,
5178                      const char *target,
5179                      const svn_opt_revision_t *peg_revision,
5180                      const svn_opt_revision_t *revision,
5181                      svn_boolean_t recurse,
5182                      svn_client_ctx_t *ctx,
5183                      apr_pool_t *pool);
5184
5185 /**
5186  * Similar to svn_client_proplist2(), except that @a peg_revision is
5187  * always the same as @a revision.
5188  *
5189  * @deprecated Provided for backward compatibility with the 1.1 API.
5190  */
5191 SVN_DEPRECATED
5192 svn_error_t *
5193 svn_client_proplist(apr_array_header_t **props,
5194                     const char *target,
5195                     const svn_opt_revision_t *revision,
5196                     svn_boolean_t recurse,
5197                     svn_client_ctx_t *ctx,
5198                     apr_pool_t *pool);
5199
5200 /** Set @a *props to a hash of the revision props attached to @a revision in
5201  * the repository represented by @a URL.  Use the authentication baton cached
5202  * in @a ctx for authentication, and @a pool for all memory allocation.
5203  * Return the actual rev queried in @a *set_rev.
5204  *
5205  * The allocated hash maps (<tt>const char *</tt>) property names to
5206  * (#svn_string_t *) property values.
5207  *
5208  * Note that unlike its cousin svn_client_proplist(), this routine
5209  * doesn't read a working copy at all; it's a pure network operation
5210  * that reads *unversioned* properties attached to a revision.
5211  */
5212 svn_error_t *
5213 svn_client_revprop_list(apr_hash_t **props,
5214                         const char *URL,
5215                         const svn_opt_revision_t *revision,
5216                         svn_revnum_t *set_rev,
5217                         svn_client_ctx_t *ctx,
5218                         apr_pool_t *pool);
5219 /** @} */
5220 \f
5221
5222 /**
5223  * @defgroup Export Export a tree from version control.
5224  *
5225  * @{
5226  */
5227
5228 /**
5229  * Export the contents of either a subversion repository or a
5230  * subversion working copy into a 'clean' directory (meaning a
5231  * directory with no administrative directories).  If @a result_rev
5232  * is not @c NULL and the path being exported is a repository URL, set
5233  * @a *result_rev to the value of the revision actually exported (set
5234  * it to #SVN_INVALID_REVNUM for local exports).
5235  *
5236  * @a from_path_or_url is either the path the working copy on disk, or
5237  * a URL to the repository you wish to export.
5238  *
5239  * When exporting a directory, @a to_path is the path to the directory
5240  * where you wish to create the exported tree; when exporting a file, it
5241  * is the path of the file that will be created.  If @a to_path is the
5242  * empty path, then the basename of the export file/directory in the repository
5243  * will be used.  If @a to_path represents an existing directory, and a
5244  * file is being exported, then a file with the that basename will be
5245  * created under that directory (as with 'copy' operations).
5246  *
5247  * @a peg_revision is the revision where the path is first looked up
5248  * when exporting from a repository.  If @a peg_revision->kind is
5249  * #svn_opt_revision_unspecified, then it defaults to #svn_opt_revision_head
5250  * for URLs or #svn_opt_revision_working for WC targets.
5251  *
5252  * @a revision is the revision that should be exported, which is only used
5253  * when exporting from a repository.
5254  *
5255  * @a peg_revision and @a revision must not be @c NULL.
5256  *
5257  * @a ctx->notify_func2 and @a ctx->notify_baton2 are the notification
5258  * functions and baton which are passed to svn_client_checkout() when
5259  * exporting from a repository.
5260  *
5261  * @a ctx is a context used for authentication in the repository case.
5262  *
5263  * @a overwrite if TRUE will cause the export to overwrite files or
5264  * directories.
5265  *
5266  * If @a ignore_externals is set, don't process externals definitions
5267  * as part of this operation.
5268  *
5269  * If @a ignore_keywords is set, don't expand keywords as part of this
5270  * operation.
5271  *
5272  * @a native_eol allows you to override the standard eol marker on the
5273  * platform you are running on.  Can be either "LF", "CR" or "CRLF" or
5274  * NULL.  If NULL will use the standard eol marker.  Any other value
5275  * will cause the #SVN_ERR_IO_UNKNOWN_EOL error to be returned.
5276  *
5277  * If @a depth is #svn_depth_infinity, export fully recursively.  Else
5278  * if it is #svn_depth_immediates, export @a from_path_or_url and its
5279  * immediate children (if any), but with subdirectories empty and at
5280  * #svn_depth_empty.  Else if #svn_depth_files, export @a
5281  * from_path_or_url and its immediate file children (if any) only.  If
5282  * @a depth is #svn_depth_empty, then export exactly @a
5283  * from_path_or_url and none of its children.
5284  *
5285  * All allocations are done in @a pool.
5286  *
5287  * @since New in 1.7.
5288  */
5289 svn_error_t *
5290 svn_client_export5(svn_revnum_t *result_rev,
5291                    const char *from_path_or_url,
5292                    const char *to_path,
5293                    const svn_opt_revision_t *peg_revision,
5294                    const svn_opt_revision_t *revision,
5295                    svn_boolean_t overwrite,
5296                    svn_boolean_t ignore_externals,
5297                    svn_boolean_t ignore_keywords,
5298                    svn_depth_t depth,
5299                    const char *native_eol,
5300                    svn_client_ctx_t *ctx,
5301                    apr_pool_t *pool);
5302
5303 /**
5304  * Similar to svn_client_export5(), but with @a ignore_keywords set
5305  * to FALSE.
5306  *
5307  * @deprecated Provided for backward compatibility with the 1.6 API.
5308  * @since New in 1.5.
5309  */
5310 SVN_DEPRECATED
5311 svn_error_t *
5312 svn_client_export4(svn_revnum_t *result_rev,
5313                    const char *from_path_or_url,
5314                    const char *to_path,
5315                    const svn_opt_revision_t *peg_revision,
5316                    const svn_opt_revision_t *revision,
5317                    svn_boolean_t overwrite,
5318                    svn_boolean_t ignore_externals,
5319                    svn_depth_t depth,
5320                    const char *native_eol,
5321                    svn_client_ctx_t *ctx,
5322                    apr_pool_t *pool);
5323
5324
5325 /**
5326  * Similar to svn_client_export4(), but with @a depth set according to
5327  * @a recurse: if @a recurse is TRUE, set @a depth to
5328  * #svn_depth_infinity, if @a recurse is FALSE, set @a depth to
5329  * #svn_depth_files.
5330  *
5331  * @deprecated Provided for backward compatibility with the 1.4 API.
5332  *
5333  * @since New in 1.2.
5334  */
5335 SVN_DEPRECATED
5336 svn_error_t *
5337 svn_client_export3(svn_revnum_t *result_rev,
5338                    const char *from_path_or_url,
5339                    const char *to_path,
5340                    const svn_opt_revision_t *peg_revision,
5341                    const svn_opt_revision_t *revision,
5342                    svn_boolean_t overwrite,
5343                    svn_boolean_t ignore_externals,
5344                    svn_boolean_t recurse,
5345                    const char *native_eol,
5346                    svn_client_ctx_t *ctx,
5347                    apr_pool_t *pool);
5348
5349
5350 /**
5351  * Similar to svn_client_export3(), but with @a peg_revision
5352  * always set to #svn_opt_revision_unspecified, @a overwrite set to
5353  * the value of @a force, @a ignore_externals always FALSE, and
5354  * @a recurse always TRUE.
5355  *
5356  * @since New in 1.1.
5357  * @deprecated Provided for backward compatibility with the 1.1 API.
5358  */
5359 SVN_DEPRECATED
5360 svn_error_t *
5361 svn_client_export2(svn_revnum_t *result_rev,
5362                    const char *from_path_or_url,
5363                    const char *to_path,
5364                    svn_opt_revision_t *revision,
5365                    svn_boolean_t force,
5366                    const char *native_eol,
5367                    svn_client_ctx_t *ctx,
5368                    apr_pool_t *pool);
5369
5370
5371 /**
5372  * Similar to svn_client_export2(), but with @a native_eol always set
5373  * to NULL.
5374  *
5375  * @deprecated Provided for backward compatibility with the 1.0 API.
5376  */
5377 SVN_DEPRECATED
5378 svn_error_t *
5379 svn_client_export(svn_revnum_t *result_rev,
5380                   const char *from_path_or_url,
5381                   const char *to_path,
5382                   svn_opt_revision_t *revision,
5383                   svn_boolean_t force,
5384                   svn_client_ctx_t *ctx,
5385                   apr_pool_t *pool);
5386
5387 /** @} */
5388
5389 /**
5390  * @defgroup List List / ls
5391  *
5392  * @{
5393  */
5394
5395 /** The type of function invoked by svn_client_list3() to report the details
5396  * of each directory entry being listed.
5397  *
5398  * @a baton is the baton that was passed to the caller.  @a path is the
5399  * entry's path relative to @a abs_path; it is the empty path when reporting
5400  * the top node of the list operation.  @a dirent contains some or all of
5401  * the directory entry's details, as determined by the caller.  @a lock is
5402  * the entry's lock, if it is locked and if lock information is being
5403  * reported by the caller; otherwise @a lock is NULL.  @a abs_path is the
5404  * repository path of the top node of the list operation; it is relative to
5405  * the repository root and begins with "/".
5406  *
5407  * If svn_client_list3() was called with @a include_externals set to TRUE,
5408  * @a external_parent_url and @a external_target will be set.
5409  * @a external_parent_url is url of the directory which has the
5410  * externals definitions. @a external_target is the target subdirectory of
5411  * externals definitions which is relative to the parent directory that holds
5412  * the external item.
5413  *
5414  * If external_parent_url and external_target are defined, the item being
5415  * listed is part of the external described by external_parent_url and
5416  * external_target. Else, the item is not part of any external.
5417  * Moreover, we will never mix items which are part of separate
5418  * externals, and will always finish listing an external before listing
5419  * the next one.
5420  *
5421  * @a scratch_pool may be used for temporary allocations.
5422  *
5423  * @since New in 1.8.
5424  */
5425 typedef svn_error_t *(*svn_client_list_func2_t)(
5426   void *baton,
5427   const char *path,
5428   const svn_dirent_t *dirent,
5429   const svn_lock_t *lock,
5430   const char *abs_path,
5431   const char *external_parent_url,
5432   const char *external_target,
5433   apr_pool_t *scratch_pool);
5434
5435 /**
5436  * Similar to #svn_client_list_func2_t, but without any information about
5437  * externals definitions.
5438  *
5439  * @deprecated Provided for backward compatibility with the 1.7 API.
5440  *
5441  * @since New in 1.4
5442  *
5443  * */
5444 typedef svn_error_t *(*svn_client_list_func_t)(void *baton,
5445                                                const char *path,
5446                                                const svn_dirent_t *dirent,
5447                                                const svn_lock_t *lock,
5448                                                const char *abs_path,
5449                                                apr_pool_t *pool);
5450
5451 /**
5452  * Report the directory entry, and possibly children, for @a
5453  * path_or_url at @a revision.  The actual node revision selected is
5454  * determined by the path as it exists in @a peg_revision.  If @a
5455  * peg_revision->kind is #svn_opt_revision_unspecified, then it defaults
5456  * to #svn_opt_revision_head for URLs or #svn_opt_revision_working
5457  * for WC targets.
5458  *
5459  * Report directory entries by invoking @a list_func/@a baton with @a path
5460  * relative to @a path_or_url.  The dirent for @a path_or_url is reported
5461  * using an empty @a path.  If @a path_or_url is a directory, also report
5462  * its children.  If @a path_or_url is non-existent, return
5463  * #SVN_ERR_FS_NOT_FOUND.
5464  *
5465  * If @a fetch_locks is TRUE, include locks when reporting directory entries.
5466  *
5467  * If @a include_externals is TRUE, also list all external items
5468  * reached by recursion. @a depth value passed to the original list target
5469  * applies for the externals also.
5470  *
5471  * Use @a pool for temporary allocations.
5472  *
5473  * Use authentication baton cached in @a ctx to authenticate against the
5474  * repository.
5475  *
5476  * If @a depth is #svn_depth_empty, list just @a path_or_url itself.
5477  * If @a depth is #svn_depth_files, list @a path_or_url and its file
5478  * entries.  If #svn_depth_immediates, list its immediate file and
5479  * directory entries.  If #svn_depth_infinity, list file entries and
5480  * recurse (with #svn_depth_infinity) on directory entries.
5481  *
5482  * @a dirent_fields controls which fields in the #svn_dirent_t's are
5483  * filled in.  To have them totally filled in use #SVN_DIRENT_ALL,
5484  * otherwise simply bitwise OR together the combination of @c SVN_DIRENT_
5485  * fields you care about.
5486  *
5487  * @since New in 1.8.
5488  */
5489 svn_error_t *
5490 svn_client_list3(const char *path_or_url,
5491                  const svn_opt_revision_t *peg_revision,
5492                  const svn_opt_revision_t *revision,
5493                  svn_depth_t depth,
5494                  apr_uint32_t dirent_fields,
5495                  svn_boolean_t fetch_locks,
5496                  svn_boolean_t include_externals,
5497                  svn_client_list_func2_t list_func,
5498                  void *baton,
5499                  svn_client_ctx_t *ctx,
5500                  apr_pool_t *pool);
5501
5502
5503 /** Similar to svn_client_list3(), but with @a include_externals set
5504  * to FALSE, and using a #svn_client_list_func_t as callback.
5505  *
5506  * @deprecated Provided for backwards compatibility with the 1.7 API.
5507  *
5508  * @since New in 1.5.
5509  */
5510 SVN_DEPRECATED
5511 svn_error_t *
5512 svn_client_list2(const char *path_or_url,
5513                  const svn_opt_revision_t *peg_revision,
5514                  const svn_opt_revision_t *revision,
5515                  svn_depth_t depth,
5516                  apr_uint32_t dirent_fields,
5517                  svn_boolean_t fetch_locks,
5518                  svn_client_list_func_t list_func,
5519                  void *baton,
5520                  svn_client_ctx_t *ctx,
5521                  apr_pool_t *pool);
5522
5523 /**
5524  * Similar to svn_client_list2(), but with @a recurse instead of @a depth.
5525  * If @a recurse is TRUE, pass #svn_depth_files for @a depth; else
5526  * pass #svn_depth_infinity.
5527  *
5528  * @since New in 1.4.
5529  *
5530  * @deprecated Provided for backward compatibility with the 1.4 API.
5531  */
5532 SVN_DEPRECATED
5533 svn_error_t *
5534 svn_client_list(const char *path_or_url,
5535                 const svn_opt_revision_t *peg_revision,
5536                 const svn_opt_revision_t *revision,
5537                 svn_boolean_t recurse,
5538                 apr_uint32_t dirent_fields,
5539                 svn_boolean_t fetch_locks,
5540                 svn_client_list_func_t list_func,
5541                 void *baton,
5542                 svn_client_ctx_t *ctx,
5543                 apr_pool_t *pool);
5544
5545 /**
5546  * Same as svn_client_list(), but always passes #SVN_DIRENT_ALL for
5547  * the @a dirent_fields argument and returns all information in two
5548  * hash tables instead of invoking a callback.
5549  *
5550  * Set @a *dirents to a newly allocated hash of directory entries.
5551  * The @a dirents hash maps entry names (<tt>const char *</tt>) to
5552  * #svn_dirent_t *'s.
5553  *
5554  * If @a locks is not @c NULL, set @a *locks to a hash table mapping
5555  * entry names (<tt>const char *</tt>) to #svn_lock_t *'s.
5556  *
5557  * @since New in 1.3.
5558  *
5559  * @deprecated Provided for backward compatibility with the 1.3 API.
5560  * Use svn_client_list2() instead.
5561  */
5562 SVN_DEPRECATED
5563 svn_error_t *
5564 svn_client_ls3(apr_hash_t **dirents,
5565                apr_hash_t **locks,
5566                const char *path_or_url,
5567                const svn_opt_revision_t *peg_revision,
5568                const svn_opt_revision_t *revision,
5569                svn_boolean_t recurse,
5570                svn_client_ctx_t *ctx,
5571                apr_pool_t *pool);
5572
5573 /**
5574  * Same as svn_client_ls3(), but without the ability to get locks.
5575  *
5576  * @since New in 1.2.
5577  *
5578  * @deprecated Provided for backward compatibility with the 1.2 API.
5579  * Use svn_client_list2() instead.
5580  */
5581 SVN_DEPRECATED
5582 svn_error_t *
5583 svn_client_ls2(apr_hash_t **dirents,
5584                const char *path_or_url,
5585                const svn_opt_revision_t *peg_revision,
5586                const svn_opt_revision_t *revision,
5587                svn_boolean_t recurse,
5588                svn_client_ctx_t *ctx,
5589                apr_pool_t *pool);
5590
5591 /**
5592  * Similar to svn_client_ls2() except that @a peg_revision is always
5593  * the same as @a revision.
5594  *
5595  * @deprecated Provided for backward compatibility with the 1.1 API.
5596  * Use svn_client_list2() instead.
5597  */
5598 SVN_DEPRECATED
5599 svn_error_t *
5600 svn_client_ls(apr_hash_t **dirents,
5601               const char *path_or_url,
5602               svn_opt_revision_t *revision,
5603               svn_boolean_t recurse,
5604               svn_client_ctx_t *ctx,
5605               apr_pool_t *pool);
5606
5607
5608 /** @} */
5609
5610 /**
5611  * @defgroup Cat View the contents of a file in the repository.
5612  *
5613  * @{
5614  */
5615
5616 /**
5617  * Output the content of a file.
5618  *
5619  * @param[in] out           The stream to which the content will be written.
5620  * @param[in] path_or_url   The path or URL of the file.
5621  * @param[in] peg_revision  The peg revision.
5622  * @param[in] revision  The operative revision.
5623  * @param[in] ctx   The standard client context, used for possible
5624  *                  authentication.
5625  * @param[in] pool  Used for any temporary allocation.
5626  *
5627  * @todo Add an expansion/translation flag?
5628  *
5629  * @return A pointer to an #svn_error_t of the type (this list is not
5630  *         exhaustive): <br>
5631  *         An unspecified error if @a revision is of kind
5632  *         #svn_opt_revision_previous (or some other kind that requires
5633  *         a local path), because the desired revision cannot be
5634  *         determined. <br>
5635  *         If no error occurred, return #SVN_NO_ERROR.
5636  *
5637  * @since New in 1.2.
5638  *
5639  * @see #svn_client_ctx_t <br> @ref clnt_revisions for
5640  *      a discussion of operative and peg revisions.
5641  */
5642 svn_error_t *
5643 svn_client_cat2(svn_stream_t *out,
5644                 const char *path_or_url,
5645                 const svn_opt_revision_t *peg_revision,
5646                 const svn_opt_revision_t *revision,
5647                 svn_client_ctx_t *ctx,
5648                 apr_pool_t *pool);
5649
5650
5651 /**
5652  * Similar to svn_client_cat2() except that the peg revision is always
5653  * the same as @a revision.
5654  *
5655  * @deprecated Provided for backward compatibility with the 1.1 API.
5656  */
5657 SVN_DEPRECATED
5658 svn_error_t *
5659 svn_client_cat(svn_stream_t *out,
5660                const char *path_or_url,
5661                const svn_opt_revision_t *revision,
5662                svn_client_ctx_t *ctx,
5663                apr_pool_t *pool);
5664
5665 /** @} end group: cat */
5666
5667
5668 \f
5669 /** Changelist commands
5670  *
5671  * @defgroup svn_client_changelist_funcs Client Changelist Functions
5672  * @{
5673  */
5674
5675 /** Implementation note:
5676  *
5677  *  For now, changelists are implemented by scattering the
5678  *  associations across multiple .svn/entries files in a working copy.
5679  *  However, this client API was written so that we have the option of
5680  *  changing the underlying implementation -- we may someday want to
5681  *  store changelist definitions in a centralized database.
5682  */
5683
5684 /**
5685  * Add each path in @a paths (recursing to @a depth as necessary) to
5686  * @a changelist.  If a path is already a member of another
5687  * changelist, then remove it from the other changelist and add it to
5688  * @a changelist.  (For now, a path cannot belong to two changelists
5689  * at once.)
5690  *
5691  * @a paths is an array of (const char *) local WC paths.
5692  *
5693  * @a changelists is an array of <tt>const char *</tt> changelist
5694  * names, used as a restrictive filter on items whose changelist
5695  * assignments are adjusted; that is, don't tweak the changeset of any
5696  * item unless it's currently a member of one of those changelists.
5697  * If @a changelists is empty (or altogether @c NULL), no changelist
5698  * filtering occurs.
5699  *
5700  * @note This metadata is purely a client-side "bookkeeping"
5701  * convenience, and is entirely managed by the working copy.
5702  *
5703  * @since New in 1.5.
5704  */
5705 svn_error_t *
5706 svn_client_add_to_changelist(const apr_array_header_t *paths,
5707                              const char *changelist,
5708                              svn_depth_t depth,
5709                              const apr_array_header_t *changelists,
5710                              svn_client_ctx_t *ctx,
5711                              apr_pool_t *pool);
5712
5713 /**
5714  * Remove each path in @a paths (recursing to @a depth as necessary)
5715  * from changelists to which they are currently assigned.
5716  *
5717  * @a paths is an array of (const char *) local WC paths.
5718  *
5719  * @a changelists is an array of <tt>const char *</tt> changelist
5720  * names, used as a restrictive filter on items whose changelist
5721  * assignments are removed; that is, don't remove from a changeset any
5722  * item unless it's currently a member of one of those changelists.
5723  * If @a changelists is empty (or altogether @c NULL), all changelist
5724  * assignments in and under each path in @a paths (to @a depth) will
5725  * be removed.
5726  *
5727  * @note This metadata is purely a client-side "bookkeeping"
5728  * convenience, and is entirely managed by the working copy.
5729  *
5730  * @since New in 1.5.
5731  */
5732 svn_error_t *
5733 svn_client_remove_from_changelists(const apr_array_header_t *paths,
5734                                    svn_depth_t depth,
5735                                    const apr_array_header_t *changelists,
5736                                    svn_client_ctx_t *ctx,
5737                                    apr_pool_t *pool);
5738
5739
5740 /**
5741  * Beginning at @a path, crawl to @a depth to discover every path in
5742  * or under @a path which belongs to one of the changelists in @a
5743  * changelists (an array of <tt>const char *</tt> changelist names).
5744  * If @a changelists is @c NULL, discover paths with any changelist.
5745  * Call @a callback_func (with @a callback_baton) each time a
5746  * changelist-having path is discovered.
5747  *
5748  * @a path is a local WC path.
5749  *
5750  * If @a ctx->cancel_func is not @c NULL, invoke it passing @a
5751  * ctx->cancel_baton during the recursive walk.
5752  *
5753  * @since New in 1.5.
5754  */
5755 svn_error_t *
5756 svn_client_get_changelists(const char *path,
5757                            const apr_array_header_t *changelists,
5758                            svn_depth_t depth,
5759                            svn_changelist_receiver_t callback_func,
5760                            void *callback_baton,
5761                            svn_client_ctx_t *ctx,
5762                            apr_pool_t *pool);
5763
5764 /** @} */
5765
5766
5767 \f
5768 /** Locking commands
5769  *
5770  * @defgroup svn_client_locking_funcs Client Locking Functions
5771  * @{
5772  */
5773
5774 /**
5775  * Lock @a targets in the repository.  @a targets is an array of
5776  * <tt>const char *</tt> paths - either all working copy paths or all URLs.
5777  * All targets must be in the same repository.
5778  *
5779  * If a target is already locked in the repository, no lock will be
5780  * acquired unless @a steal_lock is TRUE, in which case the locks are
5781  * stolen.  @a comment, if non-NULL, is an xml-escapable description
5782  * stored with each lock in the repository.  Each acquired lock will
5783  * be stored in the working copy if the targets are WC paths.
5784  *
5785  * For each target @a ctx->notify_func2/notify_baton2 will be used to indicate
5786  * whether it was locked.  An action of #svn_wc_notify_locked
5787  * means that the path was locked.  If the path was not locked because
5788  * it was out of date or there was already a lock in the repository,
5789  * the notification function will be called with
5790  * #svn_wc_notify_failed_lock, and the error passed in the notification
5791  * structure.
5792  *
5793  * Use @a pool for temporary allocations.
5794  *
5795  * @since New in 1.2.
5796  */
5797 svn_error_t *
5798 svn_client_lock(const apr_array_header_t *targets,
5799                 const char *comment,
5800                 svn_boolean_t steal_lock,
5801                 svn_client_ctx_t *ctx,
5802                 apr_pool_t *pool);
5803
5804 /**
5805  * Unlock @a targets in the repository.  @a targets is an array of
5806  * <tt>const char *</tt> paths - either all working copy paths or all URLs.
5807  * All targets must be in the same repository.
5808  *
5809  * If the targets are WC paths, and @a break_lock is FALSE, the working
5810  * copy must contain a lock for each target.
5811  * If this is not the case, or the working copy lock doesn't match the
5812  * lock token in the repository, an error will be signaled.
5813  *
5814  * If the targets are URLs, the locks may be broken even if @a break_lock
5815  * is FALSE, but only if the lock owner is the same as the
5816  * authenticated user.
5817  *
5818  * If @a break_lock is TRUE, the locks will be broken in the
5819  * repository.  In both cases, the locks, if any, will be removed from
5820  * the working copy if the targets are WC paths.
5821  *
5822  * The notification functions in @a ctx will be called for each
5823  * target.  If the target was successfully unlocked,
5824  * #svn_wc_notify_unlocked will be used.  Else, if the error is
5825  * directly related to unlocking the path (see
5826  * #SVN_ERR_IS_UNLOCK_ERROR), #svn_wc_notify_failed_unlock will be
5827  * used and the error will be passed in the notification structure.
5828
5829  * Use @a pool for temporary allocations.
5830  *
5831  * @since New in 1.2.
5832  */
5833 svn_error_t *
5834 svn_client_unlock(const apr_array_header_t *targets,
5835                   svn_boolean_t break_lock,
5836                   svn_client_ctx_t *ctx,
5837                   apr_pool_t *pool);
5838
5839 /** @} */
5840
5841 /**
5842  * @defgroup Info Show repository information about a working copy.
5843  *
5844  * @{
5845  */
5846
5847 /** The size of the file is unknown.
5848  * Used as value in fields of type @c apr_size_t in #svn_info_t.
5849  *
5850  * @since New in 1.5
5851  * @deprecated Provided for backward compatibility with the 1.6 API.
5852  */
5853 #define SVN_INFO_SIZE_UNKNOWN ((apr_size_t) -1)
5854
5855 /**
5856  * A structure which describes various system-generated metadata about
5857  * a working-copy path or URL.
5858  *
5859  * @note Fields may be added to the end of this structure in future
5860  * versions.  Therefore, users shouldn't allocate structures of this
5861  * type, to preserve binary compatibility.
5862  *
5863  * @since New in 1.2.
5864  * @deprecated Provided for backward compatibility with the 1.6 API.  The new
5865  * API is #svn_client_info2_t.
5866  */
5867 typedef struct svn_info_t
5868 {
5869   /** Where the item lives in the repository. */
5870   const char *URL;
5871
5872   /** The revision of the object.  If path_or_url is a working-copy
5873    * path, then this is its current working revnum.  If path_or_url
5874    * is a URL, then this is the repos revision that path_or_url lives in. */
5875   svn_revnum_t rev;
5876
5877   /** The node's kind. */
5878   svn_node_kind_t kind;
5879
5880   /** The root URL of the repository. */
5881   const char *repos_root_URL;
5882
5883   /** The repository's UUID. */
5884   const char *repos_UUID;
5885
5886   /** The last revision in which this object changed. */
5887   svn_revnum_t last_changed_rev;
5888
5889   /** The date of the last_changed_rev. */
5890   apr_time_t last_changed_date;
5891
5892   /** The author of the last_changed_rev. */
5893   const char *last_changed_author;
5894
5895   /** An exclusive lock, if present.  Could be either local or remote. */
5896   svn_lock_t *lock;
5897
5898   /** Whether or not to ignore the next 10 wc-specific fields. */
5899   svn_boolean_t has_wc_info;
5900
5901   /**
5902    * @name Working-copy path fields
5903    * These things only apply to a working-copy path.
5904    * See svn_wc_entry_t for explanations.
5905    * @{
5906    */
5907   svn_wc_schedule_t schedule;
5908   const char *copyfrom_url;
5909   svn_revnum_t copyfrom_rev;
5910   apr_time_t text_time;
5911   apr_time_t prop_time;  /* will always be 0 for svn 1.4 and later */
5912   const char *checksum;
5913   const char *conflict_old;
5914   const char *conflict_new;
5915   const char *conflict_wrk;
5916   const char *prejfile;
5917   /** @since New in 1.5. */
5918   const char *changelist;
5919   /** @since New in 1.5. */
5920   svn_depth_t depth;
5921
5922   /**
5923    * Similar to working_size64, but will be #SVN_INFO_SIZE_UNKNOWN when
5924    * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte).
5925    *
5926    * @deprecated Provided for backward compatibility with the 1.5 API.
5927    */
5928   apr_size_t working_size;
5929
5930   /** @} */
5931
5932   /**
5933    * Similar to size64, but size will be #SVN_INFO_SIZE_UNKNOWN when
5934    * its value would overflow apr_size_t (so when size >= 4 GB - 1 byte).
5935    *
5936    * @deprecated Provided for backward compatibility with the 1.5 API.
5937    */
5938   apr_size_t size;
5939
5940   /**
5941    * The size of the file in the repository (untranslated,
5942    * e.g. without adjustment of line endings and keyword
5943    * expansion). Only applicable for file -- not directory -- URLs.
5944    * For working copy paths, size64 will be #SVN_INVALID_FILESIZE.
5945    * @since New in 1.6.
5946    */
5947   svn_filesize_t size64;
5948
5949   /**
5950    * The size of the file after being translated into its local
5951    * representation, or #SVN_INVALID_FILESIZE if unknown.
5952    * Not applicable for directories.
5953    * @since New in 1.6.
5954    * @name Working-copy path fields
5955    * @{
5956    */
5957   svn_filesize_t working_size64;
5958
5959   /**
5960    * Info on any tree conflict of which this node is a victim. Otherwise NULL.
5961    * @since New in 1.6.
5962    */
5963   svn_wc_conflict_description_t *tree_conflict;
5964
5965   /** @} */
5966
5967 } svn_info_t;
5968
5969
5970 /**
5971  * The callback invoked by svn_client_info2().  Each invocation
5972  * describes @a path with the information present in @a info.  Note
5973  * that any fields within @a info may be NULL if information is
5974  * unavailable.  Use @a pool for all temporary allocation.
5975  *
5976  * @since New in 1.2.
5977  * @deprecated Provided for backward compatibility with the 1.6 API.  The new
5978  * API is #svn_client_info_receiver2_t.
5979  */
5980 typedef svn_error_t *(*svn_info_receiver_t)(
5981   void *baton,
5982   const char *path,
5983   const svn_info_t *info,
5984   apr_pool_t *pool);
5985
5986 /**
5987  * Return a duplicate of @a info, allocated in @a pool. No part of the new
5988  * structure will be shared with @a info.
5989  *
5990  * @since New in 1.3.
5991  * @deprecated Provided for backward compatibility with the 1.6 API.  The new
5992  * API is #svn_client_info2_dup().
5993  */
5994 SVN_DEPRECATED
5995 svn_info_t *
5996 svn_info_dup(const svn_info_t *info,
5997              apr_pool_t *pool);
5998
5999 /**
6000  * A structure which describes various system-generated metadata about
6001  * a working-copy path or URL.
6002  *
6003  * @note Fields may be added to the end of this structure in future
6004  * versions.  Therefore, users shouldn't allocate structures of this
6005  * type, to preserve binary compatibility.
6006  *
6007  * @since New in 1.7.
6008  */
6009 typedef struct svn_client_info2_t
6010 {
6011   /** Where the item lives in the repository. */
6012   const char *URL;
6013
6014   /** The revision of the object.  If the target is a working-copy
6015    * path, then this is its current working revnum.  If the target
6016    * is a URL, then this is the repos revision that it lives in. */
6017   svn_revnum_t rev;
6018
6019   /** The root URL of the repository. */
6020   const char *repos_root_URL;
6021
6022   /** The repository's UUID. */
6023   const char *repos_UUID;
6024
6025   /** The node's kind. */
6026   svn_node_kind_t kind;
6027
6028   /** The size of the file in the repository (untranslated,
6029    * e.g. without adjustment of line endings and keyword
6030    * expansion). Only applicable for file -- not directory -- URLs.
6031    * For working copy paths, @a size will be #SVN_INVALID_FILESIZE. */
6032   svn_filesize_t size;
6033
6034   /** The last revision in which this object changed. */
6035   svn_revnum_t last_changed_rev;
6036
6037   /** The date of the last_changed_rev. */
6038   apr_time_t last_changed_date;
6039
6040   /** The author of the last_changed_rev. */
6041   const char *last_changed_author;
6042
6043   /** An exclusive lock, if present.  Could be either local or remote. */
6044   const svn_lock_t *lock;
6045
6046   /** Possible information about the working copy, NULL if not valid. */
6047   const svn_wc_info_t *wc_info;
6048
6049 } svn_client_info2_t;
6050
6051 /**
6052  * Return a duplicate of @a info, allocated in @a pool. No part of the new
6053  * structure will be shared with @a info.
6054  *
6055  * @since New in 1.7.
6056  */
6057 svn_client_info2_t *
6058 svn_client_info2_dup(const svn_client_info2_t *info,
6059                      apr_pool_t *pool);
6060
6061 /**
6062  * The callback invoked by info retrievers.  Each invocation
6063  * describes @a abspath_or_url with the information present in @a info.
6064  * Use @a scratch_pool for all temporary allocation.
6065  *
6066  * @since New in 1.7.
6067  */
6068 typedef svn_error_t *(*svn_client_info_receiver2_t)(
6069                          void *baton,
6070                          const char *abspath_or_url,
6071                          const svn_client_info2_t *info,
6072                          apr_pool_t *scratch_pool);
6073
6074 /**
6075  * Invoke @a receiver with @a receiver_baton to return information
6076  * about @a abspath_or_url in @a revision.  The information returned is
6077  * system-generated metadata, not the sort of "property" metadata
6078  * created by users.  See #svn_client_info2_t.
6079  *
6080  * If both revision arguments are either #svn_opt_revision_unspecified
6081  * or @c NULL, then information will be pulled solely from the working copy;
6082  * no network connections will be made.
6083  *
6084  * Otherwise, information will be pulled from a repository.  The
6085  * actual node revision selected is determined by the @a abspath_or_url
6086  * as it exists in @a peg_revision.  If @a peg_revision->kind is
6087  * #svn_opt_revision_unspecified, then it defaults to
6088  * #svn_opt_revision_head for URLs or #svn_opt_revision_working for
6089  * WC targets.
6090  *
6091  * If @a abspath_or_url is not a local path, then if @a revision is of
6092  * kind #svn_opt_revision_previous (or some other kind that requires
6093  * a local path), an error will be returned, because the desired
6094  * revision cannot be determined.
6095  *
6096  * Use the authentication baton cached in @a ctx to authenticate
6097  * against the repository.
6098  *
6099  * If @a abspath_or_url is a file, just invoke @a receiver on it.  If it
6100  * is a directory, then descend according to @a depth.  If @a depth is
6101  * #svn_depth_empty, invoke @a receiver on @a abspath_or_url and
6102  * nothing else; if #svn_depth_files, on @a abspath_or_url and its
6103  * immediate file children; if #svn_depth_immediates, the preceding
6104  * plus on each immediate subdirectory; if #svn_depth_infinity, then
6105  * recurse fully, invoking @a receiver on @a abspath_or_url and
6106  * everything beneath it.
6107  *
6108  * If @a fetch_excluded is TRUE, also also send excluded nodes in the working
6109  * copy to @a receiver, otherwise these are skipped. If @a fetch_actual_only
6110  * is TRUE also send nodes that don't exist as versioned but are still
6111  * tree conflicted.
6112  *
6113  * @a changelists is an array of <tt>const char *</tt> changelist
6114  * names, used as a restrictive filter on items whose info is
6115  * reported; that is, don't report info about any item unless
6116  * it's a member of one of those changelists.  If @a changelists is
6117  * empty (or altogether @c NULL), no changelist filtering occurs.
6118  *
6119  * @since New in 1.7.
6120  */
6121 svn_error_t *
6122 svn_client_info3(const char *abspath_or_url,
6123                  const svn_opt_revision_t *peg_revision,
6124                  const svn_opt_revision_t *revision,
6125                  svn_depth_t depth,
6126                  svn_boolean_t fetch_excluded,
6127                  svn_boolean_t fetch_actual_only,
6128                  const apr_array_header_t *changelists,
6129                  svn_client_info_receiver2_t receiver,
6130                  void *receiver_baton,
6131                  svn_client_ctx_t *ctx,
6132                  apr_pool_t *scratch_pool);
6133
6134 /** Similar to svn_client_info3, but uses an svn_info_receiver_t instead of
6135  * a #svn_client_info_receiver2_t, and @a path_or_url may be a relative path.
6136  *
6137  * @since New in 1.5.
6138  * @deprecated Provided for backward compatibility with the 1.6 API.
6139  */
6140 SVN_DEPRECATED
6141 svn_error_t *
6142 svn_client_info2(const char *path_or_url,
6143                  const svn_opt_revision_t *peg_revision,
6144                  const svn_opt_revision_t *revision,
6145                  svn_info_receiver_t receiver,
6146                  void *receiver_baton,
6147                  svn_depth_t depth,
6148                  const apr_array_header_t *changelists,
6149                  svn_client_ctx_t *ctx,
6150                  apr_pool_t *pool);
6151
6152 /**
6153  * Similar to svn_client_info2() but with @a changelists passed as @c
6154  * NULL, and @a depth set according to @a recurse: if @a recurse is
6155  * TRUE, @a depth is #svn_depth_infinity, else #svn_depth_empty.
6156  *
6157  * @deprecated Provided for backward compatibility with the 1.4 API.
6158  */
6159 SVN_DEPRECATED
6160 svn_error_t *
6161 svn_client_info(const char *path_or_url,
6162                 const svn_opt_revision_t *peg_revision,
6163                 const svn_opt_revision_t *revision,
6164                 svn_info_receiver_t receiver,
6165                 void *receiver_baton,
6166                 svn_boolean_t recurse,
6167                 svn_client_ctx_t *ctx,
6168                 apr_pool_t *pool);
6169
6170 /**
6171  * Set @a *wcroot_abspath to the local abspath of the root of the
6172  * working copy in which @a local_abspath resides.
6173  *
6174  * @since New in 1.7.
6175  */
6176 svn_error_t *
6177 svn_client_get_wc_root(const char **wcroot_abspath,
6178                        const char *local_abspath,
6179                        svn_client_ctx_t *ctx,
6180                        apr_pool_t *result_pool,
6181                        apr_pool_t *scratch_pool);
6182
6183 /**
6184  * Set @a *min_revision and @a *max_revision to the lowest and highest
6185  * revision numbers found within @a local_abspath.  If @a committed is
6186  * TRUE, set @a *min_revision and @a *max_revision to the lowest and
6187  * highest comitted (i.e. "last changed") revision numbers,
6188  * respectively.  NULL may be passed for either of @a min_revision and
6189  * @a max_revision to indicate the caller's lack of interest in the
6190  * value.  Use @a scratch_pool for temporary allocations.
6191  *
6192  * @since New in 1.7.
6193  */
6194 svn_error_t *
6195 svn_client_min_max_revisions(svn_revnum_t *min_revision,
6196                              svn_revnum_t *max_revision,
6197                              const char *local_abspath,
6198                              svn_boolean_t committed,
6199                              svn_client_ctx_t *ctx,
6200                              apr_pool_t *scratch_pool);
6201
6202 /** @} */
6203
6204 \f
6205 /**
6206  * @defgroup Patch Apply a patch to the working copy
6207  *
6208  * @{
6209  */
6210
6211 /**
6212  * The callback invoked by svn_client_patch() before attempting to patch
6213  * the target file at @a canon_path_from_patchfile (the path as parsed from
6214  * the patch file, but in canonicalized form). The callback can set
6215  * @a *filtered to @c TRUE to prevent the file from being patched, or else
6216  * must set it to @c FALSE.
6217  *
6218  * The callback is also provided with @a patch_abspath, the path of a
6219  * temporary file containing the patched result, and with @a reject_abspath,
6220  * the path to a temporary file containing the diff text of any hunks
6221  * which were rejected during patching.
6222  *
6223  * Because the callback is invoked before the patching attempt is made,
6224  * there is no guarantee that the target file will actually be patched
6225  * successfully. Client implementations must pay attention to notification
6226  * feedback provided by svn_client_patch() to find out which paths were
6227  * patched successfully.
6228  *
6229  * Note also that the files at @a patch_abspath and @a reject_abspath are
6230  * guaranteed to remain on disk after patching only if the
6231  * @a remove_tempfiles parameter for svn_client_patch() is @c FALSE.
6232  *
6233  * The const char * parameters may be allocated in @a scratch_pool which
6234  * will be cleared after each invocation.
6235  *
6236  * @since New in 1.7.
6237  */
6238 typedef svn_error_t *(*svn_client_patch_func_t)(
6239   void *baton,
6240   svn_boolean_t *filtered,
6241   const char *canon_path_from_patchfile,
6242   const char *patch_abspath,
6243   const char *reject_abspath,
6244   apr_pool_t *scratch_pool);
6245
6246 /**
6247  * Apply a unidiff patch that's located at absolute path
6248  * @a patch_abspath to the working copy directory at @a wc_dir_abspath.
6249  *
6250  * This function makes a best-effort attempt at applying the patch.
6251  * It might skip patch targets which cannot be patched (e.g. targets
6252  * that are outside of the working copy). It will also reject hunks
6253  * which cannot be applied to a target in case the hunk's context
6254  * does not match anywhere in the patch target.
6255  *
6256  * If @a dry_run is TRUE, the patching process is carried out, and full
6257  * notification feedback is provided, but the working copy is not modified.
6258  *
6259  * @a strip_count specifies how many leading path components should be
6260  * stripped from paths obtained from the patch. It is an error if a
6261  * negative strip count is passed.
6262  *
6263  * If @a reverse is @c TRUE, apply patches in reverse, deleting lines
6264  * the patch would add and adding lines the patch would delete.
6265  *
6266  * If @a ignore_whitespace is TRUE, allow patches to be applied if they
6267  * only differ from the target by whitespace.
6268  *
6269  * If @a remove_tempfiles is TRUE, lifetimes of temporary files created
6270  * during patching will be managed internally. Otherwise, the caller should
6271  * take ownership of these files, the names of which can be obtained by
6272  * passing a @a patch_func callback.
6273  *
6274  * If @a patch_func is non-NULL, invoke @a patch_func with @a patch_baton
6275  * for each patch target processed.
6276  *
6277  * If @a ctx->notify_func2 is non-NULL, invoke @a ctx->notify_func2 with
6278  * @a ctx->notify_baton2 as patching progresses.
6279  *
6280  * If @a ctx->cancel_func is non-NULL, invoke it passing @a
6281  * ctx->cancel_baton at various places during the operation.
6282  *
6283  * Use @a scratch_pool for temporary allocations.
6284  *
6285  * @since New in 1.7.
6286  */
6287 svn_error_t *
6288 svn_client_patch(const char *patch_abspath,
6289                  const char *wc_dir_abspath,
6290                  svn_boolean_t dry_run,
6291                  int strip_count,
6292                  svn_boolean_t reverse,
6293                  svn_boolean_t ignore_whitespace,
6294                  svn_boolean_t remove_tempfiles,
6295                  svn_client_patch_func_t patch_func,
6296                  void *patch_baton,
6297                  svn_client_ctx_t *ctx,
6298                  apr_pool_t *scratch_pool);
6299
6300 /** @} */
6301
6302 /** @} end group: Client working copy management */
6303
6304 /**
6305  *
6306  * @defgroup clnt_sessions Client session related functions
6307  *
6308  * @{
6309  *
6310  */
6311
6312 \f
6313 /* Converting paths to URLs. */
6314
6315 /** Set @a *url to the URL for @a path_or_url allocated in result_pool.
6316  *
6317  * If @a path_or_url is already a URL, set @a *url to @a path_or_url.
6318  *
6319  * If @a path_or_url is a versioned item, set @a *url to @a
6320  * path_or_url's entry URL.  If @a path_or_url is unversioned (has
6321  * no entry), set @a *url to NULL.
6322  *
6323  * Use @a ctx->wc_ctx to retrieve the information. Use
6324  ** @a scratch_pool for temporary allocations.
6325  *
6326  * @since New in 1.7.
6327  */
6328 svn_error_t *
6329 svn_client_url_from_path2(const char **url,
6330                           const char *path_or_url,
6331                           svn_client_ctx_t *ctx,
6332                           apr_pool_t *result_pool,
6333                           apr_pool_t *scratch_pool);
6334
6335 /** Similar to svn_client_url_from_path2(), but without a context argument.
6336  *
6337  * @since New in 1.5.
6338  * @deprecated Provided for backward compatibility with the 1.6 API.
6339  */
6340 SVN_DEPRECATED
6341 svn_error_t *
6342 svn_client_url_from_path(const char **url,
6343                          const char *path_or_url,
6344                          apr_pool_t *pool);
6345
6346
6347 \f
6348 /* Fetching a repository's root URL and UUID. */
6349
6350 /** Set @a *repos_root_url and @a *repos_uuid, to the root URL and UUID of
6351  * the repository in which @a abspath_or_url is versioned. Use the
6352  * authentication baton and working copy context cached in @a ctx as
6353  * necessary. @a repos_root_url and/or @a repos_uuid may be NULL if not
6354  * wanted.
6355  *
6356  * This function will open a temporary RA session to the repository if
6357  * necessary to get the information.
6358  *
6359  * Allocate @a *repos_root_url and @a *repos_uuid in @a result_pool.
6360  * Use @a scratch_pool for temporary allocations.
6361  *
6362  * @since New in 1.8.
6363  */
6364 svn_error_t *
6365 svn_client_get_repos_root(const char **repos_root_url,
6366                           const char **repos_uuid,
6367                           const char *abspath_or_url,
6368                           svn_client_ctx_t *ctx,
6369                           apr_pool_t *result_pool,
6370                           apr_pool_t *scratch_pool);
6371
6372 /** Set @a *url to the repository root URL of the repository in which
6373  * @a path_or_url is versioned (or scheduled to be versioned),
6374  * allocated in @a pool.  @a ctx is required for possible repository
6375  * authentication.
6376  *
6377  * @since New in 1.5.
6378  * @deprecated Provided for backward compatibility with the 1.7 API. Use
6379  * svn_client_get_repos_root() instead, with an absolute path.
6380  */
6381 SVN_DEPRECATED
6382 svn_error_t *
6383 svn_client_root_url_from_path(const char **url,
6384                               const char *path_or_url,
6385                               svn_client_ctx_t *ctx,
6386                               apr_pool_t *pool);
6387
6388 /** Get repository @a uuid for @a url.
6389  *
6390  * Use a @a pool to open a temporary RA session to @a url, discover the
6391  * repository uuid, and free the session.  Return the uuid in @a uuid,
6392  * allocated in @a pool.  @a ctx is required for possible repository
6393  * authentication.
6394  *
6395  * @deprecated Provided for backward compatibility with the 1.7 API. Use
6396  * svn_client_get_repos_root() instead.
6397  */
6398 SVN_DEPRECATED
6399 svn_error_t *
6400 svn_client_uuid_from_url(const char **uuid,
6401                          const char *url,
6402                          svn_client_ctx_t *ctx,
6403                          apr_pool_t *pool);
6404
6405
6406 /** Return the repository @a uuid for working-copy @a local_abspath,
6407  * allocated in @a result_pool.  Use @a ctx->wc_ctx to retrieve the
6408  * information.
6409  *
6410  * Use @a scratch_pool for temporary allocations.
6411  *
6412  * @since New in 1.7.
6413  * @deprecated Provided for backward compatibility with the 1.7 API. Use
6414  * svn_client_get_repos_root() instead.
6415  */
6416 SVN_DEPRECATED
6417 svn_error_t *
6418 svn_client_uuid_from_path2(const char **uuid,
6419                            const char *local_abspath,
6420                            svn_client_ctx_t *ctx,
6421                            apr_pool_t *result_pool,
6422                            apr_pool_t *scratch_pool);
6423
6424 /** Similar to svn_client_uuid_from_path2(), but with a relative path and
6425  * an access baton.
6426  *
6427  * @deprecated Provided for backward compatibility with the 1.6 API.
6428  */
6429 SVN_DEPRECATED
6430 svn_error_t *
6431 svn_client_uuid_from_path(const char **uuid,
6432                           const char *path,
6433                           svn_wc_adm_access_t *adm_access,
6434                           svn_client_ctx_t *ctx,
6435                           apr_pool_t *pool);
6436
6437 \f
6438 /* Opening RA sessions. */
6439
6440 /** Open an RA session rooted at @a url, and return it in @a *session.
6441  *
6442  * Use the authentication baton stored in @a ctx for authentication.
6443  * @a *session is allocated in @a result_pool.
6444  *
6445  * If @a wri_abspath is not NULL, use the working copy identified by @a
6446  * wri_abspath to potentially avoid transferring unneeded data.
6447  *
6448  * @note This function is similar to svn_ra_open4(), but the caller avoids
6449  * having to providing its own callback functions.
6450  * @since New in 1.8.
6451  */
6452 svn_error_t *
6453 svn_client_open_ra_session2(svn_ra_session_t **session,
6454                            const char *url,
6455                            const char *wri_abspath,
6456                            svn_client_ctx_t *ctx,
6457                            apr_pool_t *result_pool,
6458                            apr_pool_t *scratch_pool);
6459
6460 /** Similar to svn_client_open_ra_session2(), but with @ wri_abspath
6461  * always passed as NULL, and with the same pool used as both @a
6462  * result_pool and @a scratch_pool.
6463  *
6464  * @since New in 1.3.
6465  * @deprecated Provided for backward compatibility with the 1.7 API.
6466  */
6467 SVN_DEPRECATED
6468 svn_error_t *
6469 svn_client_open_ra_session(svn_ra_session_t **session,
6470                            const char *url,
6471                            svn_client_ctx_t *ctx,
6472                            apr_pool_t *pool);
6473
6474
6475 /** @} end group: Client session related functions */
6476
6477 /** @} */
6478
6479 #ifdef __cplusplus
6480 }
6481 #endif /* __cplusplus */
6482
6483 #endif  /* SVN_CLIENT_H */