3 * ====================================================================
4 * Copyright (c) 2000-2008 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 * ====================================================================
19 * @brief Repository Access
28 #include <apr_pools.h>
29 #include <apr_tables.h>
31 #include "svn_error.h"
32 #include "svn_delta.h"
34 #include "svn_mergeinfo.h"
38 #endif /* __cplusplus */
42 /* Misc. declarations */
45 * Get libsvn_ra version information.
49 const svn_version_t
*svn_ra_version(void);
52 /** This is a function type which allows the RA layer to fetch working
53 * copy (WC) properties.
55 * The @a baton is provided along with the function pointer and should
56 * be passed back in. This will be the @a callback_baton or the
57 * @a close_baton as appropriate.
59 * @a path is relative to the "root" of the session, defined by the
60 * @a repos_URL passed to svn_ra_open3() vtable call.
62 * @a name is the name of the property to fetch. If the property is present,
63 * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
65 typedef svn_error_t
*(*svn_ra_get_wc_prop_func_t
)(void *baton
,
68 const svn_string_t
**value
,
71 /** This is a function type which allows the RA layer to store new
72 * working copy properties during update-like operations. See the
73 * comments for @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and
74 * @a name. The @a value is the value that will be stored for the property;
75 * a NULL @a value means the property will be deleted.
77 typedef svn_error_t
*(*svn_ra_set_wc_prop_func_t
)(void *baton
,
80 const svn_string_t
*value
,
83 /** This is a function type which allows the RA layer to store new
84 * working copy properties as part of a commit. See the comments for
85 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
86 * The @a value is the value that will be stored for the property; a
87 * @c NULL @a value means the property will be deleted.
89 * Note that this might not actually store the new property before
90 * returning, but instead schedule it to be changed as part of
91 * post-commit processing (in which case a successful commit means the
92 * properties got written). Thus, during the commit, it is possible
93 * to invoke this function to set a new value for a wc prop, then read
94 * the wc prop back from the working copy and get the *old* value.
97 typedef svn_error_t
*(*svn_ra_push_wc_prop_func_t
)(void *baton
,
100 const svn_string_t
*value
,
103 /** This is a function type which allows the RA layer to invalidate
104 * (i.e., remove) wcprops recursively. See the documentation for
105 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
107 * Unlike @c svn_ra_push_wc_prop_func_t, this has immediate effect. If
108 * it returns success, the wcprops have been removed.
110 typedef svn_error_t
*(*svn_ra_invalidate_wc_props_func_t
)(void *baton
,
116 /** A function type for retrieving the youngest revision from a repos. */
117 typedef svn_error_t
*(*svn_ra_get_latest_revnum_func_t
)
118 (void *session_baton
,
119 svn_revnum_t
*latest_revnum
);
121 /** A function type which allows the RA layer to ask about any
122 * customizations to the client name string. This is primarily used
123 * by HTTP-based RA layers wishing to extend the string reported to
124 * Apache/mod_dav_svn via the User-agent HTTP header.
126 typedef svn_error_t
*(*svn_ra_get_client_string_func_t
)(void *baton
,
132 * A callback function type for use in @c get_file_revs.
133 * @a baton is provided by the caller, @a path is the pathname of the file
134 * in revision @a rev and @a rev_props are the revision properties.
135 * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a
136 * handler/baton which will be called with the delta between the previous
137 * revision and this one after the return of this callback. They may be
139 * @a prop_diffs is an array of svn_prop_t elements indicating the property
140 * delta for this and the previous revision.
141 * @a pool may be used for temporary allocations, but you can't rely
142 * on objects allocated to live outside of this particular call and the
143 * immediately following calls to @a *delta_handler, if any.
147 typedef svn_error_t
*(*svn_ra_file_rev_handler_t
)
151 apr_hash_t
*rev_props
,
152 svn_txdelta_window_handler_t
*delta_handler
,
154 apr_array_header_t
*prop_diffs
,
158 * Callback function type for locking and unlocking actions.
162 * @a do_lock is TRUE when locking @a path, and FALSE
165 * @a lock is a lock for @a path or NULL if @a do_lock is FALSE or @a ra_err is
168 * @a ra_err is NULL unless the ra layer encounters a locking related
169 * error which it passes back for notification purposes. The caller
170 * is responsible for clearing @a ra_err after the callback is run.
172 * @a baton is a closure object; it should be provided by the
173 * implementation, and passed by the caller. @a pool may be used for
174 * temporary allocation.
176 typedef svn_error_t
*(*svn_ra_lock_callback_t
)(void *baton
,
178 svn_boolean_t do_lock
,
179 const svn_lock_t
*lock
,
184 * Callback function type for progress notification.
186 * @a progress is the number of bytes already transferred, @a total is
187 * the total number of bytes to transfer or -1 if it's not known, @a
188 * baton is the callback baton.
192 typedef void (*svn_ra_progress_notify_func_t
)(apr_off_t progress
,
198 * Callback function type for replay_range actions.
200 * This callback function should provide replay_range with an editor which
201 * will be driven with the received replay reports from the master repository.
203 * @a revision is the target revision number of the received replay report.
205 * @a editor and @a edit_baton should provided by the callback implementation.
207 * @a replay_baton is the baton as originally passed to replay_range.
209 * @a revprops contains key/value pairs for each revision properties for this
214 typedef svn_error_t
*(*svn_ra_replay_revstart_callback_t
)
215 (svn_revnum_t revision
,
217 const svn_delta_editor_t
**editor
,
219 apr_hash_t
*rev_props
,
223 * Callback function type for replay_range actions.
225 * This callback function should close the editor.
227 * @a revision is the target revision number of the received replay report.
229 * @a editor and @a edit_baton should provided by the callback implementation.
231 * @a replay_baton is the baton as originally passed to replay_range.
233 * @a revprops contains key/value pairs for each revision properties for this
238 typedef svn_error_t
*(*svn_ra_replay_revfinish_callback_t
)
239 (svn_revnum_t revision
,
241 const svn_delta_editor_t
*editor
,
243 apr_hash_t
*rev_props
,
248 * The update Reporter.
250 * A vtable structure which allows a working copy to describe a subset
251 * (or possibly all) of its working-copy to an RA layer, for the
252 * purposes of an update, switch, status, or diff operation.
254 * Paths for report calls are relative to the target (not the anchor)
255 * of the operation. Report calls must be made in depth-first order:
256 * parents before children, all children of a parent before any
257 * siblings of the parent. The first report call must be a set_path
258 * with a @a path argument of "" and a valid revision. (If the target
259 * of the operation is locally deleted or missing, use the anchor's
260 * revision.) If the target of the operation is deleted or switched
261 * relative to the anchor, follow up the initial set_path call with a
262 * link_path or delete_path call with a @a path argument of "" to
263 * indicate that. In no other case may there be two report
264 * descriptions for the same path. If the target of the operation is
265 * a locally added file or directory (which previously did not exist),
266 * it may be reported as having revision 0 or as having the parent
267 * directory's revision.
271 typedef struct svn_ra_reporter3_t
273 /** Describe a working copy @a path as being at a particular
274 * @a revision and having depth @a depth.
276 * @a revision may be SVN_INVALID_REVNUM if (for example) @a path
277 * represents a locally-added path with no revision number, or @a
278 * depth is @c svn_depth_exclude.
280 * @a path may not be underneath a path on which set_path() was
281 * previously called with @c svn_depth_exclude in this report.
283 * If @a start_empty is set and @a path is a directory, the
284 * implementor should assume the directory has no entries or props.
286 * This will *override* any previous set_path() calls made on parent
287 * paths. @a path is relative to the URL specified in svn_ra_open3().
289 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
291 * All temporary allocations are done in @a pool.
293 svn_error_t
*(*set_path
)(void *report_baton
,
295 svn_revnum_t revision
,
297 svn_boolean_t start_empty
,
298 const char *lock_token
,
301 /** Describing a working copy @a path as missing.
303 * @a path may not be underneath a path on which set_path() was
304 * previously called with @c svn_depth_exclude in this report.
306 * All temporary allocations are done in @a pool.
308 svn_error_t
*(*delete_path
)(void *report_baton
,
312 /** Like set_path(), but differs in that @a path in the working copy
313 * (relative to the root of the report driver) isn't a reflection of
314 * @a path in the repository (relative to the URL specified when
315 * opening the RA layer), but is instead a reflection of a different
316 * repository @a url at @a revision, and has depth @a depth.
318 * @a path may not be underneath a path on which set_path() was
319 * previously called with @c svn_depth_exclude in this report.
321 * If @a start_empty is set and @a path is a directory,
322 * the implementor should assume the directory has no entries or props.
324 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
326 * All temporary allocations are done in @a pool.
328 svn_error_t
*(*link_path
)(void *report_baton
,
331 svn_revnum_t revision
,
333 svn_boolean_t start_empty
,
334 const char *lock_token
,
337 /** WC calls this when the state report is finished; any directories
338 * or files not explicitly `set' are assumed to be at the
339 * baseline revision originally passed into do_update(). No other
340 * reporting functions, including abort_report, should be called after
341 * calling this function.
343 svn_error_t
*(*finish_report
)(void *report_baton
,
346 /** If an error occurs during a report, this routine should cause the
347 * filesystem transaction to be aborted & cleaned up. No other reporting
348 * functions should be called after calling this function.
350 svn_error_t
*(*abort_report
)(void *report_baton
,
353 } svn_ra_reporter3_t
;
356 * Similar to @c svn_ra_reporter3_t, but without support for depths.
358 * @deprecated Provided for backward compatibility with the 1.4 API.
360 typedef struct svn_ra_reporter2_t
362 /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
363 * with @a depth always set to @c svn_depth_infinity. */
364 svn_error_t
*(*set_path
)(void *report_baton
,
366 svn_revnum_t revision
,
367 svn_boolean_t start_empty
,
368 const char *lock_token
,
371 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
372 svn_error_t
*(*delete_path
)(void *report_baton
,
376 /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
377 * with @a depth always set to @c svn_depth_infinity. */
378 svn_error_t
*(*link_path
)(void *report_baton
,
381 svn_revnum_t revision
,
382 svn_boolean_t start_empty
,
383 const char *lock_token
,
386 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
387 svn_error_t
*(*finish_report
)(void *report_baton
,
390 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
391 svn_error_t
*(*abort_report
)(void *report_baton
,
394 } svn_ra_reporter2_t
;
397 * Similar to @c svn_ra_reporter2_t, but without support for lock tokens.
399 * @deprecated Provided for backward compatibility with the 1.1 API.
401 typedef struct svn_ra_reporter_t
403 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
404 * with @a lock_token always set to NULL. */
405 svn_error_t
*(*set_path
)(void *report_baton
,
407 svn_revnum_t revision
,
408 svn_boolean_t start_empty
,
411 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
412 svn_error_t
*(*delete_path
)(void *report_baton
,
416 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
417 * with @a lock_token always set to NULL. */
418 svn_error_t
*(*link_path
)(void *report_baton
,
421 svn_revnum_t revision
,
422 svn_boolean_t start_empty
,
425 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
426 svn_error_t
*(*finish_report
)(void *report_baton
,
429 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
430 svn_error_t
*(*abort_report
)(void *report_baton
,
435 /** A collection of callbacks implemented by libsvn_client which allows
436 * an RA layer to "pull" information from the client application, or
437 * possibly store information. libsvn_client passes this vtable to
440 * Each routine takes a @a callback_baton originally provided with the
443 * Clients must use svn_ra_create_callbacks() to allocate and
444 * initialize this structure.
448 typedef struct svn_ra_callbacks2_t
450 /** Open a unique temporary file for writing in the working copy.
451 * This file will be automatically deleted when @a fp is closed.
453 svn_error_t
*(*open_tmp_file
)(apr_file_t
**fp
,
454 void *callback_baton
,
457 /** An authentication baton, created by the application, which is
458 * capable of retrieving all known types of credentials.
460 svn_auth_baton_t
*auth_baton
;
462 /*** The following items may be set to NULL to disallow the RA layer
463 to perform the respective operations of the vtable functions.
464 Perhaps WC props are not defined or are in invalid for this
465 session, or perhaps the commit operation this RA session will
466 perform is a server-side only one that shouldn't do post-commit
467 processing on a working copy path. ***/
469 /** Fetch working copy properties.
471 *<pre> ### we might have a problem if the RA layer ever wants a property
472 * ### that corresponds to a different revision of the file than
473 * ### what is in the WC. we'll cross that bridge one day...</pre>
475 svn_ra_get_wc_prop_func_t get_wc_prop
;
477 /** Immediately set new values for working copy properties. */
478 svn_ra_set_wc_prop_func_t set_wc_prop
;
480 /** Schedule new values for working copy properties. */
481 svn_ra_push_wc_prop_func_t push_wc_prop
;
483 /** Invalidate working copy properties. */
484 svn_ra_invalidate_wc_props_func_t invalidate_wc_props
;
486 /** Notification callback used for progress information.
487 * May be NULL if not used.
489 svn_ra_progress_notify_func_t progress_func
;
491 /** Notification callback baton, used with progress_func. */
492 void *progress_baton
;
494 /** Cancelation function
496 * As its baton, the general callback baton is used
500 svn_cancel_func_t cancel_func
;
502 /** Client string customization callback function
505 svn_ra_get_client_string_func_t get_client_string
;
507 } svn_ra_callbacks2_t
;
509 /** Similar to svn_ra_callbacks2_t, except that the progress
510 * notification function and baton is missing.
512 * @deprecated Provided for backward compatibility with the 1.2 API.
514 typedef struct svn_ra_callbacks_t
516 svn_error_t
*(*open_tmp_file
)(apr_file_t
**fp
,
517 void *callback_baton
,
520 svn_auth_baton_t
*auth_baton
;
522 svn_ra_get_wc_prop_func_t get_wc_prop
;
524 svn_ra_set_wc_prop_func_t set_wc_prop
;
526 svn_ra_push_wc_prop_func_t push_wc_prop
;
528 svn_ra_invalidate_wc_props_func_t invalidate_wc_props
;
530 } svn_ra_callbacks_t
;
534 /*----------------------------------------------------------------------*/
536 /* Public Interfaces. */
539 * Initialize the RA library. This function must be called before using
540 * any function in this header, except the deprecated APIs based on
541 * @c svn_ra_plugin_t, or svn_ra_version(). This function must not be called
542 * simultaneously in multiple threads. @a pool must live
543 * longer than any open RA sessions.
548 svn_ra_initialize(apr_pool_t
*pool
);
550 /** Initialize a callback structure.
551 * Set @a *callbacks to a ra callbacks object, allocated in @a pool.
553 * Clients must use this function to allocate and initialize @c
554 * svn_ra_callbacks2_t structures.
559 svn_ra_create_callbacks(svn_ra_callbacks2_t
**callbacks
,
563 * A repository access session. This object is used to perform requests
564 * to a repository, identified by an URL.
568 typedef struct svn_ra_session_t svn_ra_session_t
;
571 * Open a repository session to @a repos_URL. Return an opaque object
572 * representing this session in @a *session_p, allocated in @a pool.
574 * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal
575 * to the UUID of the repository at @c repos_URL.
577 * @a callbacks/@a callback_baton is a table of callbacks provided by the
578 * client; see @c svn_ra_callbacks2_t.
580 * @a config is a hash mapping <tt>const char *</tt> keys to
581 * @c svn_config_t * values. For example, the @c svn_config_t for the
582 * "~/.subversion/config" file is under the key "config".
584 * All RA requests require a session; they will continue to
585 * use @a pool for memory allocation.
587 * @see svn_client_open_ra_session().
592 svn_ra_open3(svn_ra_session_t
**session_p
,
593 const char *repos_URL
,
595 const svn_ra_callbacks2_t
*callbacks
,
596 void *callback_baton
,
601 * Similiar to svn_ra_open3(), but with @a uuid set to @c NULL.
604 * @deprecated Provided for backward compatibility with the 1.4 API.
607 svn_ra_open2(svn_ra_session_t
**session_p
,
608 const char *repos_URL
,
609 const svn_ra_callbacks2_t
*callbacks
,
610 void *callback_baton
,
615 * @see svn_ra_open2().
617 * @deprecated Provided for backward compatibility with the 1.2 API.
620 svn_ra_open(svn_ra_session_t
**session_p
,
621 const char *repos_URL
,
622 const svn_ra_callbacks_t
*callbacks
,
623 void *callback_baton
,
627 /** Change the root URL of an open @a ra_session to point to a new path in the
628 * same repository. @a url is the new root URL. Use @a pool for
629 * temporary allocations.
631 * If @a url has a different repository root than the current session
632 * URL, return @c SVN_ERR_RA_ILLEGAL_URL.
637 svn_ra_reparent(svn_ra_session_t
*ra_session
,
641 /** Set @a *url to the repository URL to which @a ra_session was
642 * opened or most recently reparented.
645 svn_ra_get_session_url(svn_ra_session_t
*ra_session
,
651 * Get the latest revision number from the repository of @a session.
653 * Use @a pool for memory allocation.
658 svn_ra_get_latest_revnum(svn_ra_session_t
*session
,
659 svn_revnum_t
*latest_revnum
,
663 * Get the latest revision number at time @a tm in the repository of
666 * Use @a pool for memory allocation.
671 svn_ra_get_dated_revision(svn_ra_session_t
*session
,
672 svn_revnum_t
*revision
,
677 * Set the property @a name to @a value on revision @a rev in the repository
680 * If @a value is @c NULL, delete the named revision property.
682 * Please note that properties attached to revisions are @em unversioned.
684 * Use @a pool for memory allocation.
689 svn_ra_change_rev_prop(svn_ra_session_t
*session
,
692 const svn_string_t
*value
,
696 * Set @a *props to the list of unversioned properties attached to revision
697 * @a rev in the repository of @a session. The hash maps
698 * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values.
700 * Use @a pool for memory allocation.
705 svn_ra_rev_proplist(svn_ra_session_t
*session
,
711 * Set @a *value to the value of unversioned property @a name attached to
712 * revision @a rev in the repository of @a session. If @a rev has no
713 * property by that name, set @a *value to @c NULL.
715 * Use @a pool for memory allocation.
720 svn_ra_rev_prop(svn_ra_session_t
*session
,
723 svn_string_t
**value
,
727 * Set @a *editor and @a *edit_baton to an editor for committing
728 * changes to the repository of @a session, setting the revision
729 * properties from @a revprop_table. The revisions being committed
730 * against are passed to the editor functions, starting with the rev
731 * argument to @c open_root. The path root of the commit is the @a
734 * @a revprop_table is a hash mapping <tt>const char *</tt> property
735 * names to @c svn_string_t property values. The commit log message
736 * is expected to be in the @c SVN_PROP_REVISION_LOG element. @a
737 * revprop_table can not contain either of @c SVN_PROP_REVISION_DATE
738 * or @c SVN_PROP_REVISION_AUTHOR.
740 * Before @c close_edit returns, but after the commit has succeeded,
741 * it will invoke @a callback with the new revision number, the
742 * commit date (as a <tt>const char *</tt>), commit author (as a
743 * <tt>const char *</tt>), and @a callback_baton as arguments. If
744 * @a callback returns an error, that error will be returned from @c
745 * close_edit, otherwise @c close_edit will return successfully
746 * (unless it encountered an error before invoking @a callback).
748 * The callback will not be called if the commit was a no-op
749 * (i.e. nothing was committed);
751 * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char
752 * *</tt> paths (relative to the URL of @a session) to <tt>
753 * const char *</tt> lock tokens. The server checks that the
754 * correct token is provided for each committed, locked path. @a lock_tokens
755 * must live during the whole commit operation.
757 * If @a keep_locks is @c TRUE, then do not release locks on
758 * committed objects. Else, automatically release such locks.
760 * The caller may not perform any RA operations using @a session before
761 * finishing the edit.
763 * Use @a pool for memory allocation.
768 svn_ra_get_commit_editor3(svn_ra_session_t
*session
,
769 const svn_delta_editor_t
**editor
,
771 apr_hash_t
*revprop_table
,
772 svn_commit_callback2_t callback
,
773 void *callback_baton
,
774 apr_hash_t
*lock_tokens
,
775 svn_boolean_t keep_locks
,
779 * Same as svn_ra_get_commit_editor3(), but with @c revprop_table set
780 * to a hash containing the @c SVN_PROP_REVISION_LOG property set
781 * to the value of @a log_msg.
785 * @deprecated Provided for backward compatibility with the 1.4 API.
788 svn_ra_get_commit_editor2(svn_ra_session_t
*session
,
789 const svn_delta_editor_t
**editor
,
792 svn_commit_callback2_t callback
,
793 void *callback_baton
,
794 apr_hash_t
*lock_tokens
,
795 svn_boolean_t keep_locks
,
799 * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t.
803 * @deprecated Provided for backward compatibility with the 1.3 API.
806 svn_ra_get_commit_editor(svn_ra_session_t
*session
,
807 const svn_delta_editor_t
**editor
,
810 svn_commit_callback_t callback
,
811 void *callback_baton
,
812 apr_hash_t
*lock_tokens
,
813 svn_boolean_t keep_locks
,
817 * Fetch the contents and properties of file @a path at @a revision.
818 * @a revision may be SVN_INVALID_REVNUM, indicating that the HEAD
819 * revision should be used. Interpret @a path relative to the URL in
820 * @a session. Use @a pool for all allocations.
822 * If @a revision is @c SVN_INVALID_REVNUM and @a fetched_rev is not
823 * @c NULL, then set @a *fetched_rev to the actual revision that was
826 * If @a stream is non @c NULL, push the contents of the file at @a
827 * stream, do not call svn_stream_close() when finished.
829 * If @a props is non @c NULL, set @a *props to contain the properties of
830 * the file. This means @em all properties: not just ones controlled by
831 * the user and stored in the repository fs, but non-tweakable ones
832 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
833 * etc.) The keys are <tt>const char *</tt>, values are
834 * <tt>@c svn_string_t *</tt>.
836 * The stream handlers for @a stream may not perform any RA
837 * operations using @a session.
842 svn_ra_get_file(svn_ra_session_t
*session
,
844 svn_revnum_t revision
,
845 svn_stream_t
*stream
,
846 svn_revnum_t
*fetched_rev
,
851 * If @a dirents is non @c NULL, set @a *dirents to contain all the entries
852 * of directory @a path at @a revision. The keys of @a dirents will be
853 * entry names (<tt>const char *</tt>), and the values dirents
854 * (<tt>@c svn_dirent_t *</tt>). Use @a pool for all allocations.
856 * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt>
857 * objects are filled in. To have them completely filled in just pass
858 * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_
859 * fields you would like to have returned to you.
861 * @a path is interpreted relative to the URL in @a session.
863 * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
864 * @a *fetched_rev is not @c NULL, then this function will set
865 * @a *fetched_rev to the actual revision that was retrieved. (Some
866 * callers want to know, and some don't.)
868 * If @a props is non @c NULL, set @a *props to contain the properties of
869 * the directory. This means @em all properties: not just ones controlled by
870 * the user and stored in the repository fs, but non-tweakable ones
871 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
872 * etc.) The keys are <tt>const char *</tt>, values are
873 * <tt>@c svn_string_t *</tt>.
878 svn_ra_get_dir2(svn_ra_session_t
*session
,
879 apr_hash_t
**dirents
,
880 svn_revnum_t
*fetched_rev
,
883 svn_revnum_t revision
,
884 apr_uint32_t dirent_fields
,
888 * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the
889 * @a dirent_fields parameter.
893 * @deprecated Provided for compatibility with the 1.3 API.
896 svn_ra_get_dir(svn_ra_session_t
*session
,
898 svn_revnum_t revision
,
899 apr_hash_t
**dirents
,
900 svn_revnum_t
*fetched_rev
,
905 * Set @a *catalog to a mergeinfo catalog for the paths in @a paths.
906 * If no mergeinfo is available, set @a *catalog to @c NULL. The
907 * requested mergeinfo hashes are for @a paths (which are relative to
908 * @a session's URL) in @a revision. If one of the paths does not exist
909 * in that revision, return SVN_ERR_FS_NOT_FOUND.
911 * @a inherit indicates whether explicit, explicit or inherited, or
912 * only inherited mergeinfo for @a paths is retrieved.
914 * If @a include_descendants is TRUE, then additionally return the
915 * mergeinfo for any descendant of any element of @a paths which has
916 * the @c SVN_PROP_MERGEINFO property explicitly set on it. (Note
917 * that inheritance is only taken into account for the elements in @a
918 * paths; descendants of the elements in @a paths which get their
919 * mergeinfo via inheritance are not included in @a *catalog.)
921 * Allocate the returned values in @a pool.
923 * If @a revision is @c SVN_INVALID_REVNUM, it defaults to youngest.
925 * If the server doesn't support retrieval of mergeinfo (which can
926 * happen even for file:// URLs, if the repository itself hasn't been
927 * upgraded), return @c SVN_ERR_UNSUPPORTED_FEATURE in preference to
928 * any other error that might otherwise be returned.
933 svn_ra_get_mergeinfo(svn_ra_session_t
*session
,
934 svn_mergeinfo_catalog_t
*catalog
,
935 const apr_array_header_t
*paths
,
936 svn_revnum_t revision
,
937 svn_mergeinfo_inheritance_t inherit
,
938 svn_boolean_t include_descendants
,
942 * Ask the RA layer to update a working copy.
944 * The client initially provides an @a update_editor/@a update_baton to the
945 * RA layer; this editor contains knowledge of where the change will
946 * begin in the working copy (when @c open_root() is called).
948 * In return, the client receives a @a reporter/@a report_baton. The
949 * client then describes its working copy by making calls into the
952 * When finished, the client calls @a reporter->finish_report(). The
953 * RA layer then does a complete drive of @a update_editor, ending with
954 * @a update_editor->close_edit(), to update the working copy.
956 * @a update_target is an optional single path component to restrict
957 * the scope of the update to just that entry (in the directory
958 * represented by the @a session's URL). If @a update_target is the
959 * empty string, the entire directory is updated.
961 * Update the target only as deeply as @a depth indicates.
963 * If @a send_copyfrom_args is TRUE, then ask the server to send
964 * copyfrom arguments to add_file() and add_directory() when possible.
965 * (Note: this means that any subsequent txdeltas coming from the
966 * server are presumed to apply against the copied file!)
968 * The working copy will be updated to @a revision_to_update_to, or the
969 * "latest" revision if this arg is invalid.
971 * The caller may not perform any RA operations using @a session before
972 * finishing the report, and may not perform any RA operations using
973 * @a session from within the editing operations of @a update_editor.
975 * Use @a pool for memory allocation.
977 * @note The reporter provided by this function does NOT supply copy-
978 * from information to the diff editor callbacks.
980 * @note In order to prevent pre-1.5 servers from doing more work than
981 * needed, and sending too much data back, a pre-1.5 'recurse'
982 * directive may be sent to the server, based on @a depth.
987 svn_ra_do_update2(svn_ra_session_t
*session
,
988 const svn_ra_reporter3_t
**reporter
,
990 svn_revnum_t revision_to_update_to
,
991 const char *update_target
,
993 svn_boolean_t send_copyfrom_args
,
994 const svn_delta_editor_t
*update_editor
,
999 * Similar to svn_ra_do_update2(), but taking @c svn_ra_reporter2_t
1000 * instead of @c svn_ra_reporter3_t. If @a recurse is TRUE, pass
1001 * @c svn_depth_infinity for @a depth, else pass @c svn_depth_files.
1003 * @deprecated Provided for compatibility with the 1.4 API.
1006 svn_ra_do_update(svn_ra_session_t
*session
,
1007 const svn_ra_reporter2_t
**reporter
,
1008 void **report_baton
,
1009 svn_revnum_t revision_to_update_to
,
1010 const char *update_target
,
1011 svn_boolean_t recurse
,
1012 const svn_delta_editor_t
*update_editor
,
1018 * Ask the RA layer to 'switch' a working copy to a new
1019 * @a switch_url; it's another form of svn_ra_do_update().
1021 * The client initially provides a @a switch_editor/@a switch_baton to the RA
1022 * layer; this editor contains knowledge of where the change will
1023 * begin in the working copy (when open_root() is called).
1025 * In return, the client receives a @a reporter/@a report_baton. The
1026 * client then describes its working copy by making calls into the
1029 * When finished, the client calls @a reporter->finish_report(). The
1030 * RA layer then does a complete drive of @a switch_editor, ending with
1031 * close_edit(), to switch the working copy.
1033 * @a switch_target is an optional single path component will restrict
1034 * the scope of things affected by the switch to an entry in the
1035 * directory represented by the @a session's URL, or empty if the
1036 * entire directory is meant to be switched.
1038 * Switch the target only as deeply as @a depth indicates.
1040 * The working copy will be switched to @a revision_to_switch_to, or the
1041 * "latest" revision if this arg is invalid.
1043 * The caller may not perform any RA operations using
1044 * @a session before finishing the report, and may not perform
1045 * any RA operations using @a session from within the editing
1046 * operations of @a switch_editor.
1048 * Use @a pool for memory allocation.
1050 * @note The reporter provided by this function does NOT supply copy-
1051 * from information to the diff editor callbacks.
1053 * @note In order to prevent pre-1.5 servers from doing more work than
1054 * needed, and sending too much data back, a pre-1.5 'recurse'
1055 * directive may be sent to the server, based on @a depth.
1057 * @since New in 1.5.
1060 svn_ra_do_switch2(svn_ra_session_t
*session
,
1061 const svn_ra_reporter3_t
**reporter
,
1062 void **report_baton
,
1063 svn_revnum_t revision_to_switch_to
,
1064 const char *switch_target
,
1066 const char *switch_url
,
1067 const svn_delta_editor_t
*switch_editor
,
1072 * Similar to svn_ra_do_switch2(), but taking @c svn_ra_reporter2_t
1073 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1074 * @c svn_depth_infinity for depths. The switch itself is performed
1075 * according to @a recurse: if TRUE, then use @c svn_depth_infinity
1076 * for @a depth, else use @c svn_depth_files.
1078 * @deprecated Provided for compatibility with the 1.4 API.
1081 svn_ra_do_switch(svn_ra_session_t
*session
,
1082 const svn_ra_reporter2_t
**reporter
,
1083 void **report_baton
,
1084 svn_revnum_t revision_to_switch_to
,
1085 const char *switch_target
,
1086 svn_boolean_t recurse
,
1087 const char *switch_url
,
1088 const svn_delta_editor_t
*switch_editor
,
1093 * Ask the RA layer to describe the status of a working copy with respect
1094 * to @a revision of the repository (or HEAD, if @a revision is invalid).
1096 * The client initially provides a @a status_editor/@a status_baton to the RA
1097 * layer; this editor contains knowledge of where the change will
1098 * begin in the working copy (when open_root() is called).
1100 * In return, the client receives a @a reporter/@a report_baton. The
1101 * client then describes its working copy by making calls into the
1104 * When finished, the client calls @a reporter->finish_report(). The RA
1105 * layer then does a complete drive of @a status_editor, ending with
1106 * close_edit(), to report, essentially, what would be modified in
1107 * the working copy were the client to call do_update().
1108 * @a status_target is an optional single path component will restrict
1109 * the scope of the status report to an entry in the directory
1110 * represented by the @a session's URL, or empty if the entire directory
1111 * is meant to be examined.
1113 * Get status only as deeply as @a depth indicates.
1115 * The caller may not perform any RA operations using @a session
1116 * before finishing the report, and may not perform any RA operations
1117 * using @a session from within the editing operations of @a status_editor.
1119 * Use @a pool for memory allocation.
1121 * @note The reporter provided by this function does NOT supply copy-
1122 * from information to the diff editor callbacks.
1124 * @note In order to prevent pre-1.5 servers from doing more work than
1125 * needed, and sending too much data back, a pre-1.5 'recurse'
1126 * directive may be sent to the server, based on @a depth.
1128 * @since New in 1.5.
1131 svn_ra_do_status2(svn_ra_session_t
*session
,
1132 const svn_ra_reporter3_t
**reporter
,
1133 void **report_baton
,
1134 const char *status_target
,
1135 svn_revnum_t revision
,
1137 const svn_delta_editor_t
*status_editor
,
1143 * Similar to svn_ra_do_status2(), but taking @c svn_ra_reporter2_t
1144 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1145 * @c svn_depth_infinity for depths. The status operation itself is
1146 * performed according to @a recurse: if TRUE, then @a depth is
1147 * @c svn_depth_infinity, else it is @c svn_depth_immediates.
1149 * @deprecated Provided for compatibility with the 1.4 API.
1152 svn_ra_do_status(svn_ra_session_t
*session
,
1153 const svn_ra_reporter2_t
**reporter
,
1154 void **report_baton
,
1155 const char *status_target
,
1156 svn_revnum_t revision
,
1157 svn_boolean_t recurse
,
1158 const svn_delta_editor_t
*status_editor
,
1163 * Ask the RA layer to 'diff' a working copy against @a versus_url;
1164 * it's another form of svn_ra_do_update2().
1166 * @note This function cannot be used to diff a single file, only a
1167 * working copy directory. See the svn_ra_do_switch2() function
1170 * The client initially provides a @a diff_editor/@a diff_baton to the RA
1171 * layer; this editor contains knowledge of where the common diff
1172 * root is in the working copy (when open_root() is called).
1174 * In return, the client receives a @a reporter/@a report_baton. The
1175 * client then describes its working copy by making calls into the
1178 * When finished, the client calls @a reporter->finish_report(). The
1179 * RA layer then does a complete drive of @a diff_editor, ending with
1180 * close_edit(), to transmit the diff.
1182 * @a diff_target is an optional single path component will restrict
1183 * the scope of the diff to an entry in the directory represented by
1184 * the @a session's URL, or empty if the entire directory is meant to be
1185 * one of the diff paths.
1187 * The working copy will be diffed against @a versus_url as it exists
1188 * in revision @a revision, or as it is in head if @a revision is
1189 * @c SVN_INVALID_REVNUM.
1191 * Use @a ignore_ancestry to control whether or not items being
1192 * diffed will be checked for relatedness first. Unrelated items
1193 * are typically transmitted to the editor as a deletion of one thing
1194 * and the addition of another, but if this flag is @c TRUE,
1195 * unrelated items will be diffed as if they were related.
1197 * Diff only as deeply as @a depth indicates.
1199 * The caller may not perform any RA operations using @a session before
1200 * finishing the report, and may not perform any RA operations using
1201 * @a session from within the editing operations of @a diff_editor.
1203 * @a text_deltas instructs the driver of the @a diff_editor to enable
1204 * the generation of text deltas. If @a text_deltas is FALSE the window
1205 * handler returned by apply_textdelta will be called once with a NULL
1206 * @c svn_txdelta_window_t pointer.
1208 * Use @a pool for memory allocation.
1210 * @note The reporter provided by this function does NOT supply copy-
1211 * from information to the diff editor callbacks.
1213 * @note In order to prevent pre-1.5 servers from doing more work than
1214 * needed, and sending too much data back, a pre-1.5 'recurse'
1215 * directive may be sent to the server, based on @a depth.
1217 * @since New in 1.5.
1220 svn_ra_do_diff3(svn_ra_session_t
*session
,
1221 const svn_ra_reporter3_t
**reporter
,
1222 void **report_baton
,
1223 svn_revnum_t revision
,
1224 const char *diff_target
,
1226 svn_boolean_t ignore_ancestry
,
1227 svn_boolean_t text_deltas
,
1228 const char *versus_url
,
1229 const svn_delta_editor_t
*diff_editor
,
1234 * Similar to svn_ra_do_diff3(), but taking @c svn_ra_reporter2_t
1235 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1236 * @c svn_depth_infinity for depths. Perform the diff according to
1237 * @a recurse: if TRUE, then @a depth is @c svn_depth_infinity, else
1238 * it is @c svn_depth_files.
1240 * @deprecated Provided for compatibility with the 1.4 API.
1243 svn_ra_do_diff2(svn_ra_session_t
*session
,
1244 const svn_ra_reporter2_t
**reporter
,
1245 void **report_baton
,
1246 svn_revnum_t revision
,
1247 const char *diff_target
,
1248 svn_boolean_t recurse
,
1249 svn_boolean_t ignore_ancestry
,
1250 svn_boolean_t text_deltas
,
1251 const char *versus_url
,
1252 const svn_delta_editor_t
*diff_editor
,
1258 * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE.
1260 * @deprecated Provided for backward compatibility with the 1.3 API.
1263 svn_ra_do_diff(svn_ra_session_t
*session
,
1264 const svn_ra_reporter2_t
**reporter
,
1265 void **report_baton
,
1266 svn_revnum_t revision
,
1267 const char *diff_target
,
1268 svn_boolean_t recurse
,
1269 svn_boolean_t ignore_ancestry
,
1270 const char *versus_url
,
1271 const svn_delta_editor_t
*diff_editor
,
1276 * Invoke @a receiver with @a receiver_baton on each log message from
1277 * @a start to @a end. @a start may be greater or less than @a end;
1278 * this just controls whether the log messages are processed in descending
1279 * or ascending revision number order.
1281 * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
1283 * If @a paths is non-NULL and has one or more elements, then only show
1284 * revisions in which at least one of @a paths was changed (i.e., if
1285 * file, text or props changed; if dir, props changed or an entry
1286 * was added or deleted). Each path is an <tt>const char *</tt>, relative
1287 * to the @a session's common parent.
1289 * If @a limit is non-zero only invoke @a receiver on the first @a limit
1292 * If @a discover_changed_paths, then each call to receiver passes a
1293 * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument;
1294 * the hash's keys are all the paths committed in that revision.
1295 * Otherwise, each call to receiver passes NULL for @a changed_paths.
1297 * If @a strict_node_history is set, copy history will not be traversed
1298 * (if any exists) when harvesting the revision logs for each path.
1300 * If @a include_merged_revisions is set, log information for revisions
1301 * which have been merged to @a targets will also be returned.
1303 * If @a revprops is NULL, retrieve all revprops; else, retrieve only the
1304 * revprops named in the array (i.e. retrieve none if the array is empty).
1306 * If any invocation of @a receiver returns error, return that error
1307 * immediately and without wrapping it.
1309 * If @a start or @a end is a non-existent revision, return the error
1310 * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
1312 * See also the documentation for @c svn_log_message_receiver_t.
1314 * The caller may not invoke any RA operations using @a session from
1315 * within @a receiver.
1317 * Use @a pool for memory allocation.
1319 * @note Pre-1.5 servers do not support custom revprop retrieval; if @a
1320 * revprops is NULL or contains a revprop other than svn:author, svn:date,
1321 * or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned.
1323 * @since New in 1.5.
1327 svn_ra_get_log2(svn_ra_session_t
*session
,
1328 const apr_array_header_t
*paths
,
1332 svn_boolean_t discover_changed_paths
,
1333 svn_boolean_t strict_node_history
,
1334 svn_boolean_t include_merged_revisions
,
1335 const apr_array_header_t
*revprops
,
1336 svn_log_entry_receiver_t receiver
,
1337 void *receiver_baton
,
1341 * Similar to svn_ra_get_log2(), but uses @c svn_log_message_receiver_t
1342 * instead of @c svn_log_entry_receiver_t. Also, @a
1343 * include_merged_revisions is set to @c FALSE and @a revprops is
1344 * svn:author, svn:date, and svn:log.
1346 * @since New in 1.2.
1347 * @deprecated Provided for backward compatibility with the 1.4 API.
1350 svn_ra_get_log(svn_ra_session_t
*session
,
1351 const apr_array_header_t
*paths
,
1355 svn_boolean_t discover_changed_paths
,
1356 svn_boolean_t strict_node_history
,
1357 svn_log_message_receiver_t receiver
,
1358 void *receiver_baton
,
1362 * Set @a *kind to the node kind associated with @a path at @a revision.
1363 * If @a path does not exist under @a revision, set @a *kind to
1364 * @c svn_node_none. @a path is relative to the @a session's parent URL.
1366 * Use @a pool for memory allocation.
1368 * @since New in 1.2.
1371 svn_ra_check_path(svn_ra_session_t
*session
,
1373 svn_revnum_t revision
,
1374 svn_node_kind_t
*kind
,
1378 * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a
1379 * revision. @a path is relative to the @a session's parent's URL.
1380 * If @a path does not exist in @a revision, set @a *dirent to NULL.
1382 * Use @a pool for memory allocation.
1384 * @since New in 1.2.
1387 svn_ra_stat(svn_ra_session_t
*session
,
1389 svn_revnum_t revision
,
1390 svn_dirent_t
**dirent
,
1395 * Set @a *uuid to the repository's UUID, allocated in @a pool.
1397 * @since New in 1.5.
1400 svn_ra_get_uuid2(svn_ra_session_t
*session
,
1405 * Similar to svn_ra_get_uuid2(), but returns the value allocated in
1406 * @a session's pool.
1408 * @deprecated Provided for backward compatibility with the 1.4 API.
1409 * @since New in 1.2.
1412 svn_ra_get_uuid(svn_ra_session_t
*session
,
1417 * Set @a *url to the repository's root URL, allocated in @a pool.
1418 * The value will not include a trailing '/'. The returned URL is
1419 * guaranteed to be a prefix of the @a session's URL.
1421 * @since New in 1.5.
1424 svn_ra_get_repos_root2(svn_ra_session_t
*session
,
1430 * Similar to svn_ra_get_repos_root2(), but returns the value
1431 * allocated in @a session's pool.
1433 * @deprecated Provided for backward compatibility with the 1.4 API.
1434 * @since New in 1.2.
1437 svn_ra_get_repos_root(svn_ra_session_t
*session
,
1442 * Set @a *locations to the locations (at the repository revisions
1443 * @a location_revisions) of the file identified by @a path in
1444 * @a peg_revision. @a path is relative to the URL to which
1445 * @a session was opened. @a location_revisions is an array of
1446 * @c svn_revnum_t's. @a *locations will be a mapping from the revisions to
1447 * their appropriate absolute paths. If the file doesn't exist in a
1448 * location_revision, that revision will be ignored.
1450 * Use @a pool for all allocations.
1452 * @since New in 1.2.
1455 svn_ra_get_locations(svn_ra_session_t
*session
,
1456 apr_hash_t
**locations
,
1458 svn_revnum_t peg_revision
,
1459 apr_array_header_t
*location_revisions
,
1464 * Call @a receiver (with @a receiver_baton) for each segment in the
1465 * location history of @a path in @a peg_revision, working backwards in
1466 * time from @a start_rev to @a end_rev.
1468 * @a end_rev may be @c SVN_INVALID_REVNUM to indicate that you want
1469 * to trace the history of the object to its origin.
1471 * @a start_rev may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1472 * revision". Otherwise, @a start_rev must be younger than @a end_rev
1473 * (unless @a end_rev is @c SVN_INVALID_REVNUM).
1475 * @a peg_revision may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1476 * revision", and must evaluate to be at least as young as @a start_rev.
1478 * Use @a pool for all allocations.
1480 * @since New in 1.5.
1483 svn_ra_get_location_segments(svn_ra_session_t
*session
,
1485 svn_revnum_t peg_revision
,
1486 svn_revnum_t start_rev
,
1487 svn_revnum_t end_rev
,
1488 svn_location_segment_receiver_t receiver
,
1489 void *receiver_baton
,
1493 * Retrieve a subset of the interesting revisions of a file @a path
1494 * as seen in revision @a end (see svn_fs_history_prev() for a
1495 * definition of "interesting revisions"). Invoke @a handler with
1496 * @a handler_baton as its first argument for each such revision.
1497 * @a session is an open RA session. Use @a pool for all allocations.
1499 * If there is an interesting revision of the file that is less than or
1500 * equal to @a start, the iteration will begin at that revision.
1501 * Else, the iteration will begin at the first revision of the file in
1502 * the repository, which has to be less than or equal to @a end. Note
1503 * that if the function succeeds, @a handler will have been called at
1506 * In a series of calls to @a handler, the file contents for the first
1507 * interesting revision will be provided as a text delta against the
1508 * empty file. In the following calls, the delta will be against the
1509 * fulltext contents for the previous call.
1511 * If @a include_merged_revisions is TRUE, revisions which a included as a
1512 * result of a merge between @a start and @a end will be included.
1514 * @note This functionality is not available in pre-1.1 servers. If the
1515 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1518 * @since New in 1.5.
1521 svn_ra_get_file_revs2(svn_ra_session_t
*session
,
1525 svn_boolean_t include_merged_revisions
,
1526 svn_file_rev_handler_t handler
,
1527 void *handler_baton
,
1531 * Similiar to svn_ra_get_file_revs2(), but with @a include_merged_revisions
1534 * @since New in 1.2.
1535 * @deprecated Provided for backward compatibility with the 1.4 API.
1538 svn_ra_get_file_revs(svn_ra_session_t
*session
,
1542 svn_ra_file_rev_handler_t handler
,
1543 void *handler_baton
,
1547 * Lock each path in @a path_revs, which is a hash whose keys are the
1548 * paths to be locked, and whose values are the corresponding base
1549 * revisions for each path.
1551 * Note that locking is never anonymous, so any server implementing
1552 * this function will have to "pull" a username from the client, if
1553 * it hasn't done so already.
1555 * @a comment is optional: it's either an xml-escapable string
1556 * which describes the lock, or it is NULL.
1558 * If any path is already locked by a different user, then call @a
1559 * lock_func/@a lock_baton with an error. If @a steal_lock is TRUE,
1560 * then "steal" the existing lock(s) anyway, even if the RA username
1561 * does not match the current lock's owner. Delete any lock on the
1562 * path, and unconditionally create a new lock.
1564 * For each path, if its base revision (in @a path_revs) is a valid
1565 * revnum, then do an out-of-dateness check. If the revnum is less
1566 * than the last-changed-revision of any path (or if a path doesn't
1567 * exist in HEAD), call @a lock_func/@a lock_baton with an
1568 * SVN_ERR_RA_OUT_OF_DATE error.
1570 * After successfully locking a file, @a lock_func is called with the
1573 * Use @a pool for temporary allocations.
1575 * @since New in 1.2.
1578 svn_ra_lock(svn_ra_session_t
*session
,
1579 apr_hash_t
*path_revs
,
1580 const char *comment
,
1581 svn_boolean_t steal_lock
,
1582 svn_ra_lock_callback_t lock_func
,
1587 * Remove the repository lock for each path in @a path_tokens.
1588 * @a path_tokens is a hash whose keys are the paths to be locked, and
1589 * whose values are the corresponding lock tokens for each path. If
1590 * the path has no corresponding lock token, or if @a break_lock is TRUE,
1591 * then the corresponding value shall be "".
1593 * Note that unlocking is never anonymous, so any server
1594 * implementing this function will have to "pull" a username from
1595 * the client, if it hasn't done so already.
1597 * If @a token points to a lock, but the RA username doesn't match the
1598 * lock's owner, call @a lock_func/@a lock_baton with an error. If @a
1599 * break_lock is TRUE, however, instead allow the lock to be "broken"
1602 * After successfully unlocking a path, @a lock_func is called with
1603 * the @a lock_baton.
1605 * Use @a pool for temporary allocations.
1607 * @since New in 1.2.
1610 svn_ra_unlock(svn_ra_session_t
*session
,
1611 apr_hash_t
*path_tokens
,
1612 svn_boolean_t break_lock
,
1613 svn_ra_lock_callback_t lock_func
,
1618 * If @a path is locked, set @a *lock to an svn_lock_t which
1619 * represents the lock, allocated in @a pool. If @a path is not
1620 * locked, set @a *lock to NULL.
1622 * @since New in 1.2.
1625 svn_ra_get_lock(svn_ra_session_t
*session
,
1631 * Set @a *locks to a hashtable which represents all locks on or
1634 * The hashtable maps (const char *) absolute fs paths to (const
1635 * svn_lock_t *) structures. The hashtable -- and all keys and
1636 * values -- are allocated in @a pool.
1638 * @note It is not considered an error for @a path to not exist in HEAD.
1639 * Such a search will simply return no locks.
1641 * @note This functionality is not available in pre-1.2 servers. If the
1642 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1645 * @since New in 1.2.
1648 svn_ra_get_locks(svn_ra_session_t
*session
,
1655 * Replay the changes from a range of revisions between @a start_revision
1656 * and @a end_revision.
1658 * When receiving information for one revision, a callback @a revstart_func is
1659 * called; this callback will provide an editor and baton through which the
1660 * revision will be replayed.
1661 * When replaying the revision is finished, callback @a fevfinish_func will be
1662 * called so the editor can be closed.
1664 * Changes will be limited to those that occur under @a session's URL, and
1665 * the server will assume that the client has no knowledge of revisions
1666 * prior to @a low_water_mark. These two limiting factors define the portion
1667 * of the tree that the server will assume the client already has knowledge of,
1668 * and thus any copies of data from outside that part of the tree will be
1669 * sent in their entirety, not as simple copies or deltas against a previous
1672 * If @a send_deltas is @c TRUE, the actual text and property changes in
1673 * the revision will be sent, otherwise dummy text deltas and NULL property
1674 * changes will be sent instead.
1676 * @a pool is used for all allocation.
1678 * @since New in 1.5.
1681 svn_ra_replay_range(svn_ra_session_t
*session
,
1682 svn_revnum_t start_revision
,
1683 svn_revnum_t end_revision
,
1684 svn_revnum_t low_water_mark
,
1685 svn_boolean_t send_deltas
,
1686 svn_ra_replay_revstart_callback_t revstart_func
,
1687 svn_ra_replay_revfinish_callback_t revfinish_func
,
1692 * Replay the changes from @a revision through @a editor and @a edit_baton.
1694 * Changes will be limited to those that occur under @a session's URL, and
1695 * the server will assume that the client has no knowledge of revisions
1696 * prior to @a low_water_mark. These two limiting factors define the portion
1697 * of the tree that the server will assume the client already has knowledge of,
1698 * and thus any copies of data from outside that part of the tree will be
1699 * sent in their entirety, not as simple copies or deltas against a previous
1702 * If @a send_deltas is @c TRUE, the actual text and property changes in
1703 * the revision will be sent, otherwise dummy text deltas and null property
1704 * changes will be sent instead.
1706 * @a pool is used for all allocation.
1708 * @since New in 1.4.
1711 svn_ra_replay(svn_ra_session_t
*session
,
1712 svn_revnum_t revision
,
1713 svn_revnum_t low_water_mark
,
1714 svn_boolean_t send_deltas
,
1715 const svn_delta_editor_t
*editor
,
1720 * Set @a *has to TRUE if the server represented by @a session has
1721 * @a capability (one of the capabilities beginning with
1722 * @c "SVN_RA_CAPABILITY_"), else set @a *has to FALSE.
1724 * If @a capability isn't recognized, throw @c SVN_ERR_UNKNOWN_CAPABILITY,
1725 * with the effect on @a *has undefined.
1727 * Use @a pool for all allocation.
1729 * @since New in 1.5.
1732 svn_ra_has_capability(svn_ra_session_t
*session
,
1734 const char *capability
,
1738 * The capability of understanding @c svn_depth_t (e.g., the server
1739 * understands what the client means when the client describes the
1740 * depth of a working copy to the server.)
1742 * @since New in 1.5.
1744 #define SVN_RA_CAPABILITY_DEPTH "depth"
1747 * The capability of doing the right thing with merge-tracking
1748 * information. This capability should be reported bidirectionally,
1749 * because some repositories may want to reject clients that do not
1750 * self-report as knowing how to handle merge-tracking.
1752 * @since New in 1.5.
1754 #define SVN_RA_CAPABILITY_MERGEINFO "mergeinfo"
1757 * The capability of retrieving arbitrary revprops in svn_ra_get_log2.
1759 * @since New in 1.5.
1761 #define SVN_RA_CAPABILITY_LOG_REVPROPS "log-revprops"
1764 * The capability of replaying a directory in the repository (partial replay).
1766 * @since New in 1.5.
1768 #define SVN_RA_CAPABILITY_PARTIAL_REPLAY "partial-replay"
1771 * The capability of including revision properties in a commit.
1773 * @since New in 1.5.
1775 #define SVN_RA_CAPABILITY_COMMIT_REVPROPS "commit-revprops"
1777 /* *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY ***
1779 * RA layers generally fetch all capabilities when asked about any
1780 * capability, to save future round trips. So if you add a new
1781 * capability here, make sure to update the RA layers to remember
1782 * it after any capabilities query.
1784 * Also note that capability strings should not include colons,
1785 * because we pass a list of client capabilities to the start-commit
1786 * hook as a single, colon-separated string.
1790 * Append a textual list of all available RA modules to the stringbuf
1793 * @since New in 1.2.
1796 svn_ra_print_modules(svn_stringbuf_t
*output
,
1801 * Similar to svn_ra_print_modules().
1802 * @a ra_baton is ignored.
1804 * @deprecated Provided for backward compatibility with the 1.1 API.
1807 svn_ra_print_ra_libraries(svn_stringbuf_t
**descriptions
,
1814 * Using this callback struct is similar to calling the newer public
1815 * interface that is based on @c svn_ra_session_t.
1817 * @deprecated Provided for backward compatibility with the 1.1 API.
1819 typedef struct svn_ra_plugin_t
1821 /** The proper name of the RA library, (like "ra_neon" or "ra_local") */
1824 /** Short doc string printed out by `svn --version` */
1825 const char *description
;
1827 /* The vtable hooks */
1829 /** Call svn_ra_open() and set @a session_baton to an object representing
1830 * the new session. All other arguments are passed to svn_ra_open().
1832 svn_error_t
*(*open
)(void **session_baton
,
1833 const char *repos_URL
,
1834 const svn_ra_callbacks_t
*callbacks
,
1835 void *callback_baton
,
1839 /** Call svn_ra_get_latest_revnum() with the session associated with
1840 * @a session_baton and all other arguments.
1842 svn_error_t
*(*get_latest_revnum
)(void *session_baton
,
1843 svn_revnum_t
*latest_revnum
,
1846 /** Call svn_ra_get_dated_revision() with the session associated with
1847 * @a session_baton and all other arguments.
1849 svn_error_t
*(*get_dated_revision
)(void *session_baton
,
1850 svn_revnum_t
*revision
,
1854 /** Call svn_ra_change_rev_prop() with the session associated with
1855 * @a session_baton and all other arguments.
1857 svn_error_t
*(*change_rev_prop
)(void *session_baton
,
1860 const svn_string_t
*value
,
1863 /** Call svn_ra_rev_proplist() with the session associated with
1864 * @a session_baton and all other arguments.
1866 svn_error_t
*(*rev_proplist
)(void *session_baton
,
1871 /** Call svn_ra_rev_prop() with the session associated with
1872 * @a session_baton and all other arguments.
1874 svn_error_t
*(*rev_prop
)(void *session_baton
,
1877 svn_string_t
**value
,
1880 /** Call svn_ra_get_commit_editor() with the session associated with
1881 * @a session_baton and all other arguments plus @a lock_tokens set to
1882 * @c NULL and @a keep_locks set to @c TRUE.
1884 svn_error_t
*(*get_commit_editor
)(void *session_baton
,
1885 const svn_delta_editor_t
**editor
,
1887 const char *log_msg
,
1888 svn_commit_callback_t callback
,
1889 void *callback_baton
,
1892 /** Call svn_ra_get_file() with the session associated with
1893 * @a session_baton and all other arguments.
1895 svn_error_t
*(*get_file
)(void *session_baton
,
1897 svn_revnum_t revision
,
1898 svn_stream_t
*stream
,
1899 svn_revnum_t
*fetched_rev
,
1903 /** Call svn_ra_get_dir() with the session associated with
1904 * @a session_baton and all other arguments.
1906 svn_error_t
*(*get_dir
)(void *session_baton
,
1908 svn_revnum_t revision
,
1909 apr_hash_t
**dirents
,
1910 svn_revnum_t
*fetched_rev
,
1914 /** Call svn_ra_do_update() with the session associated with
1915 * @a session_baton and all other arguments.
1917 svn_error_t
*(*do_update
)(void *session_baton
,
1918 const svn_ra_reporter_t
**reporter
,
1919 void **report_baton
,
1920 svn_revnum_t revision_to_update_to
,
1921 const char *update_target
,
1922 svn_boolean_t recurse
,
1923 const svn_delta_editor_t
*update_editor
,
1927 /** Call svn_ra_do_switch() with the session associated with
1928 * @a session_baton and all other arguments.
1930 svn_error_t
*(*do_switch
)(void *session_baton
,
1931 const svn_ra_reporter_t
**reporter
,
1932 void **report_baton
,
1933 svn_revnum_t revision_to_switch_to
,
1934 const char *switch_target
,
1935 svn_boolean_t recurse
,
1936 const char *switch_url
,
1937 const svn_delta_editor_t
*switch_editor
,
1941 /** Call svn_ra_do_status() with the session associated with
1942 * @a session_baton and all other arguments.
1944 svn_error_t
*(*do_status
)(void *session_baton
,
1945 const svn_ra_reporter_t
**reporter
,
1946 void **report_baton
,
1947 const char *status_target
,
1948 svn_revnum_t revision
,
1949 svn_boolean_t recurse
,
1950 const svn_delta_editor_t
*status_editor
,
1954 /** Call svn_ra_do_diff() with the session associated with
1955 * @a session_baton and all other arguments.
1957 svn_error_t
*(*do_diff
)(void *session_baton
,
1958 const svn_ra_reporter_t
**reporter
,
1959 void **report_baton
,
1960 svn_revnum_t revision
,
1961 const char *diff_target
,
1962 svn_boolean_t recurse
,
1963 svn_boolean_t ignore_ancestry
,
1964 const char *versus_url
,
1965 const svn_delta_editor_t
*diff_editor
,
1969 /** Call svn_ra_get_log() with the session associated with
1970 * @a session_baton and all other arguments. @a limit is set to 0.
1972 svn_error_t
*(*get_log
)(void *session_baton
,
1973 const apr_array_header_t
*paths
,
1976 svn_boolean_t discover_changed_paths
,
1977 svn_boolean_t strict_node_history
,
1978 svn_log_message_receiver_t receiver
,
1979 void *receiver_baton
,
1982 /** Call svn_ra_check_path() with the session associated with
1983 * @a session_baton and all other arguments.
1985 svn_error_t
*(*check_path
)(void *session_baton
,
1987 svn_revnum_t revision
,
1988 svn_node_kind_t
*kind
,
1991 /** Call svn_ra_get_uuid() with the session associated with
1992 * @a session_baton and all other arguments.
1994 svn_error_t
*(*get_uuid
)(void *session_baton
,
1998 /** Call svn_ra_get_repos_root() with the session associated with
1999 * @a session_baton and all other arguments.
2001 svn_error_t
*(*get_repos_root
)(void *session_baton
,
2006 * Call svn_ra_get_locations() with the session associated with
2007 * @a session_baton and all other arguments.
2009 * @since New in 1.1.
2011 svn_error_t
*(*get_locations
)(void *session_baton
,
2012 apr_hash_t
**locations
,
2014 svn_revnum_t peg_revision
,
2015 apr_array_header_t
*location_revisions
,
2019 * Call svn_ra_get_file_revs() with the session associated with
2020 * @a session_baton and all other arguments.
2022 * @since New in 1.1.
2024 svn_error_t
*(*get_file_revs
)(void *session_baton
,
2028 svn_ra_file_rev_handler_t handler
,
2029 void *handler_baton
,
2033 * Return the plugin's version information.
2035 * @since New in 1.1.
2037 const svn_version_t
*(*get_version
)(void);
2043 * All "ra_FOO" implementations *must* export a function named
2044 * svn_ra_FOO_init() of type @c svn_ra_init_func_t.
2046 * When called by libsvn_client, this routine adds an entry (or
2047 * entries) to the hash table for any URL schemes it handles. The hash
2048 * value must be of type (<tt>@c svn_ra_plugin_t *</tt>). @a pool is a
2049 * pool for allocating configuration / one-time data.
2051 * This type is defined to use the "C Calling Conventions" to ensure that
2052 * abi_version is the first parameter. The RA plugin must check that value
2053 * before accessing the other parameters.
2055 * ### need to force this to be __cdecl on Windows... how??
2057 * @deprecated Provided for backward compatibility with the 1.1 API.
2059 typedef svn_error_t
*(*svn_ra_init_func_t
)(int abi_version
,
2064 * The current ABI (Application Binary Interface) version for the
2065 * RA plugin model. This version number will change when the ABI
2066 * between the SVN core (e.g. libsvn_client) and the RA plugin changes.
2068 * An RA plugin should verify that the passed version number is acceptable
2069 * before accessing the rest of the parameters, and before returning any
2072 * It is entirely acceptable for an RA plugin to accept multiple ABI
2073 * versions. It can simply interpret the parameters based on the version,
2074 * and it can return different plugin structures.
2078 * VSN DATE REASON FOR CHANGE
2079 * --- ---------- ------------------------------------------------
2080 * 1 2001-02-17 Initial revision.
2081 * 2 2004-06-29 Preparing for svn 1.1, which adds new RA vtable funcs.
2082 * 2005-01-19 Rework the plugin interface and don't provide the vtable
2083 * to the client. Separate ABI versions are no longer used.
2086 * @deprecated Provided for backward compatibility with the 1.0 API.
2088 #define SVN_RA_ABI_VERSION 2
2090 /* Public RA implementations. */
2092 /** Initialize libsvn_ra_neon.
2094 * @deprecated Provided for backward compatibility with the 1.1 API. */
2096 svn_ra_dav_init(int abi_version
,
2100 /** Initialize libsvn_ra_local.
2102 * @deprecated Provided for backward compatibility with the 1.1 API. */
2104 svn_ra_local_init(int abi_version
,
2108 /** Initialize libsvn_ra_svn.
2110 * @deprecated Provided for backward compatibility with the 1.1 API. */
2112 svn_ra_svn_init(int abi_version
,
2116 /** Initialize libsvn_ra_serf.
2118 * @since New in 1.4.
2119 * @deprecated Provided for backward compatibility with the 1.1 API. */
2121 svn_ra_serf_init(int abi_version
,
2127 * Initialize the compatibility wrapper, using @a pool for any allocations.
2128 * The caller must hold on to @a ra_baton as long as the RA library is used.
2130 * @deprecated Provided for backward compatibility with the 1.1 API.
2132 svn_error_t
*svn_ra_init_ra_libs(void **ra_baton
, apr_pool_t
*pool
);
2135 * Return an RA vtable-@a library which can handle URL. A number of
2136 * svn_client_* routines will call this internally, but client apps might
2137 * use it too. $a ra_baton is a baton obtained by a call to
2138 * svn_ra_init_ra_libs().
2140 * @deprecated Provided for backward compatibility with the 1.1 API.
2143 svn_ra_get_ra_library(svn_ra_plugin_t
**library
,
2150 #endif /* __cplusplus */
2152 #endif /* SVN_RA_H */