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
26 #include <apr_pools.h>
28 #include <apr_tables.h>
30 #include <apr_file_io.h> /* for apr_file_t */
32 #include "svn_types.h"
33 #include "svn_string.h"
34 #include "svn_delta.h"
36 #include "svn_mergeinfo.h"
40 #endif /* __cplusplus */
44 /* Misc. declarations */
47 * Get libsvn_ra version information.
55 /** This is a function type which allows the RA layer to fetch working
56 * copy (WC) properties.
58 * The @a baton is provided along with the function pointer and should
59 * be passed back in. This will be the @a callback_baton or the
60 * @a close_baton as appropriate.
62 * @a path is relative to the "root" of the session, defined by the
63 * @a repos_URL passed to svn_ra_open3() vtable call.
65 * @a name is the name of the property to fetch. If the property is present,
66 * then it is returned in @a value. Otherwise, @a *value is set to @c NULL.
68 typedef svn_error_t
*(*svn_ra_get_wc_prop_func_t
)(void *baton
,
71 const svn_string_t
**value
,
74 /** This is a function type which allows the RA layer to store new
75 * working copy properties during update-like operations. See the
76 * comments for @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and
77 * @a name. The @a value is the value that will be stored for the property;
78 * a NULL @a value means the property will be deleted.
80 typedef svn_error_t
*(*svn_ra_set_wc_prop_func_t
)(void *baton
,
83 const svn_string_t
*value
,
86 /** This is a function type which allows the RA layer to store new
87 * working copy properties as part of a commit. See the comments for
88 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
89 * The @a value is the value that will be stored for the property; a
90 * @c NULL @a value means the property will be deleted.
92 * Note that this might not actually store the new property before
93 * returning, but instead schedule it to be changed as part of
94 * post-commit processing (in which case a successful commit means the
95 * properties got written). Thus, during the commit, it is possible
96 * to invoke this function to set a new value for a wc prop, then read
97 * the wc prop back from the working copy and get the *old* value.
100 typedef svn_error_t
*(*svn_ra_push_wc_prop_func_t
)(void *baton
,
103 const svn_string_t
*value
,
106 /** This is a function type which allows the RA layer to invalidate
107 * (i.e., remove) wcprops recursively. See the documentation for
108 * @c svn_ra_get_wc_prop_func_t for @a baton, @a path, and @a name.
110 * Unlike @c svn_ra_push_wc_prop_func_t, this has immediate effect. If
111 * it returns success, the wcprops have been removed.
113 typedef svn_error_t
*(*svn_ra_invalidate_wc_props_func_t
)(void *baton
,
119 /** A function type for retrieving the youngest revision from a repos. */
120 typedef svn_error_t
*(*svn_ra_get_latest_revnum_func_t
)
121 (void *session_baton
,
122 svn_revnum_t
*latest_revnum
);
124 /** A function type which allows the RA layer to ask about any
125 * customizations to the client name string. This is primarily used
126 * by HTTP-based RA layers wishing to extend the string reported to
127 * Apache/mod_dav_svn via the User-agent HTTP header.
129 typedef svn_error_t
*(*svn_ra_get_client_string_func_t
)(void *baton
,
135 * A callback function type for use in @c get_file_revs.
136 * @a baton is provided by the caller, @a path is the pathname of the file
137 * in revision @a rev and @a rev_props are the revision properties.
138 * If @a delta_handler and @a delta_baton are non-NULL, they may be set to a
139 * handler/baton which will be called with the delta between the previous
140 * revision and this one after the return of this callback. They may be
142 * @a prop_diffs is an array of svn_prop_t elements indicating the property
143 * delta for this and the previous revision.
144 * @a pool may be used for temporary allocations, but you can't rely
145 * on objects allocated to live outside of this particular call and the
146 * immediately following calls to @a *delta_handler, if any.
150 typedef svn_error_t
*(*svn_ra_file_rev_handler_t
)
154 apr_hash_t
*rev_props
,
155 svn_txdelta_window_handler_t
*delta_handler
,
157 apr_array_header_t
*prop_diffs
,
161 * Callback function type for locking and unlocking actions.
165 * @a do_lock is TRUE when locking @a path, and FALSE
168 * @a lock is a lock for @a path or NULL if @a do_lock is FALSE or @a ra_err is
171 * @a ra_err is NULL unless the ra layer encounters a locking related
172 * error which it passes back for notification purposes. The caller
173 * is responsible for clearing @a ra_err after the callback is run.
175 * @a baton is a closure object; it should be provided by the
176 * implementation, and passed by the caller. @a pool may be used for
177 * temporary allocation.
179 typedef svn_error_t
*(*svn_ra_lock_callback_t
)(void *baton
,
181 svn_boolean_t do_lock
,
182 const svn_lock_t
*lock
,
187 * Callback function type for progress notification.
189 * @a progress is the number of bytes already transferred, @a total is
190 * the total number of bytes to transfer or -1 if it's not known, @a
191 * baton is the callback baton.
195 typedef void (*svn_ra_progress_notify_func_t
)(apr_off_t progress
,
201 * Callback function type for replay_range actions.
203 * This callback function should provide replay_range with an editor which
204 * will be driven with the received replay reports from the master repository.
206 * @a revision is the target revision number of the received replay report.
208 * @a editor and @a edit_baton should provided by the callback implementation.
210 * @a replay_baton is the baton as originally passed to replay_range.
212 * @a revprops contains key/value pairs for each revision properties for this
217 typedef svn_error_t
*(*svn_ra_replay_revstart_callback_t
)
218 (svn_revnum_t revision
,
220 const svn_delta_editor_t
**editor
,
222 apr_hash_t
*rev_props
,
226 * Callback function type for replay_range actions.
228 * This callback function should close the editor.
230 * @a revision is the target revision number of the received replay report.
232 * @a editor and @a edit_baton should provided by the callback implementation.
234 * @a replay_baton is the baton as originally passed to replay_range.
236 * @a revprops contains key/value pairs for each revision properties for this
241 typedef svn_error_t
*(*svn_ra_replay_revfinish_callback_t
)
242 (svn_revnum_t revision
,
244 const svn_delta_editor_t
*editor
,
246 apr_hash_t
*rev_props
,
251 * The update Reporter.
253 * A vtable structure which allows a working copy to describe a subset
254 * (or possibly all) of its working-copy to an RA layer, for the
255 * purposes of an update, switch, status, or diff operation.
257 * Paths for report calls are relative to the target (not the anchor)
258 * of the operation. Report calls must be made in depth-first order:
259 * parents before children, all children of a parent before any
260 * siblings of the parent. The first report call must be a set_path
261 * with a @a path argument of "" and a valid revision. (If the target
262 * of the operation is locally deleted or missing, use the anchor's
263 * revision.) If the target of the operation is deleted or switched
264 * relative to the anchor, follow up the initial set_path call with a
265 * link_path or delete_path call with a @a path argument of "" to
266 * indicate that. In no other case may there be two report
267 * descriptions for the same path. If the target of the operation is
268 * a locally added file or directory (which previously did not exist),
269 * it may be reported as having revision 0 or as having the parent
270 * directory's revision.
274 typedef struct svn_ra_reporter3_t
276 /** Describe a working copy @a path as being at a particular
277 * @a revision and having depth @a depth.
279 * @a revision may be SVN_INVALID_REVNUM if (for example) @a path
280 * represents a locally-added path with no revision number, or @a
281 * depth is @c svn_depth_exclude.
283 * @a path may not be underneath a path on which set_path() was
284 * previously called with @c svn_depth_exclude in this report.
286 * If @a start_empty is set and @a path is a directory, the
287 * implementor should assume the directory has no entries or props.
289 * This will *override* any previous set_path() calls made on parent
290 * paths. @a path is relative to the URL specified in svn_ra_open3().
292 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
294 * All temporary allocations are done in @a pool.
296 svn_error_t
*(*set_path
)(void *report_baton
,
298 svn_revnum_t revision
,
300 svn_boolean_t start_empty
,
301 const char *lock_token
,
304 /** Describing a working copy @a path as missing.
306 * @a path may not be underneath a path on which set_path() was
307 * previously called with @c svn_depth_exclude in this report.
309 * All temporary allocations are done in @a pool.
311 svn_error_t
*(*delete_path
)(void *report_baton
,
315 /** Like set_path(), but differs in that @a path in the working copy
316 * (relative to the root of the report driver) isn't a reflection of
317 * @a path in the repository (relative to the URL specified when
318 * opening the RA layer), but is instead a reflection of a different
319 * repository @a url at @a revision, and has depth @a depth.
321 * @a path may not be underneath a path on which set_path() was
322 * previously called with @c svn_depth_exclude in this report.
324 * If @a start_empty is set and @a path is a directory,
325 * the implementor should assume the directory has no entries or props.
327 * If @a lock_token is non-NULL, it is the lock token for @a path in the WC.
329 * All temporary allocations are done in @a pool.
331 svn_error_t
*(*link_path
)(void *report_baton
,
334 svn_revnum_t revision
,
336 svn_boolean_t start_empty
,
337 const char *lock_token
,
340 /** WC calls this when the state report is finished; any directories
341 * or files not explicitly `set' are assumed to be at the
342 * baseline revision originally passed into do_update(). No other
343 * reporting functions, including abort_report, should be called after
344 * calling this function.
346 svn_error_t
*(*finish_report
)(void *report_baton
,
349 /** If an error occurs during a report, this routine should cause the
350 * filesystem transaction to be aborted & cleaned up. No other reporting
351 * functions should be called after calling this function.
353 svn_error_t
*(*abort_report
)(void *report_baton
,
356 } svn_ra_reporter3_t
;
359 * Similar to @c svn_ra_reporter3_t, but without support for depths.
361 * @deprecated Provided for backward compatibility with the 1.4 API.
363 typedef struct svn_ra_reporter2_t
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
*(*set_path
)(void *report_baton
,
369 svn_revnum_t revision
,
370 svn_boolean_t start_empty
,
371 const char *lock_token
,
374 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
375 svn_error_t
*(*delete_path
)(void *report_baton
,
379 /** Similar to the corresponding field in @c svn_ra_reporter3_t, but
380 * with @a depth always set to @c svn_depth_infinity. */
381 svn_error_t
*(*link_path
)(void *report_baton
,
384 svn_revnum_t revision
,
385 svn_boolean_t start_empty
,
386 const char *lock_token
,
389 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
390 svn_error_t
*(*finish_report
)(void *report_baton
,
393 /** Same as the corresponding field in @c svn_ra_reporter3_t. */
394 svn_error_t
*(*abort_report
)(void *report_baton
,
397 } svn_ra_reporter2_t
;
400 * Similar to @c svn_ra_reporter2_t, but without support for lock tokens.
402 * @deprecated Provided for backward compatibility with the 1.1 API.
404 typedef struct svn_ra_reporter_t
406 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
407 * with @a lock_token always set to NULL. */
408 svn_error_t
*(*set_path
)(void *report_baton
,
410 svn_revnum_t revision
,
411 svn_boolean_t start_empty
,
414 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
415 svn_error_t
*(*delete_path
)(void *report_baton
,
419 /** Similar to the corresponding field in @c svn_ra_reporter2_t, but
420 * with @a lock_token always set to NULL. */
421 svn_error_t
*(*link_path
)(void *report_baton
,
424 svn_revnum_t revision
,
425 svn_boolean_t start_empty
,
428 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
429 svn_error_t
*(*finish_report
)(void *report_baton
,
432 /** Same as the corresponding field in @c svn_ra_reporter2_t. */
433 svn_error_t
*(*abort_report
)(void *report_baton
,
438 /** A collection of callbacks implemented by libsvn_client which allows
439 * an RA layer to "pull" information from the client application, or
440 * possibly store information. libsvn_client passes this vtable to
443 * Each routine takes a @a callback_baton originally provided with the
446 * Clients must use svn_ra_create_callbacks() to allocate and
447 * initialize this structure.
451 typedef struct svn_ra_callbacks2_t
453 /** Open a unique temporary file for writing in the working copy.
454 * This file will be automatically deleted when @a fp is closed.
456 * @deprecated This callback should no longer be used by RA layers.
458 svn_error_t
*(*open_tmp_file
)(apr_file_t
**fp
,
459 void *callback_baton
,
462 /** An authentication baton, created by the application, which is
463 * capable of retrieving all known types of credentials.
465 svn_auth_baton_t
*auth_baton
;
467 /*** The following items may be set to NULL to disallow the RA layer
468 to perform the respective operations of the vtable functions.
469 Perhaps WC props are not defined or are in invalid for this
470 session, or perhaps the commit operation this RA session will
471 perform is a server-side only one that shouldn't do post-commit
472 processing on a working copy path. ***/
474 /** Fetch working copy properties.
476 *<pre> ### we might have a problem if the RA layer ever wants a property
477 * ### that corresponds to a different revision of the file than
478 * ### what is in the WC. we'll cross that bridge one day...</pre>
480 svn_ra_get_wc_prop_func_t get_wc_prop
;
482 /** Immediately set new values for working copy properties. */
483 svn_ra_set_wc_prop_func_t set_wc_prop
;
485 /** Schedule new values for working copy properties. */
486 svn_ra_push_wc_prop_func_t push_wc_prop
;
488 /** Invalidate working copy properties. */
489 svn_ra_invalidate_wc_props_func_t invalidate_wc_props
;
491 /** Notification callback used for progress information.
492 * May be NULL if not used.
494 svn_ra_progress_notify_func_t progress_func
;
496 /** Notification callback baton, used with progress_func. */
497 void *progress_baton
;
499 /** Cancelation function
501 * As its baton, the general callback baton is used
505 svn_cancel_func_t cancel_func
;
507 /** Client string customization callback function
510 svn_ra_get_client_string_func_t get_client_string
;
512 } svn_ra_callbacks2_t
;
514 /** Similar to svn_ra_callbacks2_t, except that the progress
515 * notification function and baton is missing.
517 * @deprecated Provided for backward compatibility with the 1.2 API.
519 typedef struct svn_ra_callbacks_t
521 svn_error_t
*(*open_tmp_file
)(apr_file_t
**fp
,
522 void *callback_baton
,
525 svn_auth_baton_t
*auth_baton
;
527 svn_ra_get_wc_prop_func_t get_wc_prop
;
529 svn_ra_set_wc_prop_func_t set_wc_prop
;
531 svn_ra_push_wc_prop_func_t push_wc_prop
;
533 svn_ra_invalidate_wc_props_func_t invalidate_wc_props
;
535 } svn_ra_callbacks_t
;
539 /*----------------------------------------------------------------------*/
541 /* Public Interfaces. */
544 * Initialize the RA library. This function must be called before using
545 * any function in this header, except the deprecated APIs based on
546 * @c svn_ra_plugin_t, or svn_ra_version(). This function must not be called
547 * simultaneously in multiple threads. @a pool must live
548 * longer than any open RA sessions.
553 svn_ra_initialize(apr_pool_t
*pool
);
555 /** Initialize a callback structure.
556 * Set @a *callbacks to a ra callbacks object, allocated in @a pool.
558 * Clients must use this function to allocate and initialize @c
559 * svn_ra_callbacks2_t structures.
564 svn_ra_create_callbacks(svn_ra_callbacks2_t
**callbacks
,
568 * A repository access session. This object is used to perform requests
569 * to a repository, identified by an URL.
573 typedef struct svn_ra_session_t svn_ra_session_t
;
576 * Open a repository session to @a repos_URL. Return an opaque object
577 * representing this session in @a *session_p, allocated in @a pool.
579 * Return @c SVN_ERR_RA_UUID_MISMATCH if @a uuid is non-NULL and not equal
580 * to the UUID of the repository at @c repos_URL.
582 * @a callbacks/@a callback_baton is a table of callbacks provided by the
583 * client; see @c svn_ra_callbacks2_t.
585 * @a config is a hash mapping <tt>const char *</tt> keys to
586 * @c svn_config_t * values. For example, the @c svn_config_t for the
587 * "~/.subversion/config" file is under the key "config".
589 * All RA requests require a session; they will continue to
590 * use @a pool for memory allocation.
592 * @see svn_client_open_ra_session().
597 svn_ra_open3(svn_ra_session_t
**session_p
,
598 const char *repos_URL
,
600 const svn_ra_callbacks2_t
*callbacks
,
601 void *callback_baton
,
606 * Similiar to svn_ra_open3(), but with @a uuid set to @c NULL.
609 * @deprecated Provided for backward compatibility with the 1.4 API.
613 svn_ra_open2(svn_ra_session_t
**session_p
,
614 const char *repos_URL
,
615 const svn_ra_callbacks2_t
*callbacks
,
616 void *callback_baton
,
621 * @see svn_ra_open2().
623 * @deprecated Provided for backward compatibility with the 1.2 API.
627 svn_ra_open(svn_ra_session_t
**session_p
,
628 const char *repos_URL
,
629 const svn_ra_callbacks_t
*callbacks
,
630 void *callback_baton
,
634 /** Change the root URL of an open @a ra_session to point to a new path in the
635 * same repository. @a url is the new root URL. Use @a pool for
636 * temporary allocations.
638 * If @a url has a different repository root than the current session
639 * URL, return @c SVN_ERR_RA_ILLEGAL_URL.
644 svn_ra_reparent(svn_ra_session_t
*ra_session
,
648 /** Set @a *url to the repository URL to which @a ra_session was
649 * opened or most recently reparented.
652 svn_ra_get_session_url(svn_ra_session_t
*ra_session
,
658 * Get the latest revision number from the repository of @a session.
660 * Use @a pool for memory allocation.
665 svn_ra_get_latest_revnum(svn_ra_session_t
*session
,
666 svn_revnum_t
*latest_revnum
,
670 * Get the latest revision number at time @a tm in the repository of
673 * Use @a pool for memory allocation.
678 svn_ra_get_dated_revision(svn_ra_session_t
*session
,
679 svn_revnum_t
*revision
,
684 * Set the property @a name to @a value on revision @a rev in the repository
687 * If @a value is @c NULL, delete the named revision property.
689 * Please note that properties attached to revisions are @em unversioned.
691 * Use @a pool for memory allocation.
696 svn_ra_change_rev_prop(svn_ra_session_t
*session
,
699 const svn_string_t
*value
,
703 * Set @a *props to the list of unversioned properties attached to revision
704 * @a rev in the repository of @a session. The hash maps
705 * (<tt>const char *</tt>) names to (<tt>@c svn_string_t *</tt>) values.
707 * Use @a pool for memory allocation.
712 svn_ra_rev_proplist(svn_ra_session_t
*session
,
718 * Set @a *value to the value of unversioned property @a name attached to
719 * revision @a rev in the repository of @a session. If @a rev has no
720 * property by that name, set @a *value to @c NULL.
722 * Use @a pool for memory allocation.
727 svn_ra_rev_prop(svn_ra_session_t
*session
,
730 svn_string_t
**value
,
734 * Set @a *editor and @a *edit_baton to an editor for committing
735 * changes to the repository of @a session, setting the revision
736 * properties from @a revprop_table. The revisions being committed
737 * against are passed to the editor functions, starting with the rev
738 * argument to @c open_root. The path root of the commit is the @a
741 * @a revprop_table is a hash mapping <tt>const char *</tt> property
742 * names to @c svn_string_t property values. The commit log message
743 * is expected to be in the @c SVN_PROP_REVISION_LOG element. @a
744 * revprop_table can not contain either of @c SVN_PROP_REVISION_DATE
745 * or @c SVN_PROP_REVISION_AUTHOR.
747 * Before @c close_edit returns, but after the commit has succeeded,
748 * it will invoke @a callback with the new revision number, the
749 * commit date (as a <tt>const char *</tt>), commit author (as a
750 * <tt>const char *</tt>), and @a callback_baton as arguments. If
751 * @a callback returns an error, that error will be returned from @c
752 * close_edit, otherwise @c close_edit will return successfully
753 * (unless it encountered an error before invoking @a callback).
755 * The callback will not be called if the commit was a no-op
756 * (i.e. nothing was committed);
758 * @a lock_tokens, if non-NULL, is a hash mapping <tt>const char
759 * *</tt> paths (relative to the URL of @a session) to <tt>
760 * const char *</tt> lock tokens. The server checks that the
761 * correct token is provided for each committed, locked path. @a lock_tokens
762 * must live during the whole commit operation.
764 * If @a keep_locks is @c TRUE, then do not release locks on
765 * committed objects. Else, automatically release such locks.
767 * The caller may not perform any RA operations using @a session before
768 * finishing the edit.
770 * Use @a pool for memory allocation.
775 svn_ra_get_commit_editor3(svn_ra_session_t
*session
,
776 const svn_delta_editor_t
**editor
,
778 apr_hash_t
*revprop_table
,
779 svn_commit_callback2_t callback
,
780 void *callback_baton
,
781 apr_hash_t
*lock_tokens
,
782 svn_boolean_t keep_locks
,
786 * Same as svn_ra_get_commit_editor3(), but with @c revprop_table set
787 * to a hash containing the @c SVN_PROP_REVISION_LOG property set
788 * to the value of @a log_msg.
792 * @deprecated Provided for backward compatibility with the 1.4 API.
796 svn_ra_get_commit_editor2(svn_ra_session_t
*session
,
797 const svn_delta_editor_t
**editor
,
800 svn_commit_callback2_t callback
,
801 void *callback_baton
,
802 apr_hash_t
*lock_tokens
,
803 svn_boolean_t keep_locks
,
807 * Same as svn_ra_get_commit_editor2(), but uses @c svn_commit_callback_t.
811 * @deprecated Provided for backward compatibility with the 1.3 API.
815 svn_ra_get_commit_editor(svn_ra_session_t
*session
,
816 const svn_delta_editor_t
**editor
,
819 svn_commit_callback_t callback
,
820 void *callback_baton
,
821 apr_hash_t
*lock_tokens
,
822 svn_boolean_t keep_locks
,
826 * Fetch the contents and properties of file @a path at @a revision.
827 * @a revision may be SVN_INVALID_REVNUM, indicating that the HEAD
828 * revision should be used. Interpret @a path relative to the URL in
829 * @a session. Use @a pool for all allocations.
831 * If @a revision is @c SVN_INVALID_REVNUM and @a fetched_rev is not
832 * @c NULL, then set @a *fetched_rev to the actual revision that was
835 * If @a stream is non @c NULL, push the contents of the file at @a
836 * stream, do not call svn_stream_close() when finished.
838 * If @a props is non @c NULL, set @a *props to contain the properties of
839 * the file. This means @em all properties: not just ones controlled by
840 * the user and stored in the repository fs, but non-tweakable ones
841 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
842 * etc.) The keys are <tt>const char *</tt>, values are
843 * <tt>@c svn_string_t *</tt>.
845 * The stream handlers for @a stream may not perform any RA
846 * operations using @a session.
851 svn_ra_get_file(svn_ra_session_t
*session
,
853 svn_revnum_t revision
,
854 svn_stream_t
*stream
,
855 svn_revnum_t
*fetched_rev
,
860 * If @a dirents is non @c NULL, set @a *dirents to contain all the entries
861 * of directory @a path at @a revision. The keys of @a dirents will be
862 * entry names (<tt>const char *</tt>), and the values dirents
863 * (<tt>@c svn_dirent_t *</tt>). Use @a pool for all allocations.
865 * @a dirent_fields controls which portions of the <tt>@c svn_dirent_t</tt>
866 * objects are filled in. To have them completely filled in just pass
867 * @c SVN_DIRENT_ALL, otherwise pass the bitwise OR of all the @c SVN_DIRENT_
868 * fields you would like to have returned to you.
870 * @a path is interpreted relative to the URL in @a session.
872 * If @a revision is @c SVN_INVALID_REVNUM (meaning 'head') and
873 * @a *fetched_rev is not @c NULL, then this function will set
874 * @a *fetched_rev to the actual revision that was retrieved. (Some
875 * callers want to know, and some don't.)
877 * If @a props is non @c NULL, set @a *props to contain the properties of
878 * the directory. This means @em all properties: not just ones controlled by
879 * the user and stored in the repository fs, but non-tweakable ones
880 * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
881 * etc.) The keys are <tt>const char *</tt>, values are
882 * <tt>@c svn_string_t *</tt>.
887 svn_ra_get_dir2(svn_ra_session_t
*session
,
888 apr_hash_t
**dirents
,
889 svn_revnum_t
*fetched_rev
,
892 svn_revnum_t revision
,
893 apr_uint32_t dirent_fields
,
897 * Similar to @c svn_ra_get_dir2, but with @c SVN_DIRENT_ALL for the
898 * @a dirent_fields parameter.
902 * @deprecated Provided for compatibility with the 1.3 API.
906 svn_ra_get_dir(svn_ra_session_t
*session
,
908 svn_revnum_t revision
,
909 apr_hash_t
**dirents
,
910 svn_revnum_t
*fetched_rev
,
915 * Set @a *catalog to a mergeinfo catalog for the paths in @a paths.
916 * If no mergeinfo is available, set @a *catalog to @c NULL. The
917 * requested mergeinfo hashes are for @a paths (which are relative to
918 * @a session's URL) in @a revision. If one of the paths does not exist
919 * in that revision, return SVN_ERR_FS_NOT_FOUND.
921 * @a inherit indicates whether explicit, explicit or inherited, or
922 * only inherited mergeinfo for @a paths is retrieved.
924 * If @a include_descendants is TRUE, then additionally return the
925 * mergeinfo for any descendant of any element of @a paths which has
926 * the @c SVN_PROP_MERGEINFO property explicitly set on it. (Note
927 * that inheritance is only taken into account for the elements in @a
928 * paths; descendants of the elements in @a paths which get their
929 * mergeinfo via inheritance are not included in @a *catalog.)
931 * Allocate the returned values in @a pool.
933 * If @a revision is @c SVN_INVALID_REVNUM, it defaults to youngest.
935 * If the server doesn't support retrieval of mergeinfo (which can
936 * happen even for file:// URLs, if the repository itself hasn't been
937 * upgraded), return @c SVN_ERR_UNSUPPORTED_FEATURE in preference to
938 * any other error that might otherwise be returned.
943 svn_ra_get_mergeinfo(svn_ra_session_t
*session
,
944 svn_mergeinfo_catalog_t
*catalog
,
945 const apr_array_header_t
*paths
,
946 svn_revnum_t revision
,
947 svn_mergeinfo_inheritance_t inherit
,
948 svn_boolean_t include_descendants
,
952 * Ask the RA layer to update a working copy.
954 * The client initially provides an @a update_editor/@a update_baton to the
955 * RA layer; this editor contains knowledge of where the change will
956 * begin in the working copy (when @c open_root() is called).
958 * In return, the client receives a @a reporter/@a report_baton. The
959 * client then describes its working copy by making calls into the
962 * When finished, the client calls @a reporter->finish_report(). The
963 * RA layer then does a complete drive of @a update_editor, ending with
964 * @a update_editor->close_edit(), to update the working copy.
966 * @a update_target is an optional single path component to restrict
967 * the scope of the update to just that entry (in the directory
968 * represented by the @a session's URL). If @a update_target is the
969 * empty string, the entire directory is updated.
971 * Update the target only as deeply as @a depth indicates.
973 * If @a send_copyfrom_args is TRUE, then ask the server to send
974 * copyfrom arguments to add_file() and add_directory() when possible.
975 * (Note: this means that any subsequent txdeltas coming from the
976 * server are presumed to apply against the copied file!)
978 * The working copy will be updated to @a revision_to_update_to, or the
979 * "latest" revision if this arg is invalid.
981 * The caller may not perform any RA operations using @a session before
982 * finishing the report, and may not perform any RA operations using
983 * @a session from within the editing operations of @a update_editor.
985 * Use @a pool for memory allocation.
987 * @note The reporter provided by this function does NOT supply copy-
988 * from information to the diff editor callbacks.
990 * @note In order to prevent pre-1.5 servers from doing more work than
991 * needed, and sending too much data back, a pre-1.5 'recurse'
992 * directive may be sent to the server, based on @a depth.
997 svn_ra_do_update2(svn_ra_session_t
*session
,
998 const svn_ra_reporter3_t
**reporter
,
1000 svn_revnum_t revision_to_update_to
,
1001 const char *update_target
,
1003 svn_boolean_t send_copyfrom_args
,
1004 const svn_delta_editor_t
*update_editor
,
1009 * Similar to svn_ra_do_update2(), but taking @c svn_ra_reporter2_t
1010 * instead of @c svn_ra_reporter3_t; if @a recurse is true, pass @c
1011 * svn_depth_infinity for @a depth, else pass @c svn_depth_files; and
1012 * with @a send_copyfrom_args always false.
1014 * @deprecated Provided for compatibility with the 1.4 API.
1018 svn_ra_do_update(svn_ra_session_t
*session
,
1019 const svn_ra_reporter2_t
**reporter
,
1020 void **report_baton
,
1021 svn_revnum_t revision_to_update_to
,
1022 const char *update_target
,
1023 svn_boolean_t recurse
,
1024 const svn_delta_editor_t
*update_editor
,
1030 * Ask the RA layer to 'switch' a working copy to a new
1031 * @a switch_url; it's another form of svn_ra_do_update().
1033 * The client initially provides a @a switch_editor/@a switch_baton to the RA
1034 * layer; this editor contains knowledge of where the change will
1035 * begin in the working copy (when open_root() is called).
1037 * In return, the client receives a @a reporter/@a report_baton. The
1038 * client then describes its working copy by making calls into the
1041 * When finished, the client calls @a reporter->finish_report(). The
1042 * RA layer then does a complete drive of @a switch_editor, ending with
1043 * close_edit(), to switch the working copy.
1045 * @a switch_target is an optional single path component will restrict
1046 * the scope of things affected by the switch to an entry in the
1047 * directory represented by the @a session's URL, or empty if the
1048 * entire directory is meant to be switched.
1050 * Switch the target only as deeply as @a depth indicates.
1052 * The working copy will be switched to @a revision_to_switch_to, or the
1053 * "latest" revision if this arg is invalid.
1055 * The caller may not perform any RA operations using
1056 * @a session before finishing the report, and may not perform
1057 * any RA operations using @a session from within the editing
1058 * operations of @a switch_editor.
1060 * Use @a pool for memory allocation.
1062 * @note The reporter provided by this function does NOT supply copy-
1063 * from information to the diff editor callbacks.
1065 * @note In order to prevent pre-1.5 servers from doing more work than
1066 * needed, and sending too much data back, a pre-1.5 'recurse'
1067 * directive may be sent to the server, based on @a depth.
1069 * @since New in 1.5.
1072 svn_ra_do_switch2(svn_ra_session_t
*session
,
1073 const svn_ra_reporter3_t
**reporter
,
1074 void **report_baton
,
1075 svn_revnum_t revision_to_switch_to
,
1076 const char *switch_target
,
1078 const char *switch_url
,
1079 const svn_delta_editor_t
*switch_editor
,
1084 * Similar to svn_ra_do_switch2(), but taking @c svn_ra_reporter2_t
1085 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1086 * @c svn_depth_infinity for depths. The switch itself is performed
1087 * according to @a recurse: if TRUE, then use @c svn_depth_infinity
1088 * for @a depth, else use @c svn_depth_files.
1090 * @deprecated Provided for compatibility with the 1.4 API.
1094 svn_ra_do_switch(svn_ra_session_t
*session
,
1095 const svn_ra_reporter2_t
**reporter
,
1096 void **report_baton
,
1097 svn_revnum_t revision_to_switch_to
,
1098 const char *switch_target
,
1099 svn_boolean_t recurse
,
1100 const char *switch_url
,
1101 const svn_delta_editor_t
*switch_editor
,
1106 * Ask the RA layer to describe the status of a working copy with respect
1107 * to @a revision of the repository (or HEAD, if @a revision is invalid).
1109 * The client initially provides a @a status_editor/@a status_baton to the RA
1110 * layer; this editor contains knowledge of where the change will
1111 * begin in the working copy (when open_root() is called).
1113 * In return, the client receives a @a reporter/@a report_baton. The
1114 * client then describes its working copy by making calls into the
1117 * When finished, the client calls @a reporter->finish_report(). The RA
1118 * layer then does a complete drive of @a status_editor, ending with
1119 * close_edit(), to report, essentially, what would be modified in
1120 * the working copy were the client to call do_update().
1121 * @a status_target is an optional single path component will restrict
1122 * the scope of the status report to an entry in the directory
1123 * represented by the @a session's URL, or empty if the entire directory
1124 * is meant to be examined.
1126 * Get status only as deeply as @a depth indicates.
1128 * The caller may not perform any RA operations using @a session
1129 * before finishing the report, and may not perform any RA operations
1130 * using @a session from within the editing operations of @a status_editor.
1132 * Use @a pool for memory allocation.
1134 * @note The reporter provided by this function does NOT supply copy-
1135 * from information to the diff editor callbacks.
1137 * @note In order to prevent pre-1.5 servers from doing more work than
1138 * needed, and sending too much data back, a pre-1.5 'recurse'
1139 * directive may be sent to the server, based on @a depth.
1141 * @since New in 1.5.
1144 svn_ra_do_status2(svn_ra_session_t
*session
,
1145 const svn_ra_reporter3_t
**reporter
,
1146 void **report_baton
,
1147 const char *status_target
,
1148 svn_revnum_t revision
,
1150 const svn_delta_editor_t
*status_editor
,
1156 * Similar to svn_ra_do_status2(), but taking @c svn_ra_reporter2_t
1157 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1158 * @c svn_depth_infinity for depths. The status operation itself is
1159 * performed according to @a recurse: if TRUE, then @a depth is
1160 * @c svn_depth_infinity, else it is @c svn_depth_immediates.
1162 * @deprecated Provided for compatibility with the 1.4 API.
1166 svn_ra_do_status(svn_ra_session_t
*session
,
1167 const svn_ra_reporter2_t
**reporter
,
1168 void **report_baton
,
1169 const char *status_target
,
1170 svn_revnum_t revision
,
1171 svn_boolean_t recurse
,
1172 const svn_delta_editor_t
*status_editor
,
1177 * Ask the RA layer to 'diff' a working copy against @a versus_url;
1178 * it's another form of svn_ra_do_update2().
1180 * @note This function cannot be used to diff a single file, only a
1181 * working copy directory. See the svn_ra_do_switch2() function
1184 * The client initially provides a @a diff_editor/@a diff_baton to the RA
1185 * layer; this editor contains knowledge of where the common diff
1186 * root is in the working copy (when open_root() is called).
1188 * In return, the client receives a @a reporter/@a report_baton. The
1189 * client then describes its working copy by making calls into the
1192 * When finished, the client calls @a reporter->finish_report(). The
1193 * RA layer then does a complete drive of @a diff_editor, ending with
1194 * close_edit(), to transmit the diff.
1196 * @a diff_target is an optional single path component will restrict
1197 * the scope of the diff to an entry in the directory represented by
1198 * the @a session's URL, or empty if the entire directory is meant to be
1199 * one of the diff paths.
1201 * The working copy will be diffed against @a versus_url as it exists
1202 * in revision @a revision, or as it is in head if @a revision is
1203 * @c SVN_INVALID_REVNUM.
1205 * Use @a ignore_ancestry to control whether or not items being
1206 * diffed will be checked for relatedness first. Unrelated items
1207 * are typically transmitted to the editor as a deletion of one thing
1208 * and the addition of another, but if this flag is @c TRUE,
1209 * unrelated items will be diffed as if they were related.
1211 * Diff only as deeply as @a depth indicates.
1213 * The caller may not perform any RA operations using @a session before
1214 * finishing the report, and may not perform any RA operations using
1215 * @a session from within the editing operations of @a diff_editor.
1217 * @a text_deltas instructs the driver of the @a diff_editor to enable
1218 * the generation of text deltas. If @a text_deltas is FALSE the window
1219 * handler returned by apply_textdelta will be called once with a NULL
1220 * @c svn_txdelta_window_t pointer.
1222 * Use @a pool for memory allocation.
1224 * @note The reporter provided by this function does NOT supply copy-
1225 * from information to the diff editor callbacks.
1227 * @note In order to prevent pre-1.5 servers from doing more work than
1228 * needed, and sending too much data back, a pre-1.5 'recurse'
1229 * directive may be sent to the server, based on @a depth.
1231 * @since New in 1.5.
1234 svn_ra_do_diff3(svn_ra_session_t
*session
,
1235 const svn_ra_reporter3_t
**reporter
,
1236 void **report_baton
,
1237 svn_revnum_t revision
,
1238 const char *diff_target
,
1240 svn_boolean_t ignore_ancestry
,
1241 svn_boolean_t text_deltas
,
1242 const char *versus_url
,
1243 const svn_delta_editor_t
*diff_editor
,
1248 * Similar to svn_ra_do_diff3(), but taking @c svn_ra_reporter2_t
1249 * instead of @c svn_ra_reporter3_t, and therefore only able to report
1250 * @c svn_depth_infinity for depths. Perform the diff according to
1251 * @a recurse: if TRUE, then @a depth is @c svn_depth_infinity, else
1252 * it is @c svn_depth_files.
1254 * @deprecated Provided for compatibility with the 1.4 API.
1258 svn_ra_do_diff2(svn_ra_session_t
*session
,
1259 const svn_ra_reporter2_t
**reporter
,
1260 void **report_baton
,
1261 svn_revnum_t revision
,
1262 const char *diff_target
,
1263 svn_boolean_t recurse
,
1264 svn_boolean_t ignore_ancestry
,
1265 svn_boolean_t text_deltas
,
1266 const char *versus_url
,
1267 const svn_delta_editor_t
*diff_editor
,
1273 * Similar to svn_ra_do_diff2(), but with @a text_deltas set to @c TRUE.
1275 * @deprecated Provided for backward compatibility with the 1.3 API.
1279 svn_ra_do_diff(svn_ra_session_t
*session
,
1280 const svn_ra_reporter2_t
**reporter
,
1281 void **report_baton
,
1282 svn_revnum_t revision
,
1283 const char *diff_target
,
1284 svn_boolean_t recurse
,
1285 svn_boolean_t ignore_ancestry
,
1286 const char *versus_url
,
1287 const svn_delta_editor_t
*diff_editor
,
1292 * Invoke @a receiver with @a receiver_baton on each log message from
1293 * @a start to @a end. @a start may be greater or less than @a end;
1294 * this just controls whether the log messages are processed in descending
1295 * or ascending revision number order.
1297 * If @a start or @a end is @c SVN_INVALID_REVNUM, it defaults to youngest.
1299 * If @a paths is non-NULL and has one or more elements, then only show
1300 * revisions in which at least one of @a paths was changed (i.e., if
1301 * file, text or props changed; if dir, props changed or an entry
1302 * was added or deleted). Each path is an <tt>const char *</tt>, relative
1303 * to the @a session's common parent.
1305 * If @a limit is non-zero only invoke @a receiver on the first @a limit
1308 * If @a discover_changed_paths, then each call to receiver passes a
1309 * <tt>const apr_hash_t *</tt> for the receiver's @a changed_paths argument;
1310 * the hash's keys are all the paths committed in that revision.
1311 * Otherwise, each call to receiver passes NULL for @a changed_paths.
1313 * If @a strict_node_history is set, copy history will not be traversed
1314 * (if any exists) when harvesting the revision logs for each path.
1316 * If @a include_merged_revisions is set, log information for revisions
1317 * which have been merged to @a targets will also be returned.
1319 * If @a revprops is NULL, retrieve all revprops; else, retrieve only the
1320 * revprops named in the array (i.e. retrieve none if the array is empty).
1322 * If any invocation of @a receiver returns error, return that error
1323 * immediately and without wrapping it.
1325 * If @a start or @a end is a non-existent revision, return the error
1326 * @c SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a receiver.
1328 * See also the documentation for @c svn_log_message_receiver_t.
1330 * The caller may not invoke any RA operations using @a session from
1331 * within @a receiver.
1333 * Use @a pool for memory allocation.
1335 * @note If @a paths is NULL or empty, the result depends on the
1336 * server. Pre-1.5 servers will send nothing; 1.5 servers will
1337 * effectively perform the log operation on the root of the
1338 * repository. This behavior may be changed in the future to ensure
1339 * consistency across all pedigrees of server.
1341 * @note Pre-1.5 servers do not support custom revprop retrieval; if @a
1342 * revprops is NULL or contains a revprop other than svn:author, svn:date,
1343 * or svn:log, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is returned.
1345 * @since New in 1.5.
1349 svn_ra_get_log2(svn_ra_session_t
*session
,
1350 const apr_array_header_t
*paths
,
1354 svn_boolean_t discover_changed_paths
,
1355 svn_boolean_t strict_node_history
,
1356 svn_boolean_t include_merged_revisions
,
1357 const apr_array_header_t
*revprops
,
1358 svn_log_entry_receiver_t receiver
,
1359 void *receiver_baton
,
1363 * Similar to svn_ra_get_log2(), but uses @c svn_log_message_receiver_t
1364 * instead of @c svn_log_entry_receiver_t. Also, @a
1365 * include_merged_revisions is set to @c FALSE and @a revprops is
1366 * svn:author, svn:date, and svn:log.
1368 * @since New in 1.2.
1369 * @deprecated Provided for backward compatibility with the 1.4 API.
1373 svn_ra_get_log(svn_ra_session_t
*session
,
1374 const apr_array_header_t
*paths
,
1378 svn_boolean_t discover_changed_paths
,
1379 svn_boolean_t strict_node_history
,
1380 svn_log_message_receiver_t receiver
,
1381 void *receiver_baton
,
1385 * Set @a *kind to the node kind associated with @a path at @a revision.
1386 * If @a path does not exist under @a revision, set @a *kind to
1387 * @c svn_node_none. @a path is relative to the @a session's parent URL.
1389 * Use @a pool for memory allocation.
1391 * @since New in 1.2.
1394 svn_ra_check_path(svn_ra_session_t
*session
,
1396 svn_revnum_t revision
,
1397 svn_node_kind_t
*kind
,
1401 * Set @a *dirent to an @c svn_dirent_t associated with @a path at @a
1402 * revision. @a path is relative to the @a session's parent's URL.
1403 * If @a path does not exist in @a revision, set @a *dirent to NULL.
1405 * Use @a pool for memory allocation.
1407 * @since New in 1.2.
1410 svn_ra_stat(svn_ra_session_t
*session
,
1412 svn_revnum_t revision
,
1413 svn_dirent_t
**dirent
,
1418 * Set @a *uuid to the repository's UUID, allocated in @a pool.
1420 * @since New in 1.5.
1423 svn_ra_get_uuid2(svn_ra_session_t
*session
,
1428 * Similar to svn_ra_get_uuid2(), but returns the value allocated in
1429 * @a session's pool.
1431 * @deprecated Provided for backward compatibility with the 1.4 API.
1432 * @since New in 1.2.
1436 svn_ra_get_uuid(svn_ra_session_t
*session
,
1441 * Set @a *url to the repository's root URL, allocated in @a pool.
1442 * The value will not include a trailing '/'. The returned URL is
1443 * guaranteed to be a prefix of the @a session's URL.
1445 * @since New in 1.5.
1448 svn_ra_get_repos_root2(svn_ra_session_t
*session
,
1454 * Similar to svn_ra_get_repos_root2(), but returns the value
1455 * allocated in @a session's pool.
1457 * @deprecated Provided for backward compatibility with the 1.4 API.
1458 * @since New in 1.2.
1462 svn_ra_get_repos_root(svn_ra_session_t
*session
,
1467 * Set @a *locations to the locations (at the repository revisions
1468 * @a location_revisions) of the file identified by @a path in
1469 * @a peg_revision. @a path is relative to the URL to which
1470 * @a session was opened. @a location_revisions is an array of
1471 * @c svn_revnum_t's. @a *locations will be a mapping from the revisions to
1472 * their appropriate absolute paths. If the file doesn't exist in a
1473 * location_revision, that revision will be ignored.
1475 * Use @a pool for all allocations.
1477 * @since New in 1.2.
1480 svn_ra_get_locations(svn_ra_session_t
*session
,
1481 apr_hash_t
**locations
,
1483 svn_revnum_t peg_revision
,
1484 apr_array_header_t
*location_revisions
,
1489 * Call @a receiver (with @a receiver_baton) for each segment in the
1490 * location history of @a path in @a peg_revision, working backwards in
1491 * time from @a start_rev to @a end_rev.
1493 * @a end_rev may be @c SVN_INVALID_REVNUM to indicate that you want
1494 * to trace the history of the object to its origin.
1496 * @a start_rev may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1497 * revision". Otherwise, @a start_rev must be younger than @a end_rev
1498 * (unless @a end_rev is @c SVN_INVALID_REVNUM).
1500 * @a peg_revision may be @c SVN_INVALID_REVNUM to indicate "the HEAD
1501 * revision", and must evaluate to be at least as young as @a start_rev.
1503 * Use @a pool for all allocations.
1505 * @since New in 1.5.
1508 svn_ra_get_location_segments(svn_ra_session_t
*session
,
1510 svn_revnum_t peg_revision
,
1511 svn_revnum_t start_rev
,
1512 svn_revnum_t end_rev
,
1513 svn_location_segment_receiver_t receiver
,
1514 void *receiver_baton
,
1518 * Retrieve a subset of the interesting revisions of a file @a path
1519 * as seen in revision @a end (see svn_fs_history_prev() for a
1520 * definition of "interesting revisions"). Invoke @a handler with
1521 * @a handler_baton as its first argument for each such revision.
1522 * @a session is an open RA session. Use @a pool for all allocations.
1524 * If there is an interesting revision of the file that is less than or
1525 * equal to @a start, the iteration will begin at that revision.
1526 * Else, the iteration will begin at the first revision of the file in
1527 * the repository, which has to be less than or equal to @a end. Note
1528 * that if the function succeeds, @a handler will have been called at
1531 * In a series of calls to @a handler, the file contents for the first
1532 * interesting revision will be provided as a text delta against the
1533 * empty file. In the following calls, the delta will be against the
1534 * fulltext contents for the previous call.
1536 * If @a include_merged_revisions is TRUE, revisions which a included as a
1537 * result of a merge between @a start and @a end will be included.
1539 * @note This functionality is not available in pre-1.1 servers. If the
1540 * server doesn't implement it, an alternative (but much slower)
1541 * implementation based on svn_ra_get_log2() is used.
1543 * @since New in 1.5.
1546 svn_ra_get_file_revs2(svn_ra_session_t
*session
,
1550 svn_boolean_t include_merged_revisions
,
1551 svn_file_rev_handler_t handler
,
1552 void *handler_baton
,
1556 * Similiar to svn_ra_get_file_revs2(), but with @a include_merged_revisions
1559 * @since New in 1.2.
1560 * @deprecated Provided for backward compatibility with the 1.4 API.
1564 svn_ra_get_file_revs(svn_ra_session_t
*session
,
1568 svn_ra_file_rev_handler_t handler
,
1569 void *handler_baton
,
1573 * Lock each path in @a path_revs, which is a hash whose keys are the
1574 * paths to be locked, and whose values are the corresponding base
1575 * revisions for each path.
1577 * Note that locking is never anonymous, so any server implementing
1578 * this function will have to "pull" a username from the client, if
1579 * it hasn't done so already.
1581 * @a comment is optional: it's either an xml-escapable string
1582 * which describes the lock, or it is NULL.
1584 * If any path is already locked by a different user, then call @a
1585 * lock_func/@a lock_baton with an error. If @a steal_lock is TRUE,
1586 * then "steal" the existing lock(s) anyway, even if the RA username
1587 * does not match the current lock's owner. Delete any lock on the
1588 * path, and unconditionally create a new lock.
1590 * For each path, if its base revision (in @a path_revs) is a valid
1591 * revnum, then do an out-of-dateness check. If the revnum is less
1592 * than the last-changed-revision of any path (or if a path doesn't
1593 * exist in HEAD), call @a lock_func/@a lock_baton with an
1594 * SVN_ERR_RA_OUT_OF_DATE error.
1596 * After successfully locking a file, @a lock_func is called with the
1599 * Use @a pool for temporary allocations.
1601 * @since New in 1.2.
1604 svn_ra_lock(svn_ra_session_t
*session
,
1605 apr_hash_t
*path_revs
,
1606 const char *comment
,
1607 svn_boolean_t steal_lock
,
1608 svn_ra_lock_callback_t lock_func
,
1613 * Remove the repository lock for each path in @a path_tokens.
1614 * @a path_tokens is a hash whose keys are the paths to be locked, and
1615 * whose values are the corresponding lock tokens for each path. If
1616 * the path has no corresponding lock token, or if @a break_lock is TRUE,
1617 * then the corresponding value shall be "".
1619 * Note that unlocking is never anonymous, so any server
1620 * implementing this function will have to "pull" a username from
1621 * the client, if it hasn't done so already.
1623 * If @a token points to a lock, but the RA username doesn't match the
1624 * lock's owner, call @a lock_func/@a lock_baton with an error. If @a
1625 * break_lock is TRUE, however, instead allow the lock to be "broken"
1628 * After successfully unlocking a path, @a lock_func is called with
1629 * the @a lock_baton.
1631 * Use @a pool for temporary allocations.
1633 * @since New in 1.2.
1636 svn_ra_unlock(svn_ra_session_t
*session
,
1637 apr_hash_t
*path_tokens
,
1638 svn_boolean_t break_lock
,
1639 svn_ra_lock_callback_t lock_func
,
1644 * If @a path is locked, set @a *lock to an svn_lock_t which
1645 * represents the lock, allocated in @a pool. If @a path is not
1646 * locked, set @a *lock to NULL.
1648 * @since New in 1.2.
1651 svn_ra_get_lock(svn_ra_session_t
*session
,
1657 * Set @a *locks to a hashtable which represents all locks on or
1660 * The hashtable maps (const char *) absolute fs paths to (const
1661 * svn_lock_t *) structures. The hashtable -- and all keys and
1662 * values -- are allocated in @a pool.
1664 * @note It is not considered an error for @a path to not exist in HEAD.
1665 * Such a search will simply return no locks.
1667 * @note This functionality is not available in pre-1.2 servers. If the
1668 * server doesn't implement it, an @c SVN_ERR_RA_NOT_IMPLEMENTED error is
1671 * @since New in 1.2.
1674 svn_ra_get_locks(svn_ra_session_t
*session
,
1681 * Replay the changes from a range of revisions between @a start_revision
1682 * and @a end_revision.
1684 * When receiving information for one revision, a callback @a revstart_func is
1685 * called; this callback will provide an editor and baton through which the
1686 * revision will be replayed.
1687 * When replaying the revision is finished, callback @a revfinish_func will be
1688 * called so the editor can be closed.
1690 * Changes will be limited to those that occur under @a session's URL, and
1691 * the server will assume that the client has no knowledge of revisions
1692 * prior to @a low_water_mark. These two limiting factors define the portion
1693 * of the tree that the server will assume the client already has knowledge of,
1694 * and thus any copies of data from outside that part of the tree will be
1695 * sent in their entirety, not as simple copies or deltas against a previous
1698 * If @a send_deltas is @c TRUE, the actual text and property changes in
1699 * the revision will be sent, otherwise dummy text deltas and NULL property
1700 * changes will be sent instead.
1702 * @a pool is used for all allocation.
1704 * @since New in 1.5.
1707 svn_ra_replay_range(svn_ra_session_t
*session
,
1708 svn_revnum_t start_revision
,
1709 svn_revnum_t end_revision
,
1710 svn_revnum_t low_water_mark
,
1711 svn_boolean_t send_deltas
,
1712 svn_ra_replay_revstart_callback_t revstart_func
,
1713 svn_ra_replay_revfinish_callback_t revfinish_func
,
1718 * Replay the changes from @a revision through @a editor and @a edit_baton.
1720 * Changes will be limited to those that occur under @a session's URL, and
1721 * the server will assume that the client has no knowledge of revisions
1722 * prior to @a low_water_mark. These two limiting factors define the portion
1723 * of the tree that the server will assume the client already has knowledge of,
1724 * and thus any copies of data from outside that part of the tree will be
1725 * sent in their entirety, not as simple copies or deltas against a previous
1728 * If @a send_deltas is @c TRUE, the actual text and property changes in
1729 * the revision will be sent, otherwise dummy text deltas and null property
1730 * changes will be sent instead.
1732 * @a pool is used for all allocation.
1734 * @since New in 1.4.
1737 svn_ra_replay(svn_ra_session_t
*session
,
1738 svn_revnum_t revision
,
1739 svn_revnum_t low_water_mark
,
1740 svn_boolean_t send_deltas
,
1741 const svn_delta_editor_t
*editor
,
1746 * Set @a *has to TRUE if the server represented by @a session has
1747 * @a capability (one of the capabilities beginning with
1748 * @c "SVN_RA_CAPABILITY_"), else set @a *has to FALSE.
1750 * If @a capability isn't recognized, throw @c SVN_ERR_UNKNOWN_CAPABILITY,
1751 * with the effect on @a *has undefined.
1753 * Use @a pool for all allocation.
1755 * @since New in 1.5.
1758 svn_ra_has_capability(svn_ra_session_t
*session
,
1760 const char *capability
,
1764 * Given @a path at revision @a peg_revision, set @a *revision_deleted to the
1765 * revision @a path was first deleted, within the inclusive revision range
1766 * defined by @a peg_revision and @a end_revision. @a path is relative
1767 * to the URL in @a session.
1769 * If @a path does not exist at @a peg_revision or was not deleted within
1770 * the specified range, then set @a *revision_deleted to @c SVN_INVALID_REVNUM.
1771 * If @a peg_revision or @a end_revision are invalid or if @a peg_revision is
1772 * greater than @a end_revision, then return @c SVN_ERR_CLIENT_BAD_REVISION.
1774 * Use @a pool for all allocations.
1776 * @since New in 1.6.
1779 svn_ra_get_deleted_rev(svn_ra_session_t
*session
,
1781 svn_revnum_t peg_revision
,
1782 svn_revnum_t end_revision
,
1783 svn_revnum_t
*revision_deleted
,
1787 * The capability of understanding @c svn_depth_t (e.g., the server
1788 * understands what the client means when the client describes the
1789 * depth of a working copy to the server.)
1791 * @since New in 1.5.
1793 #define SVN_RA_CAPABILITY_DEPTH "depth"
1796 * The capability of doing the right thing with merge-tracking
1797 * information. This capability should be reported bidirectionally,
1798 * because some repositories may want to reject clients that do not
1799 * self-report as knowing how to handle merge-tracking.
1801 * @since New in 1.5.
1803 #define SVN_RA_CAPABILITY_MERGEINFO "mergeinfo"
1806 * The capability of retrieving arbitrary revprops in svn_ra_get_log2.
1808 * @since New in 1.5.
1810 #define SVN_RA_CAPABILITY_LOG_REVPROPS "log-revprops"
1813 * The capability of replaying a directory in the repository (partial replay).
1815 * @since New in 1.5.
1817 #define SVN_RA_CAPABILITY_PARTIAL_REPLAY "partial-replay"
1820 * The capability of including revision properties in a commit.
1822 * @since New in 1.5.
1824 #define SVN_RA_CAPABILITY_COMMIT_REVPROPS "commit-revprops"
1826 /* *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY ***
1828 * RA layers generally fetch all capabilities when asked about any
1829 * capability, to save future round trips. So if you add a new
1830 * capability here, make sure to update the RA layers to remember
1831 * it after any capabilities query.
1833 * Also note that capability strings should not include colons,
1834 * because we pass a list of client capabilities to the start-commit
1835 * hook as a single, colon-separated string.
1839 * Append a textual list of all available RA modules to the stringbuf
1842 * @since New in 1.2.
1845 svn_ra_print_modules(svn_stringbuf_t
*output
,
1850 * Similar to svn_ra_print_modules().
1851 * @a ra_baton is ignored.
1853 * @deprecated Provided for backward compatibility with the 1.1 API.
1857 svn_ra_print_ra_libraries(svn_stringbuf_t
**descriptions
,
1864 * Using this callback struct is similar to calling the newer public
1865 * interface that is based on @c svn_ra_session_t.
1867 * @deprecated Provided for backward compatibility with the 1.1 API.
1869 typedef struct svn_ra_plugin_t
1871 /** The proper name of the RA library, (like "ra_neon" or "ra_local") */
1874 /** Short doc string printed out by `svn --version` */
1875 const char *description
;
1877 /* The vtable hooks */
1879 /** Call svn_ra_open() and set @a session_baton to an object representing
1880 * the new session. All other arguments are passed to svn_ra_open().
1882 svn_error_t
*(*open
)(void **session_baton
,
1883 const char *repos_URL
,
1884 const svn_ra_callbacks_t
*callbacks
,
1885 void *callback_baton
,
1889 /** Call svn_ra_get_latest_revnum() with the session associated with
1890 * @a session_baton and all other arguments.
1892 svn_error_t
*(*get_latest_revnum
)(void *session_baton
,
1893 svn_revnum_t
*latest_revnum
,
1896 /** Call svn_ra_get_dated_revision() with the session associated with
1897 * @a session_baton and all other arguments.
1899 svn_error_t
*(*get_dated_revision
)(void *session_baton
,
1900 svn_revnum_t
*revision
,
1904 /** Call svn_ra_change_rev_prop() with the session associated with
1905 * @a session_baton and all other arguments.
1907 svn_error_t
*(*change_rev_prop
)(void *session_baton
,
1910 const svn_string_t
*value
,
1913 /** Call svn_ra_rev_proplist() with the session associated with
1914 * @a session_baton and all other arguments.
1916 svn_error_t
*(*rev_proplist
)(void *session_baton
,
1921 /** Call svn_ra_rev_prop() with the session associated with
1922 * @a session_baton and all other arguments.
1924 svn_error_t
*(*rev_prop
)(void *session_baton
,
1927 svn_string_t
**value
,
1930 /** Call svn_ra_get_commit_editor() with the session associated with
1931 * @a session_baton and all other arguments plus @a lock_tokens set to
1932 * @c NULL and @a keep_locks set to @c TRUE.
1934 svn_error_t
*(*get_commit_editor
)(void *session_baton
,
1935 const svn_delta_editor_t
**editor
,
1937 const char *log_msg
,
1938 svn_commit_callback_t callback
,
1939 void *callback_baton
,
1942 /** Call svn_ra_get_file() with the session associated with
1943 * @a session_baton and all other arguments.
1945 svn_error_t
*(*get_file
)(void *session_baton
,
1947 svn_revnum_t revision
,
1948 svn_stream_t
*stream
,
1949 svn_revnum_t
*fetched_rev
,
1953 /** Call svn_ra_get_dir() with the session associated with
1954 * @a session_baton and all other arguments.
1956 svn_error_t
*(*get_dir
)(void *session_baton
,
1958 svn_revnum_t revision
,
1959 apr_hash_t
**dirents
,
1960 svn_revnum_t
*fetched_rev
,
1964 /** Call svn_ra_do_update() with the session associated with
1965 * @a session_baton and all other arguments.
1967 svn_error_t
*(*do_update
)(void *session_baton
,
1968 const svn_ra_reporter_t
**reporter
,
1969 void **report_baton
,
1970 svn_revnum_t revision_to_update_to
,
1971 const char *update_target
,
1972 svn_boolean_t recurse
,
1973 const svn_delta_editor_t
*update_editor
,
1977 /** Call svn_ra_do_switch() with the session associated with
1978 * @a session_baton and all other arguments.
1980 svn_error_t
*(*do_switch
)(void *session_baton
,
1981 const svn_ra_reporter_t
**reporter
,
1982 void **report_baton
,
1983 svn_revnum_t revision_to_switch_to
,
1984 const char *switch_target
,
1985 svn_boolean_t recurse
,
1986 const char *switch_url
,
1987 const svn_delta_editor_t
*switch_editor
,
1991 /** Call svn_ra_do_status() with the session associated with
1992 * @a session_baton and all other arguments.
1994 svn_error_t
*(*do_status
)(void *session_baton
,
1995 const svn_ra_reporter_t
**reporter
,
1996 void **report_baton
,
1997 const char *status_target
,
1998 svn_revnum_t revision
,
1999 svn_boolean_t recurse
,
2000 const svn_delta_editor_t
*status_editor
,
2004 /** Call svn_ra_do_diff() with the session associated with
2005 * @a session_baton and all other arguments.
2007 svn_error_t
*(*do_diff
)(void *session_baton
,
2008 const svn_ra_reporter_t
**reporter
,
2009 void **report_baton
,
2010 svn_revnum_t revision
,
2011 const char *diff_target
,
2012 svn_boolean_t recurse
,
2013 svn_boolean_t ignore_ancestry
,
2014 const char *versus_url
,
2015 const svn_delta_editor_t
*diff_editor
,
2019 /** Call svn_ra_get_log() with the session associated with
2020 * @a session_baton and all other arguments. @a limit is set to 0.
2022 svn_error_t
*(*get_log
)(void *session_baton
,
2023 const apr_array_header_t
*paths
,
2026 svn_boolean_t discover_changed_paths
,
2027 svn_boolean_t strict_node_history
,
2028 svn_log_message_receiver_t receiver
,
2029 void *receiver_baton
,
2032 /** Call svn_ra_check_path() with the session associated with
2033 * @a session_baton and all other arguments.
2035 svn_error_t
*(*check_path
)(void *session_baton
,
2037 svn_revnum_t revision
,
2038 svn_node_kind_t
*kind
,
2041 /** Call svn_ra_get_uuid() with the session associated with
2042 * @a session_baton and all other arguments.
2044 svn_error_t
*(*get_uuid
)(void *session_baton
,
2048 /** Call svn_ra_get_repos_root() with the session associated with
2049 * @a session_baton and all other arguments.
2051 svn_error_t
*(*get_repos_root
)(void *session_baton
,
2056 * Call svn_ra_get_locations() with the session associated with
2057 * @a session_baton and all other arguments.
2059 * @since New in 1.1.
2061 svn_error_t
*(*get_locations
)(void *session_baton
,
2062 apr_hash_t
**locations
,
2064 svn_revnum_t peg_revision
,
2065 apr_array_header_t
*location_revisions
,
2069 * Call svn_ra_get_file_revs() with the session associated with
2070 * @a session_baton and all other arguments.
2072 * @since New in 1.1.
2074 svn_error_t
*(*get_file_revs
)(void *session_baton
,
2078 svn_ra_file_rev_handler_t handler
,
2079 void *handler_baton
,
2083 * Return the plugin's version information.
2085 * @since New in 1.1.
2087 const svn_version_t
*(*get_version
)(void);
2093 * All "ra_FOO" implementations *must* export a function named
2094 * svn_ra_FOO_init() of type @c svn_ra_init_func_t.
2096 * When called by libsvn_client, this routine adds an entry (or
2097 * entries) to the hash table for any URL schemes it handles. The hash
2098 * value must be of type (<tt>@c svn_ra_plugin_t *</tt>). @a pool is a
2099 * pool for allocating configuration / one-time data.
2101 * This type is defined to use the "C Calling Conventions" to ensure that
2102 * abi_version is the first parameter. The RA plugin must check that value
2103 * before accessing the other parameters.
2105 * ### need to force this to be __cdecl on Windows... how??
2107 * @deprecated Provided for backward compatibility with the 1.1 API.
2109 typedef svn_error_t
*(*svn_ra_init_func_t
)(int abi_version
,
2114 * The current ABI (Application Binary Interface) version for the
2115 * RA plugin model. This version number will change when the ABI
2116 * between the SVN core (e.g. libsvn_client) and the RA plugin changes.
2118 * An RA plugin should verify that the passed version number is acceptable
2119 * before accessing the rest of the parameters, and before returning any
2122 * It is entirely acceptable for an RA plugin to accept multiple ABI
2123 * versions. It can simply interpret the parameters based on the version,
2124 * and it can return different plugin structures.
2128 * VSN DATE REASON FOR CHANGE
2129 * --- ---------- ------------------------------------------------
2130 * 1 2001-02-17 Initial revision.
2131 * 2 2004-06-29 Preparing for svn 1.1, which adds new RA vtable funcs.
2132 * 2005-01-19 Rework the plugin interface and don't provide the vtable
2133 * to the client. Separate ABI versions are no longer used.
2136 * @deprecated Provided for backward compatibility with the 1.0 API.
2138 #define SVN_RA_ABI_VERSION 2
2140 /* Public RA implementations. */
2142 /** Initialize libsvn_ra_neon.
2144 * @deprecated Provided for backward compatibility with the 1.1 API. */
2147 svn_ra_dav_init(int abi_version
,
2151 /** Initialize libsvn_ra_local.
2153 * @deprecated Provided for backward compatibility with the 1.1 API. */
2156 svn_ra_local_init(int abi_version
,
2160 /** Initialize libsvn_ra_svn.
2162 * @deprecated Provided for backward compatibility with the 1.1 API. */
2165 svn_ra_svn_init(int abi_version
,
2169 /** Initialize libsvn_ra_serf.
2171 * @since New in 1.4.
2172 * @deprecated Provided for backward compatibility with the 1.1 API. */
2175 svn_ra_serf_init(int abi_version
,
2181 * Initialize the compatibility wrapper, using @a pool for any allocations.
2182 * The caller must hold on to @a ra_baton as long as the RA library is used.
2184 * @deprecated Provided for backward compatibility with the 1.1 API.
2188 svn_ra_init_ra_libs(void **ra_baton
,
2192 * Return an RA vtable-@a library which can handle URL. A number of
2193 * svn_client_* routines will call this internally, but client apps might
2194 * use it too. $a ra_baton is a baton obtained by a call to
2195 * svn_ra_init_ra_libs().
2197 * @deprecated Provided for backward compatibility with the 1.1 API.
2201 svn_ra_get_ra_library(svn_ra_plugin_t
**library
,
2208 #endif /* __cplusplus */
2210 #endif /* SVN_RA_H */