OSDN Git Service

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