Add include files for msys-crypto-0.9.8.dll
[msysgit.git] / include / subversion-1 / svn_ra.h
blob05979f7fc92b81d5d1dc9245321536bad66e601c
1 /**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2000-2004 CollabNet. All rights reserved.
6 * This software is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at http://subversion.tigris.org/license-1.html.
9 * If newer versions of this license are posted there, you may use a
10 * newer version instead, at your option.
12 * This software consists of voluntary contributions made by many
13 * individuals. For exact contribution history, see the revision
14 * history and logs, available at http://subversion.tigris.org/.
15 * ====================================================================
16 * @endcopyright
18 * @file svn_ra.h
19 * @brief Repository Access
25 #ifndef SVN_RA_H
26 #define SVN_RA_H
28 #include <apr_pools.h>
29 #include <apr_tables.h>
31 #include "svn_error.h"
32 #include "svn_delta.h"
33 #include "svn_auth.h"
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
41 /* Misc. declarations */
43 /**
44 * Get libsvn_ra version information.
46 * @since New in 1.1.
48 const svn_version_t *svn_ra_version(void);
51 /** This is a function type which allows the RA layer to fetch working
52 * copy (WC) properties.
54 * The @a baton is provided along with the function pointer and should
55 * be passed back in. This will be the @a callback_baton or the
56 * @a close_baton as appropriate.
58 * @a path is relative to the "root" of the session, defined by the
59 * @a repos_url passed to the @c RA->open() vtable call.
61 * @a name is the name of the property to fetch. If the property is present,
62 * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
64 typedef svn_error_t *(*svn_ra_get_wc_prop_func_t)(void *baton,
65 const char *relpath,
66 const char *name,
67 const svn_string_t **value,
68 apr_pool_t *pool);
70 /** This is a function type which allows the RA layer to store new
71 * working copy properties during update-like operations. See the
72 * comments for @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and
73 * @a name. The @a value is the value that will be stored for the property;
74 * a null @a value means the property will be deleted.
76 typedef svn_error_t *(*svn_ra_set_wc_prop_func_t)(void *baton,
77 const char *path,
78 const char *name,
79 const svn_string_t *value,
80 apr_pool_t *pool);
82 /** This is a function type which allows the RA layer to store new
83 * working copy properties as part of a commit. See the comments for
84 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
85 * The @a value is the value that will be stored for the property; a
86 * @c NULL @a value means the property will be deleted.
88 * Note that this might not actually store the new property before
89 * returning, but instead schedule it to be changed as part of
90 * post-commit processing (in which case a successful commit means the
91 * properties got written). Thus, during the commit, it is possible
92 * to invoke this function to set a new value for a wc prop, then read
93 * the wc prop back from the working copy and get the *old* value.
94 * Callers beware.
96 typedef svn_error_t *(*svn_ra_push_wc_prop_func_t)(void *baton,
97 const char *path,
98 const char *name,
99 const svn_string_t *value,
100 apr_pool_t *pool);
102 /** This is a function type which allows the RA layer to invalidate
103 * (i.e., remove) wcprops. See the documentation for
104 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
106 * Unlike @c svn_ra_push_wc_prop_func_t, this has immediate effect. If
107 * it returns success, the wcprops have been removed.
109 typedef svn_error_t *(*svn_ra_invalidate_wc_props_func_t)(void *baton,
110 const char *path,
111 const char *name,
112 apr_pool_t *pool);
115 /** A function type for retrieving the youngest revision from a repos. */
116 typedef svn_error_t *(*svn_ra_get_latest_revnum_func_t)
117 (void *session_baton,
118 svn_revnum_t *latest_revnum);
121 * A callback function type for use in @c get_file_revs.
122 * @a baton is provided by the caller, @a path is the pathname of the file
123 * in revision @a rev and @a rev_props are the revision properties.
124 * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a
125 * handler/baton which will be called with the delta between the previous
126 * revision and this one after the return of this callback. They may be
127 * left as NULL/NULL.
128 * @a prop_diffs is an array of svn_prop_t elements indicating the property
129 * delta for this and the previous revision.
130 * @a pool may be used for temporary allocations, but you can't rely
131 * on objects allocated to live outside of this particular call and the
132 * immediately following calls to @a *delta_handler, if any.
134 * @since New in 1.1.
136 typedef svn_error_t *(*svn_ra_file_rev_handler_t)
137 (void *baton,
138 const char *path,
139 svn_revnum_t rev,
140 apr_hash_t *rev_props,
141 svn_txdelta_window_handler_t *delta_handler,
142 void **delta_baton,
143 apr_array_header_t *prop_diffs,
144 apr_pool_t *pool);
146 /**
147 * Callback function type for locking and unlocking actions.
149 * @since New in 1.2.
151 * @a do_lock is TRUE when locking @a path, and FALSE
152 * otherwise.
154 * @a lock is a lock for @a path or null if @a do_lock is false or @a ra_err is
155 * non-null.
157 * @a ra_err is NULL unless the ra layer encounters a locking related
158 * error which it passes back for notification purposes. The caller
159 * is responsible for clearing @a ra_err after the callback is run.
161 * @a baton is a closure object; it should be provided by the
162 * implementation, and passed by the caller. @a pool may be used for
163 * temporary allocation.
165 typedef svn_error_t *(*svn_ra_lock_callback_t)(void *baton,
166 const char *path,
167 svn_boolean_t do_lock,
168 const svn_lock_t *lock,
169 svn_error_t *ra_err,
170 apr_pool_t *pool);
173 * Callback function type for progress notification.
175 * @a progress is the number of bytes already transferred, @a total is
176 * the total number of bytes to transfer or -1 if it's not known, @a
177 * baton is the callback baton.
179 * @since New in 1.3.
181 typedef void (*svn_ra_progress_notify_func_t)(apr_off_t progress,
182 apr_off_t total,
183 void *baton,
184 apr_pool_t *pool);
188 * The update Reporter.
190 * A vtable structure which allows a working copy to describe a subset
191 * (or possibly all) of its working-copy to an RA layer, for the
192 * purposes of an update, switch, status, or diff operation.
194 * Paths for report calls are relative to the target (not the anchor)
195 * of the operation. Report calls must be made in depth-first order:
196 * parents before children, all children of a parent before any
197 * siblings of the parent. The first report call must be a set_path
198 * with a @a path argument of "" and a valid revision. (If the target
199 * of the operation is locally deleted or missing, use the anchor's
200 * revision.) If the target of the operation is deleted or switched
201 * relative to the anchor, follow up the initial set_path call with a
202 * link_path or delete_path call with a @a path argument of "" to
203 * indicate that. In no other case may there be two report
204 * descriptions for the same path. If the target of the operation is
205 * a locally added file or directory (which previously did not exist),
206 * it may be reported as having revision 0 or as having the parent
207 * directory's revision.
209 * @since New in 1.2.
211 typedef struct svn_ra_reporter2_t
213 /** Describe a working copy @a path as being at a particular @a revision.
215 * If @a start_empty is set and @a path is a directory, the
216 * implementor should assume the directory has no entries or props.
218 * This will *override* any previous set_path() calls made on parent
219 * paths. @a path is relative to the URL specified in @c RA->open().
221 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
223 * All temporary allocations are done in @a pool.
225 svn_error_t *(*set_path)(void *report_baton,
226 const char *path,
227 svn_revnum_t revision,
228 svn_boolean_t start_empty,
229 const char *lock_token,
230 apr_pool_t *pool);
232 /** Describing a working copy @a path as missing.
234 * All temporary allocations are done in @a pool.
236 svn_error_t *(*delete_path)(void *report_baton,
237 const char *path,
238 apr_pool_t *pool);
240 /** Like set_path(), but differs in that @a path in the working copy
241 * (relative to the root of the report driver) isn't a reflection of
242 * @a path in the repository (relative to the URL specified when
243 * opening the RA layer), but is instead a reflection of a different
244 * repository @a url at @a revision.
246 * If @a start_empty is set and @a path is a directory,
247 * the implementor should assume the directory has no entries or props.
249 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
251 * All temporary allocations are done in @a pool.
253 svn_error_t *(*link_path)(void *report_baton,
254 const char *path,
255 const char *url,
256 svn_revnum_t revision,
257 svn_boolean_t start_empty,
258 const char *lock_token,
259 apr_pool_t *pool);
261 /** WC calls this when the state report is finished; any directories
262 * or files not explicitly `set' are assumed to be at the
263 * baseline revision originally passed into do_update(). No other
264 * reporting functions, including abort_report, should be called after
265 * calling this function.
267 svn_error_t *(*finish_report)(void *report_baton,
268 apr_pool_t *pool);
270 /** If an error occurs during a report, this routine should cause the
271 * filesystem transaction to be aborted & cleaned up. No other reporting
272 * functions should be called after calling this function.
274 svn_error_t *(*abort_report)(void *report_baton,
275 apr_pool_t *pool);
277 } svn_ra_reporter2_t;
280 * Similar to @c svn_ra_reporter2_t, but without support for lock tokens.
282 * @deprecated Provided for backward compatibility with the 1.1 API.
284 typedef struct svn_ra_reporter_t
286 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
287 * with @a lock_token always set to NULL. */
288 svn_error_t *(*set_path)(void *report_baton,
289 const char *path,
290 svn_revnum_t revision,
291 svn_boolean_t start_empty,
292 apr_pool_t *pool);
294 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
295 svn_error_t *(*delete_path)(void *report_baton,
296 const char *path,
297 apr_pool_t *pool);
299 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
300 * with @a lock_token always set to NULL. */
301 svn_error_t *(*link_path)(void *report_baton,
302 const char *path,
303 const char *url,
304 svn_revnum_t revision,
305 svn_boolean_t start_empty,
306 apr_pool_t *pool);
308 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
309 svn_error_t *(*finish_report)(void *report_baton,
310 apr_pool_t *pool);
312 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
313 svn_error_t *(*abort_report)(void *report_baton,
314 apr_pool_t *pool);
315 } svn_ra_reporter_t;
318 /** A collection of callbacks implemented by libsvn_client which allows
319 * an RA layer to "pull" information from the client application, or
320 * possibly store information. libsvn_client passes this vtable to
321 * @c RA->open().
323 * Each routine takes a @a callback_baton originally provided with the
324 * vtable.
326 * Clients must use svn_ra_create_callbacks() to allocate and
327 * initialize this structure.
329 * @since New in 1.3.
331 typedef struct svn_ra_callbacks2_t
333 /** Open a unique temporary file for writing in the working copy.
334 * This file will be automatically deleted when @a fp is closed.
336 svn_error_t *(*open_tmp_file)(apr_file_t **fp,
337 void *callback_baton,
338 apr_pool_t *pool);
340 /** An authentication baton, created by the application, which is
341 * capable of retrieving all known types of credentials.
343 svn_auth_baton_t *auth_baton;
345 /*** The following items may be set to NULL to disallow the RA layer
346 to perform the respective operations of the vtable functions.
347 Perhaps WC props are not defined or are in invalid for this
348 session, or perhaps the commit operation this RA session will
349 perform is a server-side only one that shouldn't do post-commit
350 processing on a working copy path. ***/
352 /** Fetch working copy properties.
354 *<pre> ### we might have a problem if the RA layer ever wants a property
355 * ### that corresponds to a different revision of the file than
356 * ### what is in the WC. we'll cross that bridge one day...</pre>
358 svn_ra_get_wc_prop_func_t get_wc_prop;
360 /** Immediately set new values for working copy properties. */
361 svn_ra_set_wc_prop_func_t set_wc_prop;
363 /** Schedule new values for working copy properties. */
364 svn_ra_push_wc_prop_func_t push_wc_prop;
366 /** Invalidate working copy properties. */
367 svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
369 /** Notification callback used for progress information.
370 * May be NULL if not used.
372 svn_ra_progress_notify_func_t progress_func;
374 /** Notification callback baton, used with progress_func. */
375 void *progress_baton;
376 } svn_ra_callbacks2_t;
378 /** Similar to svn_ra_callbacks2_t, except that the progress
379 * notification function and baton is missing.
381 * @deprecated Provided for backward compatibility with the 1.2 API.
383 typedef struct svn_ra_callbacks_t
385 svn_error_t *(*open_tmp_file)(apr_file_t **fp,
386 void *callback_baton,
387 apr_pool_t *pool);
389 svn_auth_baton_t *auth_baton;
391 svn_ra_get_wc_prop_func_t get_wc_prop;
393 svn_ra_set_wc_prop_func_t set_wc_prop;
395 svn_ra_push_wc_prop_func_t push_wc_prop;
397 svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
399 } svn_ra_callbacks_t;
403 /*----------------------------------------------------------------------*/
405 /* Public Interfaces. */
408 * Initialize the RA library. This function must be called before using
409 * any function in this header, except the deprecated APIs based on
410 * @c svn_ra_plugin_t, or svn_ra_version(). This function must not be called
411 * simultaneously in multiple threads. @a pool must live
412 * longer than any open RA sessions.
414 * @since New in 1.2.
416 svn_error_t *
417 svn_ra_initialize(apr_pool_t *pool);
419 /** Initialize a callback structure.
420 * Set @a *callbacks to a ra callbacks object, allocated in @a pool.
422 * Clients must use this function to allocate and initialize @c
423 * svn_ra_callbacks2_t structures.
425 * @since New in 1.3.
427 svn_error_t *
428 svn_ra_create_callbacks(svn_ra_callbacks2_t **callbacks,
429 apr_pool_t *pool);
432 * A repository access session. This object is used to perform requests
433 * to a repository, identified by an URL.
435 * @since New in 1.2.
437 typedef struct svn_ra_session_t svn_ra_session_t;
440 * Open a repository session to @a repos_URL. Return an opaque object
441 * representing this session in @a *session_p, allocated in @a pool.
443 * @a callbacks/@a callback_baton is a table of callbacks provided by the
444 * client; see @c svn_ra_callbacks2_t.
446 * @a config is a hash mapping <tt>const char *</tt> keys to
447 * @c svn_config_t * values. For example, the @c svn_config_t for the
448 * "~/.subversion/config" file is under the key "config".
450 * All RA requests require a session; they will continue to
451 * use @a pool for memory allocation.
453 * @see svn_client_open_ra_session().
455 * @since New in 1.3.
457 svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,
458 const char *repos_URL,
459 const svn_ra_callbacks2_t *callbacks,
460 void *callback_baton,
461 apr_hash_t *config,
462 apr_pool_t *pool);
465 * @see svn_ra_open2().
466 * @since New in 1.2.
467 * @deprecated Provided for backward compatibility with the 1.2 API.
469 svn_error_t *svn_ra_open(svn_ra_session_t **session_p,
470 const char *repos_URL,
471 const svn_ra_callbacks_t *callbacks,
472 void *callback_baton,
473 apr_hash_t *config,
474 apr_pool_t *pool);
476 /** Change the root URL of an open @a ra_session to point to a new path in the
477 * same repository. @a url is the new root URL. Use @a pool for
478 * temporary allocations.
480 * If @a url has a different repository root than the current session
481 * URL, return @c SVN_ERR_RA_ILLEGAL_URL.
483 * @since New in 1.4.
485 svn_error_t *svn_ra_reparent(svn_ra_session_t *ra_session,
486 const char *url,
487 apr_pool_t *pool);
490 * Get the latest revision number from the repository of @a session.
492 * Use @a pool for memory allocation.
494 * @since New in 1.2.
496 svn_error_t *svn_ra_get_latest_revnum(svn_ra_session_t *session,
497 svn_revnum_t *latest_revnum,
498 apr_pool_t *pool);
501 * Get the latest revision number at time @a tm in the repository of
502 * @a session.
504 * Use @a pool for memory allocation.
506 * @since New in 1.2.
508 svn_error_t *svn_ra_get_dated_revision(svn_ra_session_t *session,
509 svn_revnum_t *revision,
510 apr_time_t tm,
511 apr_pool_t *pool);
514 * Set the property @a name to @a value on revision @a rev in the repository
515 * of @a session.
517 * If @a value is @c NULL, delete the named revision property.
519 * Please note that properties attached to revisions are @em unversioned.
521 * Use @a pool for memory allocation.
523 * @since New in 1.2.
525 svn_error_t *svn_ra_change_rev_prop(svn_ra_session_t *session,
526 svn_revnum_t rev,
527 const char *name,
528 const svn_string_t *value,
529 apr_pool_t *pool);
532 * Set @a *props to the list of unversioned properties attached to revision
533 * @a rev in the repository of @a session. The hash maps
534 * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values.
536 * Use @a pool for memory allocation.
538 * @since New in 1.2.
540 svn_error_t *svn_ra_rev_proplist(svn_ra_session_t *session,
541 svn_revnum_t rev,
542 apr_hash_t **props,
543 apr_pool_t *pool);
546 * Set @a *value to the value of unversioned property @a name attached to
547 * revision @a rev in the repository of @a session. If @a rev has no
548 * property by that name, set @a *value to @c NULL.
550 * Use @a pool for memory allocation.
552 * @since New in 1.2.
554 svn_error_t *svn_ra_rev_prop(svn_ra_session_t *session,
555 svn_revnum_t rev,
556 const char *name,
557 svn_string_t **value,
558 apr_pool_t *pool);
561 * Set @a *editor and @a *edit_baton to an editor for committing changes
562 * to the repository of @a session, using @a log_msg as the log message. The
563 * revisions being committed against are passed to the editor
564 * functions, starting with the rev argument to @c open_root. The path
565 * root of the commit is in the @a session's URL.
567 * Before @c close_edit returns, but after the commit has succeeded,
568 * it will invoke @a callback with the new revision number, the
569 * commit date (as a <tt>const char *</tt>), commit author (as a
570 * <tt>const char *</tt>), and @a callback_baton as arguments. If
571 * @a callback returns an error, that error will be returned from @c
572 * close_edit, otherwise @c close_edit will return successfully
573 * (unless it encountered an error before invoking @a callback).
575 * The callback will not be called if the commit was a no-op
576 * (i.e. nothing was committed);
578 * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char
579 * *</tt> paths (relative to the URL of @a session_baton) to <tt>
580 * const char *</tt> lock tokens. The server checks that the
581 * correct token is provided for each committed, locked path. @a lock_tokens
582 * must live during the whole commit operation.
584 * If @a keep_locks is @c TRUE, then do not release locks on
585 * committed objects. Else, automatically release such locks.
587 * The caller may not perform any RA operations using @a session before
588 * finishing the edit.
590 * Use @a pool for memory allocation.
592 * @since New in 1.4.
594 svn_error_t *svn_ra_get_commit_editor2(svn_ra_session_t *session,
595 const svn_delta_editor_t **editor,
596 void **edit_baton,
597 const char *log_msg,
598 svn_commit_callback2_t callback,
599 void *callback_baton,
600 apr_hash_t *lock_tokens,
601 svn_boolean_t keep_locks,
602 apr_pool_t *pool);
605 * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t.
607 * @since New in 1.2.
609 * @deprecated Provided for backward compatibility with the 1.3 API.
611 svn_error_t *svn_ra_get_commit_editor(svn_ra_session_t *session,
612 const svn_delta_editor_t **editor,
613 void **edit_baton,
614 const char *log_msg,
615 svn_commit_callback_t callback,
616 void *callback_baton,
617 apr_hash_t *lock_tokens,
618 svn_boolean_t keep_locks,
619 apr_pool_t *pool);
622 * Fetch the contents and properties of file @a path at @a revision.
623 * Interpret @a path relative to the URL in @a session. Use
624 * @a pool for all allocations.
626 * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
627 * @a *fetched_rev is not @c NULL, then this function will set
628 * @a *fetched_rev to the actual revision that was retrieved. (Some
629 * callers want to know, and some don't.)
631 * If @a stream is non @c NULL, push the contents of the file at @a
632 * stream, do not call svn_stream_close() when finished.
634 * If @a props is non @c NULL, set @a *props to contain the properties of
635 * the file. This means @em all properties: not just ones controlled by
636 * the user and stored in the repository fs, but non-tweakable ones
637 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
638 * etc.) The keys are <tt>const char *</tt>, values are
639 * <tt>@c svn_string_t *</tt>.
641 * The stream handlers for @a stream may not perform any RA
642 * operations using @a session.
644 * @since New in 1.2.
646 svn_error_t *svn_ra_get_file(svn_ra_session_t *session,
647 const char *path,
648 svn_revnum_t revision,
649 svn_stream_t *stream,
650 svn_revnum_t *fetched_rev,
651 apr_hash_t **props,
652 apr_pool_t *pool);
655 * If @a dirents is non @c NULL, set @a *dirents to contain all the entries
656 * of directory @a path at @a revision. The keys of @a dirents will be
657 * entry names (<tt>const char *</tt>), and the values dirents
658 * (<tt>@c svn_dirent_t *</tt>). Use @a pool for all allocations.
660 * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt>
661 * objects are filled in. To have them completely filled in just pass
662 * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_
663 * fields you would like to have returned to you.
665 * @a path is interpreted relative to the URL in @a session.
667 * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
668 * @a *fetched_rev is not @c NULL, then this function will set
669 * @a *fetched_rev to the actual revision that was retrieved. (Some
670 * callers want to know, and some don't.)
672 * If @a props is non @c NULL, set @a *props to contain the properties of
673 * the directory. This means @em all properties: not just ones controlled by
674 * the user and stored in the repository fs, but non-tweakable ones
675 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
676 * etc.) The keys are <tt>const char *</tt>, values are
677 * <tt>@c svn_string_t *</tt>.
679 * @since New in 1.4.
681 svn_error_t *svn_ra_get_dir2(svn_ra_session_t *session,
682 apr_hash_t **dirents,
683 svn_revnum_t *fetched_rev,
684 apr_hash_t **props,
685 const char *path,
686 svn_revnum_t revision,
687 apr_uint32_t dirent_fields,
688 apr_pool_t *pool);
691 * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the
692 * @a dirent_fields parameter.
694 * @since New in 1.2.
696 * @deprecated Provided for compatibility with the 1.3 API.
698 svn_error_t *svn_ra_get_dir(svn_ra_session_t *session,
699 const char *path,
700 svn_revnum_t revision,
701 apr_hash_t **dirents,
702 svn_revnum_t *fetched_rev,
703 apr_hash_t **props,
704 apr_pool_t *pool);
707 * Ask the RA layer to update a working copy.
709 * The client initially provides an @a update_editor/@a baton to the
710 * RA layer; this editor contains knowledge of where the change will
711 * begin in the working copy (when @c open_root() is called).
713 * In return, the client receives a @a reporter/@a report_baton. The
714 * client then describes its working-copy revision numbers by making
715 * calls into the @a reporter structure; the RA layer assumes that all
716 * paths are relative to the URL used to open @a session.
718 * When finished, the client calls @a reporter->finish_report(). The
719 * RA layer then does a complete drive of @a update_editor, ending with
720 * close_edit(), to update the working copy.
722 * @a update_target is an optional single path component to restrict
723 * the scope of the update to just that entry (in the directory
724 * represented by the @a session's URL). If @a update_target is the
725 * empty string, the entire directory is updated.
727 * If @a recurse is true and the target is a directory, update
728 * recursively; otherwise, update just the target and its immediate
729 * entries, but not its child directories (if any).
731 * The working copy will be updated to @a revision_to_update_to, or the
732 * "latest" revision if this arg is invalid.
734 * The caller may not perform any RA operations using @a session before
735 * finishing the report, and may not perform any RA operations using
736 * @a session from within the editing operations of @a update_editor.
738 * Use @a pool for memory allocation.
740 * @note The reporter provided by this function does NOT supply copy-
741 * from information to the diff editor callbacks.
743 * @since New in 1.2.
745 svn_error_t *svn_ra_do_update(svn_ra_session_t *session,
746 const svn_ra_reporter2_t **reporter,
747 void **report_baton,
748 svn_revnum_t revision_to_update_to,
749 const char *update_target,
750 svn_boolean_t recurse,
751 const svn_delta_editor_t *update_editor,
752 void *update_baton,
753 apr_pool_t *pool);
756 * Ask the RA layer to 'switch' a working copy to a new
757 * @a switch_url; it's another form of svn_ra_do_update().
759 * The client initially provides a @a switch_editor/@a baton to the RA
760 * layer; this editor contains knowledge of where the change will
761 * begin in the working copy (when open_root() is called).
763 * In return, the client receives a @a reporter/@a report_baton. The
764 * client then describes its working-copy revision numbers by making
765 * calls into the @a reporter structure; the RA layer assumes that all
766 * paths are relative to the URL used to create @a session_baton.
768 * When finished, the client calls @a reporter->finish_report(). The
769 * RA layer then does a complete drive of @a switch_editor, ending with
770 * close_edit(), to switch the working copy.
772 * @a switch_target is an optional single path component will restrict
773 * the scope of things affected by the switch to an entry in the
774 * directory represented by the @a session's URL, or empty if the
775 * entire directory is meant to be switched.
777 * If @a recurse is true and the target is a directory, switch
778 * recursively; otherwise, switch just the target and its immediate
779 * entries, but not its child directories (if any).
781 * The working copy will be switched to @a revision_to_switch_to, or the
782 * "latest" revision if this arg is invalid.
784 * The caller may not perform any RA operations using
785 * @a session before finishing the report, and may not perform
786 * any RA operations using @a session_baton from within the editing
787 * operations of @a switch_editor.
789 * Use @a pool for memory allocation.
791 * @note The reporter provided by this function does NOT supply copy-
792 * from information to the diff editor callbacks.
794 * @since New in 1.2.
796 svn_error_t *svn_ra_do_switch(svn_ra_session_t *session,
797 const svn_ra_reporter2_t **reporter,
798 void **report_baton,
799 svn_revnum_t revision_to_switch_to,
800 const char *switch_target,
801 svn_boolean_t recurse,
802 const char *switch_url,
803 const svn_delta_editor_t *switch_editor,
804 void *switch_baton,
805 apr_pool_t *pool);
808 * Ask the RA layer to describe the status of a working copy with respect
809 * to @a revision of the repository (or HEAD, if @a revision is invalid).
811 * The client initially provides a @a status_editor/@a baton to the RA
812 * layer; this editor contains knowledge of where the change will
813 * begin in the working copy (when open_root() is called).
815 * In return, the client receives a @a reporter/@a report_baton. The
816 * client then describes its working-copy revision numbers by making
817 * calls into the @a reporter structure; the RA layer assumes that all
818 * paths are relative to the URL used to open @a session.
820 * When finished, the client calls @a reporter->finish_report(). The RA
821 * layer then does a complete drive of @a status_editor, ending with
822 * close_edit(), to report, essentially, what would be modified in
823 * the working copy were the client to call do_update().
824 * @a status_target is an optional single path component will restrict
825 * the scope of the status report to an entry in the directory
826 * represented by the @a session_baton's URL, or empty if the entire
827 * directory is meant to be examined.
829 * If @a recurse is true and the target is a directory, get status
830 * recursively; otherwise, get status for just the target and its
831 * immediate entries, but not its child directories (if any).
833 * The caller may not perform any RA operations using @a session
834 * before finishing the report, and may not perform any RA operations
835 * using @a session from within the editing operations of @a status_editor.
837 * Use @a pool for memory allocation.
839 * @note The reporter provided by this function does NOT supply copy-
840 * from information to the diff editor callbacks.
842 * @since New in 1.2.
844 svn_error_t *svn_ra_do_status(svn_ra_session_t *session,
845 const svn_ra_reporter2_t **reporter,
846 void **report_baton,
847 const char *status_target,
848 svn_revnum_t revision,
849 svn_boolean_t recurse,
850 const svn_delta_editor_t *status_editor,
851 void *status_baton,
852 apr_pool_t *pool);
855 * Ask the RA layer to 'diff' a working copy against @a versus_url;
856 * it's another form of svn_ra_do_update().
858 * @note This function cannot be used to diff a single file, only a
859 * working copy directory. See the svn_ra_do_switch() function
860 * for more details.
862 * The client initially provides a @a diff_editor/@a baton to the RA
863 * layer; this editor contains knowledge of where the common diff
864 * root is in the working copy (when open_root() is called).
866 * In return, the client receives a @a reporter/@a report_baton. The
867 * client then describes its working-copy revision numbers by making
868 * calls into the @a reporter structure; the RA layer assumes that all
869 * paths are relative to the URL used to open @a session.
871 * When finished, the client calls @a reporter->finish_report(). The
872 * RA layer then does a complete drive of @a diff_editor, ending with
873 * close_edit(), to transmit the diff.
875 * @a diff_target is an optional single path component will restrict
876 * the scope of the diff to an entry in the directory represented by
877 * the @a session's URL, or empty if the entire directory is meant to be
878 * one of the diff paths.
880 * The working copy will be diffed against @a versus_url as it exists
881 * in revision @a revision, or as it is in head if @a revision is
882 * @c SVN_INVALID_REVNUM.
884 * Use @a ignore_ancestry to control whether or not items being
885 * diffed will be checked for relatedness first. Unrelated items
886 * are typically transmitted to the editor as a deletion of one thing
887 * and the addition of another, but if this flag is @c TRUE,
888 * unrelated items will be diffed as if they were related.
890 * If @a recurse is true and the target is a directory, diff
891 * recursively; otherwise, diff just target and its immediate entries,
892 * but not its child directories (if any).
894 * The caller may not perform any RA operations using @a session before
895 * finishing the report, and may not perform any RA operations using
896 * @a session from within the editing operations of @a diff_editor.
898 * @a text_deltas instructs the driver of the @a diff_editor to enable
899 * the generation of text deltas. If @a text_deltas is FALSE the window
900 * handler returned by apply_textdelta will be called once with a NULL
901 * @c svn_txdelta_window_t pointer.
903 * Use @a pool for memory allocation.
905 * @note The reporter provided by this function does NOT supply copy-
906 * from information to the diff editor callbacks.
908 * @since New in 1.4.
910 svn_error_t *svn_ra_do_diff2(svn_ra_session_t *session,
911 const svn_ra_reporter2_t **reporter,
912 void **report_baton,
913 svn_revnum_t revision,
914 const char *diff_target,
915 svn_boolean_t recurse,
916 svn_boolean_t ignore_ancestry,
917 svn_boolean_t text_deltas,
918 const char *versus_url,
919 const svn_delta_editor_t *diff_editor,
920 void *diff_baton,
921 apr_pool_t *pool);
924 * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE.
926 * @deprecated Provided for backward compatibility with the 1.3 API.
928 svn_error_t *svn_ra_do_diff(svn_ra_session_t *session,
929 const svn_ra_reporter2_t **reporter,
930 void **report_baton,
931 svn_revnum_t revision,
932 const char *diff_target,
933 svn_boolean_t recurse,
934 svn_boolean_t ignore_ancestry,
935 const char *versus_url,
936 const svn_delta_editor_t *diff_editor,
937 void *diff_baton,
938 apr_pool_t *pool);
941 * Invoke @a receiver with @a receiver_baton on each log message from
942 * @a start to @a end. @a start may be greater or less than @a end;
943 * this just controls whether the log messages are processed in descending
944 * or ascending revision number order.
946 * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
948 * If @a paths is non-null and has one or more elements, then only show
949 * revisions in which at least one of @a paths was changed (i.e., if
950 * file, text or props changed; if dir, props changed or an entry
951 * was added or deleted). Each path is an <tt>const char *</tt>, relative
952 * to the @a session's common parent.
954 * If @a limit is non-zero only invoke @a receiver on the first @a limit
955 * logs.
957 * If @a discover_changed_paths, then each call to receiver passes a
958 * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument;
959 * the hash's keys are all the paths committed in that revision.
960 * Otherwise, each call to receiver passes null for @a changed_paths.
962 * If @a strict_node_history is set, copy history will not be traversed
963 * (if any exists) when harvesting the revision logs for each path.
965 * If any invocation of @a receiver returns error, return that error
966 * immediately and without wrapping it.
968 * If @a start or @a end is a non-existent revision, return the error
969 * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
971 * See also the documentation for @c svn_log_message_receiver_t.
973 * The caller may not invoke any RA operations using @a session from
974 * within @a receiver.
976 * Use @a pool for memory allocation.
978 * @since New in 1.2.
980 svn_error_t *svn_ra_get_log(svn_ra_session_t *session,
981 const apr_array_header_t *paths,
982 svn_revnum_t start,
983 svn_revnum_t end,
984 int limit,
985 svn_boolean_t discover_changed_paths,
986 svn_boolean_t strict_node_history,
987 svn_log_message_receiver_t receiver,
988 void *receiver_baton,
989 apr_pool_t *pool);
992 * Set @a *kind to the node kind associated with @a path at @a revision.
993 * If @a path does not exist under @a revision, set @a *kind to
994 * @c svn_node_none. @a path is relative to the @a session's parent URL.
996 * Use @a pool for memory allocation.
998 * @since New in 1.2.
1000 svn_error_t *svn_ra_check_path(svn_ra_session_t *session,
1001 const char *path,
1002 svn_revnum_t revision,
1003 svn_node_kind_t *kind,
1004 apr_pool_t *pool);
1007 * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a
1008 * revision. @a path is relative to the @a session's parent's URL.
1009 * If @a path does not exist in @a revision, set @a *dirent to NULL.
1011 * Use @a pool for memory allocation.
1013 * @since New in 1.2.
1015 svn_error_t *svn_ra_stat(svn_ra_session_t *session,
1016 const char *path,
1017 svn_revnum_t revision,
1018 svn_dirent_t **dirent,
1019 apr_pool_t *pool);
1023 * Set @a *uuid to the repository's UUID.
1025 * @note The UUID has the same lifetime as the @a session.
1027 * Use @a pool for temporary memory allocation.
1029 * @since New in 1.2.
1031 svn_error_t *svn_ra_get_uuid(svn_ra_session_t *session,
1032 const char **uuid,
1033 apr_pool_t *pool);
1036 * Set @a *url to the repository's root URL. The value will not include
1037 * a trailing '/'. The returned URL is guaranteed to be a prefix of the
1038 * @a session's URL.
1040 * @note The URL has the same lifetime as the @a session.
1042 * Use @a pool for temporary memory allocation.
1044 * @since New in 1.2.
1046 svn_error_t *svn_ra_get_repos_root(svn_ra_session_t *session,
1047 const char **url,
1048 apr_pool_t *pool);
1051 * Set @a *locations to the locations (at the repository revisions
1052 * @a location_revisions) of the file identified by @a path in
1053 * @a peg_revision. @a path is relative to the URL to which
1054 * @a session was opened. @a location_revisions is an array of
1055 * @c svn_revnum_t's. @a *locations will be a mapping from the revisions to
1056 * their appropriate absolute paths. If the file doesn't exist in a
1057 * location_revision, that revision will be ignored.
1059 * Use @a pool for all allocations.
1061 * @note This functionality is not available in pre-1.1 servers. If the
1062 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1063 * returned.
1065 * @since New in 1.2.
1067 svn_error_t *svn_ra_get_locations(svn_ra_session_t *session,
1068 apr_hash_t **locations,
1069 const char *path,
1070 svn_revnum_t peg_revision,
1071 apr_array_header_t *location_revisions,
1072 apr_pool_t *pool);
1075 * Retrieve a subset of the interesting revisions of a file @a path
1076 * as seen in revision @a end (see svn_fs_history_prev() for a
1077 * definition of "interesting revisions"). Invoke @a handler with
1078 * @a handler_baton as its first argument for each such revision.
1079 * @a session is an open RA session. Use @a pool for all allocations.
1081 * If there is an interesting revision of the file that is less than or
1082 * equal to @a start, the iteration will begin at that revision.
1083 * Else, the iteration will begin at the first revision of the file in
1084 * the repository, which has to be less than or equal to @a end. Note
1085 * that if the function succeeds, @a handler will have been called at
1086 * least once.
1088 * In a series of calls to @a handler, the file contents for the first
1089 * interesting revision will be provided as a text delta against the
1090 * empty file. In the following calls, the delta will be against the
1091 * fulltext contents for the previous call.
1093 * @note This functionality is not available in pre-1.1 servers. If the
1094 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1095 * returned.
1097 * @since New in 1.2.
1099 svn_error_t *svn_ra_get_file_revs(svn_ra_session_t *session,
1100 const char *path,
1101 svn_revnum_t start,
1102 svn_revnum_t end,
1103 svn_ra_file_rev_handler_t handler,
1104 void *handler_baton,
1105 apr_pool_t *pool);
1108 * Lock each path in @a path_revs, which is a hash whose keys are the
1109 * paths to be locked, and whose values are the corresponding bas
1110 * revisions for each path.
1112 * Note that locking is never anonymous, so any server implementing
1113 * this function will have to "pull" a username from the client, if
1114 * it hasn't done so already.
1116 * @a comment is optional: it's either an xml-escapable string
1117 * which describes the lock, or it is NULL.
1119 * If any path is already locked by a different user, then call @a
1120 * lock_func/@a lock_baton with an error. If @a steal_lock is true,
1121 * then "steal" the existing lock(s) anyway, even if the RA username
1122 * does not match the current lock's owner. Delete any lock on the
1123 * path, and unconditionally create a new lock.
1125 * For each path, if its base revision (in @a path_revs) is a valid
1126 * revnum, then do an out-of-dateness check. If the revnum is less
1127 * than the last-changed-revision of any path (or if a path doesn't
1128 * exist in HEAD), call @a lock_func/@a lock_baton with an
1129 * SVN_ERR_RA_OUT_OF_DATE error.
1131 * After successfully locking a file, @a lock_func is called with the
1132 * @a lock_baton.
1134 * Use @a pool for temporary allocations.
1136 * @since New in 1.2.
1138 svn_error_t *svn_ra_lock(svn_ra_session_t *session,
1139 apr_hash_t *path_revs,
1140 const char *comment,
1141 svn_boolean_t steal_lock,
1142 svn_ra_lock_callback_t lock_func,
1143 void *lock_baton,
1144 apr_pool_t *pool);
1147 * Remove the repository lock for each path in @a path_tokens.
1148 * @a path_tokens is a hash whose keys are the paths to be locked, and
1149 * whose values are the corresponding lock tokens for each path. If
1150 * the path has no corresponding lock token, or if @a break_lock is TRUE,
1151 * then the corresponding value shall be "".
1153 * Note that unlocking is never anonymous, so any server
1154 * implementing this function will have to "pull" a username from
1155 * the client, if it hasn't done so already.
1157 * If @a token points to a lock, but the RA username doesn't match the
1158 * lock's owner, call @a lockfunc/@a lock_baton with an error. If @a
1159 * break_lock is true, however, instead allow the lock to be "broken"
1160 * by the RA user.
1162 * After successfully unlocking a path, @a lock_func is called with
1163 * the @a lock_baton.
1165 * Use @a pool for temporary allocations.
1167 * @since New in 1.2.
1169 svn_error_t *svn_ra_unlock(svn_ra_session_t *session,
1170 apr_hash_t *path_tokens,
1171 svn_boolean_t break_lock,
1172 svn_ra_lock_callback_t lock_func,
1173 void *lock_baton,
1174 apr_pool_t *pool);
1176 /**
1177 * If @a path is locked, set @a *lock to an svn_lock_t which
1178 * represents the lock, allocated in @a pool. If @a path is not
1179 * locked, set @a *lock to NULL.
1181 * @since New in 1.2.
1183 svn_error_t *svn_ra_get_lock(svn_ra_session_t *session,
1184 svn_lock_t **lock,
1185 const char *path,
1186 apr_pool_t *pool);
1189 * Set @a *locks to a hashtable which represents all locks on or
1190 * below @a path.
1192 * The hashtable maps (const char *) absolute fs paths to (const
1193 * svn_lock_t *) structures. The hashtable -- and all keys and
1194 * values -- are allocated in @a pool.
1196 * @note It is not considered an error for @a path to not exist in HEAD.
1197 * Such a search will simply return no locks.
1199 * @note This functionality is not available in pre-1.2 servers. If the
1200 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1201 * returned.
1203 * @since New in 1.2.
1205 svn_error_t *svn_ra_get_locks(svn_ra_session_t *session,
1206 apr_hash_t **locks,
1207 const char *path,
1208 apr_pool_t *pool);
1212 * Replay the changes from @a revision through @a editor and @a edit_baton.
1214 * Changes will be limited to those that occur under @a session's URL, and
1215 * the server will assume that the client has no knowledge of revisions
1216 * prior to @a low_water_mark. These two limiting factors define the portion
1217 * of the tree that the server will assume the client already has knowledge of,
1218 * and thus any copies of data from outside that part of the tree will be
1219 * sent in their entirety, not as simple copies or deltas against a previous
1220 * version.
1222 * If @a send_deltas is @c TRUE, the actual text and property changes in
1223 * the revision will be sent, otherwise dummy text deltas and null property
1224 * changes will be sent instead.
1226 * @a pool is used for all allocation.
1228 * @since New in 1.4.
1230 svn_error_t *svn_ra_replay(svn_ra_session_t *session,
1231 svn_revnum_t revision,
1232 svn_revnum_t low_water_mark,
1233 svn_boolean_t send_deltas,
1234 const svn_delta_editor_t *editor,
1235 void *edit_baton,
1236 apr_pool_t *pool);
1239 * Append a textual list of all available RA modules to the stringbuf
1240 * @a output.
1242 * @since New in 1.2.
1244 svn_error_t *svn_ra_print_modules(svn_stringbuf_t *output,
1245 apr_pool_t *pool);
1249 * Similar to svn_ra_print_modules().
1250 * @a ra_baton is ignored.
1252 * @deprecated Provided for backward compatibility with the 1.1 API.
1254 svn_error_t *svn_ra_print_ra_libraries(svn_stringbuf_t **descriptions,
1255 void *ra_baton,
1256 apr_pool_t *pool);
1261 * Using this callback struct is similar to calling the newer public
1262 * interface that is based on @c svn_ra_session_t.
1264 * @deprecated Provided for backward compatibility with the 1.1 API.
1266 typedef struct svn_ra_plugin_t
1268 /** The proper name of the RA library, (like "ra_dav" or "ra_local") */
1269 const char *name;
1271 /** Short doc string printed out by `svn --version` */
1272 const char *description;
1274 /* The vtable hooks */
1276 /** Call svn_ra_open() and set @a session_baton to an object representing
1277 * the new session. All other arguments are passed to svn_ra_open().
1279 svn_error_t *(*open)(void **session_baton,
1280 const char *repos_URL,
1281 const svn_ra_callbacks_t *callbacks,
1282 void *callback_baton,
1283 apr_hash_t *config,
1284 apr_pool_t *pool);
1286 /** Call svn_ra_get_latest_revnum() with the session associated with
1287 * @a session_baton and all other arguments.
1289 svn_error_t *(*get_latest_revnum)(void *session_baton,
1290 svn_revnum_t *latest_revnum,
1291 apr_pool_t *pool);
1293 /** Call svn_ra_get_dated_revision() with the session associated with
1294 * @a session_baton and all other arguments.
1296 svn_error_t *(*get_dated_revision)(void *session_baton,
1297 svn_revnum_t *revision,
1298 apr_time_t tm,
1299 apr_pool_t *pool);
1301 /** Call svn_ra_change_rev_prop() with the session associated with
1302 * @a session_baton and all other arguments.
1304 svn_error_t *(*change_rev_prop)(void *session_baton,
1305 svn_revnum_t rev,
1306 const char *name,
1307 const svn_string_t *value,
1308 apr_pool_t *pool);
1310 /** Call svn_ra_rev_proplist() with the session associated with
1311 * @a session_baton and all other arguments.
1313 svn_error_t *(*rev_proplist)(void *session_baton,
1314 svn_revnum_t rev,
1315 apr_hash_t **props,
1316 apr_pool_t *pool);
1318 /** Call svn_ra_rev_prop() with the session associated with
1319 * @a session_baton and all other arguments.
1321 svn_error_t *(*rev_prop)(void *session_baton,
1322 svn_revnum_t rev,
1323 const char *name,
1324 svn_string_t **value,
1325 apr_pool_t *pool);
1327 /** Call svn_ra_get_commit_editor() with the session associated with
1328 * @a session_baton and all other arguments plus @a lock_tokens set to
1329 * @c NULL and @a keep_locks set to @c TRUE.
1331 svn_error_t *(*get_commit_editor)(void *session_baton,
1332 const svn_delta_editor_t **editor,
1333 void **edit_baton,
1334 const char *log_msg,
1335 svn_commit_callback_t callback,
1336 void *callback_baton,
1337 apr_pool_t *pool);
1339 /** Call svn_ra_get_file() with the session associated with
1340 * @a session_baton and all other arguments.
1342 svn_error_t *(*get_file)(void *session_baton,
1343 const char *path,
1344 svn_revnum_t revision,
1345 svn_stream_t *stream,
1346 svn_revnum_t *fetched_rev,
1347 apr_hash_t **props,
1348 apr_pool_t *pool);
1350 /** Call svn_ra_get_dir() with the session associated with
1351 * @a session_baton and all other arguments.
1353 svn_error_t *(*get_dir)(void *session_baton,
1354 const char *path,
1355 svn_revnum_t revision,
1356 apr_hash_t **dirents,
1357 svn_revnum_t *fetched_rev,
1358 apr_hash_t **props,
1359 apr_pool_t *pool);
1361 /** Call svn_ra_do_update() with the session associated with
1362 * @a session_baton and all other arguments.
1364 svn_error_t *(*do_update)(void *session_baton,
1365 const svn_ra_reporter_t **reporter,
1366 void **report_baton,
1367 svn_revnum_t revision_to_update_to,
1368 const char *update_target,
1369 svn_boolean_t recurse,
1370 const svn_delta_editor_t *update_editor,
1371 void *update_baton,
1372 apr_pool_t *pool);
1374 /** Call svn_ra_do_switch() with the session associated with
1375 * @a session_baton and all other arguments.
1377 svn_error_t *(*do_switch)(void *session_baton,
1378 const svn_ra_reporter_t **reporter,
1379 void **report_baton,
1380 svn_revnum_t revision_to_switch_to,
1381 const char *switch_target,
1382 svn_boolean_t recurse,
1383 const char *switch_url,
1384 const svn_delta_editor_t *switch_editor,
1385 void *switch_baton,
1386 apr_pool_t *pool);
1388 /** Call svn_ra_do_status() with the session associated with
1389 * @a session_baton and all other arguments.
1391 svn_error_t *(*do_status)(void *session_baton,
1392 const svn_ra_reporter_t **reporter,
1393 void **report_baton,
1394 const char *status_target,
1395 svn_revnum_t revision,
1396 svn_boolean_t recurse,
1397 const svn_delta_editor_t *status_editor,
1398 void *status_baton,
1399 apr_pool_t *pool);
1401 /** Call svn_ra_do_diff() with the session associated with
1402 * @a session_baton and all other arguments.
1404 svn_error_t *(*do_diff)(void *session_baton,
1405 const svn_ra_reporter_t **reporter,
1406 void **report_baton,
1407 svn_revnum_t revision,
1408 const char *diff_target,
1409 svn_boolean_t recurse,
1410 svn_boolean_t ignore_ancestry,
1411 const char *versus_url,
1412 const svn_delta_editor_t *diff_editor,
1413 void *diff_baton,
1414 apr_pool_t *pool);
1416 /** Call svn_ra_get_log() with the session associated with
1417 * @a session_baton and all other arguments. @a limit is set to 0.
1419 svn_error_t *(*get_log)(void *session_baton,
1420 const apr_array_header_t *paths,
1421 svn_revnum_t start,
1422 svn_revnum_t end,
1423 svn_boolean_t discover_changed_paths,
1424 svn_boolean_t strict_node_history,
1425 svn_log_message_receiver_t receiver,
1426 void *receiver_baton,
1427 apr_pool_t *pool);
1429 /** Call svn_ra_check_path() with the session associated with
1430 * @a session_baton and all other arguments.
1432 svn_error_t *(*check_path)(void *session_baton,
1433 const char *path,
1434 svn_revnum_t revision,
1435 svn_node_kind_t *kind,
1436 apr_pool_t *pool);
1438 /** Call svn_ra_get_uuid() with the session associated with
1439 * @a session_baton and all other arguments.
1441 svn_error_t *(*get_uuid)(void *session_baton,
1442 const char **uuid,
1443 apr_pool_t *pool);
1445 /** Call svn_ra_get_repos_root() with the session associated with
1446 * @a session_baton and all other arguments.
1448 svn_error_t *(*get_repos_root)(void *session_baton,
1449 const char **url,
1450 apr_pool_t *pool);
1453 * Call svn_ra_get_locations() with the session associated with
1454 * @a session_baton and all other arguments.
1456 * @since New in 1.1.
1458 svn_error_t *(*get_locations)(void *session_baton,
1459 apr_hash_t **locations,
1460 const char *path,
1461 svn_revnum_t peg_revision,
1462 apr_array_header_t *location_revisions,
1463 apr_pool_t *pool);
1466 * Call svn_ra_get_file_revs() with the session associated with
1467 * @a session_baton and all other arguments.
1469 * @since New in 1.1.
1471 svn_error_t *(*get_file_revs)(void *session_baton,
1472 const char *path,
1473 svn_revnum_t start,
1474 svn_revnum_t end,
1475 svn_ra_file_rev_handler_t handler,
1476 void *handler_baton,
1477 apr_pool_t *pool);
1480 * Return the plugin's version information.
1482 * @since New in 1.1.
1484 const svn_version_t *(*get_version)(void);
1487 } svn_ra_plugin_t;
1490 * All "ra_FOO" implementations *must* export a function named
1491 * svn_ra_FOO_init() of type @c svn_ra_init_func_t.
1493 * When called by libsvn_client, this routine adds an entry (or
1494 * entries) to the hash table for any URL schemes it handles. The hash
1495 * value must be of type (<tt>@c svn_ra_plugin_t *</tt>). @a pool is a
1496 * pool for allocating configuration / one-time data.
1498 * This type is defined to use the "C Calling Conventions" to ensure that
1499 * abi_version is the first parameter. The RA plugin must check that value
1500 * before accessing the other parameters.
1502 * ### need to force this to be __cdecl on Windows... how??
1504 * @deprecated Provided for backward compatibility with the 1.1 API.
1506 typedef svn_error_t *(*svn_ra_init_func_t)(int abi_version,
1507 apr_pool_t *pool,
1508 apr_hash_t *hash);
1511 * The current ABI (Application Binary Interface) version for the
1512 * RA plugin model. This version number will change when the ABI
1513 * between the SVN core (e.g. libsvn_client) and the RA plugin changes.
1515 * An RA plugin should verify that the passed version number is acceptable
1516 * before accessing the rest of the parameters, and before returning any
1517 * information.
1519 * It is entirely acceptable for an RA plugin to accept multiple ABI
1520 * versions. It can simply interpret the parameters based on the version,
1521 * and it can return different plugin structures.
1524 * <pre>
1525 * VSN DATE REASON FOR CHANGE
1526 * --- ---------- ------------------------------------------------
1527 * 1 2001-02-17 Initial revision.
1528 * 2 2004-06-29 Preparing for svn 1.1, which adds new RA vtable funcs.
1529 * 2005-01-19 Rework the plugin interface and don't provide the vtable
1530 * to the client. Separate ABI versions are no longer used.
1531 * </pre>
1533 * @deprecated Provided for backward compatibility with the 1.0 API.
1535 #define SVN_RA_ABI_VERSION 2
1537 /* Public RA implementations. */
1539 /** Initialize libsvn_ra_dav.
1541 * @deprecated Provided for backward compatibility with the 1.1 API. */
1542 svn_error_t * svn_ra_dav_init(int abi_version,
1543 apr_pool_t *pool,
1544 apr_hash_t *hash);
1546 /** Initialize libsvn_ra_local.
1548 * @deprecated Provided for backward compatibility with the 1.1 API. */
1549 svn_error_t * svn_ra_local_init(int abi_version,
1550 apr_pool_t *pool,
1551 apr_hash_t *hash);
1553 /** Initialize libsvn_ra_svn.
1555 * @deprecated Provided for backward compatibility with the 1.1 API. */
1556 svn_error_t * svn_ra_svn_init(int abi_version,
1557 apr_pool_t *pool,
1558 apr_hash_t *hash);
1560 /** Initialize libsvn_ra_serf.
1562 * @since New in 1.4.
1563 * @deprecated Provided for backward compatibility with the 1.1 API. */
1564 svn_error_t * svn_ra_serf_init(int abi_version,
1565 apr_pool_t *pool,
1566 apr_hash_t *hash);
1570 * Initialize the compatibility wrapper, using @a pool for any allocations.
1571 * The caller must hold on to @a ra_baton as long as the RA library is used.
1573 * @deprecated Provided for backward compatibility with the 1.1 API.
1575 svn_error_t *svn_ra_init_ra_libs(void **ra_baton, apr_pool_t *pool);
1578 * Return an RA vtable-@a library which can handle URL. A number of
1579 * svn_client_* routines will call this internally, but client apps might
1580 * use it too. $a ra_baton is a baton obtained by a call to
1581 * svn_ra_init_ra_libs().
1583 * @deprecated Provided for backward compatibility with the 1.1 API.
1585 svn_error_t *svn_ra_get_ra_library(svn_ra_plugin_t **library,
1586 void *ra_baton,
1587 const char *url,
1588 apr_pool_t *pool);
1590 #ifdef __cplusplus
1592 #endif /* __cplusplus */
1594 #endif /* SVN_RA_H */