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