svn_ra.h revision 362181
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_ra.h
24 * @brief Repository Access
25 */
26
27#ifndef SVN_RA_H
28#define SVN_RA_H
29
30#include <apr.h>
31#include <apr_pools.h>
32#include <apr_hash.h>
33#include <apr_tables.h>
34#include <apr_time.h>
35#include <apr_file_io.h>  /* for apr_file_t */
36
37#include "svn_types.h"
38#include "svn_string.h"
39#include "svn_delta.h"
40#include "svn_auth.h"
41#include "svn_mergeinfo.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif /* __cplusplus */
46
47
48
49/* Misc. declarations */
50
51/**
52 * Get libsvn_ra version information.
53 *
54 * @since New in 1.1.
55 */
56const svn_version_t *
57svn_ra_version(void);
58
59
60/** This is a function type which allows the RA layer to fetch working
61 * copy (WC) properties.
62 *
63 * The @a baton is provided along with the function pointer and should
64 * be passed back in. This will be the @a callback_baton or the
65 * @a close_baton as appropriate.
66 *
67 * @a path is relative to the "root" of the session, defined by the
68 * @a repos_URL passed to svn_ra_open5() vtable call.
69 *
70 * @a name is the name of the property to fetch. If the property is present,
71 * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
72 */
73typedef svn_error_t *(*svn_ra_get_wc_prop_func_t)(void *baton,
74                                                  const char *path,
75                                                  const char *name,
76                                                  const svn_string_t **value,
77                                                  apr_pool_t *pool);
78
79/** This is a function type which allows the RA layer to store new
80 * working copy properties during update-like operations.  See the
81 * comments for @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and
82 * @a name. The @a value is the value that will be stored for the property;
83 * a NULL @a value means the property will be deleted.
84 */
85typedef svn_error_t *(*svn_ra_set_wc_prop_func_t)(void *baton,
86                                                  const char *path,
87                                                  const char *name,
88                                                  const svn_string_t *value,
89                                                  apr_pool_t *pool);
90
91/** This is a function type which allows the RA layer to store new
92 * working copy properties as part of a commit.  See the comments for
93 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
94 * The @a value is the value that will be stored for the property; a
95 * @c NULL @a value means the property will be deleted.
96 *
97 * Note that this might not actually store the new property before
98 * returning, but instead schedule it to be changed as part of
99 * post-commit processing (in which case a successful commit means the
100 * properties got written).  Thus, during the commit, it is possible
101 * to invoke this function to set a new value for a wc prop, then read
102 * the wc prop back from the working copy and get the *old* value.
103 * Callers beware.
104 */
105typedef svn_error_t *(*svn_ra_push_wc_prop_func_t)(void *baton,
106                                                   const char *path,
107                                                   const char *name,
108                                                   const svn_string_t *value,
109                                                   apr_pool_t *pool);
110
111/** This is a function type which allows the RA layer to invalidate
112 * (i.e., remove) wcprops recursively.  See the documentation for
113 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
114 *
115 * Unlike @c svn_ra_push_wc_prop_func_t, this has immediate effect.  If
116 * it returns success, the wcprops have been removed.
117 */
118typedef svn_error_t *(*svn_ra_invalidate_wc_props_func_t)(void *baton,
119                                                          const char *path,
120                                                          const char *name,
121                                                          apr_pool_t *pool);
122
123/** This is a function type which allows the RA layer to fetch the
124 * cached pristine file contents whose checksum is @a checksum, if
125 * any.  @a *contents will be a read stream containing those contents
126 * if they are found; NULL otherwise.
127 *
128 * @since New in 1.8.
129 */
130typedef svn_error_t *
131(*svn_ra_get_wc_contents_func_t)(void *baton,
132                                 svn_stream_t **contents,
133                                 const svn_checksum_t *checksum,
134                                 apr_pool_t *pool);
135
136
137/** A function type for retrieving the youngest revision from a repos.
138 * @deprecated Provided for backward compatibility with the 1.8 API.
139 */
140/* ### It seems this type was never used by the API, since 1.0.0. */
141typedef svn_error_t *(*svn_ra_get_latest_revnum_func_t)(
142  void *session_baton,
143  svn_revnum_t *latest_revnum);
144
145/** A function type which allows the RA layer to ask about any
146 * customizations to the client name string.  This is primarily used
147 * by HTTP-based RA layers wishing to extend the string reported to
148 * Apache/mod_dav_svn via the User-agent HTTP header.
149 *
150 * @since New in 1.5.
151 */
152typedef svn_error_t *(*svn_ra_get_client_string_func_t)(void *baton,
153                                                        const char **name,
154                                                        apr_pool_t *pool);
155
156
157
158/**
159 * A callback function type for use in @c get_file_revs.
160 * @a baton is provided by the caller, @a path is the pathname of the file
161 * in revision @a rev and @a rev_props are the revision properties.
162 * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a
163 * handler/baton which will be called with the delta between the previous
164 * revision and this one after the return of this callback.  They may be
165 * left as NULL/NULL.
166 * @a prop_diffs is an array of svn_prop_t elements indicating the property
167 * delta for this and the previous revision.
168 * @a pool may be used for temporary allocations, but you can't rely
169 * on objects allocated to live outside of this particular call and the
170 * immediately following calls to @a *delta_handler, if any.
171 *
172 * @since New in 1.1.
173 */
174typedef svn_error_t *(*svn_ra_file_rev_handler_t)(
175  void *baton,
176  const char *path,
177  svn_revnum_t rev,
178  apr_hash_t *rev_props,
179  svn_txdelta_window_handler_t *delta_handler,
180  void **delta_baton,
181  apr_array_header_t *prop_diffs,
182  apr_pool_t *pool);
183
184/**
185 * Callback function type for locking and unlocking actions.
186 *
187 * @since New in 1.2.
188 *
189 * @a do_lock is TRUE when locking @a path, and FALSE
190 * otherwise.
191 *
192 * @a lock is a lock for @a path or NULL if @a do_lock is FALSE or @a ra_err is
193 * non-NULL.
194 *
195 * @a ra_err is NULL unless the ra layer encounters a locking related
196 * error which it passes back for notification purposes.  The caller
197 * is responsible for clearing @a ra_err after the callback is run.
198 *
199 * @a baton is a closure object; it should be provided by the
200 * implementation, and passed by the caller.  @a pool may be used for
201 * temporary allocation.
202 */
203typedef svn_error_t *(*svn_ra_lock_callback_t)(void *baton,
204                                               const char *path,
205                                               svn_boolean_t do_lock,
206                                               const svn_lock_t *lock,
207                                               svn_error_t *ra_err,
208                                               apr_pool_t *pool);
209
210/**
211 * Callback function type for progress notification.
212 *
213 * @a progress is the number of bytes already transferred, @a total is
214 * the total number of bytes to transfer or -1 if it's not known, @a
215 * baton is the callback baton.
216 *
217 * @since New in 1.3.
218 */
219typedef void (*svn_ra_progress_notify_func_t)(apr_off_t progress,
220                                              apr_off_t total,
221                                              void *baton,
222                                              apr_pool_t *pool);
223
224/**
225 * Callback function type for replay_range actions.
226 *
227 * This callback function should provide replay_range with an editor which
228 * will be driven with the received replay reports from the master repository.
229 *
230 * @a revision is the target revision number of the received replay report.
231 *
232 * @a *editor and @a *edit_baton should provided by the callback implementation.
233 *
234 * @a replay_baton is the baton as originally passed to replay_range.
235 *
236 * @a revprops contains key/value pairs for each revision properties for this
237 * revision.
238 *
239 * @since New in 1.5.
240 */
241typedef svn_error_t *(*svn_ra_replay_revstart_callback_t)(
242  svn_revnum_t revision,
243  void *replay_baton,
244  const svn_delta_editor_t **editor,
245  void **edit_baton,
246  apr_hash_t *rev_props,
247  apr_pool_t *pool);
248
249/**
250 * Callback function type for replay_range actions.
251 *
252 * This callback function should close the editor.
253 *
254 * @a revision is the target revision number of the received replay report.
255 *
256 * @a editor and @a edit_baton are the values provided by the REVSTART callback.
257 *
258 * @a replay_baton is the baton as originally passed to replay_range.
259 *
260 * @a revprops contains key/value pairs for each revision properties for this
261 * revision.
262 *
263 * @since New in 1.5.
264 */
265typedef svn_error_t *(*svn_ra_replay_revfinish_callback_t)(
266  svn_revnum_t revision,
267  void *replay_baton,
268  const svn_delta_editor_t *editor,
269  void *edit_baton,
270  apr_hash_t *rev_props,
271  apr_pool_t *pool);
272
273
274/**
275 * Callback function that checks if an ra_svn tunnel called
276 * @a tunnel_name is handled by the callbakcs or the default
277 * implementation.
278 *
279 * @a tunnel_baton is the baton as originally passed to ra_open.
280 *
281 * @since New in 1.9.
282 */
283typedef svn_boolean_t (*svn_ra_check_tunnel_func_t)(
284    void *tunnel_baton, const char *tunnel_name);
285
286/**
287 * Callback function for closing a tunnel in ra_svn.
288 *
289 * This function will be called when the pool that owns the tunnel
290 * connection is cleared or destroyed.
291 *
292 * @a close_baton is the baton as returned from the
293 * svn_ra_open_tunnel_func_t.
294 *
295 * @a tunnel_baton was returned by the open-tunnel callback.
296 *
297 * @since New in 1.9.
298 */
299typedef void (*svn_ra_close_tunnel_func_t)(
300    void *close_baton, void *tunnel_baton);
301
302/**
303 * Callback function for opening a tunnel in ra_svn.
304 *
305 * Given the @a tunnel_name, tunnel @a user and server @a hostname and
306 * @a port, open a tunnel to the server and return its file handles,
307 * which are owned by @a pool, in @a request and @a response.
308 *
309 * @a request and @a response represent the standard input and output,
310 * respectively, of the process on the other end of the tunnel.
311 *
312 * If @a *close_func is set it will be called with @a close_baton when
313 * the tunnel is closed.
314 *
315 * The optional @a cancel_func callback can be invoked as usual to allow
316 * the user to preempt potentially lengthy operations.
317 *
318 * @a tunnel_baton is the baton as set in the callbacks.
319 *
320 * @since New in 1.9.
321 */
322typedef svn_error_t *(*svn_ra_open_tunnel_func_t)(
323    svn_stream_t **request, svn_stream_t **response,
324    svn_ra_close_tunnel_func_t *close_func, void **close_baton,
325    void *tunnel_baton,
326    const char *tunnel_name, const char *user,
327    const char *hostname, int port,
328    svn_cancel_func_t cancel_func, void *cancel_baton,
329    apr_pool_t *pool);
330
331
332/**
333 * The update Reporter.
334 *
335 * A vtable structure which allows a working copy to describe a subset
336 * (or possibly all) of its working-copy to an RA layer, for the
337 * purposes of an update, switch, status, or diff operation.
338 *
339 * Paths for report calls are relative to the target (not the anchor)
340 * of the operation.  Report calls must be made in depth-first order:
341 * parents before children, all children of a parent before any
342 * siblings of the parent.  The first report call must be a set_path
343 * with a @a path argument of "" and a valid revision.  (If the target
344 * of the operation is locally deleted or missing, use the anchor's
345 * revision.)  If the target of the operation is deleted or switched
346 * relative to the anchor, follow up the initial set_path call with a
347 * link_path or delete_path call with a @a path argument of "" to
348 * indicate that.  In no other case may there be two report
349 * descriptions for the same path.  If the target of the operation is
350 * a locally added file or directory (which previously did not exist),
351 * it may be reported as having revision 0 or as having the parent
352 * directory's revision.
353 *
354 * @since New in 1.5.
355 */
356typedef struct svn_ra_reporter3_t
357{
358  /** Describe a working copy @a path as being at a particular
359   * @a revision and having depth @a depth.
360   *
361   * @a revision may be SVN_INVALID_REVNUM if (for example) @a path
362   * represents a locally-added path with no revision number, or @a
363   * depth is @c svn_depth_exclude.
364   *
365   * @a path may not be underneath a path on which set_path() was
366   * previously called with @c svn_depth_exclude in this report.
367   *
368   * If @a start_empty is set and @a path is a directory, the
369   * implementor should assume the directory has no entries or props.
370   *
371   * This will *override* any previous set_path() calls made on parent
372   * paths.  @a path is relative to the URL specified in svn_ra_open5().
373   *
374   * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
375   *
376   * All temporary allocations are done in @a pool.
377   */
378  svn_error_t *(*set_path)(void *report_baton,
379                           const char *path,
380                           svn_revnum_t revision,
381                           svn_depth_t depth,
382                           svn_boolean_t start_empty,
383                           const char *lock_token,
384                           apr_pool_t *pool);
385
386  /** Describing a working copy @a path as missing.
387   *
388   * @a path may not be underneath a path on which set_path() was
389   * previously called with @c svn_depth_exclude in this report.
390   *
391   * All temporary allocations are done in @a pool.
392   */
393  svn_error_t *(*delete_path)(void *report_baton,
394                              const char *path,
395                              apr_pool_t *pool);
396
397  /** Like set_path(), but differs in that @a path in the working copy
398   * (relative to the root of the report driver) isn't a reflection of
399   * @a path in the repository (relative to the URL specified when
400   * opening the RA layer), but is instead a reflection of a different
401   * repository @a url at @a revision, and has depth @a depth.
402   *
403   * @a path may not be underneath a path on which set_path() was
404   * previously called with @c svn_depth_exclude in this report.
405   *
406   * If @a start_empty is set and @a path is a directory,
407   * the implementor should assume the directory has no entries or props.
408   *
409   * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
410   *
411   * All temporary allocations are done in @a pool.
412   */
413  svn_error_t *(*link_path)(void *report_baton,
414                            const char *path,
415                            const char *url,
416                            svn_revnum_t revision,
417                            svn_depth_t depth,
418                            svn_boolean_t start_empty,
419                            const char *lock_token,
420                            apr_pool_t *pool);
421
422  /** WC calls this when the state report is finished; any directories
423   * or files not explicitly `set' are assumed to be at the
424   * baseline revision originally passed into do_update().  No other
425   * reporting functions, including abort_report, should be called after
426   * calling this function.
427   */
428  svn_error_t *(*finish_report)(void *report_baton,
429                                apr_pool_t *pool);
430
431  /** If an error occurs during a report, this routine should cause the
432   * filesystem transaction to be aborted & cleaned up.  No other reporting
433   * functions should be called after calling this function.
434   */
435  svn_error_t *(*abort_report)(void *report_baton,
436                               apr_pool_t *pool);
437
438} svn_ra_reporter3_t;
439
440/**
441 * Similar to @c svn_ra_reporter3_t, but without support for depths.
442 *
443 * @deprecated Provided for backward compatibility with the 1.4 API.
444 */
445typedef struct svn_ra_reporter2_t
446{
447  /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
448   * with @a depth always set to @c svn_depth_infinity. */
449  svn_error_t *(*set_path)(void *report_baton,
450                           const char *path,
451                           svn_revnum_t revision,
452                           svn_boolean_t start_empty,
453                           const char *lock_token,
454                           apr_pool_t *pool);
455
456  /** Same as the corresponding field in @c svn_ra_reporter3_t. */
457  svn_error_t *(*delete_path)(void *report_baton,
458                              const char *path,
459                              apr_pool_t *pool);
460
461  /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
462   * with @a depth always set to @c svn_depth_infinity. */
463  svn_error_t *(*link_path)(void *report_baton,
464                            const char *path,
465                            const char *url,
466                            svn_revnum_t revision,
467                            svn_boolean_t start_empty,
468                            const char *lock_token,
469                            apr_pool_t *pool);
470
471  /** Same as the corresponding field in @c svn_ra_reporter3_t. */
472  svn_error_t *(*finish_report)(void *report_baton,
473                                apr_pool_t *pool);
474
475  /** Same as the corresponding field in @c svn_ra_reporter3_t. */
476  svn_error_t *(*abort_report)(void *report_baton,
477                               apr_pool_t *pool);
478
479} svn_ra_reporter2_t;
480
481/**
482 * Similar to @c svn_ra_reporter2_t, but without support for lock tokens.
483 *
484 * @deprecated Provided for backward compatibility with the 1.1 API.
485 */
486typedef struct svn_ra_reporter_t
487{
488  /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
489   * with @a lock_token always set to NULL. */
490  svn_error_t *(*set_path)(void *report_baton,
491                           const char *path,
492                           svn_revnum_t revision,
493                           svn_boolean_t start_empty,
494                           apr_pool_t *pool);
495
496  /** Same as the corresponding field in @c svn_ra_reporter2_t. */
497  svn_error_t *(*delete_path)(void *report_baton,
498                              const char *path,
499                              apr_pool_t *pool);
500
501  /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
502   * with @a lock_token always set to NULL. */
503  svn_error_t *(*link_path)(void *report_baton,
504                            const char *path,
505                            const char *url,
506                            svn_revnum_t revision,
507                            svn_boolean_t start_empty,
508                            apr_pool_t *pool);
509
510  /** Same as the corresponding field in @c svn_ra_reporter2_t. */
511  svn_error_t *(*finish_report)(void *report_baton,
512                                apr_pool_t *pool);
513
514  /** Same as the corresponding field in @c svn_ra_reporter2_t. */
515  svn_error_t *(*abort_report)(void *report_baton,
516                               apr_pool_t *pool);
517} svn_ra_reporter_t;
518
519
520/** A collection of callbacks implemented by libsvn_client which allows
521 * an RA layer to "pull" information from the client application, or
522 * possibly store information.  libsvn_client passes this vtable to
523 * svn_ra_open5().
524 *
525 * Each routine takes a @a callback_baton originally provided with the
526 * vtable.
527 *
528 * Clients must use svn_ra_create_callbacks() to allocate and
529 * initialize this structure.
530 *
531 * @since New in 1.3.
532 */
533typedef struct svn_ra_callbacks2_t
534{
535  /** Open a unique temporary file for writing in the working copy.
536   * This file will be automatically deleted when @a fp is closed.
537   *
538   * @deprecated This callback should no longer be used by RA layers.
539   */
540  svn_error_t *(*open_tmp_file)(apr_file_t **fp,
541                                void *callback_baton,
542                                apr_pool_t *pool);
543
544  /** An authentication baton, created by the application, which is
545   * capable of retrieving all known types of credentials.
546   */
547  svn_auth_baton_t *auth_baton;
548
549  /*** The following items may be set to NULL to disallow the RA layer
550       to perform the respective operations of the vtable functions.
551       Perhaps WC props are not defined or are in invalid for this
552       session, or perhaps the commit operation this RA session will
553       perform is a server-side only one that shouldn't do post-commit
554       processing on a working copy path.  ***/
555
556  /** Fetch working copy properties.
557   *
558   * @note we might have a problem if the RA layer ever wants a property
559   *       that corresponds to a different revision of the file than
560   *       what is in the WC. we'll cross that bridge one day...
561   */
562  svn_ra_get_wc_prop_func_t get_wc_prop;
563
564  /** Immediately set new values for working copy properties. */
565  svn_ra_set_wc_prop_func_t set_wc_prop;
566
567  /** Schedule new values for working copy properties. */
568  svn_ra_push_wc_prop_func_t push_wc_prop;
569
570  /** Invalidate working copy properties. */
571  svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
572
573  /** Notification callback used for progress information.
574   * May be NULL if not used.
575   */
576  svn_ra_progress_notify_func_t progress_func;
577
578  /** Notification callback baton, used with progress_func. */
579  void *progress_baton;
580
581  /** Cancellation function
582   *
583   * As its baton, the general callback baton is used
584   *
585   * @since New in 1.5
586   */
587  svn_cancel_func_t cancel_func;
588
589  /** Client string customization callback function
590   * @since New in 1.5
591   */
592  svn_ra_get_client_string_func_t get_client_string;
593
594  /** Working copy file content fetching function.
595   * @since New in 1.8.
596   */
597  svn_ra_get_wc_contents_func_t get_wc_contents;
598
599  /** Check-tunnel callback
600   *
601   * If not @c NULL, and open_tunnel_func is also not @c NULL, this
602   * callback will be invoked to check if open_tunnel_func should be
603   * used to create a specific tunnel, or if the default tunnel
604   * implementation (either built-in or configured in the client
605   * configuration file) should be used instead.
606   * @since New in 1.9.
607   */
608  svn_ra_check_tunnel_func_t check_tunnel_func;
609
610  /** Open-tunnel callback
611   *
612   * If not @c NULL, this callback will be invoked to create a tunnel
613   * for a ra_svn connection that needs one, overriding any tunnel
614   * definitions in the client config file. This callback is used only
615   * for ra_svn and ignored by the other RA modules.
616   * @since New in 1.9.
617   */
618  svn_ra_open_tunnel_func_t open_tunnel_func;
619
620  /** A baton used with open_tunnel_func and close_tunnel_func.
621   * @since New in 1.9.
622   */
623  void *tunnel_baton;
624} svn_ra_callbacks2_t;
625
626/** Similar to svn_ra_callbacks2_t, except that the progress
627 * notification function and baton is missing.
628 *
629 * @deprecated Provided for backward compatibility with the 1.2 API.
630 */
631typedef struct svn_ra_callbacks_t
632{
633  svn_error_t *(*open_tmp_file)(apr_file_t **fp,
634                                void *callback_baton,
635                                apr_pool_t *pool);
636
637  svn_auth_baton_t *auth_baton;
638
639  svn_ra_get_wc_prop_func_t get_wc_prop;
640
641  svn_ra_set_wc_prop_func_t set_wc_prop;
642
643  svn_ra_push_wc_prop_func_t push_wc_prop;
644
645  svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
646
647} svn_ra_callbacks_t;
648
649
650
651/*----------------------------------------------------------------------*/
652
653/* Public Interfaces. */
654
655/**
656 * Initialize the RA library.  This function must be called before using
657 * any function in this header, except the deprecated APIs based on
658 * @c svn_ra_plugin_t, or svn_ra_version().  This function must not be called
659 * simultaneously in multiple threads.  @a pool must live
660 * longer than any open RA sessions.
661 *
662 * @since New in 1.2.
663 */
664svn_error_t *
665svn_ra_initialize(apr_pool_t *pool);
666
667/** Initialize a callback structure.
668* Set @a *callbacks to a ra callbacks object, allocated in @a pool.
669*
670* Clients must use this function to allocate and initialize @c
671* svn_ra_callbacks2_t structures.
672*
673* @since New in 1.3.
674*/
675svn_error_t *
676svn_ra_create_callbacks(svn_ra_callbacks2_t **callbacks,
677                        apr_pool_t *pool);
678
679/**
680 * A repository access session.  This object is used to perform requests
681 * to a repository, identified by a URL.
682 *
683 * @since New in 1.2.
684 */
685typedef struct svn_ra_session_t svn_ra_session_t;
686
687/**
688 * Open a repository access session to the repository at @a repos_URL,
689 * or inform the caller regarding a correct URL by which to access
690 * that repository.
691 *
692 * If @a repos_URL can be used successfully to access the repository,
693 * set @a *session_p to an opaque object representing a repository
694 * session for the repository and (if @a corrected_url is non-NULL)
695 * set @a *corrected_url to NULL.  If there's a better URL that the
696 * caller should try and @a corrected_url is non-NULL, set
697 * @a *session_p to NULL and @a *corrected_url to the corrected URL.  If
698 * there's a better URL that the caller should try, and @a
699 * corrected_url is NULL, return an #SVN_ERR_RA_SESSION_URL_MISMATCH
700 * error.  Allocate all returned items in @a pool.
701 *
702 * The @a repos_URL need not point to the root of the repository: subject
703 * to authorization, it may point to any path within the repository, even
704 * a path at which no node exists in the repository.  The session will
705 * remember this URL as its "session URL" (also called "session root URL"),
706 * until changed by svn_ra_reparent().  Many RA functions take or return
707 * paths that are relative to the session URL.
708 *
709 * If a @a corrected_url is returned, it will point to the same path
710 * within the new repository root URL that @a repos_URL pointed to within
711 * the old repository root URL.
712 *
713 * If @a redirect_url is not NULL and a @corrected_url is returned, then
714 * @a redirect_url contains a non-canonicalized version of @a corrected_url,
715 * as communicated in the network protocol used by the RA provider.
716 * THe @a redirect_url should be used for to detect redirection loops.
717 * Canonicalization may change the protocol-level URL in a way that
718 * makes detection of redirect loops impossible in some cases since URLs which
719 * are different at the protocol layer could map to the same canonicalized URL.
720 *
721 * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal
722 * to the UUID of the repository at @c repos_URL.
723 *
724 * @a callbacks/@a callback_baton is a table of callbacks provided by the
725 * client; see @c svn_ra_callbacks2_t.
726 *
727 * @a config is a hash mapping <tt>const char *</tt> keys to
728 * @c svn_config_t * values.  For example, the @c svn_config_t for the
729 * "~/.subversion/config" file is under the key "config".  @a config may
730 * be NULL.  This function examines some config settings under the
731 * "servers" key (if present) before loading the required RA module, and
732 * the RA module may also examine any config settings.
733 *
734 * All RA requests require a session; they will continue to
735 * use @a pool for memory allocation.
736 *
737 * @see svn_client_open_ra_session().
738 *
739 * @since New in 1.14.
740 */
741svn_error_t *
742svn_ra_open5(svn_ra_session_t **session_p,
743             const char **corrected_url,
744             const char **redirect_url,
745             const char *repos_URL,
746             const char *uuid,
747             const svn_ra_callbacks2_t *callbacks,
748             void *callback_baton,
749             apr_hash_t *config,
750             apr_pool_t *pool);
751
752/** Similar to svn_ra_open5(), but with @a redirect_url always passed
753 * as @c NULL.
754 *
755 * @since New in 1.7.
756 * @deprecated Provided for backward compatibility with the 1.13 API.
757 */
758SVN_DEPRECATED
759svn_error_t *
760svn_ra_open4(svn_ra_session_t **session_p,
761             const char **corrected_url,
762             const char *repos_URL,
763             const char *uuid,
764             const svn_ra_callbacks2_t *callbacks,
765             void *callback_baton,
766             apr_hash_t *config,
767             apr_pool_t *pool);
768
769/** Similar to svn_ra_open4(), but with @a corrected_url always passed
770 * as @c NULL.
771 *
772 * @since New in 1.5.
773 * @deprecated Provided for backward compatibility with the 1.6 API.
774 */
775SVN_DEPRECATED
776svn_error_t *
777svn_ra_open3(svn_ra_session_t **session_p,
778             const char *repos_URL,
779             const char *uuid,
780             const svn_ra_callbacks2_t *callbacks,
781             void *callback_baton,
782             apr_hash_t *config,
783             apr_pool_t *pool);
784
785/**
786 * Similar to svn_ra_open3(), but with @a uuid set to @c NULL.
787 *
788 * @since New in 1.3.
789 * @deprecated Provided for backward compatibility with the 1.4 API.
790 */
791SVN_DEPRECATED
792svn_error_t *
793svn_ra_open2(svn_ra_session_t **session_p,
794             const char *repos_URL,
795             const svn_ra_callbacks2_t *callbacks,
796             void *callback_baton,
797             apr_hash_t *config,
798             apr_pool_t *pool);
799
800/**
801 * @see svn_ra_open2().
802 * @since New in 1.2.
803 * @deprecated Provided for backward compatibility with the 1.2 API.
804 */
805SVN_DEPRECATED
806svn_error_t *
807svn_ra_open(svn_ra_session_t **session_p,
808            const char *repos_URL,
809            const svn_ra_callbacks_t *callbacks,
810            void *callback_baton,
811            apr_hash_t *config,
812            apr_pool_t *pool);
813
814/** Change the root URL of an open @a ra_session to point to a new path in the
815 * same repository.  @a url is the new root URL.  Use @a pool for
816 * temporary allocations.
817 *
818 * If @a url has a different repository root than the current session
819 * URL, return @c SVN_ERR_RA_ILLEGAL_URL.
820 *
821 * @since New in 1.4.
822 */
823svn_error_t *
824svn_ra_reparent(svn_ra_session_t *ra_session,
825                const char *url,
826                apr_pool_t *pool);
827
828/** Set @a *url to the session URL -- the URL to which @a ra_session was
829 * opened or most recently reparented.
830 *
831 * @since New in 1.5.
832 */
833svn_error_t *
834svn_ra_get_session_url(svn_ra_session_t *ra_session,
835                       const char **url,
836                       apr_pool_t *pool);
837
838
839/** Convert @a url into a path relative to the session URL of @a ra_session,
840 * setting @a *rel_path to that value.  If @a url is not
841 * a child of the session URL, return @c SVN_ERR_RA_ILLEGAL_URL.
842 *
843 * The returned path is uri decoded to allow using it with the ra or other
844 * apis as a valid relpath.
845 *
846 * @since New in 1.7.
847 */
848svn_error_t *
849svn_ra_get_path_relative_to_session(svn_ra_session_t *ra_session,
850                                    const char **rel_path,
851                                    const char *url,
852                                    apr_pool_t *pool);
853
854/** Convert @a url into a path relative to the repository root URL of
855 * the repository with which @a ra_session is associated, setting @a
856 * *rel_path to that value.  If @a url is not a child of repository
857 * root URL, return @c SVN_ERR_RA_ILLEGAL_URL.
858 *
859 * The returned path is uri decoded to allow using it with the ra or other
860 * apis as a valid relpath.
861 *
862 * @since New in 1.7.
863 */
864svn_error_t *
865svn_ra_get_path_relative_to_root(svn_ra_session_t *ra_session,
866                                 const char **rel_path,
867                                 const char *url,
868                                 apr_pool_t *pool);
869
870/**
871 * Get the latest revision number from the repository of @a session.
872 *
873 * Use @a pool for memory allocation.
874 *
875 * @since New in 1.2.
876 */
877svn_error_t *
878svn_ra_get_latest_revnum(svn_ra_session_t *session,
879                         svn_revnum_t *latest_revnum,
880                         apr_pool_t *pool);
881
882/**
883 * Get the latest revision number at time @a tm in the repository of
884 * @a session.
885 *
886 * Use @a pool for memory allocation.
887 *
888 * @since New in 1.2.
889 */
890svn_error_t *
891svn_ra_get_dated_revision(svn_ra_session_t *session,
892                          svn_revnum_t *revision,
893                          apr_time_t tm,
894                          apr_pool_t *pool);
895
896/**
897 * Set the property @a name to @a value on revision @a rev in the repository
898 * of @a session.
899 *
900 * If @a value is @c NULL, delete the named revision property.
901 *
902 * If the server advertises the #SVN_RA_CAPABILITY_ATOMIC_REVPROPS capability
903 * and @a old_value_p is not @c NULL, then changing the property will fail with
904 * an error chain that contains #SVN_ERR_FS_PROP_BASEVALUE_MISMATCH if the
905 * present value of the property is not @a *old_value_p.  (This is an atomic
906 * test-and-set).
907 * @a *old_value_p may be @c NULL, representing that the property must be not
908 * already set.
909 *
910 * If the capability is not advertised, then @a old_value_p MUST be @c NULL.
911 *
912 * Please note that properties attached to revisions are @em unversioned.
913 *
914 * Use @a pool for memory allocation.
915 *
916 * @see svn_fs_change_rev_prop2(), svn_error_find_cause().
917 *
918 * @since New in 1.7.
919 */
920svn_error_t *
921svn_ra_change_rev_prop2(svn_ra_session_t *session,
922                        svn_revnum_t rev,
923                        const char *name,
924                        const svn_string_t *const *old_value_p,
925                        const svn_string_t *value,
926                        apr_pool_t *pool);
927
928/**
929 * Similar to svn_ra_change_rev_prop2(), but with @a old_value_p set
930 * to @c NULL.
931 *
932 * @since New in 1.2.
933 * @deprecated Provided for backward compatibility with the 1.6 API.
934 */
935SVN_DEPRECATED
936svn_error_t *
937svn_ra_change_rev_prop(svn_ra_session_t *session,
938                       svn_revnum_t rev,
939                       const char *name,
940                       const svn_string_t *value,
941                       apr_pool_t *pool);
942
943/**
944 * Set @a *props to the list of unversioned properties attached to revision
945 * @a rev in the repository of @a session.  The hash maps
946 * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values.
947 *
948 * Use @a pool for memory allocation.
949 *
950 * @since New in 1.2.
951 */
952svn_error_t *
953svn_ra_rev_proplist(svn_ra_session_t *session,
954                    svn_revnum_t rev,
955                    apr_hash_t **props,
956                    apr_pool_t *pool);
957
958/**
959 * Set @a *value to the value of unversioned property @a name attached to
960 * revision @a rev in the repository of @a session.  If @a rev has no
961 * property by that name, set @a *value to @c NULL.
962 *
963 * Use @a pool for memory allocation.
964 *
965 * @since New in 1.2.
966 */
967svn_error_t *
968svn_ra_rev_prop(svn_ra_session_t *session,
969                svn_revnum_t rev,
970                const char *name,
971                svn_string_t **value,
972                apr_pool_t *pool);
973
974/**
975 * Set @a *editor and @a *edit_baton to an editor for committing
976 * changes to the repository of @a session, setting the revision
977 * properties from @a revprop_table.  The revisions being committed
978 * against are passed to the editor functions, starting with the rev
979 * argument to @c open_root.  The path root of the commit is the @a
980 * session's URL.
981 *
982 * @a revprop_table is a hash mapping <tt>const char *</tt> property
983 * names to @c svn_string_t property values.  The commit log message
984 * is expected to be in the @c SVN_PROP_REVISION_LOG element.  @a
985 * revprop_table can not contain either of @c SVN_PROP_REVISION_DATE
986 * or @c SVN_PROP_REVISION_AUTHOR.
987 *
988 * Before @c close_edit returns, but after the commit has succeeded,
989 * it will invoke @a commit_callback (if non-NULL) with filled-in
990 * #svn_commit_info_t *, @a commit_baton, and @a pool or some subpool
991 * thereof as arguments.  If @a commit_callback returns an error, that error
992 * will be returned from @c * close_edit, otherwise @c close_edit will return
993 * successfully (unless it encountered an error before invoking
994 * @a commit_callback).
995 *
996 * The callback will not be called if the commit was a no-op
997 * (i.e. nothing was committed);
998 *
999 * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char
1000 * *</tt> paths (relative to the URL of @a session) to <tt>
1001 * const char *</tt> lock tokens.  The server checks that the
1002 * correct token is provided for each committed, locked path.  @a lock_tokens
1003 * must live during the whole commit operation.
1004 *
1005 * If @a keep_locks is @c TRUE, then do not release locks on
1006 * committed objects.  Else, automatically release such locks.
1007 *
1008 * The caller may not perform any RA operations using @a session before
1009 * finishing the edit.
1010 *
1011 * Use @a pool for memory allocation.
1012 *
1013 * @since New in 1.5.
1014 *
1015 * @note Like most commit editors, the returned editor requires that the
1016 * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
1017 * methods is a URL, not a relative path.
1018 */
1019svn_error_t *
1020svn_ra_get_commit_editor3(svn_ra_session_t *session,
1021                          const svn_delta_editor_t **editor,
1022                          void **edit_baton,
1023                          apr_hash_t *revprop_table,
1024                          svn_commit_callback2_t commit_callback,
1025                          void *commit_baton,
1026                          apr_hash_t *lock_tokens,
1027                          svn_boolean_t keep_locks,
1028                          apr_pool_t *pool);
1029
1030/**
1031 * Same as svn_ra_get_commit_editor3(), but with @c revprop_table set
1032 * to a hash containing the @c SVN_PROP_REVISION_LOG property set
1033 * to the value of @a log_msg.
1034 *
1035 * @since New in 1.4.
1036 *
1037 * @deprecated Provided for backward compatibility with the 1.4 API.
1038 */
1039SVN_DEPRECATED
1040svn_error_t *
1041svn_ra_get_commit_editor2(svn_ra_session_t *session,
1042                          const svn_delta_editor_t **editor,
1043                          void **edit_baton,
1044                          const char *log_msg,
1045                          svn_commit_callback2_t commit_callback,
1046                          void *commit_baton,
1047                          apr_hash_t *lock_tokens,
1048                          svn_boolean_t keep_locks,
1049                          apr_pool_t *pool);
1050
1051/**
1052 * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t.
1053 *
1054 * @since New in 1.2.
1055 *
1056 * @deprecated Provided for backward compatibility with the 1.3 API.
1057 */
1058SVN_DEPRECATED
1059svn_error_t *
1060svn_ra_get_commit_editor(svn_ra_session_t *session,
1061                         const svn_delta_editor_t **editor,
1062                         void **edit_baton,
1063                         const char *log_msg,
1064                         svn_commit_callback_t callback,
1065                         void *callback_baton,
1066                         apr_hash_t *lock_tokens,
1067                         svn_boolean_t keep_locks,
1068                         apr_pool_t *pool);
1069
1070/**
1071 * Fetch the contents and properties of file @a path at @a revision.
1072 * @a revision may be SVN_INVALID_REVNUM, indicating that the HEAD
1073 * revision should be used.  Interpret @a path relative to the URL in
1074 * @a session.  Use @a pool for all allocations.
1075 *
1076 * If @a revision is @c SVN_INVALID_REVNUM and @a fetched_rev is not
1077 * @c NULL, then set @a *fetched_rev to the actual revision that was
1078 * retrieved.
1079 *
1080 * If @a stream is non @c NULL, push the contents of the file at @a
1081 * stream, do not call svn_stream_close() when finished.
1082 *
1083 * If @a props is non @c NULL, set @a *props to contain the properties of
1084 * the file.  This means @em all properties: not just ones controlled by
1085 * the user and stored in the repository fs, but non-tweakable ones
1086 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
1087 * etc.)  The keys are <tt>const char *</tt>, values are
1088 * <tt>@c svn_string_t *</tt>.
1089 *
1090 * The stream handlers for @a stream may not perform any RA
1091 * operations using @a session.
1092 *
1093 * @since New in 1.2.
1094 */
1095svn_error_t *
1096svn_ra_get_file(svn_ra_session_t *session,
1097                const char *path,
1098                svn_revnum_t revision,
1099                svn_stream_t *stream,
1100                svn_revnum_t *fetched_rev,
1101                apr_hash_t **props,
1102                apr_pool_t *pool);
1103
1104/**
1105 * If @a dirents is non @c NULL, set @a *dirents to contain all the entries
1106 * of directory @a path at @a revision.  The keys of @a dirents will be
1107 * entry names (<tt>const char *</tt>), and the values dirents
1108 * (<tt>@c svn_dirent_t *</tt>).  Use @a pool for all allocations.
1109 *
1110 * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt>
1111 * objects are filled in.  To have them completely filled in just pass
1112 * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_
1113 * fields you would like to have returned to you.
1114 *
1115 * @a path is interpreted relative to the URL in @a session.
1116 *
1117 * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
1118 * @a fetched_rev is not @c NULL, then this function will set
1119 * @a *fetched_rev to the actual revision that was retrieved.  (Some
1120 * callers want to know, and some don't.)
1121 *
1122 * If @a props is non @c NULL, set @a *props to contain the properties of
1123 * the directory, including properties that are non-tweakable and
1124 * generated by the SCM system itself (such as #svn_prop_wc_kind and
1125 * #svn_prop_entry_kind properties).  The keys are <tt>const char *</tt>,
1126 * values are <tt>@c svn_string_t *</tt>.
1127 *
1128 * @since New in 1.4.
1129 */
1130svn_error_t *
1131svn_ra_get_dir2(svn_ra_session_t *session,
1132                apr_hash_t **dirents,
1133                svn_revnum_t *fetched_rev,
1134                apr_hash_t **props,
1135                const char *path,
1136                svn_revnum_t revision,
1137                apr_uint32_t dirent_fields,
1138                apr_pool_t *pool);
1139
1140/**
1141 * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the
1142 * @a dirent_fields parameter.
1143 *
1144 * @since New in 1.2.
1145 *
1146 * @deprecated Provided for compatibility with the 1.3 API.
1147 */
1148SVN_DEPRECATED
1149svn_error_t *
1150svn_ra_get_dir(svn_ra_session_t *session,
1151               const char *path,
1152               svn_revnum_t revision,
1153               apr_hash_t **dirents,
1154               svn_revnum_t *fetched_rev,
1155               apr_hash_t **props,
1156               apr_pool_t *pool);
1157
1158/**
1159 * Callback type to be used with svn_ra_list().  It will be invoked for
1160 * every directory entry found.
1161 *
1162 * The full path of the entry is given in @a rel_path and @a dirent contains
1163 * various additional information. Only the elements of @a dirent specified
1164 * by the @a dirent_fields argument to svn_ra_list() will be valid.
1165 *
1166 * @a baton is the user-provided receiver baton.  @a scratch_pool may be
1167 * used for temporary allocations.
1168 *
1169 * @since New in 1.10.
1170 */
1171typedef svn_error_t *(* svn_ra_dirent_receiver_t)(const char *rel_path,
1172                                                  svn_dirent_t *dirent,
1173                                                  void *baton,
1174                                                  apr_pool_t *scratch_pool);
1175
1176/**
1177 * Efficiently list everything within a sub-tree.  Specify a glob pattern
1178 * to search for specific files and folders.
1179 *
1180 * In @a session, walk the sub-tree starting at @a path at @a revision down
1181 * to the given @a depth.  For each directory entry found, @a receiver will
1182 * be called with @a receiver_baton.  The starting @a path will be reported
1183 * as well.  Because retrieving elements of a #svn_dirent_t can be
1184 * expensive, you need to select them individually via flags set in
1185 * @a dirent_fields.
1186 *
1187 * @a patterns is an optional array of <tt>const char *</tt>.  If it is
1188 * not @c NULL, only those directory entries will be reported whose last
1189 * path segment matches at least one of these patterns.  This feature uses
1190 * apr_fnmatch() for glob matching and requiring '.' to matched by dots
1191 * in the path.
1192 *
1193 * @a path must point to a directory and @a depth must be at least
1194 * #svn_depth_empty.
1195 *
1196 * If the server doesn't support the 'list' command, return
1197 * #SVN_ERR_UNSUPPORTED_FEATURE in preference to any other error that
1198 * might otherwise be returned.
1199 *
1200 * Use @a scratch_pool for temporary memory allocation.
1201 *
1202 * @since New in 1.10.
1203 */
1204svn_error_t *
1205svn_ra_list(svn_ra_session_t *session,
1206            const char *path,
1207            svn_revnum_t revision,
1208            const apr_array_header_t *patterns,
1209            svn_depth_t depth,
1210            apr_uint32_t dirent_fields,
1211            svn_ra_dirent_receiver_t receiver,
1212            void *receiver_baton,
1213            apr_pool_t *scratch_pool);
1214
1215/**
1216 * Set @a *catalog to a mergeinfo catalog for the paths in @a paths.
1217 * If no mergeinfo is available, set @a *catalog to @c NULL.  The
1218 * requested mergeinfo hashes are for @a paths (which are relative to
1219 * @a session's URL) in @a revision.  If one of the paths does not exist
1220 * in that revision, return SVN_ERR_FS_NOT_FOUND.
1221 *
1222 * @a inherit indicates whether explicit, explicit or inherited, or
1223 * only inherited mergeinfo for @a paths is retrieved.
1224 *
1225 * If @a include_descendants is TRUE, then additionally return the
1226 * mergeinfo for any descendant of any element of @a paths which has
1227 * the @c SVN_PROP_MERGEINFO property explicitly set on it.  (Note
1228 * that inheritance is only taken into account for the elements in @a
1229 * paths; descendants of the elements in @a paths which get their
1230 * mergeinfo via inheritance are not included in @a *catalog.)
1231 *
1232 * Allocate the returned values in @a pool.
1233 *
1234 * If @a revision is @c SVN_INVALID_REVNUM, it defaults to youngest.
1235 *
1236 * If the server doesn't support retrieval of mergeinfo (which can
1237 * happen even for file:// URLs, if the repository itself hasn't been
1238 * upgraded), return @c SVN_ERR_UNSUPPORTED_FEATURE in preference to
1239 * any other error that might otherwise be returned.
1240 *
1241 * @since New in 1.5.
1242 */
1243svn_error_t *
1244svn_ra_get_mergeinfo(svn_ra_session_t *session,
1245                     svn_mergeinfo_catalog_t *catalog,
1246                     const apr_array_header_t *paths,
1247                     svn_revnum_t revision,
1248                     svn_mergeinfo_inheritance_t inherit,
1249                     svn_boolean_t include_descendants,
1250                     apr_pool_t *pool);
1251
1252/**
1253 * Ask the RA layer to update a working copy to a new revision.
1254 *
1255 * The client initially provides an @a update_editor/@a update_baton to the
1256 * RA layer; this editor contains knowledge of where the change will
1257 * begin in the working copy (when @c open_root() is called).
1258 *
1259 * In return, the client receives a @a reporter/@a report_baton.  The
1260 * client then describes its working copy by making calls into the
1261 * @a reporter.
1262 *
1263 * When finished, the client calls @a reporter->finish_report().  The
1264 * RA layer then does a complete drive of @a update_editor, ending with
1265 * @a update_editor->close_edit(), to update the working copy.
1266 *
1267 * @a update_target is an optional single path component to restrict
1268 * the scope of the update to just that entry (in the directory
1269 * represented by the @a session's URL).  If @a update_target is the
1270 * empty string, the entire directory is updated.
1271 *
1272 * Update the target only as deeply as @a depth indicates.
1273 *
1274 * If @a send_copyfrom_args is TRUE, then ask the server to send
1275 * copyfrom arguments to add_file() and add_directory() when possible.
1276 * (Note: this means that any subsequent txdeltas coming from the
1277 * server are presumed to apply against the copied file!)
1278 *
1279 * Use @a ignore_ancestry to control whether or not items being
1280 * updated will be checked for relatedness first.  Unrelated items
1281 * are typically transmitted to the editor as a deletion of one thing
1282 * and the addition of another, but if this flag is @c TRUE,
1283 * unrelated items will be diffed as if they were related.
1284 *
1285 * The working copy will be updated to @a revision_to_update_to, or the
1286 * "latest" revision if this arg is invalid.
1287 *
1288 * The caller may not perform any RA operations using @a session before
1289 * finishing the report, and may not perform any RA operations using
1290 * @a session from within the editing operations of @a update_editor.
1291 *
1292 * Allocate @a *reporter and @a *report_baton in @a result_pool.  Use
1293 * @a scratch_pool for temporary allocations.
1294 *
1295 * @note The reporter provided by this function does NOT supply copy-
1296 * from information to the diff editor callbacks.
1297 *
1298 * @note In order to prevent pre-1.5 servers from doing more work than
1299 * needed, and sending too much data back, a pre-1.5 'recurse'
1300 * directive may be sent to the server, based on @a depth.
1301 *
1302 * @note Pre Subversion 1.8 svnserve based servers never ignore ancestry.
1303 *
1304 * @note This differs from calling svn_ra_do_switch3() with the current
1305 * URL of the target node.  Update changes only the revision numbers,
1306 * leaving any switched subtrees still switched, whereas switch changes
1307 * every node in the tree to a child of the same URL.
1308 *
1309 * @since New in 1.8.
1310 */
1311svn_error_t *
1312svn_ra_do_update3(svn_ra_session_t *session,
1313                  const svn_ra_reporter3_t **reporter,
1314                  void **report_baton,
1315                  svn_revnum_t revision_to_update_to,
1316                  const char *update_target,
1317                  svn_depth_t depth,
1318                  svn_boolean_t send_copyfrom_args,
1319                  svn_boolean_t ignore_ancestry,
1320                  const svn_delta_editor_t *update_editor,
1321                  void *update_baton,
1322                  apr_pool_t *result_pool,
1323                  apr_pool_t *scratch_pool);
1324
1325/**
1326 * Similar to svn_ra_do_update3(), but always ignoring ancestry.
1327 *
1328 * @since New in 1.5.
1329 * @deprecated Provided for compatibility with the 1.4 API.
1330 */
1331SVN_DEPRECATED
1332svn_error_t *
1333svn_ra_do_update2(svn_ra_session_t *session,
1334                  const svn_ra_reporter3_t **reporter,
1335                  void **report_baton,
1336                  svn_revnum_t revision_to_update_to,
1337                  const char *update_target,
1338                  svn_depth_t depth,
1339                  svn_boolean_t send_copyfrom_args,
1340                  const svn_delta_editor_t *update_editor,
1341                  void *update_baton,
1342                  apr_pool_t *pool);
1343
1344/**
1345 * Similar to svn_ra_do_update2(), but taking @c svn_ra_reporter2_t
1346 * instead of @c svn_ra_reporter3_t; if @a recurse is true, pass @c
1347 * svn_depth_infinity for @a depth, else pass @c svn_depth_files; and
1348 * with @a send_copyfrom_args always false.
1349 *
1350 * @deprecated Provided for compatibility with the 1.4 API.
1351 */
1352SVN_DEPRECATED
1353svn_error_t *
1354svn_ra_do_update(svn_ra_session_t *session,
1355                 const svn_ra_reporter2_t **reporter,
1356                 void **report_baton,
1357                 svn_revnum_t revision_to_update_to,
1358                 const char *update_target,
1359                 svn_boolean_t recurse,
1360                 const svn_delta_editor_t *update_editor,
1361                 void *update_baton,
1362                 apr_pool_t *pool);
1363
1364
1365/**
1366 * Ask the RA layer to switch a working copy to a new revision and URL.
1367 *
1368 * This is similar to svn_ra_do_update3(), but also changes the URL of
1369 * every node in the target tree to a child of the @a switch_url.  In
1370 * contrast, update changes only the revision numbers, leaving any
1371 * switched subtrees still switched.
1372 *
1373 * @note Pre Subversion 1.8 svnserve based servers always ignore ancestry
1374 * and never send copyfrom data.
1375 *
1376 * @since New in 1.8.
1377 */
1378svn_error_t *
1379svn_ra_do_switch3(svn_ra_session_t *session,
1380                  const svn_ra_reporter3_t **reporter,
1381                  void **report_baton,
1382                  svn_revnum_t revision_to_switch_to,
1383                  const char *switch_target,
1384                  svn_depth_t depth,
1385                  const char *switch_url,
1386                  svn_boolean_t send_copyfrom_args,
1387                  svn_boolean_t ignore_ancestry,
1388                  const svn_delta_editor_t *switch_editor,
1389                  void *switch_baton,
1390                  apr_pool_t *result_pool,
1391                  apr_pool_t *scratch_pool);
1392
1393/**
1394 * Similar to svn_ra_do_switch3(), but always ignoring ancestry and
1395 * never sending copyfrom_args.
1396 *
1397 * @since New in 1.5.
1398 * @deprecated Provided for compatibility with the 1.7 API.
1399 */
1400SVN_DEPRECATED
1401svn_error_t *
1402svn_ra_do_switch2(svn_ra_session_t *session,
1403                  const svn_ra_reporter3_t **reporter,
1404                  void **report_baton,
1405                  svn_revnum_t revision_to_switch_to,
1406                  const char *switch_target,
1407                  svn_depth_t depth,
1408                  const char *switch_url,
1409                  const svn_delta_editor_t *switch_editor,
1410                  void *switch_baton,
1411                  apr_pool_t *pool);
1412
1413/**
1414 * Similar to svn_ra_do_switch2(), but taking @c svn_ra_reporter2_t
1415 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1416 * @c svn_depth_infinity for depths.  The switch itself is performed
1417 * according to @a recurse: if TRUE, then use @c svn_depth_infinity
1418 * for @a depth, else use @c svn_depth_files.
1419 *
1420 * @deprecated Provided for compatibility with the 1.4 API.
1421 */
1422SVN_DEPRECATED
1423svn_error_t *
1424svn_ra_do_switch(svn_ra_session_t *session,
1425                 const svn_ra_reporter2_t **reporter,
1426                 void **report_baton,
1427                 svn_revnum_t revision_to_switch_to,
1428                 const char *switch_target,
1429                 svn_boolean_t recurse,
1430                 const char *switch_url,
1431                 const svn_delta_editor_t *switch_editor,
1432                 void *switch_baton,
1433                 apr_pool_t *pool);
1434
1435/**
1436 * Ask the RA layer to describe the status of a working copy with respect
1437 * to @a revision of the repository (or HEAD, if @a revision is invalid).
1438 *
1439 * The client initially provides a @a status_editor/@a status_baton to the RA
1440 * layer; this editor contains knowledge of where the change will
1441 * begin in the working copy (when open_root() is called).
1442 *
1443 * In return, the client receives a @a reporter/@a report_baton. The
1444 * client then describes its working copy by making calls into the
1445 * @a reporter.
1446 *
1447 * When finished, the client calls @a reporter->finish_report(). The RA
1448 * layer then does a complete drive of @a status_editor, ending with
1449 * close_edit(), to report, essentially, what would be modified in
1450 * the working copy were the client to call do_update().
1451 * @a status_target is an optional single path component will restrict
1452 * the scope of the status report to an entry in the directory
1453 * represented by the @a session's URL, or empty if the entire directory
1454 * is meant to be examined.
1455 *
1456 * Get status as deeply as @a depth indicates. If @a depth is
1457 * #svn_depth_unknown, get the status down to the ambient depth of the
1458 * working copy. If @a depth is deeper than the working copy, include changes
1459 * that would be needed to populate the working copy to that depth.
1460 *
1461 * The caller may not perform any RA operations using @a session
1462 * before finishing the report, and may not perform any RA operations
1463 * using @a session from within the editing operations of @a status_editor.
1464 *
1465 * Use @a pool for memory allocation.
1466 *
1467 * @note The reporter provided by this function does NOT supply copy-
1468 * from information to the diff editor callbacks.
1469 *
1470 * @note In order to prevent pre-1.5 servers from doing more work than
1471 * needed, and sending too much data back, a pre-1.5 'recurse'
1472 * directive may be sent to the server, based on @a depth.
1473 *
1474 * @since New in 1.5.
1475 */
1476svn_error_t *
1477svn_ra_do_status2(svn_ra_session_t *session,
1478                  const svn_ra_reporter3_t **reporter,
1479                  void **report_baton,
1480                  const char *status_target,
1481                  svn_revnum_t revision,
1482                  svn_depth_t depth,
1483                  const svn_delta_editor_t *status_editor,
1484                  void *status_baton,
1485                  apr_pool_t *pool);
1486
1487
1488/**
1489 * Similar to svn_ra_do_status2(), but taking @c svn_ra_reporter2_t
1490 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1491 * @c svn_depth_infinity for depths.  The status operation itself is
1492 * performed according to @a recurse: if TRUE, then @a depth is
1493 * @c svn_depth_infinity, else it is @c svn_depth_immediates.
1494 *
1495 * @deprecated Provided for compatibility with the 1.4 API.
1496 */
1497SVN_DEPRECATED
1498svn_error_t *
1499svn_ra_do_status(svn_ra_session_t *session,
1500                 const svn_ra_reporter2_t **reporter,
1501                 void **report_baton,
1502                 const char *status_target,
1503                 svn_revnum_t revision,
1504                 svn_boolean_t recurse,
1505                 const svn_delta_editor_t *status_editor,
1506                 void *status_baton,
1507                 apr_pool_t *pool);
1508
1509/**
1510 * Ask the RA layer to 'diff' a working copy against @a versus_url;
1511 * it's another form of svn_ra_do_update2().
1512 *
1513 * @note This function cannot be used to diff a single file, only a
1514 * working copy directory.  See the svn_ra_do_switch3() function
1515 * for more details.
1516 *
1517 * The client initially provides a @a diff_editor/@a diff_baton to the RA
1518 * layer; this editor contains knowledge of where the common diff
1519 * root is in the working copy (when open_root() is called).
1520 *
1521 * In return, the client receives a @a reporter/@a report_baton. The
1522 * client then describes its working copy by making calls into the
1523 * @a reporter.
1524 *
1525 * When finished, the client calls @a reporter->finish_report().  The
1526 * RA layer then does a complete drive of @a diff_editor, ending with
1527 * close_edit(), to transmit the diff.
1528 *
1529 * @a diff_target is an optional single path component will restrict
1530 * the scope of the diff to an entry in the directory represented by
1531 * the @a session's URL, or empty if the entire directory is meant to be
1532 * one of the diff paths.
1533 *
1534 * The working copy will be diffed against @a versus_url as it exists
1535 * in revision @a revision, or as it is in head if @a revision is
1536 * @c SVN_INVALID_REVNUM.
1537 *
1538 * Use @a ignore_ancestry to control whether or not items being
1539 * diffed will be checked for relatedness first.  Unrelated items
1540 * are typically transmitted to the editor as a deletion of one thing
1541 * and the addition of another, but if this flag is @c TRUE,
1542 * unrelated items will be diffed as if they were related.
1543 *
1544 * Diff only as deeply as @a depth indicates.
1545 *
1546 * The caller may not perform any RA operations using @a session before
1547 * finishing the report, and may not perform any RA operations using
1548 * @a session from within the editing operations of @a diff_editor.
1549 *
1550 * @a text_deltas instructs the driver of the @a diff_editor to enable
1551 * the generation of text deltas. If @a text_deltas is FALSE the window
1552 * handler returned by apply_textdelta will be called once with a NULL
1553 * @c svn_txdelta_window_t pointer.
1554 *
1555 * Use @a pool for memory allocation.
1556 *
1557 * @note The reporter provided by this function does NOT supply copy-
1558 * from information to the diff editor callbacks.
1559 *
1560 * @note In order to prevent pre-1.5 servers from doing more work than
1561 * needed, and sending too much data back, a pre-1.5 'recurse'
1562 * directive may be sent to the server, based on @a depth.
1563 *
1564 * @since New in 1.5.
1565 */
1566svn_error_t *
1567svn_ra_do_diff3(svn_ra_session_t *session,
1568                const svn_ra_reporter3_t **reporter,
1569                void **report_baton,
1570                svn_revnum_t revision,
1571                const char *diff_target,
1572                svn_depth_t depth,
1573                svn_boolean_t ignore_ancestry,
1574                svn_boolean_t text_deltas,
1575                const char *versus_url,
1576                const svn_delta_editor_t *diff_editor,
1577                void *diff_baton,
1578                apr_pool_t *pool);
1579
1580/**
1581 * Similar to svn_ra_do_diff3(), but taking @c svn_ra_reporter2_t
1582 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1583 * @c svn_depth_infinity for depths.  Perform the diff according to
1584 * @a recurse: if TRUE, then @a depth is @c svn_depth_infinity, else
1585 * it is @c svn_depth_files.
1586 *
1587 * @deprecated Provided for compatibility with the 1.4 API.
1588 */
1589SVN_DEPRECATED
1590svn_error_t *
1591svn_ra_do_diff2(svn_ra_session_t *session,
1592                const svn_ra_reporter2_t **reporter,
1593                void **report_baton,
1594                svn_revnum_t revision,
1595                const char *diff_target,
1596                svn_boolean_t recurse,
1597                svn_boolean_t ignore_ancestry,
1598                svn_boolean_t text_deltas,
1599                const char *versus_url,
1600                const svn_delta_editor_t *diff_editor,
1601                void *diff_baton,
1602                apr_pool_t *pool);
1603
1604
1605/**
1606 * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE.
1607 *
1608 * @deprecated Provided for backward compatibility with the 1.3 API.
1609 */
1610SVN_DEPRECATED
1611svn_error_t *
1612svn_ra_do_diff(svn_ra_session_t *session,
1613               const svn_ra_reporter2_t **reporter,
1614               void **report_baton,
1615               svn_revnum_t revision,
1616               const char *diff_target,
1617               svn_boolean_t recurse,
1618               svn_boolean_t ignore_ancestry,
1619               const char *versus_url,
1620               const svn_delta_editor_t *diff_editor,
1621               void *diff_baton,
1622               apr_pool_t *pool);
1623
1624/**
1625 * Invoke @a receiver with @a receiver_baton on each log message from
1626 * @a start to @a end.  @a start may be greater or less than @a end;
1627 * this just controls whether the log messages are processed in descending
1628 * or ascending revision number order.
1629 *
1630 * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
1631 *
1632 * If @a paths is non-NULL and has one or more elements, then only show
1633 * revisions in which at least one of @a paths was changed (i.e., if
1634 * file, text or props changed; if dir, props changed or an entry
1635 * was added or deleted).  Each path is an <tt>const char *</tt>, relative
1636 * to the repository root of @a session.
1637 *
1638 * If @a limit is greater than zero only invoke @a receiver on the first
1639 * @a limit logs.
1640 *
1641 * If @a discover_changed_paths, then each call to @a receiver passes a
1642 * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument;
1643 * the hash's keys are all the paths committed in that revision, the hash's
1644 * values are <tt>const svn_log_changed_path2_t *</tt> for each committed
1645 * path. Otherwise, each call to receiver passes NULL for @a changed_paths.
1646 *
1647 * If @a strict_node_history is set, copy history will not be traversed
1648 * (if any exists) when harvesting the revision logs for each path.
1649 *
1650 * If @a include_merged_revisions is set, log information for revisions
1651 * which have been merged to @a targets will also be returned.
1652 *
1653 * If @a revprops is NULL, retrieve all revision properties; else, retrieve
1654 * only the revision properties named by the (const char *) array elements
1655 * (i.e. retrieve none if the array is empty).
1656 *
1657 * If any invocation of @a receiver returns error, return that error
1658 * immediately and without wrapping it.
1659 *
1660 * If @a start or @a end is a non-existent revision, return the error
1661 * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
1662 *
1663 * See also the documentation for @c svn_log_message_receiver_t.
1664 *
1665 * The caller may not invoke any RA operations using @a session from
1666 * within @a receiver.
1667 *
1668 * Use @a pool for memory allocation.
1669 *
1670 * @note If @a paths is NULL or empty, the result depends on the
1671 * server.  Pre-1.5 servers will send nothing; 1.5 servers will
1672 * effectively perform the log operation on the root of the
1673 * repository.  This behavior may be changed in the future to ensure
1674 * consistency across all pedigrees of server.
1675 *
1676 * @note Pre-1.5 servers do not support custom revprop retrieval; if @a
1677 * revprops is NULL or contains a revprop other than svn:author, svn:date,
1678 * or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned.
1679 *
1680 * @since New in 1.5.
1681 */
1682svn_error_t *
1683svn_ra_get_log2(svn_ra_session_t *session,
1684                const apr_array_header_t *paths,
1685                svn_revnum_t start,
1686                svn_revnum_t end,
1687                int limit,
1688                svn_boolean_t discover_changed_paths,
1689                svn_boolean_t strict_node_history,
1690                svn_boolean_t include_merged_revisions,
1691                const apr_array_header_t *revprops,
1692                svn_log_entry_receiver_t receiver,
1693                void *receiver_baton,
1694                apr_pool_t *pool);
1695
1696/**
1697 * Similar to svn_ra_get_log2(), but uses @c svn_log_message_receiver_t
1698 * instead of @c svn_log_entry_receiver_t.  Also, @a
1699 * include_merged_revisions is set to @c FALSE and @a revprops is
1700 * svn:author, svn:date, and svn:log.
1701 *
1702 * @since New in 1.2.
1703 * @deprecated Provided for backward compatibility with the 1.4 API.
1704 */
1705SVN_DEPRECATED
1706svn_error_t *
1707svn_ra_get_log(svn_ra_session_t *session,
1708               const apr_array_header_t *paths,
1709               svn_revnum_t start,
1710               svn_revnum_t end,
1711               int limit,
1712               svn_boolean_t discover_changed_paths,
1713               svn_boolean_t strict_node_history,
1714               svn_log_message_receiver_t receiver,
1715               void *receiver_baton,
1716               apr_pool_t *pool);
1717
1718/**
1719 * Set @a *kind to the node kind associated with @a path at @a revision.
1720 * If @a path does not exist under @a revision, set @a *kind to
1721 * @c svn_node_none.  @a path is relative to the @a session's parent URL.
1722 *
1723 * Use @a pool for memory allocation.
1724 *
1725 * @since New in 1.2.
1726 */
1727svn_error_t *
1728svn_ra_check_path(svn_ra_session_t *session,
1729                  const char *path,
1730                  svn_revnum_t revision,
1731                  svn_node_kind_t *kind,
1732                  apr_pool_t *pool);
1733
1734/**
1735 * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a
1736 * revision.  @a path is relative to the @a session's parent's URL.
1737 * If @a path does not exist in @a revision, set @a *dirent to NULL.
1738 *
1739 * Use @a pool for memory allocation.
1740 *
1741 * @since New in 1.2.
1742 */
1743svn_error_t *
1744svn_ra_stat(svn_ra_session_t *session,
1745            const char *path,
1746            svn_revnum_t revision,
1747            svn_dirent_t **dirent,
1748            apr_pool_t *pool);
1749
1750
1751/**
1752 * Set @a *uuid to the repository's UUID, allocated in @a pool.
1753 *
1754 * @since New in 1.5.
1755 */
1756svn_error_t *
1757svn_ra_get_uuid2(svn_ra_session_t *session,
1758                 const char **uuid,
1759                 apr_pool_t *pool);
1760
1761/**
1762 * Similar to svn_ra_get_uuid2(), but returns the value allocated in
1763 * @a session's pool.
1764 *
1765 * @deprecated Provided for backward compatibility with the 1.4 API.
1766 * @since New in 1.2.
1767 */
1768SVN_DEPRECATED
1769svn_error_t *
1770svn_ra_get_uuid(svn_ra_session_t *session,
1771                const char **uuid,
1772                apr_pool_t *pool);
1773
1774/**
1775 * Set @a *url to the repository's root URL, allocated in @a pool.
1776 * The value will not include a trailing '/'.  The returned URL is
1777 * guaranteed to be a prefix of the @a session's URL.
1778 *
1779 * @since New in 1.5.
1780 */
1781svn_error_t *
1782svn_ra_get_repos_root2(svn_ra_session_t *session,
1783                       const char **url,
1784                       apr_pool_t *pool);
1785
1786
1787/**
1788 * Similar to svn_ra_get_repos_root2(), but returns the value
1789 * allocated in @a session's pool.
1790 *
1791 * @deprecated Provided for backward compatibility with the 1.4 API.
1792 * @since New in 1.2.
1793 */
1794SVN_DEPRECATED
1795svn_error_t *
1796svn_ra_get_repos_root(svn_ra_session_t *session,
1797                      const char **url,
1798                      apr_pool_t *pool);
1799
1800/**
1801 * Set @a *locations to the locations (at the repository revisions
1802 * @a location_revisions) of the file identified by @a path in
1803 * @a peg_revision (passing @c SVN_INVALID_REVNUM is an error).
1804 * @a path is relative to the URL to which @a session was opened.
1805 * @a location_revisions is an array of @c svn_revnum_t's.
1806 * @a *locations will be a mapping from the revisions to
1807 * their appropriate absolute paths.  If the file doesn't exist in a
1808 * location_revision, that revision will be ignored.
1809 *
1810 * Use @a pool for all allocations.
1811 *
1812 * @since New in 1.2.
1813 */
1814svn_error_t *
1815svn_ra_get_locations(svn_ra_session_t *session,
1816                     apr_hash_t **locations,
1817                     const char *path,
1818                     svn_revnum_t peg_revision,
1819                     const apr_array_header_t *location_revisions,
1820                     apr_pool_t *pool);
1821
1822
1823/**
1824 * Call @a receiver (with @a receiver_baton) for each segment in the
1825 * location history of @a path in @a peg_revision, working backwards in
1826 * time from @a start_rev to @a end_rev.
1827 *
1828 * @a end_rev may be @c SVN_INVALID_REVNUM to indicate that you want
1829 * to trace the history of the object to its origin.
1830 *
1831 * @a start_rev may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1832 * revision".  Otherwise, @a start_rev must be younger than @a end_rev
1833 * (unless @a end_rev is @c SVN_INVALID_REVNUM).
1834 *
1835 * @a peg_revision may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1836 * revision", and must evaluate to be at least as young as @a start_rev.
1837 *
1838 * Use @a pool for all allocations.
1839 *
1840 * @since New in 1.5.
1841 */
1842svn_error_t *
1843svn_ra_get_location_segments(svn_ra_session_t *session,
1844                             const char *path,
1845                             svn_revnum_t peg_revision,
1846                             svn_revnum_t start_rev,
1847                             svn_revnum_t end_rev,
1848                             svn_location_segment_receiver_t receiver,
1849                             void *receiver_baton,
1850                             apr_pool_t *pool);
1851
1852/**
1853 * Retrieve a subset of the interesting revisions of a file @a path
1854 * as seen in revision @a end (see svn_fs_history_prev() for a
1855 * definition of "interesting revisions").  Invoke @a handler with
1856 * @a handler_baton as its first argument for each such revision.
1857 * @a session is an open RA session.  Use @a pool for all allocations.
1858 *
1859 * If there is an interesting revision of the file that is less than or
1860 * equal to @a start, the iteration will begin at that revision.
1861 * Else, the iteration will begin at the first revision of the file in
1862 * the repository, which has to be less than or equal to @a end.  Note
1863 * that if the function succeeds, @a handler will have been called at
1864 * least once.
1865 *
1866 * In a series of calls to @a handler, the file contents for the first
1867 * interesting revision will be provided as a text delta against the
1868 * empty file.  In the following calls, the delta will be against the
1869 * fulltext contents for the previous call.
1870 *
1871 * If @a include_merged_revisions is TRUE, revisions which are
1872 * included as a result of a merge between @a start and @a end will be
1873 * included.
1874 *
1875 * @note This functionality is not available in pre-1.1 servers.  If the
1876 * server doesn't implement it, an alternative (but much slower)
1877 * implementation based on svn_ra_get_log2() is used.
1878 *
1879 * On subversion 1.8 and newer servers this function has been enabled
1880 * to support reversion of the revision range for @a include_merged_revision
1881 * @c FALSE reporting by switching  @a end with @a start.
1882 *
1883 * @note Prior to Subversion 1.9, this function may request delta handlers
1884 * from @a handler even for empty text deltas.  Starting with 1.9, the
1885 * delta handler / baton return arguments passed to @a handler will be
1886 * NULL unless there is an actual difference in the file contents between
1887 * the current and the previous call.
1888 *
1889 * @since New in 1.5.
1890 */
1891svn_error_t *
1892svn_ra_get_file_revs2(svn_ra_session_t *session,
1893                      const char *path,
1894                      svn_revnum_t start,
1895                      svn_revnum_t end,
1896                      svn_boolean_t include_merged_revisions,
1897                      svn_file_rev_handler_t handler,
1898                      void *handler_baton,
1899                      apr_pool_t *pool);
1900
1901/**
1902 * Similar to svn_ra_get_file_revs2(), but with @a include_merged_revisions
1903 * set to FALSE.
1904 *
1905 * @since New in 1.2.
1906 * @deprecated Provided for backward compatibility with the 1.4 API.
1907 */
1908SVN_DEPRECATED
1909svn_error_t *
1910svn_ra_get_file_revs(svn_ra_session_t *session,
1911                     const char *path,
1912                     svn_revnum_t start,
1913                     svn_revnum_t end,
1914                     svn_ra_file_rev_handler_t handler,
1915                     void *handler_baton,
1916                     apr_pool_t *pool);
1917
1918/**
1919 * Lock each path in @a path_revs, which is a hash whose keys are the
1920 * paths to be locked, and whose values are the corresponding base
1921 * revisions for each path.  The keys are (const char *) and the
1922 * revisions are (svn_revnum_t *).
1923 *
1924 * Note that locking is never anonymous, so any server implementing
1925 * this function will have to "pull" a username from the client, if
1926 * it hasn't done so already.
1927 *
1928 * @a comment is optional: it's either an xml-escapable string
1929 * which describes the lock, or it is NULL.
1930 *
1931 * If any path is already locked by a different user, then call @a
1932 * lock_func/@a lock_baton with an error.  If @a steal_lock is TRUE,
1933 * then "steal" the existing lock(s) anyway, even if the RA username
1934 * does not match the current lock's owner.  Delete any lock on the
1935 * path, and unconditionally create a new lock.
1936 *
1937 * For each path, if its base revision (in @a path_revs) is a valid
1938 * revnum, then do an out-of-dateness check.  If the revnum is less
1939 * than the last-changed-revision of any path (or if a path doesn't
1940 * exist in HEAD), call @a lock_func/@a lock_baton with an
1941 * SVN_ERR_RA_OUT_OF_DATE error.
1942 *
1943 * After successfully locking a file, @a lock_func is called with the
1944 * @a lock_baton.
1945 *
1946 * Use @a pool for temporary allocations.
1947 *
1948 * @since New in 1.2.
1949 */
1950svn_error_t *
1951svn_ra_lock(svn_ra_session_t *session,
1952            apr_hash_t *path_revs,
1953            const char *comment,
1954            svn_boolean_t steal_lock,
1955            svn_ra_lock_callback_t lock_func,
1956            void *lock_baton,
1957            apr_pool_t *pool);
1958
1959/**
1960 * Remove the repository lock for each path in @a path_tokens.
1961 * @a path_tokens is a hash whose keys are the paths to be locked, and
1962 * whose values are the corresponding lock tokens for each path.  If
1963 * the path has no corresponding lock token, or if @a break_lock is TRUE,
1964 * then the corresponding value shall be "".
1965 *
1966 * Note that unlocking is never anonymous, so any server
1967 * implementing this function will have to "pull" a username from
1968 * the client, if it hasn't done so already.
1969 *
1970 * If @a token points to a lock, but the RA username doesn't match the
1971 * lock's owner, call @a lock_func/@a lock_baton with an error.  If @a
1972 * break_lock is TRUE, however, instead allow the lock to be "broken"
1973 * by the RA user.
1974 *
1975 * After successfully unlocking a path, @a lock_func is called with
1976 * the @a lock_baton.
1977 *
1978 * Use @a pool for temporary allocations.
1979 *
1980 * @since New in 1.2.
1981 */
1982svn_error_t *
1983svn_ra_unlock(svn_ra_session_t *session,
1984              apr_hash_t *path_tokens,
1985              svn_boolean_t break_lock,
1986              svn_ra_lock_callback_t lock_func,
1987              void *lock_baton,
1988              apr_pool_t *pool);
1989
1990/**
1991 * If @a path is locked, set @a *lock to an svn_lock_t which
1992 * represents the lock, allocated in @a pool.
1993 *
1994 * If @a path is not locked or does not exist in HEAD, set @a *lock to NULL.
1995 *
1996 * @note Before 1.9, this function could return SVN_ERR_FS_NOT_FOUND
1997 * when @a path didn't exist in HEAD on specific ra layers.
1998 *
1999 * @since New in 1.2.
2000 */
2001svn_error_t *
2002svn_ra_get_lock(svn_ra_session_t *session,
2003                svn_lock_t **lock,
2004                const char *path,
2005                apr_pool_t *pool);
2006
2007/**
2008 * Set @a *locks to a hashtable which represents all locks on or
2009 * below @a path.
2010 *
2011 * @a depth limits the returned locks to those associated with paths
2012 * within the specified depth of @a path, and must be one of the
2013 * following values:  #svn_depth_empty, #svn_depth_files,
2014 * #svn_depth_immediates, or #svn_depth_infinity.
2015 *
2016 * The hashtable maps (const char *) absolute fs paths to (const
2017 * svn_lock_t *) structures.  The hashtable -- and all keys and
2018 * values -- are allocated in @a pool.
2019 *
2020 * @note It is not considered an error for @a path to not exist in HEAD.
2021 * Such a search will simply return no locks.
2022 *
2023 * @note This functionality is not available in pre-1.2 servers.  If the
2024 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
2025 * returned.
2026 *
2027 * @since New in 1.7.
2028 */
2029svn_error_t *
2030svn_ra_get_locks2(svn_ra_session_t *session,
2031                  apr_hash_t **locks,
2032                  const char *path,
2033                  svn_depth_t depth,
2034                  apr_pool_t *pool);
2035
2036/**
2037 * Similar to svn_ra_get_locks2(), but with @a depth always passed as
2038 * #svn_depth_infinity.
2039 *
2040 * @since New in 1.2.
2041 * @deprecated Provided for backward compatibility with the 1.6 API.
2042 */
2043SVN_DEPRECATED
2044svn_error_t *
2045svn_ra_get_locks(svn_ra_session_t *session,
2046                 apr_hash_t **locks,
2047                 const char *path,
2048                 apr_pool_t *pool);
2049
2050
2051/**
2052 * Replay the changes from a range of revisions between @a start_revision
2053 * and @a end_revision (inclusive).
2054 *
2055 * When receiving information for one revision, a callback @a revstart_func is
2056 * called; this callback will provide an editor and baton through which the
2057 * revision will be replayed.
2058 * When replaying the revision is finished, callback @a revfinish_func will be
2059 * called so the editor can be closed.
2060 *
2061 * Changes will be limited to those that occur under @a session's URL, and
2062 * the server will assume that the client has no knowledge of revisions
2063 * prior to @a low_water_mark.  These two limiting factors define the portion
2064 * of the tree that the server will assume the client already has knowledge of,
2065 * and thus any copies of data from outside that part of the tree will be
2066 * sent in their entirety, not as simple copies or deltas against a previous
2067 * version.
2068 *
2069 * If @a send_deltas is @c TRUE, the actual text and property changes in
2070 * the revision will be sent, otherwise dummy text deltas and NULL property
2071 * changes will be sent instead.
2072 *
2073 * @a pool is used for all allocation.
2074 *
2075 * @since New in 1.5.
2076 */
2077svn_error_t *
2078svn_ra_replay_range(svn_ra_session_t *session,
2079                    svn_revnum_t start_revision,
2080                    svn_revnum_t end_revision,
2081                    svn_revnum_t low_water_mark,
2082                    svn_boolean_t send_deltas,
2083                    svn_ra_replay_revstart_callback_t revstart_func,
2084                    svn_ra_replay_revfinish_callback_t revfinish_func,
2085                    void *replay_baton,
2086                    apr_pool_t *pool);
2087
2088/**
2089 * Replay the changes from @a revision through @a editor and @a edit_baton.
2090 *
2091 * Changes will be limited to those that occur under @a session's URL, and
2092 * the server will assume that the client has no knowledge of revisions
2093 * prior to @a low_water_mark.  These two limiting factors define the portion
2094 * of the tree that the server will assume the client already has knowledge of,
2095 * and thus any copies of data from outside that part of the tree will be
2096 * sent in their entirety, not as simple copies or deltas against a previous
2097 * version.
2098 *
2099 * If @a send_deltas is @c TRUE, the actual text and property changes in
2100 * the revision will be sent, otherwise dummy text deltas and null property
2101 * changes will be sent instead.
2102 *
2103 * @a pool is used for all allocation.
2104 *
2105 * @since New in 1.4.
2106 */
2107svn_error_t *
2108svn_ra_replay(svn_ra_session_t *session,
2109              svn_revnum_t revision,
2110              svn_revnum_t low_water_mark,
2111              svn_boolean_t send_deltas,
2112              const svn_delta_editor_t *editor,
2113              void *edit_baton,
2114              apr_pool_t *pool);
2115
2116/**
2117 * Given @a path at revision @a peg_revision, set @a *revision_deleted to the
2118 * revision @a path was first deleted, within the inclusive revision range
2119 * defined by @a peg_revision and @a end_revision.  @a path is relative
2120 * to the URL in @a session.
2121 *
2122 * If @a path does not exist at @a peg_revision or was not deleted within
2123 * the specified range, then set @a *revision_deleted to @c SVN_INVALID_REVNUM.
2124 * If @a peg_revision or @a end_revision are invalid or if @a peg_revision is
2125 * greater than @a end_revision, then return @c SVN_ERR_CLIENT_BAD_REVISION.
2126 *
2127 * Use @a pool for all allocations.
2128 *
2129 * @since New in 1.6.
2130 */
2131svn_error_t *
2132svn_ra_get_deleted_rev(svn_ra_session_t *session,
2133                       const char *path,
2134                       svn_revnum_t peg_revision,
2135                       svn_revnum_t end_revision,
2136                       svn_revnum_t *revision_deleted,
2137                       apr_pool_t *pool);
2138
2139/**
2140 * Set @a *inherited_props to a depth-first ordered array of
2141 * #svn_prop_inherited_item_t * structures representing the properties
2142 * inherited by @a path at @a revision (or the 'head' revision if
2143 * @a revision is @c SVN_INVALID_REVNUM).  Interpret @a path relative to
2144 * the URL in @a session.  Use @a pool for all allocations.  If no
2145 * inheritable properties are found, then set @a *inherited_props to
2146 * an empty array.
2147 *
2148 * The #svn_prop_inherited_item_t->path_or_url members of the
2149 * #svn_prop_inherited_item_t * structures in @a *inherited_props are
2150 * paths relative to the repository root URL (of the repository which
2151 * @a ra_session is associated).
2152 *
2153 * Allocate @a *inherited_props in @a result_pool.  Use @a scratch_pool
2154 * for temporary allocations.
2155 *
2156 * @since New in 1.8.
2157 */
2158svn_error_t *
2159svn_ra_get_inherited_props(svn_ra_session_t *session,
2160                           apr_array_header_t **inherited_props,
2161                           const char *path,
2162                           svn_revnum_t revision,
2163                           apr_pool_t *result_pool,
2164                           apr_pool_t *scratch_pool);
2165
2166/**
2167 * @defgroup Capabilities Dynamically query the server's capabilities.
2168 *
2169 * @{
2170 */
2171
2172/**
2173 * Set @a *has to TRUE if the server represented by @a session has
2174 * @a capability (one of the capabilities beginning with
2175 * @c "SVN_RA_CAPABILITY_"), else set @a *has to FALSE.
2176 *
2177 * If @a capability isn't recognized, throw @c SVN_ERR_UNKNOWN_CAPABILITY,
2178 * with the effect on @a *has undefined.
2179 *
2180 * Use @a pool for all allocation.
2181 *
2182 * @since New in 1.5.
2183 */
2184svn_error_t *
2185svn_ra_has_capability(svn_ra_session_t *session,
2186                      svn_boolean_t *has,
2187                      const char *capability,
2188                      apr_pool_t *pool);
2189
2190/**
2191 * The capability of understanding @c svn_depth_t (e.g., the server
2192 * understands what the client means when the client describes the
2193 * depth of a working copy to the server.)
2194 *
2195 * @since New in 1.5.
2196 */
2197#define SVN_RA_CAPABILITY_DEPTH "depth"
2198
2199/**
2200 * The capability of doing the right thing with merge-tracking
2201 * information.  This capability should be reported bidirectionally,
2202 * because some repositories may want to reject clients that do not
2203 * self-report as knowing how to handle merge-tracking.
2204 *
2205 * @since New in 1.5.
2206 */
2207#define SVN_RA_CAPABILITY_MERGEINFO "mergeinfo"
2208
2209/**
2210 * The capability of retrieving arbitrary revprops in svn_ra_get_log2.
2211 *
2212 * @since New in 1.5.
2213 */
2214#define SVN_RA_CAPABILITY_LOG_REVPROPS "log-revprops"
2215
2216/**
2217 * The capability of replaying a directory in the repository (partial replay).
2218 *
2219 * @since New in 1.5.
2220 */
2221#define SVN_RA_CAPABILITY_PARTIAL_REPLAY "partial-replay"
2222
2223/**
2224 * The capability of including revision properties in a commit.
2225 *
2226 * @since New in 1.5.
2227 */
2228#define SVN_RA_CAPABILITY_COMMIT_REVPROPS "commit-revprops"
2229
2230/**
2231 * The capability of specifying (and atomically verifying) expected
2232 * preexisting values when modifying revprops.
2233 *
2234 * @since New in 1.7.
2235 */
2236#define SVN_RA_CAPABILITY_ATOMIC_REVPROPS "atomic-revprops"
2237
2238/**
2239 * The capability to get inherited properties.
2240 *
2241 * @since New in 1.8.
2242 */
2243#define SVN_RA_CAPABILITY_INHERITED_PROPS "inherited-props"
2244
2245/**
2246 * The capability of a server to automatically remove transaction
2247 * properties prefixed with SVN_PROP_EPHEMERAL_PREFIX.
2248 *
2249 * @since New in 1.8.
2250 */
2251#define SVN_RA_CAPABILITY_EPHEMERAL_TXNPROPS "ephemeral-txnprops"
2252
2253/**
2254 * The capability of a server to walk revisions backwards in
2255 * svn_ra_get_file_revs2
2256 *
2257 * @since New in 1.8.
2258 */
2259#define SVN_RA_CAPABILITY_GET_FILE_REVS_REVERSE "get-file-revs-reversed"
2260
2261/**
2262 * The capability of a server to understand the list command.
2263 *
2264 * @since New in 1.10.
2265 */
2266#define SVN_RA_CAPABILITY_LIST "list"
2267
2268
2269/*       *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY ***
2270 *
2271 * RA layers generally fetch all capabilities when asked about any
2272 * capability, to save future round trips.  So if you add a new
2273 * capability here, make sure to update the RA layers to remember
2274 * it after any capabilities query.
2275 *
2276 * Also note that capability strings should not include colons,
2277 * because we pass a list of client capabilities to the start-commit
2278 * hook as a single, colon-separated string.
2279 */
2280
2281/** @} */
2282
2283
2284/**
2285 * Append a textual list of all available RA modules to the stringbuf
2286 * @a output.
2287 *
2288 * @since New in 1.2.
2289 */
2290svn_error_t *
2291svn_ra_print_modules(svn_stringbuf_t *output,
2292                     apr_pool_t *pool);
2293
2294
2295/**
2296 * Similar to svn_ra_print_modules().
2297 * @a ra_baton is ignored.
2298 *
2299 * @deprecated Provided for backward compatibility with the 1.1 API.
2300 */
2301SVN_DEPRECATED
2302svn_error_t *
2303svn_ra_print_ra_libraries(svn_stringbuf_t **descriptions,
2304                          void *ra_baton,
2305                          apr_pool_t *pool);
2306
2307
2308
2309/**
2310 * Using this callback struct is similar to calling the newer public
2311 * interface that is based on @c svn_ra_session_t.
2312 *
2313 * @deprecated Provided for backward compatibility with the 1.1 API.
2314 */
2315typedef struct svn_ra_plugin_t
2316{
2317  /** The proper name of the RA library, (like "ra_serf" or "ra_local") */
2318  const char *name;
2319
2320  /** Short doc string printed out by `svn --version` */
2321  const char *description;
2322
2323  /* The vtable hooks */
2324
2325  /** Call svn_ra_open() and set @a session_baton to an object representing
2326   * the new session.  All other arguments are passed to svn_ra_open().
2327   */
2328  svn_error_t *(*open)(void **session_baton,
2329                       const char *repos_URL,
2330                       const svn_ra_callbacks_t *callbacks,
2331                       void *callback_baton,
2332                       apr_hash_t *config,
2333                       apr_pool_t *pool);
2334
2335  /** Call svn_ra_get_latest_revnum() with the session associated with
2336   * @a session_baton and all other arguments.
2337   */
2338  svn_error_t *(*get_latest_revnum)(void *session_baton,
2339                                    svn_revnum_t *latest_revnum,
2340                                    apr_pool_t *pool);
2341
2342  /** Call svn_ra_get_dated_revision() with the session associated with
2343   * @a session_baton and all other arguments.
2344   */
2345  svn_error_t *(*get_dated_revision)(void *session_baton,
2346                                     svn_revnum_t *revision,
2347                                     apr_time_t tm,
2348                                     apr_pool_t *pool);
2349
2350  /** Call svn_ra_change_rev_prop() with the session associated with
2351   * @a session_baton and all other arguments.
2352   */
2353  svn_error_t *(*change_rev_prop)(void *session_baton,
2354                                  svn_revnum_t rev,
2355                                  const char *name,
2356                                  const svn_string_t *value,
2357                                  apr_pool_t *pool);
2358
2359  /** Call svn_ra_rev_proplist() with the session associated with
2360   * @a session_baton and all other arguments.
2361   */
2362  svn_error_t *(*rev_proplist)(void *session_baton,
2363                               svn_revnum_t rev,
2364                               apr_hash_t **props,
2365                               apr_pool_t *pool);
2366
2367  /** Call svn_ra_rev_prop() with the session associated with
2368   * @a session_baton and all other arguments.
2369   */
2370  svn_error_t *(*rev_prop)(void *session_baton,
2371                           svn_revnum_t rev,
2372                           const char *name,
2373                           svn_string_t **value,
2374                           apr_pool_t *pool);
2375
2376  /** Call svn_ra_get_commit_editor() with the session associated with
2377   * @a session_baton and all other arguments plus @a lock_tokens set to
2378   * @c NULL and @a keep_locks set to @c TRUE.
2379   */
2380  svn_error_t *(*get_commit_editor)(void *session_baton,
2381                                    const svn_delta_editor_t **editor,
2382                                    void **edit_baton,
2383                                    const char *log_msg,
2384                                    svn_commit_callback_t callback,
2385                                    void *callback_baton,
2386                                    apr_pool_t *pool);
2387
2388  /** Call svn_ra_get_file() with the session associated with
2389   * @a session_baton and all other arguments.
2390   */
2391  svn_error_t *(*get_file)(void *session_baton,
2392                           const char *path,
2393                           svn_revnum_t revision,
2394                           svn_stream_t *stream,
2395                           svn_revnum_t *fetched_rev,
2396                           apr_hash_t **props,
2397                           apr_pool_t *pool);
2398
2399  /** Call svn_ra_get_dir() with the session associated with
2400   * @a session_baton and all other arguments.
2401   */
2402  svn_error_t *(*get_dir)(void *session_baton,
2403                          const char *path,
2404                          svn_revnum_t revision,
2405                          apr_hash_t **dirents,
2406                          svn_revnum_t *fetched_rev,
2407                          apr_hash_t **props,
2408                          apr_pool_t *pool);
2409
2410  /** Call svn_ra_do_update() with the session associated with
2411   * @a session_baton and all other arguments.
2412   */
2413  svn_error_t *(*do_update)(void *session_baton,
2414                            const svn_ra_reporter_t **reporter,
2415                            void **report_baton,
2416                            svn_revnum_t revision_to_update_to,
2417                            const char *update_target,
2418                            svn_boolean_t recurse,
2419                            const svn_delta_editor_t *update_editor,
2420                            void *update_baton,
2421                            apr_pool_t *pool);
2422
2423  /** Call svn_ra_do_switch() with the session associated with
2424   * @a session_baton and all other arguments.
2425   */
2426  svn_error_t *(*do_switch)(void *session_baton,
2427                            const svn_ra_reporter_t **reporter,
2428                            void **report_baton,
2429                            svn_revnum_t revision_to_switch_to,
2430                            const char *switch_target,
2431                            svn_boolean_t recurse,
2432                            const char *switch_url,
2433                            const svn_delta_editor_t *switch_editor,
2434                            void *switch_baton,
2435                            apr_pool_t *pool);
2436
2437  /** Call svn_ra_do_status() with the session associated with
2438   * @a session_baton and all other arguments.
2439   */
2440  svn_error_t *(*do_status)(void *session_baton,
2441                            const svn_ra_reporter_t **reporter,
2442                            void **report_baton,
2443                            const char *status_target,
2444                            svn_revnum_t revision,
2445                            svn_boolean_t recurse,
2446                            const svn_delta_editor_t *status_editor,
2447                            void *status_baton,
2448                            apr_pool_t *pool);
2449
2450  /** Call svn_ra_do_diff() with the session associated with
2451   * @a session_baton and all other arguments.
2452   */
2453  svn_error_t *(*do_diff)(void *session_baton,
2454                          const svn_ra_reporter_t **reporter,
2455                          void **report_baton,
2456                          svn_revnum_t revision,
2457                          const char *diff_target,
2458                          svn_boolean_t recurse,
2459                          svn_boolean_t ignore_ancestry,
2460                          const char *versus_url,
2461                          const svn_delta_editor_t *diff_editor,
2462                          void *diff_baton,
2463                          apr_pool_t *pool);
2464
2465  /** Call svn_ra_get_log() with the session associated with
2466   * @a session_baton and all other arguments.  @a limit is set to 0.
2467   */
2468  svn_error_t *(*get_log)(void *session_baton,
2469                          const apr_array_header_t *paths,
2470                          svn_revnum_t start,
2471                          svn_revnum_t end,
2472                          svn_boolean_t discover_changed_paths,
2473                          svn_boolean_t strict_node_history,
2474                          svn_log_message_receiver_t receiver,
2475                          void *receiver_baton,
2476                          apr_pool_t *pool);
2477
2478  /** Call svn_ra_check_path() with the session associated with
2479   * @a session_baton and all other arguments.
2480   */
2481  svn_error_t *(*check_path)(void *session_baton,
2482                             const char *path,
2483                             svn_revnum_t revision,
2484                             svn_node_kind_t *kind,
2485                             apr_pool_t *pool);
2486
2487  /** Call svn_ra_get_uuid() with the session associated with
2488   * @a session_baton and all other arguments.
2489   */
2490  svn_error_t *(*get_uuid)(void *session_baton,
2491                           const char **uuid,
2492                           apr_pool_t *pool);
2493
2494  /** Call svn_ra_get_repos_root() with the session associated with
2495   * @a session_baton and all other arguments.
2496   */
2497  svn_error_t *(*get_repos_root)(void *session_baton,
2498                                 const char **url,
2499                                 apr_pool_t *pool);
2500
2501  /**
2502   * Call svn_ra_get_locations() with the session associated with
2503   * @a session_baton and all other arguments.
2504   *
2505   * @since New in 1.1.
2506   */
2507  svn_error_t *(*get_locations)(void *session_baton,
2508                                apr_hash_t **locations,
2509                                const char *path,
2510                                svn_revnum_t peg_revision,
2511                                apr_array_header_t *location_revisions,
2512                                apr_pool_t *pool);
2513
2514  /**
2515   * Call svn_ra_get_file_revs() with the session associated with
2516   * @a session_baton and all other arguments.
2517   *
2518   * @since New in 1.1.
2519   */
2520  svn_error_t *(*get_file_revs)(void *session_baton,
2521                                const char *path,
2522                                svn_revnum_t start,
2523                                svn_revnum_t end,
2524                                svn_ra_file_rev_handler_t handler,
2525                                void *handler_baton,
2526                                apr_pool_t *pool);
2527
2528  /**
2529   * Return the plugin's version information.
2530   *
2531   * @since New in 1.1.
2532   */
2533  const svn_version_t *(*get_version)(void);
2534
2535
2536} svn_ra_plugin_t;
2537
2538/**
2539 * All "ra_FOO" implementations *must* export a function named
2540 * svn_ra_FOO_init() of type @c svn_ra_init_func_t.
2541 *
2542 * When called by libsvn_client, this routine adds an entry (or
2543 * entries) to the hash table for any URL schemes it handles.  The hash
2544 * value must be of type (<tt>@c svn_ra_plugin_t *</tt>).  @a pool is a
2545 * pool for allocating configuration / one-time data.
2546 *
2547 * This type is defined to use the "C Calling Conventions" to ensure that
2548 * abi_version is the first parameter. The RA plugin must check that value
2549 * before accessing the other parameters.
2550 *
2551 * ### need to force this to be __cdecl on Windows... how??
2552 *
2553 * @deprecated Provided for backward compatibility with the 1.1 API.
2554 */
2555typedef svn_error_t *(*svn_ra_init_func_t)(int abi_version,
2556                                           apr_pool_t *pool,
2557                                           apr_hash_t *hash);
2558
2559/**
2560 * The current ABI (Application Binary Interface) version for the
2561 * RA plugin model. This version number will change when the ABI
2562 * between the SVN core (e.g. libsvn_client) and the RA plugin changes.
2563 *
2564 * An RA plugin should verify that the passed version number is acceptable
2565 * before accessing the rest of the parameters, and before returning any
2566 * information.
2567 *
2568 * It is entirely acceptable for an RA plugin to accept multiple ABI
2569 * versions. It can simply interpret the parameters based on the version,
2570 * and it can return different plugin structures.
2571 *
2572 *
2573 * <pre>
2574 * VSN  DATE        REASON FOR CHANGE
2575 * ---  ----------  ------------------------------------------------
2576 *   1  2001-02-17  Initial revision.
2577 *   2  2004-06-29  Preparing for svn 1.1, which adds new RA vtable funcs.
2578 *      2005-01-19  Rework the plugin interface and don't provide the vtable
2579 *                  to the client.  Separate ABI versions are no longer used.
2580 * </pre>
2581 *
2582 * @deprecated Provided for backward compatibility with the 1.0 API.
2583 */
2584#define SVN_RA_ABI_VERSION      2
2585
2586/* Public RA implementations. */
2587
2588/** Initialize libsvn_ra_serf.
2589 *
2590 * @deprecated Provided for backward compatibility with the 1.1 API. */
2591SVN_DEPRECATED
2592svn_error_t *
2593svn_ra_dav_init(int abi_version,
2594                apr_pool_t *pool,
2595                apr_hash_t *hash);
2596
2597/** Initialize libsvn_ra_local.
2598 *
2599 * @deprecated Provided for backward compatibility with the 1.1 API. */
2600SVN_DEPRECATED
2601svn_error_t *
2602svn_ra_local_init(int abi_version,
2603                  apr_pool_t *pool,
2604                  apr_hash_t *hash);
2605
2606/** Initialize libsvn_ra_svn.
2607 *
2608 * @deprecated Provided for backward compatibility with the 1.1 API. */
2609SVN_DEPRECATED
2610svn_error_t *
2611svn_ra_svn_init(int abi_version,
2612                apr_pool_t *pool,
2613                apr_hash_t *hash);
2614
2615/** Initialize libsvn_ra_serf.
2616 *
2617 * @since New in 1.4.
2618 * @deprecated Provided for backward compatibility with the 1.1 API. */
2619SVN_DEPRECATED
2620svn_error_t *
2621svn_ra_serf_init(int abi_version,
2622                 apr_pool_t *pool,
2623                 apr_hash_t *hash);
2624
2625
2626/**
2627 * Initialize the compatibility wrapper, using @a pool for any allocations.
2628 * The caller must hold on to @a ra_baton as long as the RA library is used.
2629 *
2630 * @deprecated Provided for backward compatibility with the 1.1 API.
2631 */
2632SVN_DEPRECATED
2633svn_error_t *
2634svn_ra_init_ra_libs(void **ra_baton,
2635                    apr_pool_t *pool);
2636
2637/**
2638 * Return an RA vtable-@a library which can handle URL.  A number of
2639 * svn_client_* routines will call this internally, but client apps might
2640 * use it too.  $a ra_baton is a baton obtained by a call to
2641 * svn_ra_init_ra_libs().
2642 *
2643 * @deprecated Provided for backward compatibility with the 1.1 API.
2644 */
2645SVN_DEPRECATED
2646svn_error_t *
2647svn_ra_get_ra_library(svn_ra_plugin_t **library,
2648                      void *ra_baton,
2649                      const char *url,
2650                      apr_pool_t *pool);
2651
2652#ifdef __cplusplus
2653}
2654#endif /* __cplusplus */
2655
2656#endif  /* SVN_RA_H */
2657
2658