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