In the command-line client, forbid
[svn.git] / subversion / include / svn_ra.h
blobe310d74ae30fc205aa0a340694457557b4715fa2
1 /**
2 * @copyright
3 * ====================================================================
4 * Copyright (c) 2000-2007 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 svn_ra_open2() 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 recursively. 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);
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);
187 * Callback function type for replay_range actions.
189 * This callback function should provide replay_range with an editor which
190 * will be driven with the received replay reports from the master repository.
192 * @a revision is the target revision number of the received replay report.
194 * @a editor and @a edit_baton should provided by the callback implementation.
196 * @a replay_baton is the baton as originally passed to replay_range.
198 * @a revprops contains key/value pairs for each revision properties for this
199 * revision.
201 * @since New in 1.5.
203 typedef svn_error_t *(*svn_ra_replay_revstart_callback_t)
204 (svn_revnum_t revision,
205 void *replay_baton,
206 const svn_delta_editor_t **editor,
207 void **edit_baton,
208 apr_hash_t *rev_props,
209 apr_pool_t *pool);
212 * Callback function type for replay_range actions.
214 * This callback function should close the editor.
216 * @a revision is the target revision number of the received replay report.
218 * @a editor and @a edit_baton should provided by the callback implementation.
220 * @a replay_baton is the baton as originally passed to replay_range.
222 * @a revprops contains key/value pairs for each revision properties for this
223 * revision.
225 * @since New in 1.5.
227 typedef svn_error_t *(*svn_ra_replay_revfinish_callback_t)
228 (svn_revnum_t revision,
229 void *replay_baton,
230 const svn_delta_editor_t *editor,
231 void *edit_baton,
232 apr_hash_t *rev_props,
233 apr_pool_t *pool);
237 * The update Reporter.
239 * A vtable structure which allows a working copy to describe a subset
240 * (or possibly all) of its working-copy to an RA layer, for the
241 * purposes of an update, switch, status, or diff operation.
243 * Paths for report calls are relative to the target (not the anchor)
244 * of the operation. Report calls must be made in depth-first order:
245 * parents before children, all children of a parent before any
246 * siblings of the parent. The first report call must be a set_path
247 * with a @a path argument of "" and a valid revision. (If the target
248 * of the operation is locally deleted or missing, use the anchor's
249 * revision.) If the target of the operation is deleted or switched
250 * relative to the anchor, follow up the initial set_path call with a
251 * link_path or delete_path call with a @a path argument of "" to
252 * indicate that. In no other case may there be two report
253 * descriptions for the same path. If the target of the operation is
254 * a locally added file or directory (which previously did not exist),
255 * it may be reported as having revision 0 or as having the parent
256 * directory's revision.
258 * @since New in 1.5.
260 typedef struct svn_ra_reporter3_t
262 /** Describe a working copy @a path as being at a particular
263 * @a revision and having depth @a depth.
265 * @a revision may be SVN_INVALID_REVNUM if (for example) @a path
266 * represents a locally-added path with no revision number, or @a
267 * depth is @c svn_depth_exclude.
269 * @a path may not be underneath a path on which set_path() was
270 * previously called with @c svn_depth_exclude in this report.
272 * If @a start_empty is set and @a path is a directory, the
273 * implementor should assume the directory has no entries or props.
275 * This will *override* any previous set_path() calls made on parent
276 * paths. @a path is relative to the URL specified in svn_ra_open2().
278 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
280 * All temporary allocations are done in @a pool.
282 svn_error_t *(*set_path)(void *report_baton,
283 const char *path,
284 svn_revnum_t revision,
285 svn_depth_t depth,
286 svn_boolean_t start_empty,
287 const char *lock_token,
288 apr_pool_t *pool);
290 /** Describing a working copy @a path as missing.
292 * @a path may not be underneath a path on which set_path() was
293 * previously called with @c svn_depth_exclude in this report.
295 * All temporary allocations are done in @a pool.
297 svn_error_t *(*delete_path)(void *report_baton,
298 const char *path,
299 apr_pool_t *pool);
301 /** Like set_path(), but differs in that @a path in the working copy
302 * (relative to the root of the report driver) isn't a reflection of
303 * @a path in the repository (relative to the URL specified when
304 * opening the RA layer), but is instead a reflection of a different
305 * repository @a url at @a revision, and has depth @a depth.
307 * @a path may not be underneath a path on which set_path() was
308 * previously called with @c svn_depth_exclude in this report.
310 * If @a start_empty is set and @a path is a directory,
311 * the implementor should assume the directory has no entries or props.
313 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
315 * All temporary allocations are done in @a pool.
317 svn_error_t *(*link_path)(void *report_baton,
318 const char *path,
319 const char *url,
320 svn_revnum_t revision,
321 svn_depth_t depth,
322 svn_boolean_t start_empty,
323 const char *lock_token,
324 apr_pool_t *pool);
326 /** WC calls this when the state report is finished; any directories
327 * or files not explicitly `set' are assumed to be at the
328 * baseline revision originally passed into do_update(). No other
329 * reporting functions, including abort_report, should be called after
330 * calling this function.
332 svn_error_t *(*finish_report)(void *report_baton,
333 apr_pool_t *pool);
335 /** If an error occurs during a report, this routine should cause the
336 * filesystem transaction to be aborted & cleaned up. No other reporting
337 * functions should be called after calling this function.
339 svn_error_t *(*abort_report)(void *report_baton,
340 apr_pool_t *pool);
342 } svn_ra_reporter3_t;
345 * Similar to @c svn_ra_reporter3_t, but without support for depths.
347 * @deprecated Provided for backward compatibility with the 1.4 API.
349 typedef struct svn_ra_reporter2_t
351 /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
352 * with @a depth always set to @c svn_depth_infinity. */
353 svn_error_t *(*set_path)(void *report_baton,
354 const char *path,
355 svn_revnum_t revision,
356 svn_boolean_t start_empty,
357 const char *lock_token,
358 apr_pool_t *pool);
360 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
361 svn_error_t *(*delete_path)(void *report_baton,
362 const char *path,
363 apr_pool_t *pool);
365 /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
366 * with @a depth always set to @c svn_depth_infinity. */
367 svn_error_t *(*link_path)(void *report_baton,
368 const char *path,
369 const char *url,
370 svn_revnum_t revision,
371 svn_boolean_t start_empty,
372 const char *lock_token,
373 apr_pool_t *pool);
375 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
376 svn_error_t *(*finish_report)(void *report_baton,
377 apr_pool_t *pool);
379 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
380 svn_error_t *(*abort_report)(void *report_baton,
381 apr_pool_t *pool);
383 } svn_ra_reporter2_t;
386 * Similar to @c svn_ra_reporter2_t, but without support for lock tokens.
388 * @deprecated Provided for backward compatibility with the 1.1 API.
390 typedef struct svn_ra_reporter_t
392 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
393 * with @a lock_token always set to NULL. */
394 svn_error_t *(*set_path)(void *report_baton,
395 const char *path,
396 svn_revnum_t revision,
397 svn_boolean_t start_empty,
398 apr_pool_t *pool);
400 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
401 svn_error_t *(*delete_path)(void *report_baton,
402 const char *path,
403 apr_pool_t *pool);
405 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
406 * with @a lock_token always set to NULL. */
407 svn_error_t *(*link_path)(void *report_baton,
408 const char *path,
409 const char *url,
410 svn_revnum_t revision,
411 svn_boolean_t start_empty,
412 apr_pool_t *pool);
414 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
415 svn_error_t *(*finish_report)(void *report_baton,
416 apr_pool_t *pool);
418 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
419 svn_error_t *(*abort_report)(void *report_baton,
420 apr_pool_t *pool);
421 } svn_ra_reporter_t;
424 /** A collection of callbacks implemented by libsvn_client which allows
425 * an RA layer to "pull" information from the client application, or
426 * possibly store information. libsvn_client passes this vtable to
427 * svn_ra_open2().
429 * Each routine takes a @a callback_baton originally provided with the
430 * vtable.
432 * Clients must use svn_ra_create_callbacks() to allocate and
433 * initialize this structure.
435 * @since New in 1.3.
437 typedef struct svn_ra_callbacks2_t
439 /** Open a unique temporary file for writing in the working copy.
440 * This file will be automatically deleted when @a fp is closed.
442 svn_error_t *(*open_tmp_file)(apr_file_t **fp,
443 void *callback_baton,
444 apr_pool_t *pool);
446 /** An authentication baton, created by the application, which is
447 * capable of retrieving all known types of credentials.
449 svn_auth_baton_t *auth_baton;
451 /*** The following items may be set to NULL to disallow the RA layer
452 to perform the respective operations of the vtable functions.
453 Perhaps WC props are not defined or are in invalid for this
454 session, or perhaps the commit operation this RA session will
455 perform is a server-side only one that shouldn't do post-commit
456 processing on a working copy path. ***/
458 /** Fetch working copy properties.
460 *<pre> ### we might have a problem if the RA layer ever wants a property
461 * ### that corresponds to a different revision of the file than
462 * ### what is in the WC. we'll cross that bridge one day...</pre>
464 svn_ra_get_wc_prop_func_t get_wc_prop;
466 /** Immediately set new values for working copy properties. */
467 svn_ra_set_wc_prop_func_t set_wc_prop;
469 /** Schedule new values for working copy properties. */
470 svn_ra_push_wc_prop_func_t push_wc_prop;
472 /** Invalidate working copy properties. */
473 svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
475 /** Notification callback used for progress information.
476 * May be NULL if not used.
478 svn_ra_progress_notify_func_t progress_func;
480 /** Notification callback baton, used with progress_func. */
481 void *progress_baton;
483 /** Cancelation function
485 * As its baton, the general callback baton is used
487 * @since New in 1.5
489 svn_cancel_func_t cancel_func;
491 } svn_ra_callbacks2_t;
493 /** Similar to svn_ra_callbacks2_t, except that the progress
494 * notification function and baton is missing.
496 * @deprecated Provided for backward compatibility with the 1.2 API.
498 typedef struct svn_ra_callbacks_t
500 svn_error_t *(*open_tmp_file)(apr_file_t **fp,
501 void *callback_baton,
502 apr_pool_t *pool);
504 svn_auth_baton_t *auth_baton;
506 svn_ra_get_wc_prop_func_t get_wc_prop;
508 svn_ra_set_wc_prop_func_t set_wc_prop;
510 svn_ra_push_wc_prop_func_t push_wc_prop;
512 svn_ra_invalidate_wc_props_func_t invalidate_wc_props;
514 } svn_ra_callbacks_t;
518 /*----------------------------------------------------------------------*/
520 /* Public Interfaces. */
523 * Initialize the RA library. This function must be called before using
524 * any function in this header, except the deprecated APIs based on
525 * @c svn_ra_plugin_t, or svn_ra_version(). This function must not be called
526 * simultaneously in multiple threads. @a pool must live
527 * longer than any open RA sessions.
529 * @since New in 1.2.
531 svn_error_t *
532 svn_ra_initialize(apr_pool_t *pool);
534 /** Initialize a callback structure.
535 * Set @a *callbacks to a ra callbacks object, allocated in @a pool.
537 * Clients must use this function to allocate and initialize @c
538 * svn_ra_callbacks2_t structures.
540 * @since New in 1.3.
542 svn_error_t *
543 svn_ra_create_callbacks(svn_ra_callbacks2_t **callbacks,
544 apr_pool_t *pool);
547 * A repository access session. This object is used to perform requests
548 * to a repository, identified by an URL.
550 * @since New in 1.2.
552 typedef struct svn_ra_session_t svn_ra_session_t;
555 * Open a repository session to @a repos_URL. Return an opaque object
556 * representing this session in @a *session_p, allocated in @a pool.
558 * @a callbacks/@a callback_baton is a table of callbacks provided by the
559 * client; see @c svn_ra_callbacks2_t.
561 * @a config is a hash mapping <tt>const char *</tt> keys to
562 * @c svn_config_t * values. For example, the @c svn_config_t for the
563 * "~/.subversion/config" file is under the key "config".
565 * All RA requests require a session; they will continue to
566 * use @a pool for memory allocation.
568 * @see svn_client_open_ra_session().
570 * @since New in 1.3.
572 svn_error_t *svn_ra_open2(svn_ra_session_t **session_p,
573 const char *repos_URL,
574 const svn_ra_callbacks2_t *callbacks,
575 void *callback_baton,
576 apr_hash_t *config,
577 apr_pool_t *pool);
580 * @see svn_ra_open2().
581 * @since New in 1.2.
582 * @deprecated Provided for backward compatibility with the 1.2 API.
584 svn_error_t *svn_ra_open(svn_ra_session_t **session_p,
585 const char *repos_URL,
586 const svn_ra_callbacks_t *callbacks,
587 void *callback_baton,
588 apr_hash_t *config,
589 apr_pool_t *pool);
591 /** Change the root URL of an open @a ra_session to point to a new path in the
592 * same repository. @a url is the new root URL. Use @a pool for
593 * temporary allocations.
595 * If @a url has a different repository root than the current session
596 * URL, return @c SVN_ERR_RA_ILLEGAL_URL.
598 * @since New in 1.4.
600 svn_error_t *svn_ra_reparent(svn_ra_session_t *ra_session,
601 const char *url,
602 apr_pool_t *pool);
604 /** Set @a *repos_URL to the repository URL to which @a ra_session was
605 * opened or most recently reparented.
607 svn_error_t *svn_ra_get_session_url(svn_ra_session_t *ra_session,
608 const char **url,
609 apr_pool_t *pool);
613 * Get the latest revision number from the repository of @a session.
615 * Use @a pool for memory allocation.
617 * @since New in 1.2.
619 svn_error_t *svn_ra_get_latest_revnum(svn_ra_session_t *session,
620 svn_revnum_t *latest_revnum,
621 apr_pool_t *pool);
624 * Get the latest revision number at time @a tm in the repository of
625 * @a session.
627 * Use @a pool for memory allocation.
629 * @since New in 1.2.
631 svn_error_t *svn_ra_get_dated_revision(svn_ra_session_t *session,
632 svn_revnum_t *revision,
633 apr_time_t tm,
634 apr_pool_t *pool);
637 * Set the property @a name to @a value on revision @a rev in the repository
638 * of @a session.
640 * If @a value is @c NULL, delete the named revision property.
642 * Please note that properties attached to revisions are @em unversioned.
644 * Use @a pool for memory allocation.
646 * @since New in 1.2.
648 svn_error_t *svn_ra_change_rev_prop(svn_ra_session_t *session,
649 svn_revnum_t rev,
650 const char *name,
651 const svn_string_t *value,
652 apr_pool_t *pool);
655 * Set @a *props to the list of unversioned properties attached to revision
656 * @a rev in the repository of @a session. The hash maps
657 * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values.
659 * Use @a pool for memory allocation.
661 * @since New in 1.2.
663 svn_error_t *svn_ra_rev_proplist(svn_ra_session_t *session,
664 svn_revnum_t rev,
665 apr_hash_t **props,
666 apr_pool_t *pool);
669 * Set @a *value to the value of unversioned property @a name attached to
670 * revision @a rev in the repository of @a session. If @a rev has no
671 * property by that name, set @a *value to @c NULL.
673 * Use @a pool for memory allocation.
675 * @since New in 1.2.
677 svn_error_t *svn_ra_rev_prop(svn_ra_session_t *session,
678 svn_revnum_t rev,
679 const char *name,
680 svn_string_t **value,
681 apr_pool_t *pool);
684 * Set @a *editor and @a *edit_baton to an editor for committing
685 * changes to the repository of @a session, setting the revision
686 * properties from @a revprop_table. The revisions being committed
687 * against are passed to the editor functions, starting with the rev
688 * argument to @c open_root. The path root of the commit is the @a
689 * session's URL.
691 * @a revprop_table is a hash mapping <tt>const char *</tt> property
692 * names to @c svn_string_t property values. The commit log message
693 * is expected to be in the @c SVN_PROP_REVISION_LOG element. @a
694 * revprop_table can not contain either of @c SVN_PROP_REVISION_DATE
695 * or @c SVN_PROP_REVISION_AUTHOR.
697 * Before @c close_edit returns, but after the commit has succeeded,
698 * it will invoke @a callback with the new revision number, the
699 * commit date (as a <tt>const char *</tt>), commit author (as a
700 * <tt>const char *</tt>), and @a callback_baton as arguments. If
701 * @a callback returns an error, that error will be returned from @c
702 * close_edit, otherwise @c close_edit will return successfully
703 * (unless it encountered an error before invoking @a callback).
705 * The callback will not be called if the commit was a no-op
706 * (i.e. nothing was committed);
708 * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char
709 * *</tt> paths (relative to the URL of @a session) to <tt>
710 * const char *</tt> lock tokens. The server checks that the
711 * correct token is provided for each committed, locked path. @a lock_tokens
712 * must live during the whole commit operation.
714 * If @a keep_locks is @c TRUE, then do not release locks on
715 * committed objects. Else, automatically release such locks.
717 * The caller may not perform any RA operations using @a session before
718 * finishing the edit.
720 * Use @a pool for memory allocation.
722 * @since New in 1.5.
724 svn_error_t *svn_ra_get_commit_editor3(svn_ra_session_t *session,
725 const svn_delta_editor_t **editor,
726 void **edit_baton,
727 apr_hash_t *revprop_table,
728 svn_commit_callback2_t callback,
729 void *callback_baton,
730 apr_hash_t *lock_tokens,
731 svn_boolean_t keep_locks,
732 apr_pool_t *pool);
735 * Same as svn_ra_get_commit_editor3(), but with @c revprop_table set
736 * to a hash containing the @c SVN_PROP_REVISION_LOG property set
737 * to the value of @a log_msg.
739 * @since New in 1.4.
741 * @deprecated Provided for backward compatibility with the 1.4 API.
743 svn_error_t *svn_ra_get_commit_editor2(svn_ra_session_t *session,
744 const svn_delta_editor_t **editor,
745 void **edit_baton,
746 const char *log_msg,
747 svn_commit_callback2_t callback,
748 void *callback_baton,
749 apr_hash_t *lock_tokens,
750 svn_boolean_t keep_locks,
751 apr_pool_t *pool);
754 * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t.
756 * @since New in 1.2.
758 * @deprecated Provided for backward compatibility with the 1.3 API.
760 svn_error_t *svn_ra_get_commit_editor(svn_ra_session_t *session,
761 const svn_delta_editor_t **editor,
762 void **edit_baton,
763 const char *log_msg,
764 svn_commit_callback_t callback,
765 void *callback_baton,
766 apr_hash_t *lock_tokens,
767 svn_boolean_t keep_locks,
768 apr_pool_t *pool);
771 * Fetch the contents and properties of file @a path at @a revision.
772 * @a revision may be SVN_INVALID_REVNUM, indicating that the HEAD
773 * revision should be used. Interpret @a path relative to the URL in
774 * @a session. Use @a pool for all allocations.
776 * If @a revision is @c SVN_INVALID_REVNUM and @a fetched_rev is not
777 * @c NULL, then set @a *fetched_rev to the actual revision that was
778 * retrieved.
780 * If @a stream is non @c NULL, push the contents of the file at @a
781 * stream, do not call svn_stream_close() when finished.
783 * If @a props is non @c NULL, set @a *props to contain the properties of
784 * the file. This means @em all properties: not just ones controlled by
785 * the user and stored in the repository fs, but non-tweakable ones
786 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
787 * etc.) The keys are <tt>const char *</tt>, values are
788 * <tt>@c svn_string_t *</tt>.
790 * The stream handlers for @a stream may not perform any RA
791 * operations using @a session.
793 * @since New in 1.2.
795 svn_error_t *svn_ra_get_file(svn_ra_session_t *session,
796 const char *path,
797 svn_revnum_t revision,
798 svn_stream_t *stream,
799 svn_revnum_t *fetched_rev,
800 apr_hash_t **props,
801 apr_pool_t *pool);
804 * If @a dirents is non @c NULL, set @a *dirents to contain all the entries
805 * of directory @a path at @a revision. The keys of @a dirents will be
806 * entry names (<tt>const char *</tt>), and the values dirents
807 * (<tt>@c svn_dirent_t *</tt>). Use @a pool for all allocations.
809 * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt>
810 * objects are filled in. To have them completely filled in just pass
811 * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_
812 * fields you would like to have returned to you.
814 * @a path is interpreted relative to the URL in @a session.
816 * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
817 * @a *fetched_rev is not @c NULL, then this function will set
818 * @a *fetched_rev to the actual revision that was retrieved. (Some
819 * callers want to know, and some don't.)
821 * If @a props is non @c NULL, set @a *props to contain the properties of
822 * the directory. This means @em all properties: not just ones controlled by
823 * the user and stored in the repository fs, but non-tweakable ones
824 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
825 * etc.) The keys are <tt>const char *</tt>, values are
826 * <tt>@c svn_string_t *</tt>.
828 * @since New in 1.4.
830 svn_error_t *svn_ra_get_dir2(svn_ra_session_t *session,
831 apr_hash_t **dirents,
832 svn_revnum_t *fetched_rev,
833 apr_hash_t **props,
834 const char *path,
835 svn_revnum_t revision,
836 apr_uint32_t dirent_fields,
837 apr_pool_t *pool);
840 * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the
841 * @a dirent_fields parameter.
843 * @since New in 1.2.
845 * @deprecated Provided for compatibility with the 1.3 API.
847 svn_error_t *svn_ra_get_dir(svn_ra_session_t *session,
848 const char *path,
849 svn_revnum_t revision,
850 apr_hash_t **dirents,
851 svn_revnum_t *fetched_rev,
852 apr_hash_t **props,
853 apr_pool_t *pool);
856 * Set @a *mergeoutput to a hash mapping <tt>const char *</tt> target
857 * paths (taken from @a paths) to mergeinfo hashes (which themselves
858 * map <tt>const char *</tt> merged-from paths to
859 * <tt>apr_array_header_t *</tt> revision range lists of
860 * <tt>svn_merge_range_t *</tt> elements). If no mergeinfo is
861 * available, set @a *mergeoutput to @c NULL. The requested mergeinfo
862 * hashes are for @a paths (which are relative to @a session's URL) in
863 * @a revision. Allocate the returned values in @a pool.
865 * @a inherit indicates whether explicit, explicit or inherited, or
866 * only inherited mergeinfo for @a paths is retrieved.
868 * If @a revision is @c SVN_INVALID_REVNUM, it defaults to youngest.
870 * If the server doesn't support retrieval of mergeinfo (which will
871 * never happen for file:// URLs), return an @c
872 * SVN_ERR_UNSUPPORTED_FEATURE error.
874 * @since New in 1.5.
876 svn_error_t *svn_ra_get_mergeinfo(svn_ra_session_t *session,
877 apr_hash_t **mergeoutput,
878 const apr_array_header_t *paths,
879 svn_revnum_t revision,
880 svn_mergeinfo_inheritance_t inherit,
881 apr_pool_t *pool);
884 * Ask the RA layer to update a working copy.
886 * The client initially provides an @a update_editor/@a update_baton to the
887 * RA layer; this editor contains knowledge of where the change will
888 * begin in the working copy (when @c open_root() is called).
890 * In return, the client receives a @a reporter/@a report_baton. The
891 * client then describes its working copy by making calls into the
892 * @a reporter.
894 * When finished, the client calls @a reporter->finish_report(). The
895 * RA layer then does a complete drive of @a update_editor, ending with
896 * @a update_editor->close_edit(), to update the working copy.
898 * @a update_target is an optional single path component to restrict
899 * the scope of the update to just that entry (in the directory
900 * represented by the @a session's URL). If @a update_target is the
901 * empty string, the entire directory is updated.
903 * Update the target only as deeply as @a depth indicates.
905 * If @a send_copyfrom_args is TRUE, then ask the server to send
906 * copyfrom arguments to add_file() and add_directory() when possible.
907 * (Note: this means that any subsequent txdeltas coming from the
908 * server are presumed to apply against the copied file!)
910 * The working copy will be updated to @a revision_to_update_to, or the
911 * "latest" revision if this arg is invalid.
913 * The caller may not perform any RA operations using @a session before
914 * finishing the report, and may not perform any RA operations using
915 * @a session from within the editing operations of @a update_editor.
917 * Use @a pool for memory allocation.
919 * @note The reporter provided by this function does NOT supply copy-
920 * from information to the diff editor callbacks.
922 * @note In order to prevent pre-1.5 servers from doing more work than
923 * needed, and sending too much data back, a pre-1.5 'recurse'
924 * directive may be sent to the server, based on @a depth.
926 * @since New in 1.5.
928 svn_error_t *svn_ra_do_update2(svn_ra_session_t *session,
929 const svn_ra_reporter3_t **reporter,
930 void **report_baton,
931 svn_revnum_t revision_to_update_to,
932 const char *update_target,
933 svn_depth_t depth,
934 svn_boolean_t send_copyfrom_args,
935 const svn_delta_editor_t *update_editor,
936 void *update_baton,
937 apr_pool_t *pool);
940 * Similar to svn_ra_do_update2(), but taking @c svn_ra_reporter2_t
941 * instead of @c svn_ra_reporter3_t. If @a recurse is TRUE, pass
942 * @c svn_depth_infinity for @a depth, else pass @c svn_depth_files.
944 * @deprecated Provided for compatibility with the 1.4 API.
946 svn_error_t *svn_ra_do_update(svn_ra_session_t *session,
947 const svn_ra_reporter2_t **reporter,
948 void **report_baton,
949 svn_revnum_t revision_to_update_to,
950 const char *update_target,
951 svn_boolean_t recurse,
952 const svn_delta_editor_t *update_editor,
953 void *update_baton,
954 apr_pool_t *pool);
958 * Ask the RA layer to 'switch' a working copy to a new
959 * @a switch_url; it's another form of svn_ra_do_update().
961 * The client initially provides a @a switch_editor/@a switch_baton to the RA
962 * layer; this editor contains knowledge of where the change will
963 * begin in the working copy (when open_root() is called).
965 * In return, the client receives a @a reporter/@a report_baton. The
966 * client then describes its working copy by making calls into the
967 * @a reporter.
969 * When finished, the client calls @a reporter->finish_report(). The
970 * RA layer then does a complete drive of @a switch_editor, ending with
971 * close_edit(), to switch the working copy.
973 * @a switch_target is an optional single path component will restrict
974 * the scope of things affected by the switch to an entry in the
975 * directory represented by the @a session's URL, or empty if the
976 * entire directory is meant to be switched.
978 * Switch the target only as deeply as @a depth indicates.
980 * The working copy will be switched to @a revision_to_switch_to, or the
981 * "latest" revision if this arg is invalid.
983 * The caller may not perform any RA operations using
984 * @a session before finishing the report, and may not perform
985 * any RA operations using @a session from within the editing
986 * operations of @a switch_editor.
988 * Use @a pool for memory allocation.
990 * @note The reporter provided by this function does NOT supply copy-
991 * from information to the diff editor callbacks.
993 * @note In order to prevent pre-1.5 servers from doing more work than
994 * needed, and sending too much data back, a pre-1.5 'recurse'
995 * directive may be sent to the server, based on @a depth.
997 * @since New in 1.5.
999 svn_error_t *svn_ra_do_switch2(svn_ra_session_t *session,
1000 const svn_ra_reporter3_t **reporter,
1001 void **report_baton,
1002 svn_revnum_t revision_to_switch_to,
1003 const char *switch_target,
1004 svn_depth_t depth,
1005 const char *switch_url,
1006 const svn_delta_editor_t *switch_editor,
1007 void *switch_baton,
1008 apr_pool_t *pool);
1011 * Similar to svn_ra_do_switch2(), but taking @c svn_ra_reporter2_t
1012 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1013 * @c svn_depth_infinity for depths. The switch itself is performed
1014 * according to @a recurse: if TRUE, then use @c svn_depth_infinity
1015 * for @a depth, else use @c svn_depth_files.
1017 * @deprecated Provided for compatibility with the 1.4 API.
1019 svn_error_t *svn_ra_do_switch(svn_ra_session_t *session,
1020 const svn_ra_reporter2_t **reporter,
1021 void **report_baton,
1022 svn_revnum_t revision_to_switch_to,
1023 const char *switch_target,
1024 svn_boolean_t recurse,
1025 const char *switch_url,
1026 const svn_delta_editor_t *switch_editor,
1027 void *switch_baton,
1028 apr_pool_t *pool);
1031 * Ask the RA layer to describe the status of a working copy with respect
1032 * to @a revision of the repository (or HEAD, if @a revision is invalid).
1034 * The client initially provides a @a status_editor/@a status_baton to the RA
1035 * layer; this editor contains knowledge of where the change will
1036 * begin in the working copy (when open_root() is called).
1038 * In return, the client receives a @a reporter/@a report_baton. The
1039 * client then describes its working copy by making calls into the
1040 * @a reporter.
1042 * When finished, the client calls @a reporter->finish_report(). The RA
1043 * layer then does a complete drive of @a status_editor, ending with
1044 * close_edit(), to report, essentially, what would be modified in
1045 * the working copy were the client to call do_update().
1046 * @a status_target is an optional single path component will restrict
1047 * the scope of the status report to an entry in the directory
1048 * represented by the @a session's URL, or empty if the entire directory
1049 * is meant to be examined.
1051 * Get status only as deeply as @a depth indicates.
1053 * The caller may not perform any RA operations using @a session
1054 * before finishing the report, and may not perform any RA operations
1055 * using @a session from within the editing operations of @a status_editor.
1057 * Use @a pool for memory allocation.
1059 * @note The reporter provided by this function does NOT supply copy-
1060 * from information to the diff editor callbacks.
1062 * @note In order to prevent pre-1.5 servers from doing more work than
1063 * needed, and sending too much data back, a pre-1.5 'recurse'
1064 * directive may be sent to the server, based on @a depth.
1066 * @since New in 1.5.
1068 svn_error_t *svn_ra_do_status2(svn_ra_session_t *session,
1069 const svn_ra_reporter3_t **reporter,
1070 void **report_baton,
1071 const char *status_target,
1072 svn_revnum_t revision,
1073 svn_depth_t depth,
1074 const svn_delta_editor_t *status_editor,
1075 void *status_baton,
1076 apr_pool_t *pool);
1080 * Similar to svn_ra_do_status2(), but taking @c svn_ra_reporter2_t
1081 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1082 * @c svn_depth_infinity for depths. The status operation itself is
1083 * performed according to @a recurse: if TRUE, then @a depth is
1084 * @c svn_depth_infinity, else it is @c svn_depth_immediates.
1086 * @deprecated Provided for compatibility with the 1.4 API.
1088 svn_error_t *svn_ra_do_status(svn_ra_session_t *session,
1089 const svn_ra_reporter2_t **reporter,
1090 void **report_baton,
1091 const char *status_target,
1092 svn_revnum_t revision,
1093 svn_boolean_t recurse,
1094 const svn_delta_editor_t *status_editor,
1095 void *status_baton,
1096 apr_pool_t *pool);
1099 * Ask the RA layer to 'diff' a working copy against @a versus_url;
1100 * it's another form of svn_ra_do_update2().
1102 * @note This function cannot be used to diff a single file, only a
1103 * working copy directory. See the svn_ra_do_switch2() function
1104 * for more details.
1106 * The client initially provides a @a diff_editor/@a diff_baton to the RA
1107 * layer; this editor contains knowledge of where the common diff
1108 * root is in the working copy (when open_root() is called).
1110 * In return, the client receives a @a reporter/@a report_baton. The
1111 * client then describes its working copy by making calls into the
1112 * @a reporter.
1114 * When finished, the client calls @a reporter->finish_report(). The
1115 * RA layer then does a complete drive of @a diff_editor, ending with
1116 * close_edit(), to transmit the diff.
1118 * @a diff_target is an optional single path component will restrict
1119 * the scope of the diff to an entry in the directory represented by
1120 * the @a session's URL, or empty if the entire directory is meant to be
1121 * one of the diff paths.
1123 * The working copy will be diffed against @a versus_url as it exists
1124 * in revision @a revision, or as it is in head if @a revision is
1125 * @c SVN_INVALID_REVNUM.
1127 * Use @a ignore_ancestry to control whether or not items being
1128 * diffed will be checked for relatedness first. Unrelated items
1129 * are typically transmitted to the editor as a deletion of one thing
1130 * and the addition of another, but if this flag is @c TRUE,
1131 * unrelated items will be diffed as if they were related.
1133 * Diff only as deeply as @a depth indicates.
1135 * The caller may not perform any RA operations using @a session before
1136 * finishing the report, and may not perform any RA operations using
1137 * @a session from within the editing operations of @a diff_editor.
1139 * @a text_deltas instructs the driver of the @a diff_editor to enable
1140 * the generation of text deltas. If @a text_deltas is FALSE the window
1141 * handler returned by apply_textdelta will be called once with a NULL
1142 * @c svn_txdelta_window_t pointer.
1144 * Use @a pool for memory allocation.
1146 * @note The reporter provided by this function does NOT supply copy-
1147 * from information to the diff editor callbacks.
1149 * @note In order to prevent pre-1.5 servers from doing more work than
1150 * needed, and sending too much data back, a pre-1.5 'recurse'
1151 * directive may be sent to the server, based on @a depth.
1153 * @since New in 1.5.
1155 svn_error_t *svn_ra_do_diff3(svn_ra_session_t *session,
1156 const svn_ra_reporter3_t **reporter,
1157 void **report_baton,
1158 svn_revnum_t revision,
1159 const char *diff_target,
1160 svn_depth_t depth,
1161 svn_boolean_t ignore_ancestry,
1162 svn_boolean_t text_deltas,
1163 const char *versus_url,
1164 const svn_delta_editor_t *diff_editor,
1165 void *diff_baton,
1166 apr_pool_t *pool);
1169 * Similar to svn_ra_do_diff3(), but taking @c svn_ra_reporter2_t
1170 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1171 * @c svn_depth_infinity for depths. Perform the diff according to
1172 * @a recurse: if TRUE, then @a depth is @c svn_depth_infinity, else
1173 * it is @c svn_depth_files.
1175 * @deprecated Provided for compatibility with the 1.4 API.
1177 svn_error_t *svn_ra_do_diff2(svn_ra_session_t *session,
1178 const svn_ra_reporter2_t **reporter,
1179 void **report_baton,
1180 svn_revnum_t revision,
1181 const char *diff_target,
1182 svn_boolean_t recurse,
1183 svn_boolean_t ignore_ancestry,
1184 svn_boolean_t text_deltas,
1185 const char *versus_url,
1186 const svn_delta_editor_t *diff_editor,
1187 void *diff_baton,
1188 apr_pool_t *pool);
1192 * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE.
1194 * @deprecated Provided for backward compatibility with the 1.3 API.
1196 svn_error_t *svn_ra_do_diff(svn_ra_session_t *session,
1197 const svn_ra_reporter2_t **reporter,
1198 void **report_baton,
1199 svn_revnum_t revision,
1200 const char *diff_target,
1201 svn_boolean_t recurse,
1202 svn_boolean_t ignore_ancestry,
1203 const char *versus_url,
1204 const svn_delta_editor_t *diff_editor,
1205 void *diff_baton,
1206 apr_pool_t *pool);
1209 * Invoke @a receiver with @a receiver_baton on each log message from
1210 * @a start to @a end. @a start may be greater or less than @a end;
1211 * this just controls whether the log messages are processed in descending
1212 * or ascending revision number order.
1214 * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
1216 * If @a paths is non-NULL and has one or more elements, then only show
1217 * revisions in which at least one of @a paths was changed (i.e., if
1218 * file, text or props changed; if dir, props changed or an entry
1219 * was added or deleted). Each path is an <tt>const char *</tt>, relative
1220 * to the @a session's common parent.
1222 * If @a limit is non-zero only invoke @a receiver on the first @a limit
1223 * logs.
1225 * If @a discover_changed_paths, then each call to receiver passes a
1226 * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument;
1227 * the hash's keys are all the paths committed in that revision.
1228 * Otherwise, each call to receiver passes NULL for @a changed_paths.
1230 * If @a strict_node_history is set, copy history will not be traversed
1231 * (if any exists) when harvesting the revision logs for each path.
1233 * If @a include_merged_revisions is set, log information for revisions
1234 * which have been merged to @a targets will also be returned.
1236 * If @a revprops is NULL, retrieve all revprops; else, retrieve only the
1237 * revprops named in the array (i.e. retrieve none if the array is empty).
1239 * If any invocation of @a receiver returns error, return that error
1240 * immediately and without wrapping it.
1242 * If @a start or @a end is a non-existent revision, return the error
1243 * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
1245 * See also the documentation for @c svn_log_message_receiver_t.
1247 * The caller may not invoke any RA operations using @a session from
1248 * within @a receiver.
1250 * Use @a pool for memory allocation.
1252 * @note Pre-1.5 servers do not support custom revprop retrieval; if @a
1253 * revprops is NULL or contains a revprop other than svn:author, svn:date,
1254 * or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned.
1256 * @since New in 1.5.
1259 svn_error_t *svn_ra_get_log2(svn_ra_session_t *session,
1260 const apr_array_header_t *paths,
1261 svn_revnum_t start,
1262 svn_revnum_t end,
1263 int limit,
1264 svn_boolean_t discover_changed_paths,
1265 svn_boolean_t strict_node_history,
1266 svn_boolean_t include_merged_revisions,
1267 apr_array_header_t *revprops,
1268 svn_log_entry_receiver_t receiver,
1269 void *receiver_baton,
1270 apr_pool_t *pool);
1273 * Similar to svn_ra_get_log2(), but uses @c svn_log_message_receiver_t
1274 * instead of @c svn_log_entry_receiver_t. Also, @a
1275 * include_merged_revisions is set to @c FALSE and @a revprops is
1276 * svn:author, svn:date, and svn:log.
1278 * @since New in 1.2.
1279 * @deprecated Provided for backward compatibility with the 1.4 API.
1281 svn_error_t *svn_ra_get_log(svn_ra_session_t *session,
1282 const apr_array_header_t *paths,
1283 svn_revnum_t start,
1284 svn_revnum_t end,
1285 int limit,
1286 svn_boolean_t discover_changed_paths,
1287 svn_boolean_t strict_node_history,
1288 svn_log_message_receiver_t receiver,
1289 void *receiver_baton,
1290 apr_pool_t *pool);
1293 * Set @a *kind to the node kind associated with @a path at @a revision.
1294 * If @a path does not exist under @a revision, set @a *kind to
1295 * @c svn_node_none. @a path is relative to the @a session's parent URL.
1297 * Use @a pool for memory allocation.
1299 * @since New in 1.2.
1301 svn_error_t *svn_ra_check_path(svn_ra_session_t *session,
1302 const char *path,
1303 svn_revnum_t revision,
1304 svn_node_kind_t *kind,
1305 apr_pool_t *pool);
1308 * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a
1309 * revision. @a path is relative to the @a session's parent's URL.
1310 * If @a path does not exist in @a revision, set @a *dirent to NULL.
1312 * Use @a pool for memory allocation.
1314 * @since New in 1.2.
1316 svn_error_t *svn_ra_stat(svn_ra_session_t *session,
1317 const char *path,
1318 svn_revnum_t revision,
1319 svn_dirent_t **dirent,
1320 apr_pool_t *pool);
1324 * Set @a *uuid to the repository's UUID.
1326 * @note The UUID has the same lifetime as the @a session.
1328 * Use @a pool for temporary memory allocation.
1330 * @since New in 1.2.
1332 svn_error_t *svn_ra_get_uuid(svn_ra_session_t *session,
1333 const char **uuid,
1334 apr_pool_t *pool);
1337 * Set @a *url to the repository's root URL. The value will not include
1338 * a trailing '/'. The returned URL is guaranteed to be a prefix of the
1339 * @a session's URL.
1341 * @note The URL has the same lifetime as the @a session.
1343 * Use @a pool for temporary memory allocation.
1345 * @since New in 1.2.
1347 svn_error_t *svn_ra_get_repos_root(svn_ra_session_t *session,
1348 const char **url,
1349 apr_pool_t *pool);
1352 * Set @a *locations to the locations (at the repository revisions
1353 * @a location_revisions) of the file identified by @a path in
1354 * @a peg_revision. @a path is relative to the URL to which
1355 * @a session was opened. @a location_revisions is an array of
1356 * @c svn_revnum_t's. @a *locations will be a mapping from the revisions to
1357 * their appropriate absolute paths. If the file doesn't exist in a
1358 * location_revision, that revision will be ignored.
1360 * Use @a pool for all allocations.
1362 * @since New in 1.2.
1364 svn_error_t *svn_ra_get_locations(svn_ra_session_t *session,
1365 apr_hash_t **locations,
1366 const char *path,
1367 svn_revnum_t peg_revision,
1368 apr_array_header_t *location_revisions,
1369 apr_pool_t *pool);
1373 * Call @a receiver (with @a receiver_baton) for each segment in the
1374 * location history of @a path in @a peg_revision, working backwards in
1375 * time from @a start_rev to @a end_rev.
1377 * @a end_rev may be @c SVN_INVALID_REVNUM to indicate that you want
1378 * to trace the history of the object to its origin.
1380 * @a start_rev may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1381 * revision". Otherwise, @a start_rev must be younger than @a end_rev
1382 * (unless @a end_rev is @c SVN_INVALID_REVNUM).
1384 * @a peg_revision may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1385 * revision", and must evaluate to be at least as young as @a start_rev.
1387 * Use @a pool for all allocations.
1389 * @since New in 1.5.
1391 svn_error_t *
1392 svn_ra_get_location_segments(svn_ra_session_t *session,
1393 const char *path,
1394 svn_revnum_t peg_revision,
1395 svn_revnum_t start_rev,
1396 svn_revnum_t end_rev,
1397 svn_location_segment_receiver_t receiver,
1398 void *receiver_baton,
1399 apr_pool_t *pool);
1402 * Retrieve a subset of the interesting revisions of a file @a path
1403 * as seen in revision @a end (see svn_fs_history_prev() for a
1404 * definition of "interesting revisions"). Invoke @a handler with
1405 * @a handler_baton as its first argument for each such revision.
1406 * @a session is an open RA session. Use @a pool for all allocations.
1408 * If there is an interesting revision of the file that is less than or
1409 * equal to @a start, the iteration will begin at that revision.
1410 * Else, the iteration will begin at the first revision of the file in
1411 * the repository, which has to be less than or equal to @a end. Note
1412 * that if the function succeeds, @a handler will have been called at
1413 * least once.
1415 * In a series of calls to @a handler, the file contents for the first
1416 * interesting revision will be provided as a text delta against the
1417 * empty file. In the following calls, the delta will be against the
1418 * fulltext contents for the previous call.
1420 * If @a include_merged_revisions is TRUE, revisions which a included as a
1421 * result of a merge between @a start and @a end will be included.
1423 * @note This functionality is not available in pre-1.1 servers. If the
1424 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1425 * returned.
1427 * @since New in 1.5.
1429 svn_error_t *svn_ra_get_file_revs2(svn_ra_session_t *session,
1430 const char *path,
1431 svn_revnum_t start,
1432 svn_revnum_t end,
1433 svn_boolean_t include_merged_revisions,
1434 svn_file_rev_handler_t handler,
1435 void *handler_baton,
1436 apr_pool_t *pool);
1439 * Similiar to svn_ra_get_file_revs2(), but with @a include_merged_revisions
1440 * set to FALSE.
1442 * @since New in 1.2.
1443 * @deprecated Provided for backward compatibility with the 1.4 API.
1445 svn_error_t *svn_ra_get_file_revs(svn_ra_session_t *session,
1446 const char *path,
1447 svn_revnum_t start,
1448 svn_revnum_t end,
1449 svn_ra_file_rev_handler_t handler,
1450 void *handler_baton,
1451 apr_pool_t *pool);
1454 * Lock each path in @a path_revs, which is a hash whose keys are the
1455 * paths to be locked, and whose values are the corresponding base
1456 * revisions for each path.
1458 * Note that locking is never anonymous, so any server implementing
1459 * this function will have to "pull" a username from the client, if
1460 * it hasn't done so already.
1462 * @a comment is optional: it's either an xml-escapable string
1463 * which describes the lock, or it is NULL.
1465 * If any path is already locked by a different user, then call @a
1466 * lock_func/@a lock_baton with an error. If @a steal_lock is TRUE,
1467 * then "steal" the existing lock(s) anyway, even if the RA username
1468 * does not match the current lock's owner. Delete any lock on the
1469 * path, and unconditionally create a new lock.
1471 * For each path, if its base revision (in @a path_revs) is a valid
1472 * revnum, then do an out-of-dateness check. If the revnum is less
1473 * than the last-changed-revision of any path (or if a path doesn't
1474 * exist in HEAD), call @a lock_func/@a lock_baton with an
1475 * SVN_ERR_RA_OUT_OF_DATE error.
1477 * After successfully locking a file, @a lock_func is called with the
1478 * @a lock_baton.
1480 * Use @a pool for temporary allocations.
1482 * @since New in 1.2.
1484 svn_error_t *svn_ra_lock(svn_ra_session_t *session,
1485 apr_hash_t *path_revs,
1486 const char *comment,
1487 svn_boolean_t steal_lock,
1488 svn_ra_lock_callback_t lock_func,
1489 void *lock_baton,
1490 apr_pool_t *pool);
1493 * Remove the repository lock for each path in @a path_tokens.
1494 * @a path_tokens is a hash whose keys are the paths to be locked, and
1495 * whose values are the corresponding lock tokens for each path. If
1496 * the path has no corresponding lock token, or if @a break_lock is TRUE,
1497 * then the corresponding value shall be "".
1499 * Note that unlocking is never anonymous, so any server
1500 * implementing this function will have to "pull" a username from
1501 * the client, if it hasn't done so already.
1503 * If @a token points to a lock, but the RA username doesn't match the
1504 * lock's owner, call @a lock_func/@a lock_baton with an error. If @a
1505 * break_lock is TRUE, however, instead allow the lock to be "broken"
1506 * by the RA user.
1508 * After successfully unlocking a path, @a lock_func is called with
1509 * the @a lock_baton.
1511 * Use @a pool for temporary allocations.
1513 * @since New in 1.2.
1515 svn_error_t *svn_ra_unlock(svn_ra_session_t *session,
1516 apr_hash_t *path_tokens,
1517 svn_boolean_t break_lock,
1518 svn_ra_lock_callback_t lock_func,
1519 void *lock_baton,
1520 apr_pool_t *pool);
1523 * If @a path is locked, set @a *lock to an svn_lock_t which
1524 * represents the lock, allocated in @a pool. If @a path is not
1525 * locked, set @a *lock to NULL.
1527 * @since New in 1.2.
1529 svn_error_t *svn_ra_get_lock(svn_ra_session_t *session,
1530 svn_lock_t **lock,
1531 const char *path,
1532 apr_pool_t *pool);
1535 * Set @a *locks to a hashtable which represents all locks on or
1536 * below @a path.
1538 * The hashtable maps (const char *) absolute fs paths to (const
1539 * svn_lock_t *) structures. The hashtable -- and all keys and
1540 * values -- are allocated in @a pool.
1542 * @note It is not considered an error for @a path to not exist in HEAD.
1543 * Such a search will simply return no locks.
1545 * @note This functionality is not available in pre-1.2 servers. If the
1546 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1547 * returned.
1549 * @since New in 1.2.
1551 svn_error_t *svn_ra_get_locks(svn_ra_session_t *session,
1552 apr_hash_t **locks,
1553 const char *path,
1554 apr_pool_t *pool);
1558 * Replay the changes from a range of revisions between @a start_revision
1559 * and @a end_revision.
1561 * When receiving information for one revision, a callback @a revstart_func is
1562 * called; this callback will provide an editor and baton through which the
1563 * revision will be replayed.
1564 * When replaying the revision is finished, callback @a fevfinish_func will be
1565 * called so the editor can be closed.
1567 * Changes will be limited to those that occur under @a session's URL, and
1568 * the server will assume that the client has no knowledge of revisions
1569 * prior to @a low_water_mark. These two limiting factors define the portion
1570 * of the tree that the server will assume the client already has knowledge of,
1571 * and thus any copies of data from outside that part of the tree will be
1572 * sent in their entirety, not as simple copies or deltas against a previous
1573 * version.
1575 * If @a send_deltas is @c TRUE, the actual text and property changes in
1576 * the revision will be sent, otherwise dummy text deltas and NULL property
1577 * changes will be sent instead.
1579 * @a pool is used for all allocation.
1581 * @since New in 1.5.
1583 svn_error_t *
1584 svn_ra_replay_range(svn_ra_session_t *session,
1585 svn_revnum_t start_revision,
1586 svn_revnum_t end_revision,
1587 svn_revnum_t low_water_mark,
1588 svn_boolean_t send_deltas,
1589 svn_ra_replay_revstart_callback_t revstart_func,
1590 svn_ra_replay_revfinish_callback_t revfinish_func,
1591 void *replay_baton,
1592 apr_pool_t *pool);
1595 * Replay the changes from @a revision through @a editor and @a edit_baton.
1597 * Changes will be limited to those that occur under @a session's URL, and
1598 * the server will assume that the client has no knowledge of revisions
1599 * prior to @a low_water_mark. These two limiting factors define the portion
1600 * of the tree that the server will assume the client already has knowledge of,
1601 * and thus any copies of data from outside that part of the tree will be
1602 * sent in their entirety, not as simple copies or deltas against a previous
1603 * version.
1605 * If @a send_deltas is @c TRUE, the actual text and property changes in
1606 * the revision will be sent, otherwise dummy text deltas and null property
1607 * changes will be sent instead.
1609 * @a pool is used for all allocation.
1611 * @since New in 1.4.
1613 svn_error_t *svn_ra_replay(svn_ra_session_t *session,
1614 svn_revnum_t revision,
1615 svn_revnum_t low_water_mark,
1616 svn_boolean_t send_deltas,
1617 const svn_delta_editor_t *editor,
1618 void *edit_baton,
1619 apr_pool_t *pool);
1622 * Set @a *has to TRUE if the server represented by @a session has
1623 * @a capability (one of the capabilities beginning with
1624 * @c "SVN_RA_CAPABILITY_"), else set @a *has to FALSE.
1626 * If @a capability isn't recognized, throw @c SVN_ERR_RA_UNKNOWN_CAPABILITY,
1627 * with the effect on @a *has undefined.
1629 * Use @a pool for all allocation.
1631 * @since New in 1.5.
1633 svn_error_t *svn_ra_has_capability(svn_ra_session_t *session,
1634 svn_boolean_t *has,
1635 const char *capability,
1636 apr_pool_t *pool);
1639 * The capability of understanding @c svn_depth_t (e.g., the server
1640 * understands what the client means when the client describes the
1641 * depth of a working copy to the server.)
1643 * @since New in 1.5.
1645 #define SVN_RA_CAPABILITY_DEPTH "depth"
1648 * The capability of doing the right thing with merge-tracking
1649 * information. This capability should be reported bidirectionally,
1650 * because some repositories may want to reject clients that do not
1651 * self-report as knowing how to handle merge-tracking.
1653 * @since New in 1.5.
1655 #define SVN_RA_CAPABILITY_MERGEINFO "mergeinfo"
1658 * The capability of retrieving arbitrary revprops in svn_ra_get_log2.
1660 * @since New in 1.5.
1662 #define SVN_RA_CAPABILITY_LOG_REVPROPS "log-revprops"
1664 /* *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY ***
1666 * RA layers generally fetch all capabilities when asked about any
1667 * capability, to save future round trips. So if you add a new
1668 * capability here, make sure to update the RA layers to remember
1669 * it after any capabilities query.
1671 * Also note that capability strings should not include colons,
1672 * because we pass a list of client capabilities to the start-commit
1673 * hook as a single, colon-separated string.
1677 * Append a textual list of all available RA modules to the stringbuf
1678 * @a output.
1680 * @since New in 1.2.
1682 svn_error_t *svn_ra_print_modules(svn_stringbuf_t *output,
1683 apr_pool_t *pool);
1687 * Similar to svn_ra_print_modules().
1688 * @a ra_baton is ignored.
1690 * @deprecated Provided for backward compatibility with the 1.1 API.
1692 svn_error_t *svn_ra_print_ra_libraries(svn_stringbuf_t **descriptions,
1693 void *ra_baton,
1694 apr_pool_t *pool);
1699 * Using this callback struct is similar to calling the newer public
1700 * interface that is based on @c svn_ra_session_t.
1702 * @deprecated Provided for backward compatibility with the 1.1 API.
1704 typedef struct svn_ra_plugin_t
1706 /** The proper name of the RA library, (like "ra_neon" or "ra_local") */
1707 const char *name;
1709 /** Short doc string printed out by `svn --version` */
1710 const char *description;
1712 /* The vtable hooks */
1714 /** Call svn_ra_open() and set @a session_baton to an object representing
1715 * the new session. All other arguments are passed to svn_ra_open().
1717 svn_error_t *(*open)(void **session_baton,
1718 const char *repos_URL,
1719 const svn_ra_callbacks_t *callbacks,
1720 void *callback_baton,
1721 apr_hash_t *config,
1722 apr_pool_t *pool);
1724 /** Call svn_ra_get_latest_revnum() with the session associated with
1725 * @a session_baton and all other arguments.
1727 svn_error_t *(*get_latest_revnum)(void *session_baton,
1728 svn_revnum_t *latest_revnum,
1729 apr_pool_t *pool);
1731 /** Call svn_ra_get_dated_revision() with the session associated with
1732 * @a session_baton and all other arguments.
1734 svn_error_t *(*get_dated_revision)(void *session_baton,
1735 svn_revnum_t *revision,
1736 apr_time_t tm,
1737 apr_pool_t *pool);
1739 /** Call svn_ra_change_rev_prop() with the session associated with
1740 * @a session_baton and all other arguments.
1742 svn_error_t *(*change_rev_prop)(void *session_baton,
1743 svn_revnum_t rev,
1744 const char *name,
1745 const svn_string_t *value,
1746 apr_pool_t *pool);
1748 /** Call svn_ra_rev_proplist() with the session associated with
1749 * @a session_baton and all other arguments.
1751 svn_error_t *(*rev_proplist)(void *session_baton,
1752 svn_revnum_t rev,
1753 apr_hash_t **props,
1754 apr_pool_t *pool);
1756 /** Call svn_ra_rev_prop() with the session associated with
1757 * @a session_baton and all other arguments.
1759 svn_error_t *(*rev_prop)(void *session_baton,
1760 svn_revnum_t rev,
1761 const char *name,
1762 svn_string_t **value,
1763 apr_pool_t *pool);
1765 /** Call svn_ra_get_commit_editor() with the session associated with
1766 * @a session_baton and all other arguments plus @a lock_tokens set to
1767 * @c NULL and @a keep_locks set to @c TRUE.
1769 svn_error_t *(*get_commit_editor)(void *session_baton,
1770 const svn_delta_editor_t **editor,
1771 void **edit_baton,
1772 const char *log_msg,
1773 svn_commit_callback_t callback,
1774 void *callback_baton,
1775 apr_pool_t *pool);
1777 /** Call svn_ra_get_file() with the session associated with
1778 * @a session_baton and all other arguments.
1780 svn_error_t *(*get_file)(void *session_baton,
1781 const char *path,
1782 svn_revnum_t revision,
1783 svn_stream_t *stream,
1784 svn_revnum_t *fetched_rev,
1785 apr_hash_t **props,
1786 apr_pool_t *pool);
1788 /** Call svn_ra_get_dir() with the session associated with
1789 * @a session_baton and all other arguments.
1791 svn_error_t *(*get_dir)(void *session_baton,
1792 const char *path,
1793 svn_revnum_t revision,
1794 apr_hash_t **dirents,
1795 svn_revnum_t *fetched_rev,
1796 apr_hash_t **props,
1797 apr_pool_t *pool);
1799 /** Call svn_ra_do_update() with the session associated with
1800 * @a session_baton and all other arguments.
1802 svn_error_t *(*do_update)(void *session_baton,
1803 const svn_ra_reporter_t **reporter,
1804 void **report_baton,
1805 svn_revnum_t revision_to_update_to,
1806 const char *update_target,
1807 svn_boolean_t recurse,
1808 const svn_delta_editor_t *update_editor,
1809 void *update_baton,
1810 apr_pool_t *pool);
1812 /** Call svn_ra_do_switch() with the session associated with
1813 * @a session_baton and all other arguments.
1815 svn_error_t *(*do_switch)(void *session_baton,
1816 const svn_ra_reporter_t **reporter,
1817 void **report_baton,
1818 svn_revnum_t revision_to_switch_to,
1819 const char *switch_target,
1820 svn_boolean_t recurse,
1821 const char *switch_url,
1822 const svn_delta_editor_t *switch_editor,
1823 void *switch_baton,
1824 apr_pool_t *pool);
1826 /** Call svn_ra_do_status() with the session associated with
1827 * @a session_baton and all other arguments.
1829 svn_error_t *(*do_status)(void *session_baton,
1830 const svn_ra_reporter_t **reporter,
1831 void **report_baton,
1832 const char *status_target,
1833 svn_revnum_t revision,
1834 svn_boolean_t recurse,
1835 const svn_delta_editor_t *status_editor,
1836 void *status_baton,
1837 apr_pool_t *pool);
1839 /** Call svn_ra_do_diff() with the session associated with
1840 * @a session_baton and all other arguments.
1842 svn_error_t *(*do_diff)(void *session_baton,
1843 const svn_ra_reporter_t **reporter,
1844 void **report_baton,
1845 svn_revnum_t revision,
1846 const char *diff_target,
1847 svn_boolean_t recurse,
1848 svn_boolean_t ignore_ancestry,
1849 const char *versus_url,
1850 const svn_delta_editor_t *diff_editor,
1851 void *diff_baton,
1852 apr_pool_t *pool);
1854 /** Call svn_ra_get_log() with the session associated with
1855 * @a session_baton and all other arguments. @a limit is set to 0.
1857 svn_error_t *(*get_log)(void *session_baton,
1858 const apr_array_header_t *paths,
1859 svn_revnum_t start,
1860 svn_revnum_t end,
1861 svn_boolean_t discover_changed_paths,
1862 svn_boolean_t strict_node_history,
1863 svn_log_message_receiver_t receiver,
1864 void *receiver_baton,
1865 apr_pool_t *pool);
1867 /** Call svn_ra_check_path() with the session associated with
1868 * @a session_baton and all other arguments.
1870 svn_error_t *(*check_path)(void *session_baton,
1871 const char *path,
1872 svn_revnum_t revision,
1873 svn_node_kind_t *kind,
1874 apr_pool_t *pool);
1876 /** Call svn_ra_get_uuid() with the session associated with
1877 * @a session_baton and all other arguments.
1879 svn_error_t *(*get_uuid)(void *session_baton,
1880 const char **uuid,
1881 apr_pool_t *pool);
1883 /** Call svn_ra_get_repos_root() with the session associated with
1884 * @a session_baton and all other arguments.
1886 svn_error_t *(*get_repos_root)(void *session_baton,
1887 const char **url,
1888 apr_pool_t *pool);
1891 * Call svn_ra_get_locations() with the session associated with
1892 * @a session_baton and all other arguments.
1894 * @since New in 1.1.
1896 svn_error_t *(*get_locations)(void *session_baton,
1897 apr_hash_t **locations,
1898 const char *path,
1899 svn_revnum_t peg_revision,
1900 apr_array_header_t *location_revisions,
1901 apr_pool_t *pool);
1904 * Call svn_ra_get_file_revs() with the session associated with
1905 * @a session_baton and all other arguments.
1907 * @since New in 1.1.
1909 svn_error_t *(*get_file_revs)(void *session_baton,
1910 const char *path,
1911 svn_revnum_t start,
1912 svn_revnum_t end,
1913 svn_ra_file_rev_handler_t handler,
1914 void *handler_baton,
1915 apr_pool_t *pool);
1918 * Return the plugin's version information.
1920 * @since New in 1.1.
1922 const svn_version_t *(*get_version)(void);
1925 } svn_ra_plugin_t;
1928 * All "ra_FOO" implementations *must* export a function named
1929 * svn_ra_FOO_init() of type @c svn_ra_init_func_t.
1931 * When called by libsvn_client, this routine adds an entry (or
1932 * entries) to the hash table for any URL schemes it handles. The hash
1933 * value must be of type (<tt>@c svn_ra_plugin_t *</tt>). @a pool is a
1934 * pool for allocating configuration / one-time data.
1936 * This type is defined to use the "C Calling Conventions" to ensure that
1937 * abi_version is the first parameter. The RA plugin must check that value
1938 * before accessing the other parameters.
1940 * ### need to force this to be __cdecl on Windows... how??
1942 * @deprecated Provided for backward compatibility with the 1.1 API.
1944 typedef svn_error_t *(*svn_ra_init_func_t)(int abi_version,
1945 apr_pool_t *pool,
1946 apr_hash_t *hash);
1949 * The current ABI (Application Binary Interface) version for the
1950 * RA plugin model. This version number will change when the ABI
1951 * between the SVN core (e.g. libsvn_client) and the RA plugin changes.
1953 * An RA plugin should verify that the passed version number is acceptable
1954 * before accessing the rest of the parameters, and before returning any
1955 * information.
1957 * It is entirely acceptable for an RA plugin to accept multiple ABI
1958 * versions. It can simply interpret the parameters based on the version,
1959 * and it can return different plugin structures.
1962 * <pre>
1963 * VSN DATE REASON FOR CHANGE
1964 * --- ---------- ------------------------------------------------
1965 * 1 2001-02-17 Initial revision.
1966 * 2 2004-06-29 Preparing for svn 1.1, which adds new RA vtable funcs.
1967 * 2005-01-19 Rework the plugin interface and don't provide the vtable
1968 * to the client. Separate ABI versions are no longer used.
1969 * </pre>
1971 * @deprecated Provided for backward compatibility with the 1.0 API.
1973 #define SVN_RA_ABI_VERSION 2
1975 /* Public RA implementations. */
1977 /** Initialize libsvn_ra_neon.
1979 * @deprecated Provided for backward compatibility with the 1.1 API. */
1980 svn_error_t * svn_ra_dav_init(int abi_version,
1981 apr_pool_t *pool,
1982 apr_hash_t *hash);
1984 /** Initialize libsvn_ra_local.
1986 * @deprecated Provided for backward compatibility with the 1.1 API. */
1987 svn_error_t * svn_ra_local_init(int abi_version,
1988 apr_pool_t *pool,
1989 apr_hash_t *hash);
1991 /** Initialize libsvn_ra_svn.
1993 * @deprecated Provided for backward compatibility with the 1.1 API. */
1994 svn_error_t * svn_ra_svn_init(int abi_version,
1995 apr_pool_t *pool,
1996 apr_hash_t *hash);
1998 /** Initialize libsvn_ra_serf.
2000 * @since New in 1.4.
2001 * @deprecated Provided for backward compatibility with the 1.1 API. */
2002 svn_error_t * svn_ra_serf_init(int abi_version,
2003 apr_pool_t *pool,
2004 apr_hash_t *hash);
2008 * Initialize the compatibility wrapper, using @a pool for any allocations.
2009 * The caller must hold on to @a ra_baton as long as the RA library is used.
2011 * @deprecated Provided for backward compatibility with the 1.1 API.
2013 svn_error_t *svn_ra_init_ra_libs(void **ra_baton, apr_pool_t *pool);
2016 * Return an RA vtable-@a library which can handle URL. A number of
2017 * svn_client_* routines will call this internally, but client apps might
2018 * use it too. $a ra_baton is a baton obtained by a call to
2019 * svn_ra_init_ra_libs().
2021 * @deprecated Provided for backward compatibility with the 1.1 API.
2023 svn_error_t *svn_ra_get_ra_library(svn_ra_plugin_t **library,
2024 void *ra_baton,
2025 const char *url,
2026 apr_pool_t *pool);
2028 #ifdef __cplusplus
2030 #endif /* __cplusplus */
2032 #endif /* SVN_RA_H */