Subversion
Loading...
Searching...
No Matches
svn_repos.h
Go to the documentation of this file.
1/**
2 * @copyright
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 * ====================================================================
21 * @endcopyright
22 *
23 * @file svn_repos.h
24 * @brief Tools built on top of the filesystem.
25 */
26
27#ifndef SVN_REPOS_H
28#define SVN_REPOS_H
29
30#include <apr_pools.h>
31#include <apr_hash.h>
32#include <apr_tables.h>
33#include <apr_time.h>
34
35#include "svn_types.h"
36#include "svn_string.h"
37#include "svn_delta.h"
38#include "svn_fs.h"
39#include "svn_io.h"
40#include "svn_mergeinfo.h"
41
42
43#ifdef __cplusplus
44extern "C" {
45#endif /* __cplusplus */
46
47/* ---------------------------------------------------------------*/
48
49/**
50 * Get libsvn_repos version information.
51 *
52 * @since New in 1.1.
53 */
54const svn_version_t *
56
57
58/* Some useful enums. They need to be declared here for the notification
59 system to pick them up. */
60/** The different "actions" attached to nodes in the dumpfile. */
62{
63 svn_node_action_change,
64 svn_node_action_add,
65 svn_node_action_delete,
66 svn_node_action_replace
67};
68
69␌
70/** @defgroup svn_repos_authz_callbacks Repository authorization callbacks
71 * @{
72 */
73
74/** Callback type for checking authorization on a path.
75 *
76 * Set @a *allowed to TRUE to indicate that some operation is
77 * authorized for @a path in @a root, or set it to FALSE to indicate
78 * unauthorized (presumably according to state stored in @a baton).
79 *
80 * Do not assume @a pool has any lifetime beyond this call.
81 *
82 * The exact operation being authorized depends on the callback
83 * implementation. For read authorization, for example, the caller
84 * would implement an instance that does read checking, and pass it as
85 * a parameter named [perhaps] 'authz_read_func'. The receiver of
86 * that parameter might also take another parameter named
87 * 'authz_write_func', which although sharing this type, would be a
88 * different implementation.
89 *
90 * @note If someday we want more sophisticated authorization states
91 * than just yes/no, @a allowed can become an enum type.
92 */
93typedef svn_error_t *(*svn_repos_authz_func_t)(svn_boolean_t *allowed,
94 svn_fs_root_t *root,
95 const char *path,
96 void *baton,
97 apr_pool_t *pool);
98
99
100/** An enum defining the kinds of access authz looks up.
101 *
102 * @since New in 1.3.
103 */
105{
106 /** No access. */
108
109 /** Path can be read. */
111
112 /** Path can be altered. */
114
115 /** The other access credentials are recursive. */
118
119
120/** Callback type for checking authorization on paths produced by
121 * the repository commit editor.
122 *
123 * Set @a *allowed to TRUE to indicate that the @a required access on
124 * @a path in @a root is authorized, or set it to FALSE to indicate
125 * unauthorized (presumable according to state stored in @a baton).
126 *
127 * If @a path is NULL, the callback should perform a global authz
128 * lookup for the @a required access. That is, the lookup should
129 * check if the @a required access is granted for at least one path of
130 * the repository, and set @a *allowed to TRUE if so. @a root may
131 * also be NULL if @a path is NULL.
132 *
133 * This callback is very similar to svn_repos_authz_func_t, with the
134 * exception of the addition of the @a required parameter.
135 * This is due to historical reasons: when authz was first implemented
136 * for svn_repos_dir_delta2(), it seemed there would need only checks
137 * for read and write operations, hence the svn_repos_authz_func_t
138 * callback prototype and usage scenario. But it was then realized
139 * that lookups due to copying needed to be recursive, and that
140 * brute-force recursive lookups didn't square with the O(1)
141 * performances a copy operation should have.
142 *
143 * So a special way to ask for a recursive lookup was introduced. The
144 * commit editor needs this capability to retain acceptable
145 * performance. Instead of revving the existing callback, causing
146 * unnecessary revving of functions that don't actually need the
147 * extended functionality, this second, more complete callback was
148 * introduced, for use by the commit editor.
149 *
150 * Some day, it would be nice to reunite these two callbacks and do
151 * the necessary revving anyway, but for the time being, this dual
152 * callback mechanism will do.
153 */
154typedef svn_error_t *(*svn_repos_authz_callback_t)
155 (svn_repos_authz_access_t required,
156 svn_boolean_t *allowed,
157 svn_fs_root_t *root,
158 const char *path,
159 void *baton,
160 apr_pool_t *pool);
161
162/** @} */
163
164
165/** @defgroup svn_repos_notifications Repository notifications
166 * @{
167 */
168
169/* Notification system. */
170
171/** The type of action occurring.
172 *
173 * @since New in 1.7.
174 */
176{
177 /** A warning message is waiting. */
179
180 /** A revision has finished being dumped. */
182
183 /** A revision has finished being verified. */
185
186 /** All revisions have finished being dumped. */
188
189 /** All revisions have finished being verified. */
191
192 /** packing of an FSFS shard has commenced */
194
195 /** packing of an FSFS shard is completed */
197
198 /** packing of the shard revprops has commenced */
200
201 /** packing of the shard revprops has completed */
203
204 /** A revision has begun loading */
206
207 /** A revision has finished loading */
209
210 /** A node has begun loading */
212
213 /** A node has finished loading */
215
216 /** A copied node has been encountered */
218
219 /** Mergeinfo has been normalized */
221
222 /** The operation has acquired a mutex for the repo. */
224
225 /** Recover has started. */
227
228 /** Upgrade has started. */
230
231 /** A revision was skipped during loading. @since New in 1.8. */
233
234 /** The structure of a revision is being verified. @since New in 1.8. */
236
237 /** A revprop shard got packed. @since New in 1.9. */
239
240 /** A non-packed revprop shard got removed. @since New in 1.9. */
242
243 /** The repository format got bumped. @since New in 1.9. */
245
246 /** A revision range was copied. @since New in 1.9. */
248
249 /** The repository pack did not do anything. @since New in 1.10. */
251
252 /** The revision properties got set. @since New in 1.10. */
255
256/** The type of warning occurring.
257 *
258 * @since New in 1.7.
259 */
261{
262 /** Referencing copy source data from a revision earlier than the
263 * first revision dumped. */
265
266 /** An #SVN_PROP_MERGEINFO property's encoded mergeinfo references a
267 * revision earlier than the first revision dumped. */
269
270 /** Found an invalid path in the filesystem.
271 * @see svn_fs.h:"Directory entry names and directory paths" */
272 /* ### TODO(doxygen): make that a proper doxygen link */
273 /* See svn_fs__path_valid(). */
275
276 /**
277 * Detected a name collision. Reported when the names of two or more
278 * entries in the same directory differ only in character
279 * representation (normalization), but are otherwise identical.
280 *
281 * @since New in 1.9.
282 */
284
285 /**
286 * Detected a mergeinfo path collision. Reported when the paths in
287 * two or more entries in the same svn:mergeinfo property differ
288 * only in character representation (normalization), but are
289 * otherwise identical.
290 *
291 * @since New in 1.9.
292 */
294
295 /**
296 * Detected invalid mergeinfo.
297 *
298 * @since New in 1.9.
299 */
302
303/**
304 * Structure used by #svn_repos_notify_func_t.
305 *
306 * The only field guaranteed to be populated is @c action. Other fields are
307 * dependent upon the @c action. (See individual fields for more information.)
308 *
309 * @note Callers of notification functions should use
310 * svn_repos_notify_create() to create structures of this type to allow for
311 * future extensibility.
312 *
313 * @since New in 1.7.
314 */
315typedef struct svn_repos_notify_t
316{
317 /** Action that describes what happened in the repository. */
319
320 /** For #svn_repos_notify_dump_rev_end and #svn_repos_notify_verify_rev_end,
321 * the revision which just completed.
322 * For #svn_fs_upgrade_format_bumped, the new format version. */
324
325 /** For #svn_repos_notify_warning, the warning message. */
326 const char *warning_str;
327 /** For #svn_repos_notify_warning, the warning type. */
329
330 /** For #svn_repos_notify_pack_shard_start,
331 #svn_repos_notify_pack_shard_end,
332 #svn_repos_notify_pack_revprops,
333 #svn_repos_notify_cleanup_revprops
334 #svn_repos_notify_pack_shard_start_revprop, and
335 #svn_repos_notify_pack_shard_end_revprop, the shard processed. */
336 apr_int64_t shard;
337
338 /** For #svn_repos_notify_load_txn_committed, the revision committed. */
340
341 /** For #svn_repos_notify_load_txn_committed, the source revision, if
342 different from @a new_revision, otherwise #SVN_INVALID_REVNUM.
343 For #svn_repos_notify_load_txn_start and
344 #svn_repos_notify_load_skipped_rev, the source revision. */
346
347 /** For #svn_repos_notify_load_node_start, the action being taken on the
348 node. */
350
351 /** For #svn_repos_notify_load_node_start, the path of the node. */
352 const char *path;
353
354 /** For #svn_repos_notify_hotcopy_rev_range, the start of the copied
355 revision range.
356 @since New in 1.9. */
358
359 /** For #svn_repos_notify_hotcopy_rev_range, the end of the copied
360 revision range (might be the same as @a start_revision).
361 @since New in 1.9. */
363
364 /* NOTE: Add new fields at the end to preserve binary compatibility.
365 Also, if you add fields here, you have to update
366 svn_repos_notify_create(). */
368
369/** Callback for providing notification from the repository.
370 * Returns @c void. Justification: success of an operation is not dependent
371 * upon successful notification of that operation.
372 *
373 * @since New in 1.7. */
374typedef void (*svn_repos_notify_func_t)(void *baton,
375 const svn_repos_notify_t *notify,
376 apr_pool_t *scratch_pool);
377
378/** Callback for filtering repository contents during dump.
379 *
380 * Set @a *include to TRUE to indicate that node, identified by path
381 * @a path in @a root should be included in dump, or set it to @c FALSE
382 * to indicate that node should be excluded (presumably according to state
383 * stored in @a baton).
384 *
385 * Do not assume @a scratch_pool has any lifetime beyond this call.
386 *
387 * @since New in 1.10.
388 */
389typedef svn_error_t * (*svn_repos_dump_filter_func_t)(
390 svn_boolean_t *include,
391 svn_fs_root_t *root,
392 const char *path,
393 void *baton,
394 apr_pool_t *scratch_pool);
395
396/**
397 * Allocate an #svn_repos_notify_t structure in @a result_pool, initialize
398 * and return it.
399 *
400 * @since New in 1.7.
401 */
404 apr_pool_t *result_pool);
405
406␌/** @} */
407
408
409/** The repository object. */
411
412/* Opening and creating repositories. */
413
414
415/** Find the root path of the repository that contains @a path.
416 *
417 * If a repository was found, the path to the root of the repository
418 * is returned, else @c NULL. The pointer to the returned path may be
419 * equal to @a path.
420 */
421const char *
423 apr_pool_t *pool);
424
425/** Set @a *repos_p to a repository object for the repository at @a path.
426 *
427 * Allocate @a *repos_p in @a result_pool.
428 *
429 * Acquires a shared lock on the repository, and attaches a cleanup
430 * function to @a result_pool to remove the lock. If no lock can be acquired,
431 * returns error, with undefined effect on @a *repos_p. If an exclusive
432 * lock is present, this blocks until it's gone. @a fs_config will be
433 * passed to the filesystem initialization function and may be @c NULL.
434 *
435 * Use @a scratch_pool for temporary allocations.
436 *
437 * @since New in 1.9.
438 */
441 const char *path,
442 apr_hash_t *fs_config,
443 apr_pool_t *result_pool,
444 apr_pool_t *scratch_pool);
445
446/** Similar to svn_repos_open3() but without @a scratch_pool.
447 *
448 * @deprecated Provided for backward compatibility with 1.8 API.
449 * @since New in 1.7.
450 */
454 const char *path,
455 apr_hash_t *fs_config,
456 apr_pool_t *pool);
457
458/** Similar to svn_repos_open2() with @a fs_config set to NULL.
459 *
460 * @deprecated Provided for backward compatibility with 1.6 API.
461 */
465 const char *path,
466 apr_pool_t *pool);
467
468/** Create a new Subversion repository at @a path, building the necessary
469 * directory structure, creating the filesystem, and so on.
470 * Return the repository object in @a *repos_p, allocated in @a pool.
471 *
472 * @a config is a client configuration hash of #svn_config_t * items
473 * keyed on config category names, and may be NULL.
474 *
475 * @a fs_config is passed to the filesystem, and may be NULL.
476 *
477 * @a unused_1 and @a unused_2 are not used and should be NULL.
478 */
481 const char *path,
482 const char *unused_1,
483 const char *unused_2,
484 apr_hash_t *config,
485 apr_hash_t *fs_config,
486 apr_pool_t *pool);
487
488/**
489 * Upgrade the Subversion repository (and its underlying versioned
490 * filesystem) located in the directory @a path to the latest version
491 * supported by this library. If the requested upgrade is not
492 * supported due to the current state of the repository or it
493 * underlying filesystem, return #SVN_ERR_REPOS_UNSUPPORTED_UPGRADE
494 * or #SVN_ERR_FS_UNSUPPORTED_UPGRADE (respectively) and make no
495 * changes to the repository or filesystem.
496 *
497 * Acquires an exclusive lock on the repository, upgrades the
498 * repository, and releases the lock. If an exclusive lock can't be
499 * acquired, returns error.
500 *
501 * If @a nonblocking is TRUE, an error of type EWOULDBLOCK is
502 * returned if the lock is not immediately available.
503 *
504 * If @a start_callback is not NULL, it will be called with @a
505 * start_callback_baton as argument before the upgrade starts, but
506 * after the exclusive lock has been acquired.
507 *
508 * Use @a pool for necessary allocations.
509 *
510 * @note This functionality is provided as a convenience for
511 * administrators wishing to make use of new Subversion functionality
512 * without a potentially costly full repository dump/load. As such,
513 * the operation performs only the minimum amount of work needed to
514 * accomplish this while maintaining the integrity of the repository.
515 * It does *not* guarantee the most optimized repository state as a
516 * dump and subsequent load would.
517 *
518 * @note On some platforms the exclusive lock does not exclude other
519 * threads in the same process so this function should only be called
520 * by a single threaded process, or by a multi-threaded process when
521 * no other threads are accessing the repository.
522 *
523 * @since New in 1.7.
524 */
527 svn_boolean_t nonblocking,
528 svn_repos_notify_func_t notify_func,
529 void *notify_baton,
530 apr_pool_t *pool);
531
532/**
533 * Similar to svn_repos_upgrade2(), but with @a start_callback and baton,
534 * rather than a notify_callback / baton
535 *
536 * @since New in 1.5.
537 * @deprecated Provided for backward compatibility with the 1.6 API.
538 */
542 svn_boolean_t nonblocking,
543 svn_error_t *(*start_callback)(void *baton),
544 void *start_callback_baton,
545 apr_pool_t *pool);
546
547/** Destroy the Subversion repository found at @a path, using @a pool for any
548 * necessary allocations.
549 */
552 apr_pool_t *pool);
553
554
555/** @defgroup svn_repos_capabilities Repository capabilities
556 * @{
557 */
558
559/**
560 * Set @a *has to TRUE if @a repos has @a capability (one of the
561 * capabilities beginning with @c "SVN_REPOS_CAPABILITY_"), else set
562 * @a *has to FALSE.
563 *
564 * If @a capability isn't recognized, throw #SVN_ERR_UNKNOWN_CAPABILITY,
565 * with the effect on @a *has undefined.
566 *
567 * Use @a pool for all allocation.
568 *
569 * @since New in 1.5.
570 */
573 svn_boolean_t *has,
574 const char *capability,
575 apr_pool_t *pool);
576
577/**
578 * Return a set of @a capabilities supported by the running Subversion
579 * library and by @a repos. (Capabilities supported by this version of
580 * Subversion but not by @a repos are not listed. This may happen when
581 * svn_repos_upgrade2() has not been called after a software upgrade.)
582 *
583 * The set is represented as a hash whose const char * keys are the set
584 * members. The values are not defined.
585 *
586 * Allocate @a capabilities in @a result_pool and use @a scratch_pool for
587 * temporary allocations.
588 *
589 * @see svn_repos_info_format
590 *
591 * @since New in 1.9.
592 */
594svn_repos_capabilities(apr_hash_t **capabilities,
595 svn_repos_t *repos,
596 apr_pool_t *result_pool,
597 apr_pool_t *scratch_pool);
598
599/**
600 * The capability of doing the right thing with merge-tracking
601 * information, both storing it and responding to queries about it.
602 *
603 * @since New in 1.5.
604 */
605#define SVN_REPOS_CAPABILITY_MERGEINFO "mergeinfo"
606/* *** PLEASE READ THIS IF YOU ADD A NEW CAPABILITY ***
607 *
608 * @c SVN_REPOS_CAPABILITY_foo strings should not include colons, to
609 * be consistent with @c SVN_RA_CAPABILITY_foo strings, which forbid
610 * colons for their own reasons. While this RA limitation has no
611 * direct impact on repository capabilities, there's no reason to be
612 * gratuitously different either.
613 *
614 * If you add a capability, update svn_repos_capabilities().
615 */
616
617/** @} */
618
619
620/**
621 * Store in @a repos the client-reported capabilities @a capabilities,
622 * which must be allocated in memory at least as long-lived as @a repos.
623 *
624 * The elements of @a capabilities are 'const char *', a subset of
625 * the constants beginning with @c SVN_RA_CAPABILITY_.
626 * @a capabilities is not copied, so changing it later will affect
627 * what is remembered by @a repos.
628 *
629 * @note The capabilities are passed along to the start-commit hook;
630 * see that hook's template for details.
631 *
632 * @note As of Subversion 1.5, there are no error conditions defined,
633 * so this always returns SVN_NO_ERROR. In future releases it may
634 * return error, however, so callers should check.
635 *
636 * @since New in 1.5.
637 */
640 const apr_array_header_t *capabilities);
641
642
643/** Return the filesystem associated with repository object @a repos. */
644svn_fs_t *
646
647/** Return the type of filesystem associated with repository object
648 * @a repos allocated in @a result_pool.
649 *
650 * @see #svn_fs_backend_names
651 *
652 * @since New in 1.9.
653 */
654const char *
656 apr_pool_t *result_pool);
657
658/** Make a hot copy of the Subversion repository found at @a src_path
659 * to @a dst_path.
660 *
661 * Copy a possibly live Subversion repository from @a src_path to
662 * @a dst_path. If @a clean_logs is @c TRUE, perform cleanup on the
663 * source filesystem as part of the copy operation; currently, this
664 * means deleting copied, unused logfiles for a Berkeley DB source
665 * repository.
666 *
667 * If @a incremental is TRUE, make an effort to not re-copy information
668 * already present in the destination. If incremental hotcopy is not
669 * implemented by the filesystem backend, raise SVN_ERR_UNSUPPORTED_FEATURE.
670 *
671 * For each revision range copied, the @a notify_func function will be
672 * called with the @a notify_baton and a notification structure containing
673 * appropriate values in @c start_revision and @c end_revision (both
674 * inclusive). @c start_revision might be equal to @c end_revision in
675 * case the copied range consists of a single revision. Currently, this
676 * notification is not triggered by the BDB backend. @a notify_func
677 * may be @c NULL if this notification is not required.
678 *
679 * The optional @a cancel_func callback will be invoked with
680 * @a cancel_baton as usual to allow the user to preempt this potentially
681 * lengthy operation.
682 *
683 * Use @a scratch_pool for temporary allocations.
684 *
685 * @since New in 1.9.
686 */
688svn_repos_hotcopy3(const char *src_path,
689 const char *dst_path,
690 svn_boolean_t clean_logs,
691 svn_boolean_t incremental,
692 svn_repos_notify_func_t notify_func,
693 void *notify_baton,
694 svn_cancel_func_t cancel_func,
695 void *cancel_baton,
696 apr_pool_t *scratch_pool);
697
698/**
699 * Like svn_repos_hotcopy3(), but with @a notify_func and @a notify_baton
700 * always passed as @c NULL.
701 *
702 * @since New in 1.8.
703 * @deprecated Provided for backward compatibility with the 1.8 API.
704 */
707svn_repos_hotcopy2(const char *src_path,
708 const char *dst_path,
709 svn_boolean_t clean_logs,
710 svn_boolean_t incremental,
711 svn_cancel_func_t cancel_func,
712 void *cancel_baton,
713 apr_pool_t *pool);
714
715/**
716 * Like svn_repos_hotcopy2(), but with @a incremental always passed as
717 * @c FALSE and without cancellation support.
718 *
719 * @deprecated Provided for backward compatibility with the 1.6 API.
720 */
723svn_repos_hotcopy(const char *src_path,
724 const char *dst_path,
725 svn_boolean_t clean_logs,
726 apr_pool_t *pool);
727
728
729/**
730 * Possibly update the repository, @a repos, to use a more efficient
731 * filesystem representation. Use @a pool for allocations.
732 *
733 * @since New in 1.7.
734 */
737 svn_repos_notify_func_t notify_func,
738 void *notify_baton,
739 svn_cancel_func_t cancel_func,
740 void *cancel_baton,
741 apr_pool_t *pool);
742
743/**
744 * Similar to svn_repos_fs_pack2(), but with a #svn_fs_pack_notify_t instead
745 * of a #svn_repos_notify_t.
746 *
747 * @since New in 1.6.
748 * @deprecated Provided for backward compatibility with the 1.6 API.
749 */
753 svn_fs_pack_notify_t notify_func,
754 void *notify_baton,
755 svn_cancel_func_t cancel_func,
756 void *cancel_baton,
757 apr_pool_t *pool);
758
759/**
760 * Run database recovery procedures on the repository at @a path,
761 * returning the database to a consistent state. Use @a pool for all
762 * allocation.
763 *
764 * Acquires an exclusive lock on the repository, recovers the
765 * database, and releases the lock. If an exclusive lock can't be
766 * acquired, returns error.
767 *
768 * If @a nonblocking is TRUE, an error of type EWOULDBLOCK is
769 * returned if the lock is not immediately available.
770 *
771 * If @a notify_func is not NULL, it will be called with @a
772 * notify_baton as argument before the recovery starts, but
773 * after the exclusive lock has been acquired.
774 *
775 * If @a cancel_func is not @c NULL, it is called periodically with
776 * @a cancel_baton as argument to see if the client wishes to cancel
777 * the recovery.
778 *
779 * @note On some platforms the exclusive lock does not exclude other
780 * threads in the same process so this function should only be called
781 * by a single threaded process, or by a multi-threaded process when
782 * no other threads are accessing the repository.
783 *
784 * @since New in 1.7.
785 */
788 svn_boolean_t nonblocking,
789 svn_repos_notify_func_t notify_func,
790 void *notify_baton,
791 svn_cancel_func_t cancel_func,
792 void * cancel_baton,
793 apr_pool_t *pool);
794
795/**
796 * Similar to svn_repos_recover4(), but with @a start callback in place of
797 * the notify_func / baton.
798 *
799 * @since New in 1.5.
800 * @deprecated Provided for backward compatibility with the 1.6 API.
801 */
805 svn_boolean_t nonblocking,
806 svn_error_t *(*start_callback)(void *baton),
807 void *start_callback_baton,
808 svn_cancel_func_t cancel_func,
809 void * cancel_baton,
810 apr_pool_t *pool);
811
812/**
813 * Similar to svn_repos_recover3(), but without cancellation support.
814 *
815 * @deprecated Provided for backward compatibility with the 1.4 API.
816 */
820 svn_boolean_t nonblocking,
821 svn_error_t *(*start_callback)(void *baton),
822 void *start_callback_baton,
823 apr_pool_t *pool);
824
825/**
826 * Similar to svn_repos_recover2(), but with nonblocking set to FALSE, and
827 * with no callbacks provided.
828 *
829 * @deprecated Provided for backward compatibility with the 1.0 API.
830 */
834 apr_pool_t *pool);
835
836/**
837 * Callback for svn_repos_freeze.
838 *
839 * @since New in 1.8.
840 */
841typedef svn_error_t *(*svn_repos_freeze_func_t)(void *baton, apr_pool_t *pool);
842
843/**
844 * Take an exclusive lock on each of the repositories in @a paths to
845 * prevent commits and then while holding all the locks invoke @a
846 * freeze_func passing @a freeze_baton. Each repository may be readable by
847 * Subversion while frozen, or may be unreadable, depending on which
848 * FS backend the repository uses. Repositories are locked in the
849 * order in which they are specified in the array.
850 *
851 * @note @a freeze_func must not, directly or indirectly, call any function
852 * that attempts to take out a lock on the underlying repository. These
853 * include functions for packing, hotcopying, setting revprops and commits.
854 * Attempts to do so may result in a deadlock.
855 *
856 * @note On some platforms the exclusive lock does not exclude other
857 * threads in the same process so this function should only be called
858 * by a single threaded process, or by a multi-threaded process when
859 * no other threads are accessing the repositories.
860 *
861 * @since New in 1.8.
862 */
864svn_repos_freeze(const apr_array_header_t *paths,
865 svn_repos_freeze_func_t freeze_func,
866 void *freeze_baton,
867 apr_pool_t *pool);
868
869/** This function is a wrapper around svn_fs_berkeley_logfiles(),
870 * returning log file paths relative to the root of the repository.
871 *
872 * @copydoc svn_fs_berkeley_logfiles()
873 */
875svn_repos_db_logfiles(apr_array_header_t **logfiles,
876 const char *path,
877 svn_boolean_t only_unused,
878 apr_pool_t *pool);
879
880
881␌
882/* Repository Paths */
883
884/** Return the top-level repository path allocated in @a pool. */
885const char *
887 apr_pool_t *pool);
888
889/** Return the path to @a repos's filesystem directory, allocated in
890 * @a pool.
891 */
892const char *
894 apr_pool_t *pool);
895
896/** Return path to @a repos's config directory, allocated in @a pool. */
897const char *
899 apr_pool_t *pool);
900
901/** Return path to @a repos's svnserve.conf, allocated in @a pool. */
902const char *
904 apr_pool_t *pool);
905
906/** Return path to @a repos's lock directory, allocated in @a pool. */
907const char *
909 apr_pool_t *pool);
910
911/** Return path to @a repos's db lockfile, allocated in @a pool. */
912const char *
914 apr_pool_t *pool);
915
916/** Return path to @a repos's db logs lockfile, allocated in @a pool. */
917const char *
919 apr_pool_t *pool);
920
921/** Return the path to @a repos's hook directory, allocated in @a pool. */
922const char *
924 apr_pool_t *pool);
925
926/** Return the path to @a repos's start-commit hook, allocated in @a pool. */
927const char *
929 apr_pool_t *pool);
930
931/** Return the path to @a repos's pre-commit hook, allocated in @a pool. */
932const char *
934 apr_pool_t *pool);
935
936/** Return the path to @a repos's post-commit hook, allocated in @a pool. */
937const char *
939 apr_pool_t *pool);
940
941/** Return the path to @a repos's pre-revprop-change hook, allocated in
942 * @a pool.
943 */
944const char *
946 apr_pool_t *pool);
947
948/** Return the path to @a repos's post-revprop-change hook, allocated in
949 * @a pool.
950 */
951const char *
953 apr_pool_t *pool);
954
955
956/** @defgroup svn_repos_lock_hooks Paths to lock hooks
957 * @{
958 * @since New in 1.2. */
959
960/** Return the path to @a repos's pre-lock hook, allocated in @a pool. */
961const char *
963 apr_pool_t *pool);
964
965/** Return the path to @a repos's post-lock hook, allocated in @a pool. */
966const char *
968 apr_pool_t *pool);
969
970/** Return the path to @a repos's pre-unlock hook, allocated in @a pool. */
971const char *
973 apr_pool_t *pool);
974
975/** Return the path to @a repos's post-unlock hook, allocated in @a pool. */
976const char *
978 apr_pool_t *pool);
979
980/** Specify that Subversion should consult the configuration file
981 * located at @a hooks_env_path to determine how to setup the
982 * environment for hook scripts invoked for the repository @a repos.
983 * As a special case, if @a hooks_env_path is @c NULL, look for the
984 * file in its default location within the repository disk structure.
985 * If @a hooks_env_path is not absolute, it specifies a path relative
986 * to the parent of the file's default location.
987 *
988 * Use @a scratch_pool for temporary allocations.
989 *
990 * If this function is not called, or if the specified configuration
991 * file does not define any environment variables, hooks will run in
992 * an empty environment.
993 *
994 * @since New in 1.8.
995 */
998 const char *hooks_env_path,
999 apr_pool_t *scratch_pool);
1000
1001/** @} */
1002
1003/* ---------------------------------------------------------------*/
1004␌
1005/* Reporting the state of a working copy, for updates. */
1006
1007
1008/**
1009 * Construct and return a @a report_baton that will be passed to the
1010 * other functions in this section to describe the state of a pre-existing
1011 * tree (typically, a working copy). When the report is finished,
1012 * @a editor/@a edit_baton will be driven in such a way as to transform the
1013 * existing tree to @a revnum and, if @a tgt_path is non-NULL, switch the
1014 * reported hierarchy to @a tgt_path.
1015 *
1016 * @a fs_base is the absolute path of the node in the filesystem at which
1017 * the comparison should be rooted. @a target is a single path component,
1018 * used to limit the scope of the report to a single entry of @a fs_base,
1019 * or "" if all of @a fs_base itself is the main subject of the report.
1020 *
1021 * @a tgt_path and @a revnum is the fs path/revision pair that is the
1022 * "target" of the delta. @a tgt_path should be provided only when
1023 * the source and target paths of the report differ. That is, @a tgt_path
1024 * should *only* be specified when specifying that the resultant editor
1025 * drive be one that transforms the reported hierarchy into a pristine tree
1026 * of @a tgt_path at revision @a revnum. A @c NULL value for @a tgt_path
1027 * will indicate that the editor should be driven in such a way as to
1028 * transform the reported hierarchy to revision @a revnum, preserving the
1029 * reported hierarchy.
1030 *
1031 * @a text_deltas instructs the driver of the @a editor to enable
1032 * the generation of text deltas.
1033 *
1034 * @a ignore_ancestry instructs the driver to ignore node ancestry
1035 * when determining how to transmit differences.
1036 *
1037 * @a send_copyfrom_args instructs the driver to send 'copyfrom'
1038 * arguments to the editor's add_file() and add_directory() methods,
1039 * and therefore to send their content as deltas against the copy source,
1040 * whenever it deems feasible. The implementation only does so for
1041 * add_file(), and only when the file itself is the copy root (not when
1042 * the file is part of a copied subtree).
1043 *
1044 * Use @a authz_read_func and @a authz_read_baton (if not @c NULL) to
1045 * avoid sending data through @a editor/@a edit_baton which is not
1046 * authorized for transmission.
1047 *
1048 * @a zero_copy_limit controls the maximum size (in bytes) at which
1049 * data blocks may be sent using the zero-copy code path. On that
1050 * path, a number of in-memory copy operations have been eliminated to
1051 * maximize throughput. However, until the whole block has been
1052 * pushed to the network stack, other clients block, so be careful
1053 * when using larger values here. Pass 0 for @a zero_copy_limit to
1054 * disable this optimization altogether.
1055 *
1056 * @note Never activate this optimization if @a editor might access
1057 * any FSFS data structures (and, hence, caches). So, it is basically
1058 * safe for networked editors only.
1059 *
1060 * All allocation for the context and collected state will occur in
1061 * @a pool.
1062 *
1063 * @a depth is the requested depth of the editor drive.
1064 *
1065 * If @a depth is #svn_depth_unknown, the editor will affect only the
1066 * paths reported by the individual calls to svn_repos_set_path3() and
1067 * svn_repos_link_path3().
1068 *
1069 * For example, if the reported tree is the @c A subdir of the Greek Tree
1070 * (see Subversion's test suite), at depth #svn_depth_empty, but the
1071 * @c A/B subdir is reported at depth #svn_depth_infinity, then
1072 * repository-side changes to @c A/mu, or underneath @c A/C and @c
1073 * A/D, would not be reflected in the editor drive, but changes
1074 * underneath @c A/B would be.
1075 *
1076 * Additionally, the editor driver will call @c add_directory and
1077 * and @c add_file for directories with an appropriate depth. For
1078 * example, a directory reported at #svn_depth_files will receive
1079 * file (but not directory) additions. A directory at #svn_depth_empty
1080 * will receive neither.
1081 *
1082 * If @a depth is #svn_depth_files, #svn_depth_immediates or
1083 * #svn_depth_infinity and @a depth is greater than the reported depth
1084 * of the working copy, then the editor driver will emit editor
1085 * operations so as to upgrade the working copy to this depth.
1086 *
1087 * If @a depth is #svn_depth_empty, #svn_depth_files,
1088 * #svn_depth_immediates and @a depth is lower
1089 * than or equal to the depth of the working copy, then the editor
1090 * operations will affect only paths at or above @a depth.
1091 *
1092 * @since New in 1.8.
1093 */
1095svn_repos_begin_report3(void **report_baton,
1096 svn_revnum_t revnum,
1097 svn_repos_t *repos,
1098 const char *fs_base,
1099 const char *target,
1100 const char *tgt_path,
1101 svn_boolean_t text_deltas,
1102 svn_depth_t depth,
1103 svn_boolean_t ignore_ancestry,
1104 svn_boolean_t send_copyfrom_args,
1105 const svn_delta_editor_t *editor,
1106 void *edit_baton,
1107 svn_repos_authz_func_t authz_read_func,
1108 void *authz_read_baton,
1109 apr_size_t zero_copy_limit,
1110 apr_pool_t *pool);
1111
1112/**
1113 * The same as svn_repos_begin_report3(), but with @a zero_copy_limit
1114 * always passed as 0.
1115 *
1116 * @since New in 1.5.
1117 * @deprecated Provided for backward compatibility with the 1.7 API.
1118 */
1121svn_repos_begin_report2(void **report_baton,
1122 svn_revnum_t revnum,
1123 svn_repos_t *repos,
1124 const char *fs_base,
1125 const char *target,
1126 const char *tgt_path,
1127 svn_boolean_t text_deltas,
1128 svn_depth_t depth,
1129 svn_boolean_t ignore_ancestry,
1130 svn_boolean_t send_copyfrom_args,
1131 const svn_delta_editor_t *editor,
1132 void *edit_baton,
1133 svn_repos_authz_func_t authz_read_func,
1134 void *authz_read_baton,
1135 apr_pool_t *pool);
1136
1137/**
1138 * The same as svn_repos_begin_report2(), but taking a boolean
1139 * @a recurse flag, and sending FALSE for @a send_copyfrom_args.
1140 *
1141 * If @a recurse is TRUE, the editor driver will drive the editor with
1142 * a depth of #svn_depth_infinity; if FALSE, then with a depth of
1143 * #svn_depth_files.
1144 *
1145 * @note @a username is ignored, and has been removed in a revised
1146 * version of this API.
1147 *
1148 * @deprecated Provided for backward compatibility with the 1.4 API.
1149 */
1152svn_repos_begin_report(void **report_baton,
1153 svn_revnum_t revnum,
1154 const char *username,
1155 svn_repos_t *repos,
1156 const char *fs_base,
1157 const char *target,
1158 const char *tgt_path,
1159 svn_boolean_t text_deltas,
1160 svn_boolean_t recurse,
1161 svn_boolean_t ignore_ancestry,
1162 const svn_delta_editor_t *editor,
1163 void *edit_baton,
1164 svn_repos_authz_func_t authz_read_func,
1165 void *authz_read_baton,
1166 apr_pool_t *pool);
1167
1168
1169/**
1170 * Given a @a report_baton constructed by svn_repos_begin_report3(),
1171 * record the presence of @a path, at @a revision with depth @a depth,
1172 * in the current tree.
1173 *
1174 * @a path is relative to the anchor/target used in the creation of the
1175 * @a report_baton.
1176 *
1177 * @a revision may be SVN_INVALID_REVNUM if (for example) @a path
1178 * represents a locally-added path with no revision number, or @a
1179 * depth is #svn_depth_exclude.
1180 *
1181 * @a path may not be underneath a path on which svn_repos_set_path3()
1182 * was previously called with #svn_depth_exclude in this report.
1183 *
1184 * The first call of this in a given report usually passes an empty
1185 * @a path; this is used to set up the correct root revision for the editor
1186 * drive.
1187 *
1188 * A depth of #svn_depth_unknown is not allowed, and results in an
1189 * error.
1190 *
1191 * If @a start_empty is TRUE and @a path is a directory, then require the
1192 * caller to explicitly provide all the children of @a path - do not assume
1193 * that the tree also contains all the children of @a path at @a revision.
1194 * This is for 'low confidence' client reporting.
1195 *
1196 * If the caller has a lock token for @a path, then @a lock_token should
1197 * be set to that token. Else, @a lock_token should be NULL.
1198 *
1199 * All temporary allocations are done in @a pool.
1200 *
1201 * @since New in 1.5.
1202 */
1204svn_repos_set_path3(void *report_baton,
1205 const char *path,
1207 svn_depth_t depth,
1208 svn_boolean_t start_empty,
1209 const char *lock_token,
1210 apr_pool_t *pool);
1211
1212/**
1213 * Similar to svn_repos_set_path3(), but with @a depth set to
1214 * #svn_depth_infinity.
1215 *
1216 * @deprecated Provided for backward compatibility with the 1.4 API.
1217 */
1220svn_repos_set_path2(void *report_baton,
1221 const char *path,
1223 svn_boolean_t start_empty,
1224 const char *lock_token,
1225 apr_pool_t *pool);
1226
1227/**
1228 * Similar to svn_repos_set_path2(), but with @a lock_token set to @c NULL.
1229 *
1230 * @deprecated Provided for backward compatibility with the 1.1 API.
1231 */
1234svn_repos_set_path(void *report_baton,
1235 const char *path,
1237 svn_boolean_t start_empty,
1238 apr_pool_t *pool);
1239
1240/**
1241 * Given a @a report_baton constructed by svn_repos_begin_report3(),
1242 * record the presence of @a path in the current tree, containing the contents
1243 * of @a link_path at @a revision with depth @a depth.
1244 *
1245 * A depth of #svn_depth_unknown is not allowed, and results in an
1246 * error.
1247 *
1248 * @a path may not be underneath a path on which svn_repos_set_path3()
1249 * was previously called with #svn_depth_exclude in this report.
1250 *
1251 * Note that while @a path is relative to the anchor/target used in the
1252 * creation of the @a report_baton, @a link_path is an absolute filesystem
1253 * path!
1254 *
1255 * If @a start_empty is TRUE and @a path is a directory, then require the
1256 * caller to explicitly provide all the children of @a path - do not assume
1257 * that the tree also contains all the children of @a link_path at
1258 * @a revision. This is for 'low confidence' client reporting.
1259 *
1260 * If the caller has a lock token for @a link_path, then @a lock_token
1261 * should be set to that token. Else, @a lock_token should be NULL.
1262 *
1263 * All temporary allocations are done in @a pool.
1264 *
1265 * @since New in 1.5.
1266 */
1268svn_repos_link_path3(void *report_baton,
1269 const char *path,
1270 const char *link_path,
1272 svn_depth_t depth,
1273 svn_boolean_t start_empty,
1274 const char *lock_token,
1275 apr_pool_t *pool);
1276
1277/**
1278 * Similar to svn_repos_link_path3(), but with @a depth set to
1279 * #svn_depth_infinity.
1280 *
1281 * @deprecated Provided for backward compatibility with the 1.4 API.
1282 */
1285svn_repos_link_path2(void *report_baton,
1286 const char *path,
1287 const char *link_path,
1289 svn_boolean_t start_empty,
1290 const char *lock_token,
1291 apr_pool_t *pool);
1292
1293/**
1294 * Similar to svn_repos_link_path2(), but with @a lock_token set to @c NULL.
1295 *
1296 * @deprecated Provided for backward compatibility with the 1.1 API.
1297 */
1300svn_repos_link_path(void *report_baton,
1301 const char *path,
1302 const char *link_path,
1304 svn_boolean_t start_empty,
1305 apr_pool_t *pool);
1306
1307/** Given a @a report_baton constructed by svn_repos_begin_report3(),
1308 * record the non-existence of @a path in the current tree.
1309 *
1310 * @a path may not be underneath a path on which svn_repos_set_path3()
1311 * was previously called with #svn_depth_exclude in this report.
1312 *
1313 * (This allows the reporter's driver to describe missing pieces of a
1314 * working copy, so that 'svn up' can recreate them.)
1315 *
1316 * All temporary allocations are done in @a pool.
1317 */
1319svn_repos_delete_path(void *report_baton,
1320 const char *path,
1321 apr_pool_t *pool);
1322
1323/** Given a @a report_baton constructed by svn_repos_begin_report3(),
1324 * finish the report and drive the editor as specified when the report
1325 * baton was constructed.
1326 *
1327 * If an error occurs during the driving of the editor, do NOT abort the
1328 * edit; that responsibility belongs to the caller of this function, if
1329 * it happens at all.
1330 *
1331 * After the call to this function, @a report_baton is no longer valid;
1332 * it should not be passed to any other reporting functions, including
1333 * svn_repos_abort_report(), even if this function returns an error.
1334 */
1336svn_repos_finish_report(void *report_baton,
1337 apr_pool_t *pool);
1338
1339
1340/** Given a @a report_baton constructed by svn_repos_begin_report3(),
1341 * abort the report. This function can be called anytime before
1342 * svn_repos_finish_report() is called.
1343 *
1344 * After the call to this function, @a report_baton is no longer valid;
1345 * it should not be passed to any other reporting functions.
1346 */
1348svn_repos_abort_report(void *report_baton,
1349 apr_pool_t *pool);
1350
1351
1352/* ---------------------------------------------------------------*/
1353␌
1354/* The magical dir_delta update routines. */
1355
1356/** Use the provided @a editor and @a edit_baton to describe the changes
1357 * necessary for making a given node (and its descendants, if it is a
1358 * directory) under @a src_root look exactly like @a tgt_path under
1359 * @a tgt_root. @a src_entry is the node to update. If @a src_entry
1360 * is empty, then compute the difference between the entire tree
1361 * anchored at @a src_parent_dir under @a src_root and @a tgt_path
1362 * under @a tgt_root. Else, describe the changes needed to update
1363 * only that entry in @a src_parent_dir. Typically, callers of this
1364 * function will use a @a tgt_path that is the concatenation of @a
1365 * src_parent_dir and @a src_entry.
1366 *
1367 * @a src_root and @a tgt_root can both be either revision or transaction
1368 * roots. If @a tgt_root is a revision, @a editor's set_target_revision()
1369 * will be called with the @a tgt_root's revision number, else it will
1370 * not be called at all.
1371 *
1372 * If @a authz_read_func is non-NULL, invoke it before any call to
1373 *
1374 * @a editor->open_root
1375 * @a editor->add_directory
1376 * @a editor->open_directory
1377 * @a editor->add_file
1378 * @a editor->open_file
1379 *
1380 * passing @a tgt_root, the same path that would be passed to the
1381 * editor function in question, and @a authz_read_baton. If the
1382 * @a *allowed parameter comes back TRUE, then proceed with the planned
1383 * editor call; else if FALSE, then invoke @a editor->absent_file or
1384 * @a editor->absent_directory as appropriate, except if the planned
1385 * editor call was open_root, throw SVN_ERR_AUTHZ_ROOT_UNREADABLE.
1386 *
1387 * If @a text_deltas is @c FALSE, send a single @c NULL txdelta window to
1388 * the window handler returned by @a editor->apply_textdelta().
1389 *
1390 * If @a depth is #svn_depth_empty, invoke @a editor calls only on
1391 * @a src_entry (or @a src_parent_dir, if @a src_entry is empty).
1392 * If @a depth is #svn_depth_files, also invoke the editor on file
1393 * children, if any; if #svn_depth_immediates, invoke it on
1394 * immediate subdirectories as well as files; if #svn_depth_infinity,
1395 * recurse fully.
1396 *
1397 * If @a entry_props is @c TRUE, accompany each opened/added entry with
1398 * propchange editor calls that relay special "entry props" (this
1399 * is typically used only for working copy updates).
1400 *
1401 * @a ignore_ancestry instructs the function to ignore node ancestry
1402 * when determining how to transmit differences.
1403 *
1404 * Before completing successfully, this function calls @a editor's
1405 * close_edit(), so the caller should expect its @a edit_baton to be
1406 * invalid after its use with this function.
1407 *
1408 * Do any allocation necessary for the delta computation in @a pool.
1409 * This function's maximum memory consumption is at most roughly
1410 * proportional to the greatest depth of the tree under @a tgt_root, not
1411 * the total size of the delta.
1412 *
1413 * ### svn_repos_dir_delta2 is mostly superseded by the reporter
1414 * ### functionality (svn_repos_begin_report3 and friends).
1415 * ### svn_repos_dir_delta2 does allow the roots to be transaction
1416 * ### roots rather than just revision roots, and it has the
1417 * ### entry_props flag. Almost all of Subversion's own code uses the
1418 * ### reporter instead; there are some stray references to the
1419 * ### svn_repos_dir_delta[2] in comments which should probably
1420 * ### actually refer to the reporter.
1421 *
1422 * @since New in 1.5.
1423 */
1426 const char *src_parent_dir,
1427 const char *src_entry,
1428 svn_fs_root_t *tgt_root,
1429 const char *tgt_path,
1430 const svn_delta_editor_t *editor,
1431 void *edit_baton,
1432 svn_repos_authz_func_t authz_read_func,
1433 void *authz_read_baton,
1434 svn_boolean_t text_deltas,
1435 svn_depth_t depth,
1436 svn_boolean_t entry_props,
1437 svn_boolean_t ignore_ancestry,
1438 apr_pool_t *pool);
1439
1440/**
1441 * Similar to svn_repos_dir_delta2(), but if @a recurse is TRUE, pass
1442 * #svn_depth_infinity for @a depth, and if @a recurse is FALSE,
1443 * pass #svn_depth_files for @a depth.
1444 *
1445 * @deprecated Provided for backward compatibility with the 1.4 API.
1446 */
1450 const char *src_parent_dir,
1451 const char *src_entry,
1452 svn_fs_root_t *tgt_root,
1453 const char *tgt_path,
1454 const svn_delta_editor_t *editor,
1455 void *edit_baton,
1456 svn_repos_authz_func_t authz_read_func,
1457 void *authz_read_baton,
1458 svn_boolean_t text_deltas,
1459 svn_boolean_t recurse,
1460 svn_boolean_t entry_props,
1461 svn_boolean_t ignore_ancestry,
1462 apr_pool_t *pool);
1463
1464
1465/** Use the provided @a editor and @a edit_baton to describe the
1466 * skeletal changes made in a particular filesystem @a root
1467 * (revision or transaction).
1468 *
1469 * Changes will be limited to those within @a base_dir, and if
1470 * @a low_water_mark is set to something other than #SVN_INVALID_REVNUM
1471 * it is assumed that the client has no knowledge of revisions prior to
1472 * @a low_water_mark. Together, these two arguments define the portion of
1473 * the tree that the client is assumed to have knowledge of, and thus any
1474 * copies of data from outside that part of the tree will be sent in their
1475 * entirety, not as simple copies or deltas against a previous version.
1476 *
1477 * The @a editor passed to this function should be aware of the fact
1478 * that, if @a send_deltas is FALSE, calls to its change_dir_prop(),
1479 * change_file_prop(), and apply_textdelta() functions will not
1480 * contain meaningful data, and merely serve as indications that
1481 * properties or textual contents were changed.
1482 *
1483 * If @a send_deltas is @c TRUE, the text and property deltas for changes
1484 * will be sent, otherwise NULL text deltas and empty prop changes will be
1485 * used.
1486 *
1487 * If @a authz_read_func is non-NULL, it will be used to determine if the
1488 * user has read access to the data being accessed. Data that the user
1489 * cannot access will be skipped.
1490 *
1491 * @note This editor driver passes SVN_INVALID_REVNUM for all
1492 * revision parameters in the editor interface except the copyfrom
1493 * parameter of the add_file() and add_directory() editor functions.
1494 *
1495 * @since New in 1.4.
1496 */
1499 const char *base_dir,
1500 svn_revnum_t low_water_mark,
1501 svn_boolean_t send_deltas,
1502 const svn_delta_editor_t *editor,
1503 void *edit_baton,
1504 svn_repos_authz_func_t authz_read_func,
1505 void *authz_read_baton,
1506 apr_pool_t *pool);
1507
1508/**
1509 * Similar to svn_repos_replay2(), but with @a base_dir set to @c "",
1510 * @a low_water_mark set to #SVN_INVALID_REVNUM, @a send_deltas
1511 * set to @c FALSE, and @a authz_read_func and @a authz_read_baton
1512 * set to @c NULL.
1513 *
1514 * @deprecated Provided for backward compatibility with the 1.3 API.
1515 */
1519 const svn_delta_editor_t *editor,
1520 void *edit_baton,
1521 apr_pool_t *pool);
1522
1523/* ---------------------------------------------------------------*/
1524␌
1525/* Making commits. */
1526
1527/**
1528 * Return an @a editor and @a edit_baton to commit changes to the
1529 * filesystem of @a repos, beginning at location 'rev:@a base_path',
1530 * where "rev" is the argument given to open_root().
1531 *
1532 * @a repos is a previously opened repository. @a repos_url_decoded is the
1533 * decoded URL to the base of the repository, and is used to check
1534 * copyfrom paths. @a txn is a filesystem transaction object to use
1535 * during the commit, or @c NULL to indicate that this function should
1536 * create (and fully manage) a new transaction.
1537 *
1538 * Store the contents of @a revprop_table, a hash mapping <tt>const
1539 * char *</tt> property names to #svn_string_t values, as properties
1540 * of the commit transaction, including author and log message if
1541 * present.
1542 *
1543 * @note #SVN_PROP_REVISION_DATE may be present in @a revprop_table, but
1544 * it will be overwritten when the transaction is committed.
1545 *
1546 * Iff @a authz_callback is provided, check read/write authorizations
1547 * on paths accessed by editor operations. An operation which fails
1548 * due to authz will return SVN_ERR_AUTHZ_UNREADABLE or
1549 * SVN_ERR_AUTHZ_UNWRITABLE.
1550 *
1551 * Calling @a (*editor)->close_edit completes the commit.
1552 *
1553 * If @a commit_callback is non-NULL, then before @c close_edit returns (but
1554 * after the commit has succeeded) @c close_edit will invoke
1555 * @a commit_callback with a filled-in #svn_commit_info_t *, @a commit_baton,
1556 * and @a pool or some subpool thereof as arguments. The @c repos_root field
1557 * of the #svn_commit_info_t is @c NULL. If @a commit_callback
1558 * returns an error, that error will be returned from @c close_edit,
1559 * otherwise if there was a post-commit hook failure, then that error
1560 * will be returned with code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
1561 * (Note that prior to Subversion 1.6, @a commit_callback cannot be @c NULL;
1562 * if you don't need a callback, pass a dummy function.)
1563 *
1564 * Calling @a (*editor)->abort_edit aborts the commit, and will also
1565 * abort the commit transaction unless @a txn was supplied (not @c
1566 * NULL). Callers who supply their own transactions are responsible
1567 * for cleaning them up (either by committing them, or aborting them).
1568 *
1569 * @since New in 1.5. Since 1.6, @a commit_callback can be @c NULL.
1570 *
1571 * @note Yes, @a repos_url_decoded is a <em>decoded</em> URL. We realize
1572 * that's sorta wonky. Sorry about that.
1573 *
1574 * @note Like most commit editors, the returned editor requires that the
1575 * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
1576 * methods is a full, URI-encoded URL, not a relative path.
1577 */
1579svn_repos_get_commit_editor5(const svn_delta_editor_t **editor,
1580 void **edit_baton,
1581 svn_repos_t *repos,
1582 svn_fs_txn_t *txn,
1583 const char *repos_url_decoded,
1584 const char *base_path,
1585 apr_hash_t *revprop_table,
1586 svn_commit_callback2_t commit_callback,
1587 void *commit_baton,
1588 svn_repos_authz_callback_t authz_callback,
1589 void *authz_baton,
1590 apr_pool_t *pool);
1591
1592/**
1593 * Similar to svn_repos_get_commit_editor5(), but with @a revprop_table
1594 * set to a hash containing @a user and @a log_msg as the
1595 * #SVN_PROP_REVISION_AUTHOR and #SVN_PROP_REVISION_LOG properties,
1596 * respectively. @a user and @a log_msg may both be @c NULL.
1597 *
1598 * @note The @a repos_url parameter has been renamed for clarity to
1599 * @a repos_url_decoded in svn_repos_get_commit_editor5(), but remains
1600 * functionally the same.
1601 *
1602 * @since New in 1.4.
1603 *
1604 * @deprecated Provided for backward compatibility with the 1.4 API.
1605 */
1608svn_repos_get_commit_editor4(const svn_delta_editor_t **editor,
1609 void **edit_baton,
1610 svn_repos_t *repos,
1611 svn_fs_txn_t *txn,
1612 const char *repos_url,
1613 const char *base_path,
1614 const char *user,
1615 const char *log_msg,
1616 svn_commit_callback2_t commit_callback,
1617 void *commit_baton,
1618 svn_repos_authz_callback_t authz_callback,
1619 void *authz_baton,
1620 apr_pool_t *pool);
1621
1622/**
1623 * Similar to svn_repos_get_commit_editor4(), but
1624 * uses the svn_commit_callback_t type.
1625 *
1626 * @since New in 1.3.
1627 *
1628 * @deprecated Provided for backward compatibility with the 1.3 API.
1629 */
1632svn_repos_get_commit_editor3(const svn_delta_editor_t **editor,
1633 void **edit_baton,
1634 svn_repos_t *repos,
1635 svn_fs_txn_t *txn,
1636 const char *repos_url,
1637 const char *base_path,
1638 const char *user,
1639 const char *log_msg,
1640 svn_commit_callback_t callback,
1641 void *callback_baton,
1642 svn_repos_authz_callback_t authz_callback,
1643 void *authz_baton,
1644 apr_pool_t *pool);
1645
1646/**
1647 * Similar to svn_repos_get_commit_editor3(), but with @a
1648 * authz_callback and @a authz_baton set to @c NULL.
1649 *
1650 * @deprecated Provided for backward compatibility with the 1.2 API.
1651 */
1654svn_repos_get_commit_editor2(const svn_delta_editor_t **editor,
1655 void **edit_baton,
1656 svn_repos_t *repos,
1657 svn_fs_txn_t *txn,
1658 const char *repos_url,
1659 const char *base_path,
1660 const char *user,
1661 const char *log_msg,
1662 svn_commit_callback_t callback,
1663 void *callback_baton,
1664 apr_pool_t *pool);
1665
1666
1667/**
1668 * Similar to svn_repos_get_commit_editor2(), but with @a txn always
1669 * set to @c NULL.
1670 *
1671 * @deprecated Provided for backward compatibility with the 1.1 API.
1672 */
1675svn_repos_get_commit_editor(const svn_delta_editor_t **editor,
1676 void **edit_baton,
1677 svn_repos_t *repos,
1678 const char *repos_url,
1679 const char *base_path,
1680 const char *user,
1681 const char *log_msg,
1682 svn_commit_callback_t callback,
1683 void *callback_baton,
1684 apr_pool_t *pool);
1685
1686/* ---------------------------------------------------------------*/
1687␌
1688/* Finding particular revisions. */
1689
1690/** Set @a *revision to the revision number in @a repos's filesystem that was
1691 * youngest at time @a tm.
1692 */
1695 svn_repos_t *repos,
1696 apr_time_t tm,
1697 apr_pool_t *pool);
1698
1699
1700/** Given a @a root/@a path within some filesystem, return three pieces of
1701 * information allocated in @a pool:
1702 *
1703 * - set @a *committed_rev to the revision in which the object was
1704 * last modified. (In fs parlance, this is the revision in which
1705 * the particular node-rev-id was 'created'.)
1706 *
1707 * - set @a *committed_date to the date of said revision, or @c NULL
1708 * if not available.
1709 *
1710 * - set @a *last_author to the author of said revision, or @c NULL
1711 * if not available.
1712 */
1715 const char **committed_date,
1716 const char **last_author,
1717 svn_fs_root_t *root,
1718 const char *path,
1719 apr_pool_t *pool);
1720
1721
1722/**
1723 * Set @a *dirent to an #svn_dirent_t associated with @a path in @a
1724 * root. If @a path does not exist in @a root, set @a *dirent to
1725 * NULL. Use @a pool for memory allocation.
1726 *
1727 * @since New in 1.2.
1728 */
1731 svn_fs_root_t *root,
1732 const char *path,
1733 apr_pool_t *pool);
1734
1735/**
1736 * Callback type to be used with svn_repos_list(). It will be invoked for
1737 * every directory entry found.
1738 *
1739 * The full path of the entry is given in @a path and @a dirent contains
1740 * various additional information. If svn_repos_list() has been called
1741 * with @a path_info_only set, only the @a kind element of this struct
1742 * will be valid.
1743 *
1744 * @a baton is the user-provided receiver baton. @a scratch_pool may be
1745 * used for temporary allocations.
1746 *
1747 * @since New in 1.10.
1748 */
1749typedef svn_error_t *(* svn_repos_dirent_receiver_t)(const char *path,
1750 svn_dirent_t *dirent,
1751 void *baton,
1752 apr_pool_t *scratch_pool);
1753
1754/**
1755 * Efficiently list everything within a sub-tree. Specify glob patterns
1756 * to search for specific files and folders.
1757 *
1758 * Walk the sub-tree starting at @a path under @a root up to the given
1759 * @a depth. For each directory entry found, @a receiver will be called
1760 * with @a receiver_baton. The starting @a path will be reported as well.
1761 * Because retrieving all elements of a #svn_dirent_t can be expensive,
1762 * you may set @a path_info_only to receive only the path name and the node
1763 * kind. The entries will be reported ordered by their path.
1764 *
1765 * @a patterns is an optional array of <tt>const char *</tt>. If it is
1766 * not @c NULL, only those directory entries will be reported whose last
1767 * path segment matches at least one of these patterns. This feature uses
1768 * apr_fnmatch() for glob matching and requiring '.' to matched by dots
1769 * in the path.
1770 *
1771 * If @a authz_read_func is not @c NULL, this function will neither report
1772 * entries nor recurse into directories that the user has no access to.
1773 *
1774 * Cancellation support is provided in the usual way through the optional
1775 * @a cancel_func and @a cancel_baton.
1776 *
1777 * @a path must point to a directory and @a depth must be at least
1778 * #svn_depth_empty.
1779 *
1780 * Use @a scratch_pool for temporary memory allocation.
1781 *
1782 * @since New in 1.10.
1783 */
1786 const char *path,
1787 const apr_array_header_t *patterns,
1788 svn_depth_t depth,
1789 svn_boolean_t path_info_only,
1790 svn_repos_authz_func_t authz_read_func,
1791 void *authz_read_baton,
1793 void *receiver_baton,
1794 svn_cancel_func_t cancel_func,
1795 void *cancel_baton,
1796 apr_pool_t *scratch_pool);
1797
1798/**
1799 * Given @a path which exists at revision @a start in @a fs, set
1800 * @a *deleted to the revision @a path was first deleted, within the
1801 * inclusive revision range bounded by @a start and @a end. If @a path
1802 * does not exist at revision @a start or was not deleted within the
1803 * specified range, then set @a *deleted to SVN_INVALID_REVNUM.
1804 * Use @a pool for memory allocation.
1805 *
1806 * @since New in 1.5.
1807 */
1810 const char *path,
1811 svn_revnum_t start,
1812 svn_revnum_t end,
1813 svn_revnum_t *deleted,
1814 apr_pool_t *pool);
1815
1816
1817/** Callback type for use with svn_repos_history(). @a path and @a
1818 * revision represent interesting history locations in the lifetime
1819 * of the path passed to svn_repos_history(). @a baton is the same
1820 * baton given to svn_repos_history(). @a pool is provided for the
1821 * convenience of the implementor, who should not expect it to live
1822 * longer than a single callback call.
1823 *
1824 * Signal to callback driver to stop processing/invoking this callback
1825 * by returning the #SVN_ERR_CEASE_INVOCATION error code.
1826 *
1827 * @note SVN_ERR_CEASE_INVOCATION is new in 1.5.
1828 */
1829typedef svn_error_t *(*svn_repos_history_func_t)(void *baton,
1830 const char *path,
1832 apr_pool_t *pool);
1833
1834/**
1835 * Call @a history_func (with @a history_baton) for each interesting
1836 * history location in the lifetime of @a path in @a fs, from the
1837 * youngest of @a end and @a start to the oldest. Stop processing if
1838 * @a history_func returns #SVN_ERR_CEASE_INVOCATION. Only cross
1839 * filesystem copy history if @a cross_copies is @c TRUE. And do all
1840 * of this in @a pool.
1841 *
1842 * If @a authz_read_func is non-NULL, then use it (and @a
1843 * authz_read_baton) to verify that @a path in @a end is readable; if
1844 * not, return SVN_ERR_AUTHZ_UNREADABLE. Also verify the readability
1845 * of every ancestral path/revision pair before pushing them at @a
1846 * history_func. If a pair is deemed unreadable, then do not send
1847 * them; instead, immediately stop traversing history and return
1848 * SVN_NO_ERROR.
1849 *
1850 * @since New in 1.1.
1851 *
1852 * @note SVN_ERR_CEASE_INVOCATION is new in 1.5.
1853 */
1856 const char *path,
1857 svn_repos_history_func_t history_func,
1858 void *history_baton,
1859 svn_repos_authz_func_t authz_read_func,
1860 void *authz_read_baton,
1861 svn_revnum_t start,
1862 svn_revnum_t end,
1863 svn_boolean_t cross_copies,
1864 apr_pool_t *pool);
1865
1866/**
1867 * Similar to svn_repos_history2(), but with @a authz_read_func
1868 * and @a authz_read_baton always set to NULL.
1869 *
1870 * @deprecated Provided for backward compatibility with the 1.0 API.
1871 */
1875 const char *path,
1876 svn_repos_history_func_t history_func,
1877 void *history_baton,
1878 svn_revnum_t start,
1879 svn_revnum_t end,
1880 svn_boolean_t cross_copies,
1881 apr_pool_t *pool);
1882
1883
1884/**
1885 * Set @a *locations to be a mapping of the revisions to the paths of
1886 * the file @a fs_path present at the repository in revision
1887 * @a peg_revision, where the revisions are taken out of the array
1888 * @a location_revisions.
1889 *
1890 * @a location_revisions is an array of svn_revnum_t's and @a *locations
1891 * maps 'svn_revnum_t *' to 'const char *'.
1892 *
1893 * If optional @a authz_read_func is non-NULL, then use it (and @a
1894 * authz_read_baton) to verify that the peg-object is readable. If not,
1895 * return SVN_ERR_AUTHZ_UNREADABLE. Also use the @a authz_read_func
1896 * to check that every path returned in the hash is readable. If an
1897 * unreadable path is encountered, stop tracing and return
1898 * SVN_NO_ERROR.
1899 *
1900 * @a pool is used for all allocations.
1901 *
1902 * @since New in 1.1.
1903 */
1906 apr_hash_t **locations,
1907 const char *fs_path,
1908 svn_revnum_t peg_revision,
1909 const apr_array_header_t *location_revisions,
1910 svn_repos_authz_func_t authz_read_func,
1911 void *authz_read_baton,
1912 apr_pool_t *pool);
1913
1914
1915/**
1916 * Call @a receiver and @a receiver_baton to report successive
1917 * location segments in revisions between @a start_rev and @a end_rev
1918 * (inclusive) for the line of history identified by the peg-object @a
1919 * path in @a peg_revision (and in @a repos).
1920 *
1921 * @a end_rev may be #SVN_INVALID_REVNUM to indicate that you want
1922 * to trace the history of the object to its origin.
1923 *
1924 * @a start_rev may be #SVN_INVALID_REVNUM to indicate "the HEAD
1925 * revision". Otherwise, @a start_rev must be younger than @a end_rev
1926 * (unless @a end_rev is #SVN_INVALID_REVNUM).
1927 *
1928 * @a peg_revision may be #SVN_INVALID_REVNUM to indicate "the HEAD
1929 * revision", and must evaluate to be at least as young as @a start_rev.
1930 *
1931 * If optional @a authz_read_func is not @c NULL, then use it (and @a
1932 * authz_read_baton) to verify that the peg-object is readable. If
1933 * not, return #SVN_ERR_AUTHZ_UNREADABLE. Also use the @a
1934 * authz_read_func to check that every path reported in a location
1935 * segment is readable. If an unreadable path is encountered, report
1936 * a final (possibly truncated) location segment (if any), stop
1937 * tracing history, and return #SVN_NO_ERROR.
1938 *
1939 * @a pool is used for all allocations.
1940 *
1941 * @since New in 1.5.
1942 */
1945 const char *path,
1946 svn_revnum_t peg_revision,
1947 svn_revnum_t start_rev,
1948 svn_revnum_t end_rev,
1950 void *receiver_baton,
1951 svn_repos_authz_func_t authz_read_func,
1952 void *authz_read_baton,
1953 apr_pool_t *pool);
1954
1955
1956/* ---------------------------------------------------------------*/
1957␌
1958/* Retrieving log messages. */
1959
1960/** Path change descriptor.
1961 *
1962 * @note Identical to #svn_fs_path_change3_t but with all information
1963 * known, i.e. @a node_kind is never #svn_node_unknown and
1964 * @a copyfrom_known is always @c TRUE.
1965 *
1966 * @note To allow for extending this structure in future releases,
1967 * always use svn_repos_path_change_create() to allocate the structure.
1968 *
1969 * @see svn_fs_path_change3_t
1970 *
1971 * @since New in 1.10.
1972 */
1974
1975/**
1976 * Return an #svn_repos_path_change_t structure, allocated in @a result_pool,
1977 * with all fields initialized to their respective null/none/empty/invalid
1978 * values.
1979 *
1980 * @note To allow for extending the #svn_repos_path_change_t structure in
1981 * future releases, this function should always be used to allocate it.
1982 *
1983 * @since New in 1.10.
1984 */
1986svn_repos_path_change_create(apr_pool_t *result_pool);
1987
1988/**
1989 * Return a deep copy of @a change, allocated in @a result_pool.
1990 *
1991 * @since New in 1.10.
1992 */
1995 apr_pool_t *result_pool);
1996
1997/** The callback invoked by log message loopers, such as
1998 * svn_repos_get_logs5().
1999 *
2000 * This function is invoked once on each changed path, in a potentially
2001 * random order that may even change between invocations for the same
2002 * revisions.
2003 *
2004 * @a baton is what you think it is, and @a change contains relevant
2005 * information for the changed path. Please note that @a change may be
2006 * modified within this callback but it will become invalid as soon as
2007 * the callback returns.
2008 *
2009 * Use @a scratch_pool for temporary allocation. The caller may clear it
2010 * between or after invocations.
2011 *
2012 * @since New in 1.10.
2013 */
2014typedef svn_error_t *(*svn_repos_path_change_receiver_t)(
2015 void *baton,
2017 apr_pool_t *scratch_pool);
2018
2019
2020/**
2021 * A structure to represent all the information about a particular log entry.
2022 *
2023 * @note To allow for extending this structure in future releases,
2024 * always use svn_repos_log_entry_create() to allocate the structure.
2025 *
2026 * @since New in 1.10.
2027 */
2029{
2030 /** The revision of the commit. */
2032
2033 /** The hash of requested revision properties, which may be NULL if it
2034 * would contain no revprops. Maps (const char *) property name to
2035 * (svn_string_t *) property value. */
2036 apr_hash_t *revprops;
2037
2038 /**
2039 * Whether or not this message has children.
2040 *
2041 * When a log operation requests additional merge information, extra log
2042 * entries may be returned as a result of this entry. The new entries, are
2043 * considered children of the original entry, and will follow it. When
2044 * the HAS_CHILDREN flag is set, the receiver should increment its stack
2045 * depth, and wait until an entry is provided with SVN_INVALID_REVNUM which
2046 * indicates the end of the children.
2047 *
2048 * For log operations which do not request additional merge information, the
2049 * HAS_CHILDREN flag is always FALSE.
2050 *
2051 * For more information see:
2052 * https://svn.apache.org/repos/asf/subversion/trunk/notes/merge-tracking/design.html#commutative-reporting
2053 */
2055
2056 /**
2057 * Whether @a revision should be interpreted as non-inheritable in the
2058 * same sense of #svn_merge_range_t.
2059 *
2060 * Currently always FALSE.
2061 */
2063
2064 /**
2065 * Whether @a revision is a merged revision resulting from a reverse merge.
2066 */
2068
2069 /* NOTE: Add new fields at the end to preserve binary compatibility. */
2071
2072/**
2073 * Return an #svn_repos_log_entry_t, allocated in @a result_pool,
2074 * with all fields initialized to their respective null/none/empty/invalid
2075 * values.
2076 *
2077 * @note To allow for extending the #svn_repos_log_entry_t structure in
2078 * future releases, this function should always be used to allocate it.
2079 *
2080 * @since New in 1.10.
2081 */
2083svn_repos_log_entry_create(apr_pool_t *result_pool);
2084
2085/** Return a deep copy of @a log_entry, allocated in @a result_pool.
2086 *
2087 * @since New in 1.10.
2088 */
2091 apr_pool_t *result_pool);
2092
2093
2094/** The callback invoked by log message loopers, such as
2095 * svn_repos_get_logs5().
2096 *
2097 * This function is invoked once on each log message, in the order
2098 * determined by the caller (see above-mentioned functions).
2099 *
2100 * @a baton is what you think it is, and @a log_entry contains relevant
2101 * information for the log message.
2102 *
2103 * If @a log_entry->has_children is @c TRUE, the message will be followed
2104 * immediately by any number of merged revisions (child messages), which are
2105 * terminated by an invocation with SVN_INVALID_REVNUM. This usage may
2106 * be recursive.
2107 *
2108 * Use @a scratch_pool for temporary allocation. The caller may clear it
2109 * between or after invocations.
2110 *
2111 * @since New in 1.10.
2112 */
2113typedef svn_error_t *(*svn_repos_log_entry_receiver_t)(
2114 void *baton,
2115 svn_repos_log_entry_t *log_entry,
2116 apr_pool_t *scratch_pool);
2117
2118
2119/**
2120 * Invoke @a revision_receiver with @a revision_receiver_baton on each
2121 * revision from @a start to @a end in @a repos's filesystem. @a start may
2122 * be greater or less than @a end; this just controls whether the log is
2123 * processed in descending or ascending revision number order.
2124 *
2125 * If not @c NULL, @a path_change_receiver will be invoked with
2126 * @a path_change_receiver_baton for each changed path in the respective
2127 * revision. These changes will be reported before the @a revision_receiver
2128 * is invoked for that revision. So, for each revision in the log, there
2129 * is a number of calls to @a path_change_receiver followed by a single
2130 * invocation of @a revision_receiver, implicitly marking the end of the
2131 * changes list for that revision. If a revision does not contain any
2132 * changes (or if none are visible due to @a authz_read_func),
2133 * @a path_change_receiver will not be called for that revision.
2134 *
2135 * If @a start or @a end is #SVN_INVALID_REVNUM, it defaults to youngest.
2136 *
2137 * If @a paths is non-NULL and has one or more elements, then only show
2138 * revisions in which at least one of @a paths was changed (i.e., if
2139 * file, text or props changed; if dir, props or entries changed or any node
2140 * changed below it). Each path is a <tt>const char *</tt> representing
2141 * an absolute path in the repository. If @a paths is NULL or empty,
2142 * show all revisions regardless of what paths were changed in those
2143 * revisions.
2144 *
2145 * If @a limit is greater than zero then only invoke @a revision_receiver
2146 * on the first @a limit logs.
2147 *
2148 * If @a strict_node_history is set, copy history (if any exists) will
2149 * not be traversed while harvesting revision logs for each path.
2150 *
2151 * If @a include_merged_revisions is set, log information for revisions
2152 * which have been merged to @a paths will also be returned, unless these
2153 * revisions are already part of @a start to @a end in @a repos's
2154 * filesystem, as limited by @a paths. In the latter case those revisions
2155 * are skipped and @a receiver is not invoked.
2156 *
2157 * If @a revprops is NULL, retrieve all revision properties; else, retrieve
2158 * only the revision properties named by the (const char *) array elements
2159 * (i.e. retrieve none if the array is empty).
2160 *
2161 * If any invocation of @a revision_receiver or @a path_change_receiver
2162 * return an error, return that error immediately and without wrapping it.
2163 *
2164 * If @a start or @a end is a non-existent revision, return the error
2165 * #SVN_ERR_FS_NO_SUCH_REVISION, without ever invoking @a revision_receiver.
2166 *
2167 * If optional @a authz_read_func is non-NULL, then use this function
2168 * (along with optional @a authz_read_baton) to check the readability
2169 * of each changed-path in each revision about to be "pushed" at
2170 * @a path_change_receiver. If a revision has some changed-paths readable
2171 * and others unreadable, unreadable paths are omitted from the
2172 * @a path_change_receiver invocations and only svn:author and svn:date
2173 * will be available in the revprops field in the @a revision_receiver
2174 * callback. If a revision has no changed-paths readable at all, then all
2175 * paths are omitted and no revprops are available. If
2176 * @a path_change_receiver is @c NULL, the same filtering is performed
2177 * just without reporting any path changes.
2178 *
2179 * Use @a scratch_pool for temporary allocations.
2180 *
2181 * @see svn_repos_path_change_receiver_t, svn_repos_log_entry_receiver_t
2182 *
2183 * @since New in 1.10.
2184 */
2187 const apr_array_header_t *paths,
2188 svn_revnum_t start,
2189 svn_revnum_t end,
2190 int limit,
2191 svn_boolean_t strict_node_history,
2192 svn_boolean_t include_merged_revisions,
2193 const apr_array_header_t *revprops,
2194 svn_repos_authz_func_t authz_read_func,
2195 void *authz_read_baton,
2196 svn_repos_path_change_receiver_t path_change_receiver,
2197 void *path_change_receiver_baton,
2198 svn_repos_log_entry_receiver_t revision_receiver,
2199 void *revision_receiver_baton,
2200 apr_pool_t *scratch_pool);
2201
2202/**
2203 * Similar to svn_repos_get_logs5 but using a #svn_log_entry_receiver_t
2204 * @a receiver to receive revision properties and changed paths through a
2205 * single callback and the @a discover_changed_paths flag to control it.
2206 *
2207 * If @a discover_changed_paths, then each call to @a receiver passes a
2208 * hash mapping paths committed in that revision to information about them
2209 * as the receiver's @a changed_paths argument.
2210 * Otherwise, each call to @a receiver passes NULL for @a changed_paths.
2211 *
2212 * @see svn_log_entry_receiver_t
2213 *
2214 * @since New in 1.5.
2215 *
2216 * @deprecated Provided for backward compatibility with the 1.9 API.
2217 */
2221 const apr_array_header_t *paths,
2222 svn_revnum_t start,
2223 svn_revnum_t end,
2224 int limit,
2225 svn_boolean_t discover_changed_paths,
2226 svn_boolean_t strict_node_history,
2227 svn_boolean_t include_merged_revisions,
2228 const apr_array_header_t *revprops,
2229 svn_repos_authz_func_t authz_read_func,
2230 void *authz_read_baton,
2231 svn_log_entry_receiver_t receiver,
2232 void *receiver_baton,
2233 apr_pool_t *pool);
2234
2235/**
2236 * Same as svn_repos_get_logs4(), but with @a receiver being
2237 * #svn_log_message_receiver_t instead of #svn_log_entry_receiver_t.
2238 * Also, @a include_merged_revisions is set to @c FALSE and @a revprops is
2239 * svn:author, svn:date, and svn:log. If @a paths is empty, nothing
2240 * is returned.
2241 *
2242 * @since New in 1.2.
2243 * @deprecated Provided for backward compatibility with the 1.4 API.
2244 */
2248 const apr_array_header_t *paths,
2249 svn_revnum_t start,
2250 svn_revnum_t end,
2251 int limit,
2252 svn_boolean_t discover_changed_paths,
2253 svn_boolean_t strict_node_history,
2254 svn_repos_authz_func_t authz_read_func,
2255 void *authz_read_baton,
2257 void *receiver_baton,
2258 apr_pool_t *pool);
2259
2260
2261/**
2262 * Same as svn_repos_get_logs3(), but with @a limit always set to 0.
2263 *
2264 * @deprecated Provided for backward compatibility with the 1.1 API.
2265 */
2269 const apr_array_header_t *paths,
2270 svn_revnum_t start,
2271 svn_revnum_t end,
2272 svn_boolean_t discover_changed_paths,
2273 svn_boolean_t strict_node_history,
2274 svn_repos_authz_func_t authz_read_func,
2275 void *authz_read_baton,
2277 void *receiver_baton,
2278 apr_pool_t *pool);
2279
2280/**
2281 * Same as svn_repos_get_logs2(), but with @a authz_read_func and
2282 * @a authz_read_baton always set to NULL.
2283 *
2284 * @deprecated Provided for backward compatibility with the 1.0 API.
2285 */
2289 const apr_array_header_t *paths,
2290 svn_revnum_t start,
2291 svn_revnum_t end,
2292 svn_boolean_t discover_changed_paths,
2293 svn_boolean_t strict_node_history,
2295 void *receiver_baton,
2296 apr_pool_t *pool);
2297
2298
2299
2300/* ---------------------------------------------------------------*/
2301␌
2302/* Retrieving mergeinfo. */
2303
2304/** Receives parsed @a mergeinfo for the file system path @a path.
2305 *
2306 * The user-provided @a baton is being passed through by the retrieval
2307 * function and @a scratch_pool will be cleared between invocations.
2308 *
2309 * @since New in 1.10.
2310 */
2312
2313/**
2314 * For each node found with mergeinfo on it, invoke @a receiver with
2315 * the provided @a receiver_baton.
2316 *
2317 * The paths in @a paths start with '/'.
2318 *
2319 * @a inherit indicates whether explicit, explicit or inherited, or
2320 * only inherited mergeinfo for @a paths is fetched.
2321 *
2322 * If @a revision is #SVN_INVALID_REVNUM, it defaults to youngest.
2323 *
2324 * If @a include_descendants is TRUE, then additionally return the
2325 * mergeinfo for any descendant of any element of @a paths which has
2326 * the #SVN_PROP_MERGEINFO property explicitly set on it. (Note
2327 * that inheritance is only taken into account for the elements in @a
2328 * paths; descendants of the elements in @a paths which get their
2329 * mergeinfo via inheritance are not reported to @a receiver.)
2330 *
2331 * If optional @a authz_read_func is non-NULL, then use this function
2332 * (along with optional @a authz_read_baton) to check the readability
2333 * of each path which mergeinfo was requested for (from @a paths).
2334 * Silently omit unreadable paths from the request for mergeinfo.
2335 *
2336 * Use @a scratch_pool for temporary allocations.
2337 *
2338 * @since New in 1.10.
2339 */
2342 const apr_array_header_t *paths,
2345 svn_boolean_t include_descendants,
2346 svn_repos_authz_func_t authz_read_func,
2347 void *authz_read_baton,
2349 void *receiver_baton,
2350 apr_pool_t *scratch_pool);
2351
2352/**
2353 * Same as svn_repos_fs_get_mergeinfo2(), but all mergeinfo is being collected
2354 * and returned in @a *catalog. It will never be @c NULL, but may be empty.
2355 *
2356 * @since New in 1.5.
2357 *
2358 * @deprecated Provided for backward compatibility with the 1.9 API.
2359 */
2363 svn_repos_t *repos,
2364 const apr_array_header_t *paths,
2367 svn_boolean_t include_descendants,
2368 svn_repos_authz_func_t authz_read_func,
2369 void *authz_read_baton,
2370 apr_pool_t *pool);
2371
2372
2373/* ---------------------------------------------------------------*/
2374␌
2375/* Retrieving multiple revisions of a file. */
2376
2377/**
2378 * Retrieve a subset of the interesting revisions of a file @a path in
2379 * @a repos as seen in revision @a end. Invoke @a handler with
2380 * @a handler_baton as its first argument for each such revision.
2381 * @a pool is used for all allocations. See svn_fs_history_prev() for
2382 * a discussion of interesting revisions.
2383 *
2384 * If optional @a authz_read_func is non-NULL, then use this function
2385 * (along with optional @a authz_read_baton) to check the readability
2386 * of the rev-path in each interesting revision encountered.
2387 *
2388 * Revision discovery happens from @a end to @a start, and if an
2389 * unreadable revision is encountered before @a start is reached, then
2390 * revision discovery stops and only the revisions from @a end to the
2391 * oldest readable revision are returned (So it will appear that @a
2392 * path was added without history in the latter revision).
2393 *
2394 * If there is an interesting revision of the file that is less than or
2395 * equal to start, the iteration will start at that revision. Else, the
2396 * iteration will start at the first revision of the file in the repository,
2397 * which has to be less than or equal to end. Note that if the function
2398 * succeeds, @a handler will have been called at least once.
2399 *
2400 * In a series of calls, the file contents for the first interesting revision
2401 * will be provided as a text delta against the empty file. In the following
2402 * calls, the delta will be against the contents for the previous call.
2403 *
2404 * If @a include_merged_revisions is TRUE, revisions which a included as a
2405 * result of a merge between @a start and @a end will be included.
2406 *
2407 * Since Subversion 1.8 this function has been enabled to support reversion
2408 * the revision range for @a include_merged_revision @c FALSE reporting by
2409 * switching @a start with @a end.
2410 *
2411 * @note Prior to Subversion 1.9, this function may request delta handlers
2412 * from @a handler even for empty text deltas. Starting with 1.9, the
2413 * delta handler / baton return arguments passed to @a handler will be
2414 * NULL unless there is an actual difference in the file contents between
2415 * the current and the previous call.
2416 *
2417 * @since New in 1.5.
2418 */
2421 const char *path,
2422 svn_revnum_t start,
2423 svn_revnum_t end,
2424 svn_boolean_t include_merged_revisions,
2425 svn_repos_authz_func_t authz_read_func,
2426 void *authz_read_baton,
2427 svn_file_rev_handler_t handler,
2428 void *handler_baton,
2429 apr_pool_t *pool);
2430
2431/**
2432 * Similar to #svn_file_rev_handler_t, but without the @a
2433 * result_of_merge parameter.
2434 *
2435 * @deprecated Provided for backward compatibility with 1.4 API.
2436 * @since New in 1.1.
2437 */
2438typedef svn_error_t *(*svn_repos_file_rev_handler_t)
2439 (void *baton,
2440 const char *path,
2441 svn_revnum_t rev,
2442 apr_hash_t *rev_props,
2443 svn_txdelta_window_handler_t *delta_handler,
2444 void **delta_baton,
2445 apr_array_header_t *prop_diffs,
2446 apr_pool_t *pool);
2447
2448/**
2449 * Similar to svn_repos_get_file_revs2(), with @a include_merged_revisions
2450 * set to FALSE.
2451 *
2452 * @deprecated Provided for backward compatibility with the 1.4 API.
2453 * @since New in 1.1.
2454 */
2458 const char *path,
2459 svn_revnum_t start,
2460 svn_revnum_t end,
2461 svn_repos_authz_func_t authz_read_func,
2462 void *authz_read_baton,
2464 void *handler_baton,
2465 apr_pool_t *pool);
2466
2467
2468/* ---------------------------------------------------------------*/
2469␌
2470/**
2471 * @defgroup svn_repos_hook_wrappers Hook-sensitive wrappers for libsvn_fs \
2472 * routines.
2473 * @{
2474 */
2475
2476/** Like svn_fs_commit_txn(), but invoke the @a repos' pre- and
2477 * post-commit hooks around the commit. Use @a pool for any necessary
2478 * allocations.
2479 *
2480 * If the pre-commit hook fails, do not attempt to commit the
2481 * transaction and throw the original error to the caller.
2482 *
2483 * A successful commit is indicated by a valid revision value in @a
2484 * *new_rev, not if svn_fs_commit_txn() returns an error, which can
2485 * occur during its post commit FS processing. If the transaction was
2486 * not committed, then return the associated error and do not execute
2487 * the post-commit hook.
2488 *
2489 * If the commit succeeds the post-commit hook is executed. If the
2490 * post-commit hook returns an error, always wrap it with
2491 * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED; this allows the caller to
2492 * find the post-commit hook error in the returned error chain. If
2493 * both svn_fs_commit_txn() and the post-commit hook return errors,
2494 * then svn_fs_commit_txn()'s error is the parent error and the
2495 * SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error is the child
2496 * error.
2497 *
2498 * @a conflict_p, @a new_rev, and @a txn are as in svn_fs_commit_txn().
2499 */
2501svn_repos_fs_commit_txn(const char **conflict_p,
2502 svn_repos_t *repos,
2503 svn_revnum_t *new_rev,
2504 svn_fs_txn_t *txn,
2505 apr_pool_t *pool);
2506
2507/** Like svn_fs_begin_txn(), but use @a revprop_table, a hash mapping
2508 * <tt>const char *</tt> property names to #svn_string_t values, to
2509 * set the properties on transaction @a *txn_p. @a repos is the
2510 * repository object which contains the filesystem. @a rev, @a
2511 * *txn_p, and @a pool are as in svn_fs_begin_txn().
2512 *
2513 * Before a txn is created, the repository's start-commit hooks are
2514 * run; if any of them fail, no txn is created, @a *txn_p is unaffected,
2515 * and #SVN_ERR_REPOS_HOOK_FAILURE is returned.
2516 *
2517 * @note @a revprop_table may contain an #SVN_PROP_REVISION_DATE property,
2518 * which will be set on the transaction, but that will be overwritten
2519 * when the transaction is committed.
2520 *
2521 * @since New in 1.5.
2522 */
2525 svn_repos_t *repos,
2526 svn_revnum_t rev,
2527 apr_hash_t *revprop_table,
2528 apr_pool_t *pool);
2529
2530
2531/**
2532 * Same as svn_repos_fs_begin_txn_for_commit2(), but with @a revprop_table
2533 * set to a hash containing @a author and @a log_msg as the
2534 * #SVN_PROP_REVISION_AUTHOR and #SVN_PROP_REVISION_LOG properties,
2535 * respectively. @a author and @a log_msg may both be @c NULL.
2536 *
2537 * @deprecated Provided for backward compatibility with the 1.4 API.
2538 */
2542 svn_repos_t *repos,
2543 svn_revnum_t rev,
2544 const char *author,
2545 const char *log_msg,
2546 apr_pool_t *pool);
2547
2548
2549/** Like svn_fs_begin_txn(), but use @a author to set the corresponding
2550 * property on transaction @a *txn_p. @a repos is the repository object
2551 * which contains the filesystem. @a rev, @a *txn_p, and @a pool are as in
2552 * svn_fs_begin_txn().
2553 *
2554 * ### Someday: before a txn is created, some kind of read-hook could
2555 * be called here.
2556 *
2557 * @note This function was never fully implemented, nor used. Ignore it.
2558 * @deprecated Provided for backward compatibility with the 1.7 API.
2559 */
2563 svn_repos_t *repos,
2564 svn_revnum_t rev,
2565 const char *author,
2566 apr_pool_t *pool);
2567
2568
2569/** @} */
2570
2571/** @defgroup svn_repos_fs_locks Repository lock wrappers
2572 * @{
2573 */
2574
2575/** Like svn_fs_lock_many(), but invoke the @a repos's pre- and
2576 * post-lock hooks before and after the locking action.
2577 *
2578 * The pre-lock is run for every path in @a targets. Those targets for
2579 * which the pre-lock is successful are passed to svn_fs_lock_many and
2580 * the post-lock is run for those that are successfully locked.
2581 * Pre-lock hook errors are passed to @a lock_callback.
2582 *
2583 * For each path in @a targets @a lock_callback will be invoked
2584 * passing @a lock_baton and the lock and error that apply to path.
2585 * @a lock_callback can be NULL in which case it is not called and any
2586 * errors that would have been passed to the callback are not reported.
2587 *
2588 * If an error occurs when running the post-lock hook the error is
2589 * returned wrapped with #SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED. If the
2590 * caller sees this error, it knows that some locks succeeded.
2591 *
2592 * The pre-lock hook may cause a different token to be used for the
2593 * lock, instead of the token supplied; see the pre-lock-hook
2594 * documentation for more.
2595 *
2596 * The lock and path passed to @a lock_callback will be allocated in
2597 * @a result_pool. Use @a scratch_pool for temporary allocations.
2598 *
2599 * @note This function is not atomic. If it returns an error, some targets
2600 * may remain unlocked while others may have been locked.
2601 *
2602 * @see svn_fs_lock_many
2603 *
2604 * @since New in 1.9.
2605 */
2608 apr_hash_t *lock_targets,
2609 const char *comment,
2610 svn_boolean_t is_dav_comment,
2611 apr_time_t expiration_date,
2612 svn_boolean_t steal_lock,
2613 svn_fs_lock_callback_t lock_callback,
2614 void *lock_baton,
2615 apr_pool_t *result_pool,
2616 apr_pool_t *scratch_pool);
2617
2618/** Similar to svn_repos_fs_lock_many() but locks only a single path.
2619 *
2620 * @since New in 1.2.
2621 */
2624 svn_repos_t *repos,
2625 const char *path,
2626 const char *token,
2627 const char *comment,
2628 svn_boolean_t is_dav_comment,
2629 apr_time_t expiration_date,
2630 svn_revnum_t current_rev,
2631 svn_boolean_t steal_lock,
2632 apr_pool_t *pool);
2633
2634
2635/** Like svn_fs_unlock_many(), but invoke the @a repos's pre- and
2636 * post-unlock hooks before and after the unlocking action.
2637 *
2638 * The pre-unlock hook is run for every path in @a targets. Those
2639 * targets for which the pre-unlock is successful are passed to
2640 * svn_fs_unlock_many and the post-unlock is run for those that are
2641 * successfully unlocked. Pre-unlock hook errors are passed to @a
2642 * lock_callback.
2643 *
2644 * For each path in @a targets @a lock_callback will be invoked
2645 * passing @a lock_baton and error that apply to path. The lock
2646 * passed to the callback will be NULL. @a lock_callback can be NULL
2647 * in which case it is not called and any errors that would have been
2648 * passed to the callback are not reported.
2649 *
2650 * If an error occurs when running the post-unlock hook, return the
2651 * original error wrapped with #SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED.
2652 * If the caller sees this error, it knows that some unlocks
2653 * succeeded.
2654 *
2655 * The path passed to @a lock_callback will be allocated in @a result_pool.
2656 * Use @a scratch_pool for temporary allocations.
2657 *
2658 * @note This function is not atomic. If it returns an error, some targets
2659 * may remain locked while others may have been unlocked.
2660 *
2661 * @see svn_fs_unlock_many
2662 *
2663 * @since New in 1.9.
2664 */
2667 apr_hash_t *unlock_targets,
2668 svn_boolean_t break_lock,
2669 svn_fs_lock_callback_t lock_callback,
2670 void *lock_baton,
2671 apr_pool_t *result_pool,
2672 apr_pool_t *scratch_pool);
2673
2674/** Similar to svn_repos_fs_unlock_many() but only unlocks a single path.
2675 *
2676 * @since New in 1.2.
2677 */
2680 const char *path,
2681 const char *token,
2682 svn_boolean_t break_lock,
2683 apr_pool_t *pool);
2684
2685
2686
2687/** Look up all the locks in and under @a path in @a repos, setting @a
2688 * *locks to a hash which maps <tt>const char *</tt> paths to the
2689 * #svn_lock_t locks associated with those paths. Use @a
2690 * authz_read_func and @a authz_read_baton to "screen" all returned
2691 * locks. That is: do not return any locks on any paths that are
2692 * unreadable in HEAD, just silently omit them.
2693 *
2694 * @a depth limits the returned locks to those associated with paths
2695 * within the specified depth of @a path, and must be one of the
2696 * following values: #svn_depth_empty, #svn_depth_files,
2697 * #svn_depth_immediates, or #svn_depth_infinity.
2698 *
2699 * @since New in 1.7.
2700 */
2702svn_repos_fs_get_locks2(apr_hash_t **locks,
2703 svn_repos_t *repos,
2704 const char *path,
2705 svn_depth_t depth,
2706 svn_repos_authz_func_t authz_read_func,
2707 void *authz_read_baton,
2708 apr_pool_t *pool);
2709
2710/**
2711 * Similar to svn_repos_fs_get_locks2(), but with @a depth always
2712 * passed as svn_depth_infinity.
2713 *
2714 * @since New in 1.2.
2715 * @deprecated Provided for backward compatibility with the 1.6 API.
2716 */
2719svn_repos_fs_get_locks(apr_hash_t **locks,
2720 svn_repos_t *repos,
2721 const char *path,
2722 svn_repos_authz_func_t authz_read_func,
2723 void *authz_read_baton,
2724 apr_pool_t *pool);
2725
2726/** @} */
2727
2728/** @defgroup svn_repos_properties Versioned and Unversioned Properties
2729 *
2730 * Prop-changing and prop-reading wrappers for libsvn_fs routines.
2731 * @{
2732 */
2733
2734/**
2735 * Like svn_fs_change_rev_prop2(), but validate the name and value of the
2736 * property and invoke the @a repos's pre- and post-revprop-change hooks
2737 * around the change as specified by @a use_pre_revprop_change_hook and
2738 * @a use_post_revprop_change_hook (respectively).
2739 *
2740 * @a rev is the revision whose property to change, @a name is the
2741 * name of the property, and @a new_value is the new value of the
2742 * property. If @a old_value_p is not @c NULL, then @a *old_value_p
2743 * is the expected current (preexisting) value of the property (or @c NULL
2744 * for "unset"). @a author is the authenticated username of the person
2745 * changing the property value, or NULL if not available.
2746 *
2747 * If @a authz_read_func is non-NULL, then use it (with @a
2748 * authz_read_baton) to validate the changed-paths associated with @a
2749 * rev. If the revision contains any unreadable changed paths, then
2750 * return #SVN_ERR_AUTHZ_UNREADABLE.
2751 *
2752 * Validate @a name and @a new_value like the same way
2753 * svn_repos_fs_change_node_prop() does.
2754 *
2755 * Use @a pool for temporary allocations.
2756 *
2757 * @since New in 1.7.
2758 */
2761 svn_revnum_t rev,
2762 const char *author,
2763 const char *name,
2764 const svn_string_t *const *old_value_p,
2765 const svn_string_t *new_value,
2766 svn_boolean_t use_pre_revprop_change_hook,
2767 svn_boolean_t use_post_revprop_change_hook,
2768 svn_repos_authz_func_t authz_read_func,
2769 void *authz_read_baton,
2770 apr_pool_t *pool);
2771
2772/**
2773 * Similar to svn_repos_fs_change_rev_prop4(), but with @a old_value_p always
2774 * set to @c NULL. (In other words, it is similar to
2775 * svn_fs_change_rev_prop().)
2776 *
2777 * @deprecated Provided for backward compatibility with the 1.6 API.
2778 * @since New in 1.5.
2779 */
2783 svn_revnum_t rev,
2784 const char *author,
2785 const char *name,
2786 const svn_string_t *new_value,
2787 svn_boolean_t use_pre_revprop_change_hook,
2788 svn_boolean_t use_post_revprop_change_hook,
2789 svn_repos_authz_func_t authz_read_func,
2790 void *authz_read_baton,
2791 apr_pool_t *pool);
2792
2793/**
2794 * Similar to svn_repos_fs_change_rev_prop3(), but with the @a
2795 * use_pre_revprop_change_hook and @a use_post_revprop_change_hook
2796 * always set to @c TRUE.
2797 *
2798 * @deprecated Provided for backward compatibility with the 1.4 API.
2799 */
2803 svn_revnum_t rev,
2804 const char *author,
2805 const char *name,
2806 const svn_string_t *new_value,
2807 svn_repos_authz_func_t authz_read_func,
2808 void *authz_read_baton,
2809 apr_pool_t *pool);
2810
2811/**
2812 * Similar to svn_repos_fs_change_rev_prop2(), but with the
2813 * @a authz_read_func parameter always NULL.
2814 *
2815 * @deprecated Provided for backward compatibility with the 1.0 API.
2816 */
2820 svn_revnum_t rev,
2821 const char *author,
2822 const char *name,
2823 const svn_string_t *new_value,
2824 apr_pool_t *pool);
2825
2826
2827
2828/**
2829 * Set @a *value_p to the value of the property named @a propname on
2830 * revision @a rev in the filesystem opened in @a repos. If @a rev
2831 * has no property by that name, set @a *value_p to zero. Allocate
2832 * the result in @a pool.
2833 *
2834 * If @a authz_read_func is non-NULL, then use it (with @a
2835 * authz_read_baton) to validate the changed-paths associated with @a
2836 * rev. If the changed-paths are all unreadable, then set @a *value_p
2837 * to zero unconditionally. If only some of the changed-paths are
2838 * unreadable, then allow 'svn:author' and 'svn:date' propvalues to be
2839 * fetched, but return 0 for any other property.
2840 *
2841 * @since New in 1.1.
2842 */
2845 svn_repos_t *repos,
2846 svn_revnum_t rev,
2847 const char *propname,
2848 svn_repos_authz_func_t authz_read_func,
2849 void *authz_read_baton,
2850 apr_pool_t *pool);
2851
2852
2853/**
2854 * Set @a *table_p to the entire property list of revision @a rev in
2855 * filesystem opened in @a repos, as a hash table allocated in @a
2856 * pool. The table maps <tt>char *</tt> property names to
2857 * #svn_string_t * values; the names and values are allocated in @a
2858 * pool.
2859 *
2860 * If @a authz_read_func is non-NULL, then use it (with @a
2861 * authz_read_baton) to validate the changed-paths associated with @a
2862 * rev. If the changed-paths are all unreadable, then return an empty
2863 * hash. If only some of the changed-paths are unreadable, then return
2864 * an empty hash, except for 'svn:author' and 'svn:date' properties
2865 * (assuming those properties exist).
2866 *
2867 * @since New in 1.1.
2868 */
2871 svn_repos_t *repos,
2872 svn_revnum_t rev,
2873 svn_repos_authz_func_t authz_read_func,
2874 void *authz_read_baton,
2875 apr_pool_t *pool);
2876
2877/** Validating wrapper for svn_fs_change_node_prop() (which see for
2878 * argument descriptions).
2879 *
2880 * If @a name's kind is not #svn_prop_regular_kind, return
2881 * #SVN_ERR_REPOS_BAD_ARGS. If @a name is an "svn:" property, validate its
2882 * @a value and return SVN_ERR_BAD_PROPERTY_VALUE if it is invalid for the
2883 * property.
2884 *
2885 * @note Originally, the only properties validated were the "svn:" properties
2886 * #SVN_PROP_REVISION_LOG and #SVN_PROP_REVISION_DATE. For the current
2887 * validation rules see the private function svn_repos__validate_prop().
2888 */
2891 const char *path,
2892 const char *name,
2893 const svn_string_t *value,
2894 apr_pool_t *pool);
2895
2896/**
2897 * Set @a *inherited_values to a depth-first ordered array of
2898 * #svn_prop_inherited_item_t * structures (the path_or_url members of
2899 * which are relative filesystem paths) representing the properties
2900 * inherited by @a path in @a root. If no properties are inherited,
2901 * then set @a *inherited_values to an empty array.
2902 *
2903 * if @a propname is NULL then retrieve all explicit and/or inherited
2904 * properties. Otherwise retrieve only the properties named @a propname.
2905 *
2906 * If optional @a authz_read_func is non-NULL, then use this function
2907 * (along with optional @a authz_read_baton) to check the readability
2908 * of each parent path from which properties are inherited. Silently omit
2909 * properties for unreadable parent paths.
2910 *
2911 * Allocate @a *inherited_props in @a result_pool. Use @a scratch_pool for
2912 * temporary allocations.
2913 *
2914 * @since New in 1.8.
2915 */
2917svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props,
2918 svn_fs_root_t *root,
2919 const char *path,
2920 const char *propname,
2921 svn_repos_authz_func_t authz_read_func,
2922 void *authz_read_baton,
2923 apr_pool_t *result_pool,
2924 apr_pool_t *scratch_pool);
2925
2926/** Validating wrapper for svn_fs_change_txn_prop() (which see for
2927 * argument descriptions). See svn_repos_fs_change_txn_props() for more
2928 * information.
2929 */
2932 const char *name,
2933 const svn_string_t *value,
2934 apr_pool_t *pool);
2935
2936/** Validating wrapper for svn_fs_change_txn_props() (which see for
2937 * argument descriptions). Validate properties and their values the
2938 * same way svn_repos_fs_change_node_prop() does.
2939 *
2940 * @since New in 1.5.
2941 */
2944 const apr_array_header_t *props,
2945 apr_pool_t *pool);
2946
2947/** @} */
2948
2949
2950/* ---------------------------------------------------------------*/
2951␌
2952/**
2953 * @defgroup svn_repos_inspection Data structures and editor things for \
2954 * repository inspection.
2955 * @{
2956 *
2957 * As it turns out, the svn_repos_replay2(), svn_repos_dir_delta2() and
2958 * svn_repos_begin_report3() interfaces can be extremely useful for
2959 * examining the repository, or more exactly, changes to the repository.
2960 * These drivers allows for differences between two trees to be
2961 * described using an editor.
2962 *
2963 * By using the editor obtained from svn_repos_node_editor() with one of
2964 * the drivers mentioned above, the description of how to transform one
2965 * tree into another can be used to build an in-memory linked-list tree,
2966 * which each node representing a repository node that was changed.
2967 */
2968
2969/** A node in the repository. */
2970typedef struct svn_repos_node_t
2971{
2972 /** Node type (file, dir, etc.) */
2974
2975 /** How this node entered the node tree: 'A'dd, 'D'elete, 'R'eplace */
2977
2978 /** Were there any textual mods? (files only) */
2980
2981 /** Where there any property mods? */
2983
2984 /** The name of this node as it appears in its parent's entries list */
2985 const char *name;
2986
2987 /** The filesystem revision where this was copied from (if any) */
2989
2990 /** The filesystem path where this was copied from (if any) */
2991 const char *copyfrom_path;
2992
2993 /** Pointer to the next sibling of this node */
2995
2996 /** Pointer to the first child of this node */
2998
2999 /** Pointer to the parent of this node */
3001
3003
3004
3005/** Set @a *editor and @a *edit_baton to an editor that, when driven by
3006 * a driver such as svn_repos_replay2(), builds an <tt>svn_repos_node_t *</tt>
3007 * tree representing the delta from @a base_root to @a root in @a
3008 * repos's filesystem.
3009 *
3010 * The editor can also be driven by svn_repos_dir_delta2() or
3011 * svn_repos_begin_report3(), but unless you have special needs,
3012 * svn_repos_replay2() is preferred.
3013 *
3014 * Invoke svn_repos_node_from_baton() on @a edit_baton to obtain the root
3015 * node afterwards.
3016 *
3017 * Note that the delta includes "bubbled-up" directories; that is,
3018 * many of the directory nodes will have no prop_mods.
3019 *
3020 * Allocate the tree and its contents in @a node_pool; do all other
3021 * allocation in @a pool.
3022 */
3024svn_repos_node_editor(const svn_delta_editor_t **editor,
3025 void **edit_baton,
3026 svn_repos_t *repos,
3027 svn_fs_root_t *base_root,
3028 svn_fs_root_t *root,
3029 apr_pool_t *node_pool,
3030 apr_pool_t *pool);
3031
3032/** Return the root node of the linked-list tree generated by driving the
3033 * editor (associated with @a edit_baton) created by svn_repos_node_editor().
3034 * This is only really useful if used *after* the editor drive is completed.
3035 */
3038
3039/**
3040 * Return repository format information for @a repos.
3041 *
3042 * Set @a *repos_format to the repository format number of @a repos, which is
3043 * an integer that increases when incompatible changes are made (such as
3044 * by #svn_repos_upgrade2).
3045 *
3046 * Set @a *supports_version to the version number of the minimum Subversion
3047 * GA release that can read and write @a repos; allocate it in
3048 * @a result_pool. Use @a scratch_pool for temporary allocations.
3049 *
3050 * @see svn_fs_info_format, svn_repos_capabilities
3051 *
3052 * @since New in 1.9.
3053 */
3055svn_repos_info_format(int *repos_format,
3056 svn_version_t **supports_version,
3057 svn_repos_t *repos,
3058 apr_pool_t *result_pool,
3059 apr_pool_t *scratch_pool);
3060
3061/** @} */
3062
3063/* ---------------------------------------------------------------*/
3064␌
3065/**
3066 * @defgroup svn_repos_dump_load Dumping, loading and verifying filesystem data
3067 * @{
3068 *
3069 * The filesystem 'dump' format contains nothing but the abstract
3070 * structure of the filesystem -- independent of any internal node-id
3071 * schema or database back-end. All of the data in the dumpfile is
3072 * acquired by public function calls into svn_fs.h. Similarly, the
3073 * parser which reads the dumpfile is able to reconstruct the
3074 * filesystem using only public svn_fs.h routines.
3075 *
3076 * Thus the dump/load feature's main purpose is for *migrating* data
3077 * from one svn filesystem to another -- presumably two filesystems
3078 * which have different internal implementations.
3079 *
3080 * If you simply want to backup your filesystem, you're probably
3081 * better off using the built-in facilities of the DB backend (using
3082 * Berkeley DB's hot-backup feature, for example.)
3083 *
3084 * For a description of the dumpfile format, see
3085 * /trunk/notes/fs_dumprestore.txt.
3086 */
3087
3088/* The RFC822-style headers in our dumpfile format. */
3089#define SVN_REPOS_DUMPFILE_MAGIC_HEADER "SVN-fs-dump-format-version"
3090#define SVN_REPOS_DUMPFILE_FORMAT_VERSION 3
3091#define SVN_REPOS_DUMPFILE_FORMAT_VERSION_DELTAS 3
3092#define SVN_REPOS_DUMPFILE_UUID "UUID"
3093#define SVN_REPOS_DUMPFILE_CONTENT_LENGTH "Content-length"
3094
3095#define SVN_REPOS_DUMPFILE_REVISION_NUMBER "Revision-number"
3096
3097#define SVN_REPOS_DUMPFILE_NODE_PATH "Node-path"
3098#define SVN_REPOS_DUMPFILE_NODE_KIND "Node-kind"
3099#define SVN_REPOS_DUMPFILE_NODE_ACTION "Node-action"
3100#define SVN_REPOS_DUMPFILE_NODE_COPYFROM_PATH "Node-copyfrom-path"
3101#define SVN_REPOS_DUMPFILE_NODE_COPYFROM_REV "Node-copyfrom-rev"
3102/** @since New in 1.6. */
3103#define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5 "Text-copy-source-md5"
3104/** @since New in 1.6. */
3105#define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_SHA1 "Text-copy-source-sha1"
3106#define SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_CHECKSUM \
3107 SVN_REPOS_DUMPFILE_TEXT_COPY_SOURCE_MD5
3108/** @since New in 1.6. */
3109#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5 "Text-content-md5"
3110/** @since New in 1.6. */
3111#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_SHA1 "Text-content-sha1"
3112#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_CHECKSUM \
3113 SVN_REPOS_DUMPFILE_TEXT_CONTENT_MD5
3114
3115#define SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH "Prop-content-length"
3116#define SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH "Text-content-length"
3117
3118/** @since New in 1.1. */
3119#define SVN_REPOS_DUMPFILE_PROP_DELTA "Prop-delta"
3120/** @since New in 1.1. */
3121#define SVN_REPOS_DUMPFILE_TEXT_DELTA "Text-delta"
3122/** @since New in 1.6. */
3123#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5 "Text-delta-base-md5"
3124/** @since New in 1.6. */
3125#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_SHA1 "Text-delta-base-sha1"
3126/** @since New in 1.5. */
3127#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM \
3128 SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5
3129
3130/** The different policies for processing the UUID in the dumpfile. */
3132{
3133 /** only update uuid if the repos has no revisions. */
3135 /** never update uuid. */
3137 /** always update uuid. */
3139};
3140
3141/** Callback type for use with svn_repos_verify_fs3(). @a revision
3142 * and @a verify_err are the details of a single verification failure
3143 * that occurred during the svn_repos_verify_fs3() call. @a baton is
3144 * the same baton given to svn_repos_verify_fs3(). @a scratch_pool is
3145 * provided for the convenience of the implementor, who should not
3146 * expect it to live longer than a single callback call.
3147 *
3148 * @a verify_err will be cleared and becomes invalid after the callback
3149 * returns, use svn_error_dup() to preserve the error. If a callback uses
3150 * @a verify_err as the return value or as a part of the return value, it
3151 * should also call svn_error_dup() for @a verify_err. Implementors of this
3152 * callback are forbidden to call svn_error_clear() for @a verify_err.
3153 *
3154 * @see svn_repos_verify_fs3
3155 *
3156 * @since New in 1.9.
3157 */
3158typedef svn_error_t *(*svn_repos_verify_callback_t)(void *baton,
3160 svn_error_t *verify_err,
3161 apr_pool_t *scratch_pool);
3162
3163/**
3164 * Verify the contents of the file system in @a repos.
3165 *
3166 * Verify the revisions from @a start_rev to @a end_rev inclusive. If
3167 * @a start_rev is #SVN_INVALID_REVNUM, start at revision 0; if @a end_rev
3168 * is #SVN_INVALID_REVNUM, end at the head revision. @a start_rev must be
3169 * older than or equal to @a end_rev. If revision 0 is included in the
3170 * range, then also verify "global invariants" of the repository, as
3171 * described in svn_fs_verify().
3172 *
3173 * If @a check_normalization is @c TRUE, report any name collisions
3174 * within the same directory or svn:mergeinfo property where the names
3175 * differ only in character representation, but are otherwise
3176 * identical.
3177 *
3178 * If @a metadata_only is @c TRUE, backends that have a concept of separate
3179 * metadata verification will only perform that and skip the more expensive
3180 * file context reconstruction and verification. For FSFS format 7+ and
3181 * FSX, this allows for a very fast check against external corruption.
3182 *
3183 * If @a verify_callback is not @c NULL, call it with @a verify_baton upon
3184 * receiving an FS-specific structure failure or a revision verification
3185 * failure. Set @c revision callback argument to #SVN_INVALID_REVNUM or
3186 * to the revision number respectively. Set @c verify_err to svn_error_t
3187 * describing the reason of the failure. @c verify_err will be cleared
3188 * after the callback returns, use svn_error_dup() to preserve the error.
3189 * If @a verify_callback returns an error different from #SVN_NO_ERROR,
3190 * stop verifying the repository and immediately return the error from
3191 * @a verify_callback.
3192 *
3193 * If @a verify_callback is @c NULL, this function returns the first
3194 * encountered verification error or #SVN_NO_ERROR if there were no failures
3195 * during the verification. Errors that prevent the verification process
3196 * from continuing, such as #SVN_ERR_CANCELLED, are returned immediately
3197 * and do not trigger an invocation of @a verify_callback.
3198 *
3199 * If @a notify_func is not null, then call it with @a notify_baton and
3200 * with a notification structure in which the fields are set as follows.
3201 * (For a warning that does not apply to a specific revision, the revision
3202 * number is #SVN_INVALID_REVNUM.)
3203 *
3204 * For each FS-specific structure warning:
3205 * @c action = svn_repos_notify_verify_rev_structure
3206 * @c revision = the revision or #SVN_INVALID_REVNUM
3207 *
3208 * For each revision verification warning:
3209 * @c action = #svn_repos_notify_warning
3210 * @c warning and @c warning_str fields set accordingly
3211 * ### TODO: Set @c revision = the revision?
3212 *
3213 * For each successfully verified revision:
3214 * @c action = #svn_repos_notify_verify_rev_end
3215 * @c revision = the revision
3216 *
3217 * At the end:
3218 * @c action = svn_repos_notify_verify_end
3219 * ### Do we really need a callback to tell us the function we
3220 * called has reached its end and is about to return?
3221 * ### Not sent, currently, if a FS structure error is found.
3222 *
3223 * If @a cancel_func is not @c NULL, call it periodically with @a
3224 * cancel_baton as argument to see if the caller wishes to cancel the
3225 * verification.
3226 *
3227 * Use @a scratch_pool for temporary allocation.
3228 *
3229 * @see svn_repos_verify_callback_t
3230 *
3231 * @since New in 1.9.
3232 */
3235 svn_revnum_t start_rev,
3236 svn_revnum_t end_rev,
3237 svn_boolean_t check_normalization,
3238 svn_boolean_t metadata_only,
3239 svn_repos_notify_func_t notify_func,
3240 void *notify_baton,
3241 svn_repos_verify_callback_t verify_callback,
3242 void *verify_baton,
3243 svn_cancel_func_t cancel,
3244 void *cancel_baton,
3245 apr_pool_t *scratch_pool);
3246
3247/**
3248 * Like svn_repos_verify_fs3(), but with @a verify_callback and
3249 * @a verify_baton set to @c NULL and with @a check_normalization
3250 * and @a metadata_only set to @c FALSE.
3251 *
3252 * @since New in 1.7.
3253 * @deprecated Provided for backward compatibility with the 1.8 API.
3254 */
3258 svn_revnum_t start_rev,
3259 svn_revnum_t end_rev,
3260 svn_repos_notify_func_t notify_func,
3261 void *notify_baton,
3262 svn_cancel_func_t cancel,
3263 void *cancel_baton,
3264 apr_pool_t *scratch_pool);
3265
3266/**
3267 * Similar to svn_repos_verify_fs2(), but with a feedback_stream instead of
3268 * handling feedback via the notify_func handler.
3269 *
3270 * If @a feedback_stream is not @c NULL, write feedback to it (lines of
3271 * the form "* Verified revision %ld\n").
3272 *
3273 * @since New in 1.5.
3274 * @deprecated Provided for backward compatibility with the 1.6 API.
3275 */
3279 svn_stream_t *feedback_stream,
3280 svn_revnum_t start_rev,
3281 svn_revnum_t end_rev,
3282 svn_cancel_func_t cancel_func,
3283 void *cancel_baton,
3284 apr_pool_t *pool);
3285
3286/**
3287 * Dump the contents of the filesystem within already-open @a repos into
3288 * writable @a dumpstream. If @a dumpstream is
3289 * @c NULL, this is effectively a primitive verify. It is not complete,
3290 * however; see instead svn_repos_verify_fs3().
3291 *
3292 * Begin at revision @a start_rev, and dump every revision up through
3293 * @a end_rev. If @a start_rev is #SVN_INVALID_REVNUM, start at revision
3294 * 0. If @a end_rev is #SVN_INVALID_REVNUM, end at the head revision.
3295 *
3296 * If @a incremental is @c TRUE, the first revision dumped will be a diff
3297 * against the previous revision (usually it looks like a full dump of
3298 * the tree).
3299 *
3300 * If @a use_deltas is @c TRUE, output only node properties which have
3301 * changed relative to the previous contents, and output text contents
3302 * as svndiff data against the previous contents. Regardless of how
3303 * this flag is set, the first revision of a non-incremental dump will
3304 * be done with full plain text. A dump with @a use_deltas set cannot
3305 * be loaded by Subversion 1.0.x.
3306 *
3307 * If @a include_revprops is @c TRUE, output the revision properties as
3308 * well, otherwise omit them.
3309 *
3310 * If @a include_changes is @c TRUE, output the revision contents, i.e.
3311 * tree and node changes.
3312 *
3313 * If @a notify_func is not null, then call it with @a notify_baton and
3314 * with a notification structure in which the fields are set as follows.
3315 * (For a warning or error notification that does not apply to a specific
3316 * revision, the revision number is #SVN_INVALID_REVNUM.)
3317 *
3318 * For each warning:
3319 * @c action = #svn_repos_notify_warning
3320 * @c warning and @c warning_str fields set accordingly
3321 * ### TODO: Set @c revision = the revision or #SVN_INVALID_REVNUM?
3322 *
3323 * For each successfully dumped revision:
3324 * @c action = #svn_repos_notify_dump_rev_end
3325 * @c revision = the revision
3326 *
3327 * At the end:
3328 * @c action = svn_repos_notify_verify_end
3329 * ### Do we really need a callback to tell us the function we
3330 * called has reached its end and is about to return?
3331 *
3332 * At the end, if there were certain warnings previously:
3333 * @c action = #svn_repos_notify_warning
3334 * @c warning and @c warning_str fields set accordingly,
3335 * reiterating the existence of previous warnings
3336 * ### This is a presentation issue. Caller could do this itself.
3337 *
3338 * If @a filter_func is not @c NULL, it is called for each node being
3339 * dumped, allowing the caller to exclude it from dump.
3340 *
3341 * If @a cancel_func is not @c NULL, it is called periodically with
3342 * @a cancel_baton as argument to see if the client wishes to cancel
3343 * the dump.
3344 *
3345 * Use @a scratch_pool for temporary allocation.
3346 *
3347 * @since New in 1.10.
3348 */
3351 svn_stream_t *stream,
3352 svn_revnum_t start_rev,
3353 svn_revnum_t end_rev,
3354 svn_boolean_t incremental,
3355 svn_boolean_t use_deltas,
3356 svn_boolean_t include_revprops,
3357 svn_boolean_t include_changes,
3358 svn_repos_notify_func_t notify_func,
3359 void *notify_baton,
3360 svn_repos_dump_filter_func_t filter_func,
3361 void *filter_baton,
3362 svn_cancel_func_t cancel_func,
3363 void *cancel_baton,
3364 apr_pool_t *pool);
3365
3366/**
3367 * Similar to svn_repos_dump_fs4(), but with @a include_revprops and
3368 * @a include_changes both set to @c TRUE and @a filter_func and
3369 * @a filter_baton set to @c NULL.
3370 *
3371 * @since New in 1.7.
3372 * @deprecated Provided for backward compatibility with the 1.9 API.
3373 */
3377 svn_stream_t *dumpstream,
3378 svn_revnum_t start_rev,
3379 svn_revnum_t end_rev,
3380 svn_boolean_t incremental,
3381 svn_boolean_t use_deltas,
3382 svn_repos_notify_func_t notify_func,
3383 void *notify_baton,
3384 svn_cancel_func_t cancel_func,
3385 void *cancel_baton,
3386 apr_pool_t *scratch_pool);
3387
3388/**
3389 * Similar to svn_repos_dump_fs3(), but with a feedback_stream instead of
3390 * handling feedback via the notify_func handler
3391 *
3392 * @since New in 1.1.
3393 * @deprecated Provided for backward compatibility with the 1.6 API.
3394 */
3398 svn_stream_t *dumpstream,
3399 svn_stream_t *feedback_stream,
3400 svn_revnum_t start_rev,
3401 svn_revnum_t end_rev,
3402 svn_boolean_t incremental,
3403 svn_boolean_t use_deltas,
3404 svn_cancel_func_t cancel_func,
3405 void *cancel_baton,
3406 apr_pool_t *pool);
3407
3408/**
3409 * Similar to svn_repos_dump_fs2(), but with the @a use_deltas
3410 * parameter always set to @c FALSE.
3411 *
3412 * @deprecated Provided for backward compatibility with the 1.0 API.
3413 */
3417 svn_stream_t *dumpstream,
3418 svn_stream_t *feedback_stream,
3419 svn_revnum_t start_rev,
3420 svn_revnum_t end_rev,
3421 svn_boolean_t incremental,
3422 svn_cancel_func_t cancel_func,
3423 void *cancel_baton,
3424 apr_pool_t *pool);
3425
3426
3427/**
3428 * Read and parse dumpfile-formatted @a dumpstream, reconstructing
3429 * filesystem revisions in already-open @a repos, handling uuids in
3430 * accordance with @a uuid_action. Use @a pool for all allocation.
3431 *
3432 * If the dumpstream contains copy history that is unavailable in the
3433 * repository, an error will be thrown.
3434 *
3435 * The repository's UUID will be updated iff
3436 * the dumpstream contains a UUID and
3437 * @a uuid_action is not equal to #svn_repos_load_uuid_ignore and
3438 * either the repository contains no revisions or
3439 * @a uuid_action is equal to #svn_repos_load_uuid_force.
3440 *
3441 * If the dumpstream contains no UUID, then @a uuid_action is
3442 * ignored and the repository UUID is not touched.
3443 *
3444 * @a start_rev and @a end_rev act as filters, the lower and upper
3445 * (inclusive) range values of revisions in @a dumpstream which will
3446 * be loaded. Either both of these values are #SVN_INVALID_REVNUM (in
3447 * which case no revision-based filtering occurs at all), or both are
3448 * valid revisions (where @a start_rev is older than or equivalent to
3449 * @a end_rev).
3450 *
3451 * If @a parent_dir is not NULL, then the parser will reparent all the
3452 * loaded nodes, from root to @a parent_dir. The directory @a parent_dir
3453 * must be an existing directory in the repository.
3454 *
3455 * If @a use_pre_commit_hook is set, call the repository's pre-commit
3456 * hook before committing each loaded revision.
3457 *
3458 * If @a use_post_commit_hook is set, call the repository's
3459 * post-commit hook after committing each loaded revision.
3460 *
3461 * If @a validate_props is set, then validate Subversion revision and
3462 * node properties (those in the svn: namespace) against established
3463 * rules for those things.
3464 *
3465 * If @a ignore_dates is set, ignore any revision datestamps found in
3466 * @a dumpstream, allowing the revisions created by the load process
3467 * to be stamped as if they were newly created via the normal commit
3468 * process.
3469 *
3470 * If @a normalize_props is set, attempt to normalize invalid Subversion
3471 * revision and node properties (those in the svn: namespace) so that
3472 * their values would follow the established rules for them. For example,
3473 * for such properties, typically the value must be in UTF-8 with LF
3474 * line endings.
3475 *
3476 * @note The details or the performed normalizations are deliberately
3477 * left unspecified and may change in the future.
3478 *
3479 * If non-NULL, use @a notify_func and @a notify_baton to send notification
3480 * of events to the caller.
3481 *
3482 * If @a cancel_func is not @c NULL, it is called periodically with
3483 * @a cancel_baton as argument to see if the client wishes to cancel
3484 * the load.
3485 *
3486 * @since New in 1.10.
3487 */
3490 svn_stream_t *dumpstream,
3491 svn_revnum_t start_rev,
3492 svn_revnum_t end_rev,
3493 enum svn_repos_load_uuid uuid_action,
3494 const char *parent_dir,
3495 svn_boolean_t use_pre_commit_hook,
3496 svn_boolean_t use_post_commit_hook,
3497 svn_boolean_t validate_props,
3498 svn_boolean_t ignore_dates,
3499 svn_boolean_t normalize_props,
3500 svn_repos_notify_func_t notify_func,
3501 void *notify_baton,
3502 svn_cancel_func_t cancel_func,
3503 void *cancel_baton,
3504 apr_pool_t *pool);
3505
3506/**
3507 * Similar to svn_repos_load_fs6(), but with the @a normalize_props
3508 * parameter always set to @c FALSE.
3509 *
3510 * @since New in 1.9.
3511 * @deprecated Provided for backward compatibility with the 1.9 API.
3512 */
3516 svn_stream_t *dumpstream,
3517 svn_revnum_t start_rev,
3518 svn_revnum_t end_rev,
3519 enum svn_repos_load_uuid uuid_action,
3520 const char *parent_dir,
3521 svn_boolean_t use_pre_commit_hook,
3522 svn_boolean_t use_post_commit_hook,
3523 svn_boolean_t validate_props,
3524 svn_boolean_t ignore_dates,
3525 svn_repos_notify_func_t notify_func,
3526 void *notify_baton,
3527 svn_cancel_func_t cancel_func,
3528 void *cancel_baton,
3529 apr_pool_t *pool);
3530
3531/** Similar to svn_repos_load_fs5(), but with @a ignore_dates
3532 * always passed as FALSE.
3533 *
3534 * @since New in 1.8.
3535 * @deprecated Provided for backward compatibility with the 1.8 API.
3536 */
3540 svn_stream_t *dumpstream,
3541 svn_revnum_t start_rev,
3542 svn_revnum_t end_rev,
3543 enum svn_repos_load_uuid uuid_action,
3544 const char *parent_dir,
3545 svn_boolean_t use_pre_commit_hook,
3546 svn_boolean_t use_post_commit_hook,
3547 svn_boolean_t validate_props,
3548 svn_repos_notify_func_t notify_func,
3549 void *notify_baton,
3550 svn_cancel_func_t cancel_func,
3551 void *cancel_baton,
3552 apr_pool_t *pool);
3553
3554/** Similar to svn_repos_load_fs4(), but with @a start_rev and @a
3555 * end_rev always passed as #SVN_INVALID_REVNUM.
3556 *
3557 * @since New in 1.7.
3558 * @deprecated Provided for backward compatibility with the 1.7 API.
3559 */
3563 svn_stream_t *dumpstream,
3564 enum svn_repos_load_uuid uuid_action,
3565 const char *parent_dir,
3566 svn_boolean_t use_pre_commit_hook,
3567 svn_boolean_t use_post_commit_hook,
3568 svn_boolean_t validate_props,
3569 svn_repos_notify_func_t notify_func,
3570 void *notify_baton,
3571 svn_cancel_func_t cancel_func,
3572 void *cancel_baton,
3573 apr_pool_t *pool);
3574
3575/**
3576 * Similar to svn_repos_load_fs3(), but with @a feedback_stream in
3577 * place of the #svn_repos_notify_func_t and baton and with
3578 * @a validate_props always FALSE.
3579 *
3580 * @since New in 1.2.
3581 * @deprecated Provided for backward compatibility with the 1.6 API.
3582 */
3586 svn_stream_t *dumpstream,
3587 svn_stream_t *feedback_stream,
3588 enum svn_repos_load_uuid uuid_action,
3589 const char *parent_dir,
3590 svn_boolean_t use_pre_commit_hook,
3591 svn_boolean_t use_post_commit_hook,
3592 svn_cancel_func_t cancel_func,
3593 void *cancel_baton,
3594 apr_pool_t *pool);
3595
3596/**
3597 * Similar to svn_repos_load_fs2(), but with @a use_pre_commit_hook and
3598 * @a use_post_commit_hook always @c FALSE.
3599 *
3600 * @deprecated Provided for backward compatibility with the 1.1 API.
3601 */
3605 svn_stream_t *dumpstream,
3606 svn_stream_t *feedback_stream,
3607 enum svn_repos_load_uuid uuid_action,
3608 const char *parent_dir,
3609 svn_cancel_func_t cancel_func,
3610 void *cancel_baton,
3611 apr_pool_t *pool);
3612
3613/**
3614 * Read and parse dumpfile-formatted @a dumpstream, extracting the
3615 * revision properties from it and apply them to the already-open
3616 * @a repos. Use @a scratch_pool for temporary allocations.
3617 *
3618 * If, after filtering by the @a start_rev and @a end_rev, the dumpstream
3619 * contains revisions missing in @a repos, an error will be thrown.
3620 *
3621 * @a start_rev and @a end_rev act as filters, the lower and upper
3622 * (inclusive) range values of revisions in @a dumpstream which will
3623 * be loaded. Either both of these values are #SVN_INVALID_REVNUM (in
3624 * which case no revision-based filtering occurs at all), or both are
3625 * valid revisions (where @a start_rev is older than or equivalent to
3626 * @a end_rev).
3627 *
3628 * If @a validate_props is set, then validate Subversion revision
3629 * properties (those in the svn: namespace) against established
3630 * rules for those things.
3631 *
3632 * If @a ignore_dates is set, ignore any revision datestamps found in
3633 * @a dumpstream, keeping whatever timestamps the revisions currently
3634 * have.
3635 *
3636 * If @a normalize_props is set, attempt to normalize invalid Subversion
3637 * revision and node properties (those in the svn: namespace) so that
3638 * their values would follow the established rules for them. For example,
3639 * for such properties, typically the value must be in UTF-8 with LF
3640 * line endings.
3641 *
3642 * @note The details or the performed normalizations are deliberately
3643 * left unspecified and may change in the future.
3644 *
3645 * If non-NULL, use @a notify_func and @a notify_baton to send notification
3646 * of events to the caller.
3647 *
3648 * If @a cancel_func is not @c NULL, it is called periodically with
3649 * @a cancel_baton as argument to see if the client wishes to cancel
3650 * the load.
3651 *
3652 * @remark No repository hooks will be triggered.
3653 *
3654 * @since New in 1.10.
3655 */
3658 svn_stream_t *dumpstream,
3659 svn_revnum_t start_rev,
3660 svn_revnum_t end_rev,
3661 svn_boolean_t validate_props,
3662 svn_boolean_t ignore_dates,
3663 svn_boolean_t normalize_props,
3664 svn_repos_notify_func_t notify_func,
3665 void *notify_baton,
3666 svn_cancel_func_t cancel_func,
3667 void *cancel_baton,
3668 apr_pool_t *scratch_pool);
3669
3670/**
3671 * A vtable that is driven by svn_repos_parse_dumpstream3().
3672 *
3673 * @since New in 1.8.
3674 */
3676{
3677 /** The parser has discovered a new "magic header" record within the
3678 * parsing session represented by @a parse_baton. The dump-format
3679 * version number is @a version.
3680 */
3681 svn_error_t *(*magic_header_record)(int version,
3682 void *parse_baton,
3683 apr_pool_t *pool);
3684
3685 /** The parser has discovered a new uuid record within the parsing
3686 * session represented by @a parse_baton. The uuid's value is
3687 * @a uuid, and it is allocated in @a pool.
3688 */
3689 svn_error_t *(*uuid_record)(const char *uuid,
3690 void *parse_baton,
3691 apr_pool_t *pool);
3692
3693 /** The parser has discovered a new revision record within the
3694 * parsing session represented by @a parse_baton. All the headers are
3695 * placed in @a headers (allocated in @a pool), which maps <tt>const
3696 * char *</tt> header-name ==> <tt>const char *</tt> header-value.
3697 * The @a revision_baton received back (also allocated in @a pool)
3698 * represents the revision.
3699 */
3700 svn_error_t *(*new_revision_record)(void **revision_baton,
3701 apr_hash_t *headers,
3702 void *parse_baton,
3703 apr_pool_t *pool);
3704
3705 /** The parser has discovered a new node record within the current
3706 * revision represented by @a revision_baton. All the headers are
3707 * placed in @a headers (as with @c new_revision_record), allocated in
3708 * @a pool. The @a node_baton received back is allocated in @a pool
3709 * and represents the node.
3710 */
3711 svn_error_t *(*new_node_record)(void **node_baton,
3712 apr_hash_t *headers,
3713 void *revision_baton,
3714 apr_pool_t *pool);
3715
3716 /** For a given @a revision_baton, set a property @a name to @a value. */
3717 svn_error_t *(*set_revision_property)(void *revision_baton,
3718 const char *name,
3719 const svn_string_t *value);
3720
3721 /** For a given @a node_baton, set a property @a name to @a value. */
3722 svn_error_t *(*set_node_property)(void *node_baton,
3723 const char *name,
3724 const svn_string_t *value);
3725
3726 /** For a given @a node_baton, delete property @a name. */
3727 svn_error_t *(*delete_node_property)(void *node_baton, const char *name);
3728
3729 /** For a given @a node_baton, remove all properties. */
3730 svn_error_t *(*remove_node_props)(void *node_baton);
3731
3732 /** For a given @a node_baton, set @a stream to a writable stream
3733 * capable of receiving the node's fulltext. The parser will write
3734 * the fulltext to the stream and then close the stream to signal
3735 * completion.
3736 *
3737 * If a @c NULL is returned instead of a stream, the vtable is
3738 * indicating that no text is desired, and the parser will not
3739 * attempt to send it.
3740 */
3741 svn_error_t *(*set_fulltext)(svn_stream_t **stream,
3742 void *node_baton);
3743
3744 /** For a given @a node_baton, set @a handler and @a handler_baton
3745 * to a window handler and baton capable of receiving a delta
3746 * against the node's previous contents. The parser will send all
3747 * the windows of data to this handler, and will then send a NULL
3748 * window to signal completion.
3749 *
3750 * If a @c NULL is returned instead of a handler, the vtable is
3751 * indicating that no delta is desired, and the parser will not
3752 * attempt to send it.
3753 */
3754 svn_error_t *(*apply_textdelta)(svn_txdelta_window_handler_t *handler,
3755 void **handler_baton,
3756 void *node_baton);
3757
3758 /** The parser has reached the end of the current node represented by
3759 * @a node_baton, it can be freed.
3760 */
3761 svn_error_t *(*close_node)(void *node_baton);
3762
3763 /** The parser has reached the end of the current revision
3764 * represented by @a revision_baton. In other words, there are no more
3765 * changed nodes within the revision. The baton can be freed.
3766 */
3767 svn_error_t *(*close_revision)(void *revision_baton);
3768
3770
3771
3772/**
3773 * Read and parse dumpfile-formatted @a stream, calling callbacks in
3774 * @a parse_fns/@a parse_baton, and using @a pool for allocations.
3775 *
3776 * If @a deltas_are_text is @c TRUE, handle text-deltas with the @a
3777 * set_fulltext callback. This is useful when manipulating a dump
3778 * stream without loading it. Otherwise handle text-deltas with the
3779 * @a apply_textdelta callback.
3780 *
3781 * If @a cancel_func is not @c NULL, it is called periodically with
3782 * @a cancel_baton as argument to see if the client wishes to cancel
3783 * the dump.
3784 *
3785 * This parser has built-in knowledge of the dumpfile format, but only
3786 * in a limited sense:
3787 *
3788 * * it recognizes the "magic" format-version header.
3789 *
3790 * * it recognizes the UUID header.
3791 *
3792 * * it recognizes revision and node records by looking for either
3793 * a REVISION_NUMBER or NODE_PATH headers.
3794 *
3795 * * it recognizes the CONTENT-LENGTH headers, so it knows if and
3796 * how to suck up the content body.
3797 *
3798 * * it knows how to parse a content body into two parts: props
3799 * and text, and pass the pieces to the vtable.
3800 *
3801 * This is enough knowledge to make it easy on vtable implementors,
3802 * but still allow expansion of the format: most headers do not have
3803 * to be handled explicitly.
3804 *
3805 * ### [JAF] Wouldn't it be more efficient to support a start/end rev
3806 * range here than only supporting it in receivers such as
3807 * svn_repos_get_fs_build_parser4()? This parser could then skip over
3808 * chunks of the input stream before the oldest required rev, and
3809 * could stop reading entirely after the youngest required rev.
3810 *
3811 * @since New in 1.8.
3812
3813 * @since Starting in 1.10, @a parse_fns may contain NULL pointers for
3814 * those callbacks that the caller is not interested in.
3815 */
3818 const svn_repos_parse_fns3_t *parse_fns,
3819 void *parse_baton,
3820 svn_boolean_t deltas_are_text,
3821 svn_cancel_func_t cancel_func,
3822 void *cancel_baton,
3823 apr_pool_t *pool);
3824
3825
3826/**
3827 * Set @a *parser and @a *parse_baton to a vtable parser which commits new
3828 * revisions to the fs in @a repos. The constructed parser will treat
3829 * UUID records in a manner consistent with @a uuid_action. Use @a pool
3830 * to operate on the fs.
3831 *
3832 * @a start_rev and @a end_rev act as filters, the lower and upper
3833 * (inclusive) range values of revisions which will
3834 * be loaded. Either both of these values are #SVN_INVALID_REVNUM (in
3835 * which case no revision-based filtering occurs at all), or both are
3836 * valid revisions (where @a start_rev is older than or equivalent to
3837 * @a end_rev). They refer to dump stream revision numbers rather than
3838 * committed revision numbers.
3839 *
3840 * If @a use_history is true, then when the parser encounters a node that
3841 * is added-with-history, it will require 'copy-from' history to exist in
3842 * the repository at the relative (adjusted) copy-from revision and path.
3843 * It will perform a copy from that source location, and will fail if no
3844 * suitable source exists there. If @a use_history is false, then it will
3845 * instead convert every copy to a plain add.
3846 *
3847 * ### The 'use_history=FALSE' case is unused and untested in Subversion.
3848 * It seems to me it would not work with a deltas dumpfile (a driver
3849 * that calls the @c apply_textdelta method), as it would not have
3850 * access to the delta base text.
3851 *
3852 * If @a use_pre_commit_hook is set, call the repository's pre-commit
3853 * hook before committing each loaded revision.
3854 *
3855 * If @a use_post_commit_hook is set, call the repository's
3856 * post-commit hook after committing each loaded revision.
3857 *
3858 * If @a validate_props is set, then validate Subversion revision and
3859 * node properties (those in the svn: namespace) against established
3860 * rules for those things.
3861 *
3862 * If @a ignore_dates is set, ignore any revision datestamps found in
3863 * @a dumpstream, allowing the revisions created by the load process
3864 * to be stamped as if they were newly created via the normal commit
3865 * process.
3866 *
3867 * If @a normalize_props is set, attempt to normalize invalid Subversion
3868 * revision and node properties (those in the svn: namespace) so that
3869 * their values would follow the established rules for them. For example,
3870 * for such properties, typically the value must be in UTF-8 with LF
3871 * line endings.
3872 *
3873 * @note The details or the performed normalizations are deliberately
3874 * left unspecified and may change in the future.
3875 *
3876 * If @a parent_dir is not NULL, then the parser will reparent all the
3877 * loaded nodes, from root to @a parent_dir. The directory @a parent_dir
3878 * must be an existing directory in the repository.
3879 *
3880 * @since New in 1.10.
3881 */
3884 void **parse_baton,
3885 svn_repos_t *repos,
3886 svn_revnum_t start_rev,
3887 svn_revnum_t end_rev,
3888 svn_boolean_t use_history,
3889 svn_boolean_t validate_props,
3890 enum svn_repos_load_uuid uuid_action,
3891 const char *parent_dir,
3892 svn_boolean_t use_pre_commit_hook,
3893 svn_boolean_t use_post_commit_hook,
3894 svn_boolean_t ignore_dates,
3895 svn_boolean_t normalize_props,
3896 svn_repos_notify_func_t notify_func,
3897 void *notify_baton,
3898 apr_pool_t *pool);
3899
3900/**
3901 * Similar to svn_repos_get_fs_build_parser6(), but with the
3902 * @a normalize_props parameter always set to @c FALSE.
3903 *
3904 * @since New in 1.9.
3905 * @deprecated Provided for backward compatibility with the 1.9 API.
3906 */
3910 void **parse_baton,
3911 svn_repos_t *repos,
3912 svn_revnum_t start_rev,
3913 svn_revnum_t end_rev,
3914 svn_boolean_t use_history,
3915 svn_boolean_t validate_props,
3916 enum svn_repos_load_uuid uuid_action,
3917 const char *parent_dir,
3918 svn_boolean_t use_pre_commit_hook,
3919 svn_boolean_t use_post_commit_hook,
3920 svn_boolean_t ignore_dates,
3921 svn_repos_notify_func_t notify_func,
3922 void *notify_baton,
3923 apr_pool_t *pool);
3924
3925/**
3926 * Similar to svn_repos_get_fs_build_parser5(), but with the
3927 * @c use_pre_commit_hook, @c use_post_commit_hook and @c ignore_dates
3928 * arguments all false.
3929 *
3930 * @since New in 1.8.
3931 * @deprecated Provided for backward compatibility with the 1.8 API.
3932 */
3936 void **parse_baton,
3937 svn_repos_t *repos,
3938 svn_revnum_t start_rev,
3939 svn_revnum_t end_rev,
3940 svn_boolean_t use_history,
3941 svn_boolean_t validate_props,
3942 enum svn_repos_load_uuid uuid_action,
3943 const char *parent_dir,
3944 svn_repos_notify_func_t notify_func,
3945 void *notify_baton,
3946 apr_pool_t *pool);
3947
3948
3949
3950/**
3951 * A vtable that is driven by svn_repos_parse_dumpstream2().
3952 * Similar to #svn_repos_parse_fns3_t except that it lacks
3953 * the magic_header_record callback.
3954 *
3955 * @deprecated Provided for backward compatibility with the 1.7 API.
3956 */
3958{
3959 /** Same as #svn_repos_parse_fns3_t.new_revision_record. */
3960 svn_error_t *(*new_revision_record)(void **revision_baton,
3961 apr_hash_t *headers,
3962 void *parse_baton,
3963 apr_pool_t *pool);
3964 /** Same as #svn_repos_parse_fns3_t.uuid_record. */
3965 svn_error_t *(*uuid_record)(const char *uuid,
3966 void *parse_baton,
3967 apr_pool_t *pool);
3968 /** Same as #svn_repos_parse_fns3_t.new_node_record. */
3969 svn_error_t *(*new_node_record)(void **node_baton,
3970 apr_hash_t *headers,
3971 void *revision_baton,
3972 apr_pool_t *pool);
3973 /** Same as #svn_repos_parse_fns3_t.set_revision_property. */
3974 svn_error_t *(*set_revision_property)(void *revision_baton,
3975 const char *name,
3976 const svn_string_t *value);
3977 /** Same as #svn_repos_parse_fns3_t.set_node_property. */
3978 svn_error_t *(*set_node_property)(void *node_baton,
3979 const char *name,
3980 const svn_string_t *value);
3981 /** Same as #svn_repos_parse_fns3_t.delete_node_property. */
3982 svn_error_t *(*delete_node_property)(void *node_baton,
3983 const char *name);
3984 /** Same as #svn_repos_parse_fns3_t.remove_node_props. */
3985 svn_error_t *(*remove_node_props)(void *node_baton);
3986 /** Same as #svn_repos_parse_fns3_t.set_fulltext. */
3987 svn_error_t *(*set_fulltext)(svn_stream_t **stream,
3988 void *node_baton);
3989 /** Same as #svn_repos_parse_fns3_t.apply_textdelta. */
3990 svn_error_t *(*apply_textdelta)(svn_txdelta_window_handler_t *handler,
3991 void **handler_baton,
3992 void *node_baton);
3993 /** Same as #svn_repos_parse_fns3_t.close_node. */
3994 svn_error_t *(*close_node)(void *node_baton);
3995 /** Same as #svn_repos_parse_fns3_t.close_revision. */
3996 svn_error_t *(*close_revision)(void *revision_baton);
3998
3999/** @deprecated Provided for backward compatibility with the 1.7 API. */
4001
4002
4003/**
4004 * A vtable that is driven by svn_repos_parse_dumpstream().
4005 * Similar to #svn_repos_parse_fns2_t except that it lacks
4006 * the delete_node_property and apply_textdelta callbacks.
4007 *
4008 * @deprecated Provided for backward compatibility with the 1.0 API.
4009 */
4011{
4012 /** Same as #svn_repos_parse_fns2_t.new_revision_record. */
4013 svn_error_t *(*new_revision_record)(void **revision_baton,
4014 apr_hash_t *headers,
4015 void *parse_baton,
4016 apr_pool_t *pool);
4017 /** Same as #svn_repos_parse_fns2_t.uuid_record. */
4018 svn_error_t *(*uuid_record)(const char *uuid,
4019 void *parse_baton,
4020 apr_pool_t *pool);
4021 /** Same as #svn_repos_parse_fns2_t.new_node_record. */
4022 svn_error_t *(*new_node_record)(void **node_baton,
4023 apr_hash_t *headers,
4024 void *revision_baton,
4025 apr_pool_t *pool);
4026 /** Same as #svn_repos_parse_fns2_t.set_revision_property. */
4027 svn_error_t *(*set_revision_property)(void *revision_baton,
4028 const char *name,
4029 const svn_string_t *value);
4030 /** Same as #svn_repos_parse_fns2_t.set_node_property. */
4031 svn_error_t *(*set_node_property)(void *node_baton,
4032 const char *name,
4033 const svn_string_t *value);
4034 /** Same as #svn_repos_parse_fns2_t.remove_node_props. */
4035 svn_error_t *(*remove_node_props)(void *node_baton);
4036 /** Same as #svn_repos_parse_fns2_t.set_fulltext. */
4037 svn_error_t *(*set_fulltext)(svn_stream_t **stream,
4038 void *node_baton);
4039 /** Same as #svn_repos_parse_fns2_t.close_node. */
4040 svn_error_t *(*close_node)(void *node_baton);
4041 /** Same as #svn_repos_parse_fns2_t.close_revision. */
4042 svn_error_t *(*close_revision)(void *revision_baton);
4044
4045
4046/**
4047 * Similar to svn_repos_parse_dumpstream3(), but uses the more limited
4048 * #svn_repos_parser_fns2_t vtable type.
4049 *
4050 * @deprecated Provided for backward compatibility with the 1.7 API.
4051 */
4055 const svn_repos_parser_fns2_t *parse_fns,
4056 void *parse_baton,
4057 svn_cancel_func_t cancel_func,
4058 void *cancel_baton,
4059 apr_pool_t *pool);
4060
4061/**
4062 * Similar to svn_repos_parse_dumpstream2(), but uses the more limited
4063 * #svn_repos_parser_fns_t vtable type.
4064 *
4065 * @deprecated Provided for backward compatibility with the 1.0 API.
4066 */
4070 const svn_repos_parser_fns_t *parse_fns,
4071 void *parse_baton,
4072 svn_cancel_func_t cancel_func,
4073 void *cancel_baton,
4074 apr_pool_t *pool);
4075
4076/**
4077 * Similar to svn_repos_get_fs_build_parser4(), but with @a start_rev
4078 * and @a end_rev always passed as #SVN_INVALID_REVNUM, and yielding
4079 * the more limited svn_repos_parse_fns2_t.
4080 *
4081 * @since New in 1.7.
4082 * @deprecated Provided for backward compatibility with the 1.7 API.
4083 */
4087 void **parse_baton,
4088 svn_repos_t *repos,
4089 svn_boolean_t use_history,
4090 svn_boolean_t validate_props,
4091 enum svn_repos_load_uuid uuid_action,
4092 const char *parent_dir,
4093 svn_repos_notify_func_t notify_func,
4094 void *notify_baton,
4095 apr_pool_t *pool);
4096
4097/**
4098 * Similar to svn_repos_get_fs_build_parser3(), but with @a outstream
4099 * in place if a #svn_repos_notify_func_t and baton and with
4100 * @a validate_props always FALSE.
4101 *
4102 * @since New in 1.1.
4103 * @deprecated Provided for backward compatibility with the 1.6 API.
4104 */
4108 void **parse_baton,
4109 svn_repos_t *repos,
4110 svn_boolean_t use_history,
4111 enum svn_repos_load_uuid uuid_action,
4112 svn_stream_t *outstream,
4113 const char *parent_dir,
4114 apr_pool_t *pool);
4115
4116/**
4117 * Similar to svn_repos_get_fs_build_parser2(), but yields the more
4118 * limited svn_repos_parser_fns_t vtable type.
4119 *
4120 * @deprecated Provided for backward compatibility with the 1.0 API.
4121 */
4125 void **parse_baton,
4126 svn_repos_t *repos,
4127 svn_boolean_t use_history,
4128 enum svn_repos_load_uuid uuid_action,
4129 svn_stream_t *outstream,
4130 const char *parent_dir,
4131 apr_pool_t *pool);
4132
4133
4134/** @} */
4135
4136/** A data type which stores the authz information.
4137 *
4138 * @since New in 1.3.
4139 */
4141
4142/**
4143 * This should be called before any other authz function.
4144 *
4145 * @a pool must support multi-threaded access if the application will use
4146 * authz from multiple threads.
4147 *
4148 * @since New in 1.10.
4149 */
4152
4153/**
4154 * Callback for reporting authz file parsing warnings.
4155 *
4156 * The implementation may use @a scratch_pool for temporary
4157 * allocations but should not assume that the lifetime of that pool
4158 * persists past the callback invocation.
4159 *
4160 * The implementation @e must @e not clear @a error.
4161 */
4162typedef void (*svn_repos_authz_warning_func_t)(void *baton,
4163 const svn_error_t *error,
4164 apr_pool_t *scratch_pool);
4165
4166/**
4167 * Read authz configuration data from @a path (a dirent, an absolute file url
4168 * or a registry path) into @a *authz_p, allocated in @a pool.
4169 *
4170 * If @a groups_path (a dirent, an absolute file url, or a registry path) is
4171 * set, use the global groups parsed from it.
4172 *
4173 * If @a path or @a groups_path is not a valid authz rule file, then return
4174 * #SVN_ERR_AUTHZ_INVALID_CONFIG. The contents of @a *authz_p is then
4175 * undefined. If @a must_exist is TRUE, a missing authz or groups file
4176 * is also an error other than #SVN_ERR_AUTHZ_INVALID_CONFIG (exact error
4177 * depends on the access type).
4178 *
4179 * For efficient access of in-repository authz, you may provide @a repos_hint
4180 * which will be tried first and may remove the need to open a temporary
4181 * repository instance. Otherwise, set it to NULL and the repositories will
4182 * be opened as needed.
4183 *
4184 * If the @a warning_func callback is not @c NULL, it is called
4185 * (with @a warning_baton) to report non-fatal warnings emitted by
4186 * the parser.
4187 *
4188 * @since New in 1.12.
4189 */
4192 const char *path,
4193 const char *groups_path,
4194 svn_boolean_t must_exist,
4195 svn_repos_t *repos_hint,
4196 svn_repos_authz_warning_func_t warning_func,
4197 void *warning_baton,
4198 apr_pool_t *result_pool,
4199 apr_pool_t *scratch_pool);
4200
4201/**
4202 * Similar to svn_repos_authz_read3(), but with @a warning_func and
4203 * @a warning_baton set to @c NULL.
4204 *
4205 * @since New in 1.10.
4206 * @deprecated Provided for backward compatibility with the 1.11 API.
4207 */
4211 const char *path,
4212 const char *groups_path,
4213 svn_boolean_t must_exist,
4214 svn_repos_t *repos_hint,
4215 apr_pool_t *result_pool,
4216 apr_pool_t *scratch_pool);
4217
4218/**
4219 * Similar to svn_repos_authz_read3(), but with @a repos_hint set to @c NULL.
4220 *
4221 * @since New in 1.8.
4222 * @deprecated Provided for backward compatibility with the 1.9 API.
4223 */
4227 const char *path,
4228 const char *groups_path,
4229 svn_boolean_t must_exist,
4230 apr_pool_t *pool);
4231
4232
4233/**
4234 * Similar to svn_repos_authz_read2(), but with @a groups_path and @a
4235 * repos_root always passed as @c NULL.
4236 *
4237 * @since New in 1.3.
4238 * @deprecated Provided for backward compatibility with the 1.7 API.
4239 */
4243 const char *file,
4244 svn_boolean_t must_exist,
4245 apr_pool_t *pool);
4246
4247/**
4248 * Read authz configuration data from @a stream into @a *authz_p,
4249 * allocated in @a result_pool.
4250 *
4251 * If @a groups_stream is set, use the global groups parsed from it.
4252 *
4253 * If the @a warning_func callback is not @c NULL, it is called
4254 * (with @a warning_baton) to report non-fatal warnings emitted by
4255 * the parser.
4256 *
4257 * Uses @a scratch_pool for temporary aloocations.
4258 *
4259 * @since New in 1.12.
4260 */
4263 svn_stream_t *stream,
4264 svn_stream_t *groups_stream,
4265 svn_repos_authz_warning_func_t warning_func,
4266 void *warning_baton,
4267 apr_pool_t *result_pool,
4268 apr_pool_t *scratch_pool);
4269
4270/**
4271 * Similar to svn_repos_authz_parse2(), but with @a warning_func and
4272 * @a warning_baton set to @c NULL.
4273 *
4274 * @since New in 1.8.
4275 * @deprecated Provided for backward compatibility with the 1.11 API.
4276 */
4280 svn_stream_t *stream,
4281 svn_stream_t *groups_stream,
4282 apr_pool_t *pool);
4283
4284/**
4285 * Check whether @a user can access @a path in the repository @a
4286 * repos_name with the @a required_access. @a authz lists the ACLs to
4287 * check against. Set @a *access_granted to indicate if the requested
4288 * access is granted.
4289 *
4290 * If @a path is NULL, then check whether @a user has the @a
4291 * required_access anywhere in the repository. Set @a *access_granted
4292 * to TRUE if at least one path is accessible with the @a
4293 * required_access.
4294 *
4295 * For compatibility with 1.6, and earlier, @a repos_name can be NULL
4296 * in which case it is equivalent to a @a repos_name of "".
4297 *
4298 * @note Presently, @a repos_name must byte-for-byte match the repos_name
4299 * specified in the authz file; it is treated as an opaque string, and not
4300 * as a dirent.
4301 *
4302 * @since New in 1.3.
4303 */
4306 const char *repos_name,
4307 const char *path,
4308 const char *user,
4309 svn_repos_authz_access_t required_access,
4310 svn_boolean_t *access_granted,
4311 apr_pool_t *pool);
4312
4313
4314␌
4315/** Revision Access Levels
4316 *
4317 * Like most version control systems, access to versioned objects in
4318 * Subversion is determined on primarily path-based system. Users either
4319 * do or don't have the ability to read a given path.
4320 *
4321 * However, unlike many version control systems where versioned objects
4322 * maintain their own distinct version information (revision numbers,
4323 * authors, log messages, change timestamps, etc.), Subversion binds
4324 * multiple paths changed as part of a single commit operation into a
4325 * set, calls the whole thing a revision, and hangs commit metadata
4326 * (author, date, log message, etc.) off of that revision. So, commit
4327 * metadata is shared across all the paths changed as part of a given
4328 * commit operation.
4329 *
4330 * It is common (or, at least, we hope it is) for log messages to give
4331 * detailed information about changes made in the commit to which the log
4332 * message is attached. Such information might include a mention of all
4333 * the files changed, what was changed in them, and so on. But this
4334 * causes a problem when presenting information to readers who aren't
4335 * authorized to read every path in the repository. Simply knowing that
4336 * a given path exists may be a security leak, even if the user can't see
4337 * the contents of the data located at that path.
4338 *
4339 * So Subversion does what it reasonably can to prevent the leak of this
4340 * information, and does so via a staged revision access policy. A
4341 * reader can be said to have one of three levels of access to a given
4342 * revision's metadata, based solely on the reader's access rights to the
4343 * paths changed or copied in that revision:
4344 *
4345 * 'full access' -- Granted when the reader has access to all paths
4346 * changed or copied in the revision, or when no paths were
4347 * changed in the revision at all, this access level permits
4348 * full visibility of all revision property names and values,
4349 * and the full changed-paths information.
4350 *
4351 * 'no access' -- Granted when the reader does not have access to any
4352 * paths changed or copied in the revision, this access level
4353 * denies the reader access to all revision properties and all
4354 * changed-paths information.
4355 *
4356 * 'partial access' -- Granted when the reader has access to at least
4357 * one, but not all, of the paths changed or copied in the revision,
4358 * this access level permits visibility of the svn:date and
4359 * svn:author revision properties and only the paths of the
4360 * changed-paths information to which the reader has access.
4361 *
4362 */
4363
4364
4365/** An enum defining levels of revision access.
4366 *
4367 * @since New in 1.5.
4368 */
4370{
4371 /** no access allowed to the revision properties and all changed-paths
4372 * information. */
4374 /** access granted to some (svn:date and svn:author) revision properties and
4375 * changed-paths information on paths the read has access to. */
4377 /** access granted to all revision properites and changed-paths
4378 * information. */
4380}
4382
4383
4384/**
4385 * Set @a access to the access level granted for @a revision in @a
4386 * repos, as determined by consulting the @a authz_read_func callback
4387 * function and its associated @a authz_read_baton.
4388 *
4389 * @a authz_read_func may be @c NULL, in which case @a access will be
4390 * set to #svn_repos_revision_access_full.
4391 *
4392 * @since New in 1.5.
4393 */
4396 svn_repos_t *repos,
4398 svn_repos_authz_func_t authz_read_func,
4399 void *authz_read_baton,
4400 apr_pool_t *pool);
4401
4402
4403#ifdef __cplusplus
4404}
4405#endif /* __cplusplus */
4406
4407#endif /* SVN_REPOS_H */
svn_error_t *(* svn_file_rev_handler_t)(void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_boolean_t result_of_merge, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool)
The callback invoked by file rev loopers, such as svn_ra_plugin_t.get_file_revs2() and svn_repos_get_...
Definition svn_delta.h:1538
struct svn_fs_t svn_fs_t
An object representing a Subversion filesystem.
Definition svn_fs.h:66
svn_error_t *(* svn_fs_mergeinfo_receiver_t)(const char *path, svn_mergeinfo_t mergeinfo, void *baton, apr_pool_t *scratch_pool)
Receives parsed mergeinfo for the file system path path.
Definition svn_fs.h:2173
svn_error_t *(* svn_fs_pack_notify_t)(void *baton, apr_int64_t shard, svn_fs_pack_notify_action_t action, apr_pool_t *pool)
The type of a pack notification function.
Definition svn_fs.h:3298
svn_error_t *(* svn_location_segment_receiver_t)(svn_location_segment_t *segment, void *baton, apr_pool_t *pool)
A callback invoked by generators of svn_location_segment_t objects, used to report information about ...
Definition svn_types.h:1219
svn_error_t *(* svn_txdelta_window_handler_t)(svn_txdelta_window_t *window, void *baton)
A typedef for functions that consume a series of delta windows, for use in caller-pushes interfaces.
Definition svn_delta.h:265
svn_error_t *(* svn_fs_lock_callback_t)(void *baton, const char *path, const svn_lock_t *lock, svn_error_t *fs_err, apr_pool_t *scratch_pool)
The callback invoked by svn_fs_lock_many() and svn_fs_unlock_many().
Definition svn_fs.h:3024
struct svn_fs_root_t svn_fs_root_t
The Filesystem Root object.
Definition svn_fs.h:1380
struct svn_fs_txn_t svn_fs_txn_t
The type of a Subversion transaction object.
Definition svn_fs.h:1111
struct svn_stream_t svn_stream_t
An abstract stream of bytes–either incoming or outgoing or both.
Definition svn_io.h:863
svn_repos_authz_access_t
An enum defining the kinds of access authz looks up.
Definition svn_repos.h:105
svn_error_t *(* svn_repos_authz_func_t)(svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool)
Callback type for checking authorization on a path.
Definition svn_repos.h:93
svn_error_t *(* svn_repos_authz_callback_t)(svn_repos_authz_access_t required, svn_boolean_t *allowed, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *pool)
Callback type for checking authorization on paths produced by the repository commit editor.
Definition svn_repos.h:155
@ svn_authz_write
Path can be altered.
Definition svn_repos.h:113
@ svn_authz_recursive
The other access credentials are recursive.
Definition svn_repos.h:116
@ svn_authz_read
Path can be read.
Definition svn_repos.h:110
@ svn_authz_none
No access.
Definition svn_repos.h:107
svn_error_t * svn_repos_has_capability(svn_repos_t *repos, svn_boolean_t *has, const char *capability, apr_pool_t *pool)
Set *has to TRUE if repos has capability (one of the capabilities beginning with "SVN_REPOS_CAPABILIT...
svn_error_t * svn_repos_capabilities(apr_hash_t **capabilities, svn_repos_t *repos, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Return a set of capabilities supported by the running Subversion library and by repos.
svn_error_t * svn_repos_verify_fs(svn_repos_t *repos, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_verify_fs2(), but with a feedback_stream instead of handling feedback via the no...
svn_error_t * svn_repos_load_fs2(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_load_fs3(), but with feedback_stream in place of the svn_repos_notify_func_t and...
svn_error_t * svn_repos_parse_dumpstream2(svn_stream_t *stream, const svn_repos_parser_fns2_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_parse_dumpstream3(), but uses the more limited svn_repos_parser_fns2_t vtable ty...
svn_error_t * svn_repos_load_fs6(svn_repos_t *repos, svn_stream_t *dumpstream, svn_revnum_t start_rev, svn_revnum_t end_rev, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_boolean_t validate_props, svn_boolean_t ignore_dates, svn_boolean_t normalize_props, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Read and parse dumpfile-formatted dumpstream, reconstructing filesystem revisions in already-open rep...
svn_error_t * svn_repos_load_fs(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_load_fs2(), but with use_pre_commit_hook and use_post_commit_hook always FALSE.
svn_repos_load_uuid
The different policies for processing the UUID in the dumpfile.
Definition svn_repos.h:3132
svn_error_t * svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **parser, void **parse_baton, svn_repos_t *repos, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t use_history, svn_boolean_t validate_props, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_repos_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool)
Similar to svn_repos_get_fs_build_parser5(), but with the use_pre_commit_hook, use_post_commit_hook a...
svn_error_t * svn_repos_verify_fs3(svn_repos_t *repos, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t check_normalization, svn_boolean_t metadata_only, svn_repos_notify_func_t notify_func, void *notify_baton, svn_repos_verify_callback_t verify_callback, void *verify_baton, svn_cancel_func_t cancel, void *cancel_baton, apr_pool_t *scratch_pool)
Verify the contents of the file system in repos.
svn_error_t * svn_repos_load_fs_revprops(svn_repos_t *repos, svn_stream_t *dumpstream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t validate_props, svn_boolean_t ignore_dates, svn_boolean_t normalize_props, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *scratch_pool)
Read and parse dumpfile-formatted dumpstream, extracting the revision properties from it and apply th...
svn_error_t * svn_repos_load_fs5(svn_repos_t *repos, svn_stream_t *dumpstream, svn_revnum_t start_rev, svn_revnum_t end_rev, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_boolean_t validate_props, svn_boolean_t ignore_dates, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_load_fs6(), but with the normalize_props parameter always set to FALSE.
svn_error_t * svn_repos_dump_fs(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_dump_fs2(), but with the use_deltas parameter always set to FALSE.
svn_error_t *(* svn_repos_verify_callback_t)(void *baton, svn_revnum_t revision, svn_error_t *verify_err, apr_pool_t *scratch_pool)
Callback type for use with svn_repos_verify_fs3().
Definition svn_repos.h:3158
svn_error_t * svn_repos_get_fs_build_parser2(const svn_repos_parse_fns2_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool)
Similar to svn_repos_get_fs_build_parser3(), but with outstream in place if a svn_repos_notify_func_t...
svn_error_t * svn_repos_verify_fs2(svn_repos_t *repos, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel, void *cancel_baton, apr_pool_t *scratch_pool)
Like svn_repos_verify_fs3(), but with verify_callback and verify_baton set to NULL and with check_nor...
svn_error_t * svn_repos_parse_dumpstream(svn_stream_t *stream, const svn_repos_parser_fns_t *parse_fns, void *parse_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_parse_dumpstream2(), but uses the more limited svn_repos_parser_fns_t vtable typ...
svn_error_t * svn_repos_load_fs4(svn_repos_t *repos, svn_stream_t *dumpstream, svn_revnum_t start_rev, svn_revnum_t end_rev, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_boolean_t validate_props, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_load_fs5(), but with ignore_dates always passed as FALSE.
svn_error_t * svn_repos_dump_fs4(svn_repos_t *repos, svn_stream_t *stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_boolean_t use_deltas, svn_boolean_t include_revprops, svn_boolean_t include_changes, svn_repos_notify_func_t notify_func, void *notify_baton, svn_repos_dump_filter_func_t filter_func, void *filter_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Dump the contents of the filesystem within already-open repos into writable dumpstream.
svn_error_t * svn_repos_dump_fs3(svn_repos_t *repos, svn_stream_t *dumpstream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_boolean_t use_deltas, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *scratch_pool)
Similar to svn_repos_dump_fs4(), but with include_revprops and include_changes both set to TRUE and f...
svn_error_t * svn_repos_get_fs_build_parser3(const svn_repos_parse_fns2_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, svn_boolean_t validate_props, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_repos_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool)
Similar to svn_repos_get_fs_build_parser4(), but with start_rev and end_rev always passed as SVN_INVA...
svn_error_t * svn_repos_load_fs3(svn_repos_t *repos, svn_stream_t *dumpstream, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_boolean_t validate_props, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_load_fs4(), but with start_rev and end_rev always passed as SVN_INVALID_REVNUM.
svn_error_t * svn_repos_get_fs_build_parser6(const svn_repos_parse_fns3_t **parser, void **parse_baton, svn_repos_t *repos, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t use_history, svn_boolean_t validate_props, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_boolean_t ignore_dates, svn_boolean_t normalize_props, svn_repos_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool)
Set *parser and *parse_baton to a vtable parser which commits new revisions to the fs in repos.
svn_repos_parse_fns2_t svn_repos_parser_fns2_t
Definition svn_repos.h:4000
svn_error_t * svn_repos_get_fs_build_parser(const svn_repos_parser_fns_t **parser, void **parse_baton, svn_repos_t *repos, svn_boolean_t use_history, enum svn_repos_load_uuid uuid_action, svn_stream_t *outstream, const char *parent_dir, apr_pool_t *pool)
Similar to svn_repos_get_fs_build_parser2(), but yields the more limited svn_repos_parser_fns_t vtabl...
svn_error_t * svn_repos_parse_dumpstream3(svn_stream_t *stream, const svn_repos_parse_fns3_t *parse_fns, void *parse_baton, svn_boolean_t deltas_are_text, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Read and parse dumpfile-formatted stream, calling callbacks in parse_fns/parse_baton,...
svn_error_t * svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **parser, void **parse_baton, svn_repos_t *repos, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t use_history, svn_boolean_t validate_props, enum svn_repos_load_uuid uuid_action, const char *parent_dir, svn_boolean_t use_pre_commit_hook, svn_boolean_t use_post_commit_hook, svn_boolean_t ignore_dates, svn_repos_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool)
Similar to svn_repos_get_fs_build_parser6(), but with the normalize_props parameter always set to FAL...
svn_error_t * svn_repos_dump_fs2(svn_repos_t *repos, svn_stream_t *dumpstream, svn_stream_t *feedback_stream, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_boolean_t incremental, svn_boolean_t use_deltas, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_dump_fs3(), but with a feedback_stream instead of handling feedback via the noti...
struct svn_repos_parse_fns_t svn_repos_parser_fns_t
A vtable that is driven by svn_repos_parse_dumpstream().
@ svn_repos_load_uuid_ignore
never update uuid.
Definition svn_repos.h:3136
@ svn_repos_load_uuid_force
always update uuid.
Definition svn_repos.h:3138
@ svn_repos_load_uuid_default
only update uuid if the repos has no revisions.
Definition svn_repos.h:3134
svn_error_t * svn_repos_fs_lock(svn_lock_t **lock, svn_repos_t *repos, const char *path, const char *token, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_revnum_t current_rev, svn_boolean_t steal_lock, apr_pool_t *pool)
Similar to svn_repos_fs_lock_many() but locks only a single path.
svn_error_t * svn_repos_fs_unlock(svn_repos_t *repos, const char *path, const char *token, svn_boolean_t break_lock, apr_pool_t *pool)
Similar to svn_repos_fs_unlock_many() but only unlocks a single path.
svn_error_t * svn_repos_fs_lock_many(svn_repos_t *repos, apr_hash_t *lock_targets, const char *comment, svn_boolean_t is_dav_comment, apr_time_t expiration_date, svn_boolean_t steal_lock, svn_fs_lock_callback_t lock_callback, void *lock_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Like svn_fs_lock_many(), but invoke the repos's pre- and post-lock hooks before and after the locking...
svn_error_t * svn_repos_fs_unlock_many(svn_repos_t *repos, apr_hash_t *unlock_targets, svn_boolean_t break_lock, svn_fs_lock_callback_t lock_callback, void *lock_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Like svn_fs_unlock_many(), but invoke the repos's pre- and post-unlock hooks before and after the unl...
svn_error_t * svn_repos_fs_get_locks2(apr_hash_t **locks, svn_repos_t *repos, const char *path, svn_depth_t depth, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Look up all the locks in and under path in repos, setting *locks to a hash which maps const char * pa...
svn_error_t * svn_repos_fs_get_locks(apr_hash_t **locks, svn_repos_t *repos, const char *path, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Similar to svn_repos_fs_get_locks2(), but with depth always passed as svn_depth_infinity.
svn_error_t * svn_repos_fs_begin_txn_for_commit2(svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, apr_hash_t *revprop_table, apr_pool_t *pool)
Like svn_fs_begin_txn(), but use revprop_table, a hash mapping const char * property names to svn_str...
svn_error_t * svn_repos_fs_begin_txn_for_update(svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, apr_pool_t *pool)
Like svn_fs_begin_txn(), but use author to set the corresponding property on transaction *txn_p.
svn_error_t * svn_repos_fs_begin_txn_for_commit(svn_fs_txn_t **txn_p, svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *log_msg, apr_pool_t *pool)
Same as svn_repos_fs_begin_txn_for_commit2(), but with revprop_table set to a hash containing author ...
svn_error_t * svn_repos_fs_commit_txn(const char **conflict_p, svn_repos_t *repos, svn_revnum_t *new_rev, svn_fs_txn_t *txn, apr_pool_t *pool)
Like svn_fs_commit_txn(), but invoke the repos' pre- and post-commit hooks around the commit.
svn_repos_node_t * svn_repos_node_from_baton(void *edit_baton)
Return the root node of the linked-list tree generated by driving the editor (associated with edit_ba...
svn_error_t * svn_repos_info_format(int *repos_format, svn_version_t **supports_version, svn_repos_t *repos, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Return repository format information for repos.
svn_error_t * svn_repos_node_editor(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_root_t *base_root, svn_fs_root_t *root, apr_pool_t *node_pool, apr_pool_t *pool)
Set *editor and *edit_baton to an editor that, when driven by a driver such as svn_repos_replay2(),...
const char * svn_repos_pre_unlock_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's pre-unlock hook, allocated in pool.
const char * svn_repos_post_unlock_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's post-unlock hook, allocated in pool.
const char * svn_repos_post_lock_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's post-lock hook, allocated in pool.
svn_error_t * svn_repos_hooks_setenv(svn_repos_t *repos, const char *hooks_env_path, apr_pool_t *scratch_pool)
Specify that Subversion should consult the configuration file located at hooks_env_path to determine ...
const char * svn_repos_pre_lock_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's pre-lock hook, allocated in pool.
void(* svn_repos_notify_func_t)(void *baton, const svn_repos_notify_t *notify, apr_pool_t *scratch_pool)
Callback for providing notification from the repository.
Definition svn_repos.h:374
svn_repos_notify_action_t
The type of action occurring.
Definition svn_repos.h:176
svn_repos_notify_t * svn_repos_notify_create(svn_repos_notify_action_t action, apr_pool_t *result_pool)
Allocate an svn_repos_notify_t structure in result_pool, initialize and return it.
svn_repos_notify_warning_t
The type of warning occurring.
Definition svn_repos.h:261
svn_error_t *(* svn_repos_dump_filter_func_t)(svn_boolean_t *include, svn_fs_root_t *root, const char *path, void *baton, apr_pool_t *scratch_pool)
Callback for filtering repository contents during dump.
Definition svn_repos.h:389
@ svn_repos_notify_load_txn_committed
A revision has finished loading.
Definition svn_repos.h:208
@ svn_repos_notify_load_copied_node
A copied node has been encountered.
Definition svn_repos.h:217
@ svn_repos_notify_warning
A warning message is waiting.
Definition svn_repos.h:178
@ svn_repos_notify_verify_rev_end
A revision has finished being verified.
Definition svn_repos.h:184
@ svn_repos_notify_mutex_acquired
The operation has acquired a mutex for the repo.
Definition svn_repos.h:223
@ svn_repos_notify_load_revprop_set
The revision properties got set.
Definition svn_repos.h:253
@ svn_repos_notify_pack_shard_end_revprop
packing of the shard revprops has completed
Definition svn_repos.h:202
@ svn_repos_notify_cleanup_revprops
A non-packed revprop shard got removed.
Definition svn_repos.h:241
@ svn_repos_notify_verify_rev_structure
The structure of a revision is being verified.
Definition svn_repos.h:235
@ svn_repos_notify_format_bumped
The repository format got bumped.
Definition svn_repos.h:244
@ svn_repos_notify_load_skipped_rev
A revision was skipped during loading.
Definition svn_repos.h:232
@ svn_repos_notify_load_normalized_mergeinfo
Mergeinfo has been normalized.
Definition svn_repos.h:220
@ svn_repos_notify_pack_noop
The repository pack did not do anything.
Definition svn_repos.h:250
@ svn_repos_notify_pack_shard_start
packing of an FSFS shard has commenced
Definition svn_repos.h:193
@ svn_repos_notify_recover_start
Recover has started.
Definition svn_repos.h:226
@ svn_repos_notify_dump_end
All revisions have finished being dumped.
Definition svn_repos.h:187
@ svn_repos_notify_load_node_start
A node has begun loading.
Definition svn_repos.h:211
@ svn_repos_notify_load_txn_start
A revision has begun loading.
Definition svn_repos.h:205
@ svn_repos_notify_pack_shard_start_revprop
packing of the shard revprops has commenced
Definition svn_repos.h:199
@ svn_repos_notify_verify_end
All revisions have finished being verified.
Definition svn_repos.h:190
@ svn_repos_notify_dump_rev_end
A revision has finished being dumped.
Definition svn_repos.h:181
@ svn_repos_notify_pack_revprops
A revprop shard got packed.
Definition svn_repos.h:238
@ svn_repos_notify_hotcopy_rev_range
A revision range was copied.
Definition svn_repos.h:247
@ svn_repos_notify_upgrade_start
Upgrade has started.
Definition svn_repos.h:229
@ svn_repos_notify_pack_shard_end
packing of an FSFS shard is completed
Definition svn_repos.h:196
@ svn_repos_notify_load_node_done
A node has finished loading.
Definition svn_repos.h:214
@ svn_repos_notify_warning_found_old_mergeinfo
An SVN_PROP_MERGEINFO property's encoded mergeinfo references a revision earlier than the first revis...
Definition svn_repos.h:268
@ svn_repos_notify_warning_found_old_reference
Referencing copy source data from a revision earlier than the first revision dumped.
Definition svn_repos.h:264
@ svn_repos_notify_warning_invalid_mergeinfo
Detected invalid mergeinfo.
Definition svn_repos.h:300
@ svn_repos_notify_warning_mergeinfo_collision
Detected a mergeinfo path collision.
Definition svn_repos.h:293
@ svn_repos_notify_warning_name_collision
Detected a name collision.
Definition svn_repos.h:283
@ svn_repos_notify_warning_invalid_fspath
Found an invalid path in the filesystem.
Definition svn_repos.h:274
svn_error_t * svn_repos_fs_change_rev_prop(svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, apr_pool_t *pool)
Similar to svn_repos_fs_change_rev_prop2(), but with the authz_read_func parameter always NULL.
svn_error_t * svn_repos_fs_change_rev_prop4(svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *const *old_value_p, const svn_string_t *new_value, svn_boolean_t use_pre_revprop_change_hook, svn_boolean_t use_post_revprop_change_hook, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Like svn_fs_change_rev_prop2(), but validate the name and value of the property and invoke the repos'...
svn_error_t * svn_repos_fs_change_txn_prop(svn_fs_txn_t *txn, const char *name, const svn_string_t *value, apr_pool_t *pool)
Validating wrapper for svn_fs_change_txn_prop() (which see for argument descriptions).
svn_error_t * svn_repos_fs_change_rev_prop3(svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_boolean_t use_pre_revprop_change_hook, svn_boolean_t use_post_revprop_change_hook, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Similar to svn_repos_fs_change_rev_prop4(), but with old_value_p always set to NULL.
svn_error_t * svn_repos_fs_change_rev_prop2(svn_repos_t *repos, svn_revnum_t rev, const char *author, const char *name, const svn_string_t *new_value, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Similar to svn_repos_fs_change_rev_prop3(), but with the use_pre_revprop_change_hook and use_post_rev...
svn_error_t * svn_repos_fs_change_node_prop(svn_fs_root_t *root, const char *path, const char *name, const svn_string_t *value, apr_pool_t *pool)
Validating wrapper for svn_fs_change_node_prop() (which see for argument descriptions).
svn_error_t * svn_repos_fs_revision_proplist(apr_hash_t **table_p, svn_repos_t *repos, svn_revnum_t rev, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Set *table_p to the entire property list of revision rev in filesystem opened in repos,...
svn_error_t * svn_repos_fs_revision_prop(svn_string_t **value_p, svn_repos_t *repos, svn_revnum_t rev, const char *propname, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Set *value_p to the value of the property named propname on revision rev in the filesystem opened in ...
svn_error_t * svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props, svn_fs_root_t *root, const char *path, const char *propname, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Set *inherited_values to a depth-first ordered array of svn_prop_inherited_item_t * structures (the p...
svn_error_t * svn_repos_fs_change_txn_props(svn_fs_txn_t *txn, const apr_array_header_t *props, apr_pool_t *pool)
Validating wrapper for svn_fs_change_txn_props() (which see for argument descriptions).
const svn_lock_t * lock
Points to the lock structure received from the repository when action is svn_wc_notify_locked.
Definition svn_wc.h:1431
apr_hash_t * rev_props
If action is svn_wc_notify_blame_revision, contains a list of revision properties for the specified r...
Definition svn_wc.h:1485
svn_wc_notify_action_t action
Action that describes what happened to svn_wc_notify_t.path.
Definition svn_wc.h:1419
svn_revnum_t revision
When action is svn_wc_notify_update_completed, target revision of the update, or SVN_INVALID_REVNUM i...
Definition svn_wc.h:1455
const char * path
Structure used in the svn_wc_notify_func2_t function.
Definition svn_wc.h:1416
A general subversion directory entry.
Definition svn_types.h:560
Subversion error object.
Definition svn_types.h:177
Change descriptor.
Definition svn_fs.h:1512
A lock object, for client & server to share.
Definition svn_types.h:1105
A structure to represent all the information about a particular log entry.
Definition svn_repos.h:2029
svn_boolean_t has_children
Whether or not this message has children.
Definition svn_repos.h:2054
svn_revnum_t revision
The revision of the commit.
Definition svn_repos.h:2031
svn_boolean_t non_inheritable
Whether revision should be interpreted as non-inheritable in the same sense of svn_merge_range_t.
Definition svn_repos.h:2062
svn_boolean_t subtractive_merge
Whether revision is a merged revision resulting from a reverse merge.
Definition svn_repos.h:2067
apr_hash_t * revprops
The hash of requested revision properties, which may be NULL if it would contain no revprops.
Definition svn_repos.h:2036
A node in the repository.
Definition svn_repos.h:2971
struct svn_repos_node_t * sibling
Pointer to the next sibling of this node.
Definition svn_repos.h:2994
svn_boolean_t prop_mod
Where there any property mods?
Definition svn_repos.h:2982
const char * name
The name of this node as it appears in its parent's entries list.
Definition svn_repos.h:2985
svn_node_kind_t kind
Node type (file, dir, etc.).
Definition svn_repos.h:2973
const char * copyfrom_path
The filesystem path where this was copied from (if any).
Definition svn_repos.h:2991
char action
How this node entered the node tree: 'A'dd, 'D'elete, 'R'eplace.
Definition svn_repos.h:2976
struct svn_repos_node_t * parent
Pointer to the parent of this node.
Definition svn_repos.h:3000
svn_revnum_t copyfrom_rev
The filesystem revision where this was copied from (if any).
Definition svn_repos.h:2988
struct svn_repos_node_t * child
Pointer to the first child of this node.
Definition svn_repos.h:2997
svn_boolean_t text_mod
Were there any textual mods?
Definition svn_repos.h:2979
Structure used by svn_repos_notify_func_t.
Definition svn_repos.h:316
svn_revnum_t old_revision
For svn_repos_notify_load_txn_committed, the source revision, if different from new_revision,...
Definition svn_repos.h:345
svn_revnum_t end_revision
For svn_repos_notify_hotcopy_rev_range, the end of the copied revision range (might be the same as st...
Definition svn_repos.h:362
apr_int64_t shard
For svn_repos_notify_pack_shard_start, svn_repos_notify_pack_shard_end, svn_repos_notify_pack_revprop...
Definition svn_repos.h:336
svn_revnum_t new_revision
For svn_repos_notify_load_txn_committed, the revision committed.
Definition svn_repos.h:339
svn_repos_notify_action_t action
Action that describes what happened in the repository.
Definition svn_repos.h:318
enum svn_node_action node_action
For svn_repos_notify_load_node_start, the action being taken on the node.
Definition svn_repos.h:349
const char * path
For svn_repos_notify_load_node_start, the path of the node.
Definition svn_repos.h:352
svn_revnum_t revision
For svn_repos_notify_dump_rev_end and svn_repos_notify_verify_rev_end, the revision which just comple...
Definition svn_repos.h:323
const char * warning_str
For svn_repos_notify_warning, the warning message.
Definition svn_repos.h:326
svn_repos_notify_warning_t warning
For svn_repos_notify_warning, the warning type.
Definition svn_repos.h:328
svn_revnum_t start_revision
For svn_repos_notify_hotcopy_rev_range, the start of the copied revision range.
Definition svn_repos.h:357
A vtable that is driven by svn_repos_parse_dumpstream2().
Definition svn_repos.h:3958
A vtable that is driven by svn_repos_parse_dumpstream3().
Definition svn_repos.h:3676
A vtable that is driven by svn_repos_parse_dumpstream().
Definition svn_repos.h:4011
A simple counted string.
Definition svn_string.h:97
Version information.
Delta-parsing.
Interface to the Subversion filesystem.
General file I/O for Subversion.
mergeinfo handling and processing
apr_hash_t * svn_mergeinfo_catalog_t
A hash mapping paths (const char *) to svn_mergeinfo_t.
svn_mergeinfo_inheritance_t
The three ways to request mergeinfo affecting a given path.
svn_error_t * svn_repos_recover2(const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, apr_pool_t *pool)
Similar to svn_repos_recover3(), but without cancellation support.
svn_error_t * svn_repos_begin_report2(void **report_baton, svn_revnum_t revnum, svn_repos_t *repos, const char *fs_base, const char *target, const char *tgt_path, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t send_copyfrom_args, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
The same as svn_repos_begin_report3(), but with zero_copy_limit always passed as 0.
svn_error_t * svn_repos_open2(svn_repos_t **repos_p, const char *path, apr_hash_t *fs_config, apr_pool_t *pool)
Similar to svn_repos_open3() but without scratch_pool.
svn_node_action
The different "actions" attached to nodes in the dumpfile.
Definition svn_repos.h:62
svn_error_t * svn_repos_fs_pack(svn_repos_t *repos, svn_fs_pack_notify_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_fs_pack2(), but with a svn_fs_pack_notify_t instead of a svn_repos_notify_t.
svn_error_t * svn_repos_get_commit_editor2(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool)
Similar to svn_repos_get_commit_editor3(), but with authz_callback and authz_baton set to NULL.
svn_error_t * svn_repos_recover4(const char *path, svn_boolean_t nonblocking, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Run database recovery procedures on the repository at path, returning the database to a consistent st...
svn_error_t * svn_repos_begin_report(void **report_baton, svn_revnum_t revnum, const char *username, svn_repos_t *repos, const char *fs_base, const char *target, const char *tgt_path, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t ignore_ancestry, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
The same as svn_repos_begin_report2(), but taking a boolean recurse flag, and sending FALSE for send_...
svn_repos_revision_access_level_t
Revision Access Levels.
Definition svn_repos.h:4370
@ svn_repos_revision_access_full
access granted to all revision properites and changed-paths information.
Definition svn_repos.h:4379
@ svn_repos_revision_access_none
no access allowed to the revision properties and all changed-paths information.
Definition svn_repos.h:4373
@ svn_repos_revision_access_partial
access granted to some (svn:date and svn:author) revision properties and changed-paths information on...
Definition svn_repos.h:4376
svn_error_t * svn_repos_get_logs5(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t strict_node_history, svn_boolean_t include_merged_revisions, const apr_array_header_t *revprops, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_repos_path_change_receiver_t path_change_receiver, void *path_change_receiver_baton, svn_repos_log_entry_receiver_t revision_receiver, void *revision_receiver_baton, apr_pool_t *scratch_pool)
Invoke revision_receiver with revision_receiver_baton on each revision from start to end in repos's f...
svn_error_t * svn_repos_get_logs2(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool)
Same as svn_repos_get_logs3(), but with limit always set to 0.
svn_error_t * svn_repos_open3(svn_repos_t **repos_p, const char *path, apr_hash_t *fs_config, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Set *repos_p to a repository object for the repository at path.
const char * svn_repos_start_commit_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's start-commit hook, allocated in pool.
const char * svn_repos_pre_revprop_change_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's pre-revprop-change hook, allocated in pool.
svn_error_t * svn_repos_authz_read2(svn_authz_t **authz_p, const char *path, const char *groups_path, svn_boolean_t must_exist, apr_pool_t *pool)
Similar to svn_repos_authz_read3(), but with repos_hint set to NULL.
svn_error_t * svn_repos_link_path2(void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool)
Similar to svn_repos_link_path3(), but with depth set to svn_depth_infinity.
svn_error_t * svn_repos_finish_report(void *report_baton, apr_pool_t *pool)
Given a report_baton constructed by svn_repos_begin_report3(), finish the report and drive the editor...
svn_error_t * svn_repos_authz_initialize(apr_pool_t *pool)
This should be called before any other authz function.
svn_error_t * svn_repos_get_commit_editor3(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool)
Similar to svn_repos_get_commit_editor4(), but uses the svn_commit_callback_t type.
svn_error_t * svn_repos_list(svn_fs_root_t *root, const char *path, const apr_array_header_t *patterns, svn_depth_t depth, svn_boolean_t path_info_only, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_repos_dirent_receiver_t receiver, void *receiver_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *scratch_pool)
Efficiently list everything within a sub-tree.
svn_error_t * svn_repos_hotcopy3(const char *src_path, const char *dst_path, svn_boolean_t clean_logs, svn_boolean_t incremental, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *scratch_pool)
Make a hot copy of the Subversion repository found at src_path to dst_path.
svn_error_t * svn_repos_authz_parse2(svn_authz_t **authz_p, svn_stream_t *stream, svn_stream_t *groups_stream, svn_repos_authz_warning_func_t warning_func, void *warning_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Read authz configuration data from stream into *authz_p, allocated in result_pool.
const char * svn_repos_conf_dir(svn_repos_t *repos, apr_pool_t *pool)
Return path to repos's config directory, allocated in pool.
svn_error_t * svn_repos_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog, svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t revision, svn_mergeinfo_inheritance_t inherit, svn_boolean_t include_descendants, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Same as svn_repos_fs_get_mergeinfo2(), but all mergeinfo is being collected and returned in *catalog.
svn_error_t * svn_repos_get_file_revs(svn_repos_t *repos, const char *path, svn_revnum_t start, svn_revnum_t end, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_repos_file_rev_handler_t handler, void *handler_baton, apr_pool_t *pool)
Similar to svn_repos_get_file_revs2(), with include_merged_revisions set to FALSE.
svn_error_t *(* svn_repos_freeze_func_t)(void *baton, apr_pool_t *pool)
Callback for svn_repos_freeze.
Definition svn_repos.h:841
svn_error_t * svn_repos_authz_read3(svn_authz_t **authz_p, const char *path, const char *groups_path, svn_boolean_t must_exist, svn_repos_t *repos_hint, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Similar to svn_repos_authz_read3(), but with warning_func and warning_baton set to NULL.
const char * svn_repos_path(svn_repos_t *repos, apr_pool_t *pool)
Return the top-level repository path allocated in pool.
svn_error_t * svn_repos_authz_check_access(svn_authz_t *authz, const char *repos_name, const char *path, const char *user, svn_repos_authz_access_t required_access, svn_boolean_t *access_granted, apr_pool_t *pool)
Check whether user can access path in the repository repos_name with the required_access.
svn_error_t * svn_repos_link_path(void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t *pool)
Similar to svn_repos_link_path2(), but with lock_token set to NULL.
svn_error_t * svn_repos_deleted_rev(svn_fs_t *fs, const char *path, svn_revnum_t start, svn_revnum_t end, svn_revnum_t *deleted, apr_pool_t *pool)
Given path which exists at revision start in fs, set *deleted to the revision path was first deleted,...
svn_error_t * svn_repos_db_logfiles(apr_array_header_t **logfiles, const char *path, svn_boolean_t only_unused, apr_pool_t *pool)
This function is a wrapper around svn_fs_berkeley_logfiles(), returning log file paths relative to th...
void(* svn_repos_authz_warning_func_t)(void *baton, const svn_error_t *error, apr_pool_t *scratch_pool)
Callback for reporting authz file parsing warnings.
Definition svn_repos.h:4162
svn_fs_path_change3_t svn_repos_path_change_t
Path change descriptor.
Definition svn_repos.h:1973
const char * svn_repos_pre_commit_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's pre-commit hook, allocated in pool.
svn_error_t * svn_repos_create(svn_repos_t **repos_p, const char *path, const char *unused_1, const char *unused_2, apr_hash_t *config, apr_hash_t *fs_config, apr_pool_t *pool)
Create a new Subversion repository at path, building the necessary directory structure,...
struct svn_authz_t svn_authz_t
A data type which stores the authz information.
Definition svn_repos.h:4140
svn_error_t *(* svn_repos_log_entry_receiver_t)(void *baton, svn_repos_log_entry_t *log_entry, apr_pool_t *scratch_pool)
The callback invoked by log message loopers, such as svn_repos_get_logs5().
Definition svn_repos.h:2113
svn_error_t * svn_repos_history(svn_fs_t *fs, const char *path, svn_repos_history_func_t history_func, void *history_baton, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t *pool)
Similar to svn_repos_history2(), but with authz_read_func and authz_read_baton always set to NULL.
svn_error_t * svn_repos_check_revision_access(svn_repos_revision_access_level_t *access_level, svn_repos_t *repos, svn_revnum_t revision, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Set access to the access level granted for revision in repos, as determined by consulting the authz_r...
svn_error_t * svn_repos_fs_get_mergeinfo2(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t revision, svn_mergeinfo_inheritance_t inherit, svn_boolean_t include_descendants, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_repos_mergeinfo_receiver_t receiver, void *receiver_baton, apr_pool_t *scratch_pool)
For each node found with mergeinfo on it, invoke receiver with the provided receiver_baton.
svn_error_t * svn_repos_dir_delta(svn_fs_root_t *src_root, const char *src_parent_dir, const char *src_entry, svn_fs_root_t *tgt_root, const char *tgt_path, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_boolean_t text_deltas, svn_boolean_t recurse, svn_boolean_t entry_props, svn_boolean_t ignore_ancestry, apr_pool_t *pool)
Similar to svn_repos_dir_delta2(), but if recurse is TRUE, pass svn_depth_infinity for depth,...
svn_error_t * svn_repos_abort_report(void *report_baton, apr_pool_t *pool)
Given a report_baton constructed by svn_repos_begin_report3(), abort the report.
svn_repos_path_change_t * svn_repos_path_change_create(apr_pool_t *result_pool)
Return an svn_repos_path_change_t structure, allocated in result_pool, with all fields initialized to...
svn_error_t * svn_repos_delete(const char *path, apr_pool_t *pool)
Destroy the Subversion repository found at path, using pool for any necessary allocations.
const char * svn_repos_hook_dir(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's hook directory, allocated in pool.
const char * svn_repos_find_root_path(const char *path, apr_pool_t *pool)
Find the root path of the repository that contains path.
svn_error_t * svn_repos_replay(svn_fs_root_t *root, const svn_delta_editor_t *editor, void *edit_baton, apr_pool_t *pool)
Similar to svn_repos_replay2(), but with base_dir set to "", low_water_mark set to SVN_INVALID_REVNUM...
svn_error_t * svn_repos_set_path(void *report_baton, const char *path, svn_revnum_t revision, svn_boolean_t start_empty, apr_pool_t *pool)
Similar to svn_repos_set_path2(), but with lock_token set to NULL.
svn_error_t * svn_repos_authz_read4(svn_authz_t **authz_p, const char *path, const char *groups_path, svn_boolean_t must_exist, svn_repos_t *repos_hint, svn_repos_authz_warning_func_t warning_func, void *warning_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Read authz configuration data from path (a dirent, an absolute file url or a registry path) into *aut...
svn_error_t * svn_repos_dir_delta2(svn_fs_root_t *src_root, const char *src_parent_dir, const char *src_entry, svn_fs_root_t *tgt_root, const char *tgt_path, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t entry_props, svn_boolean_t ignore_ancestry, apr_pool_t *pool)
Use the provided editor and edit_baton to describe the changes necessary for making a given node (and...
svn_repos_log_entry_t * svn_repos_log_entry_dup(const svn_repos_log_entry_t *log_entry, apr_pool_t *result_pool)
Return a deep copy of log_entry, allocated in result_pool.
svn_repos_path_change_t * svn_repos_path_change_dup(svn_repos_path_change_t *change, apr_pool_t *result_pool)
Return a deep copy of change, allocated in result_pool.
svn_error_t * svn_repos_delete_path(void *report_baton, const char *path, apr_pool_t *pool)
Given a report_baton constructed by svn_repos_begin_report3(), record the non-existence of path in th...
svn_error_t * svn_repos_replay2(svn_fs_root_t *root, const char *base_dir, svn_revnum_t low_water_mark, svn_boolean_t send_deltas, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Use the provided editor and edit_baton to describe the skeletal changes made in a particular filesyst...
svn_error_t *(* svn_repos_path_change_receiver_t)(void *baton, svn_repos_path_change_t *change, apr_pool_t *scratch_pool)
The callback invoked by log message loopers, such as svn_repos_get_logs5().
Definition svn_repos.h:2014
svn_error_t * svn_repos_hotcopy(const char *src_path, const char *dst_path, svn_boolean_t clean_logs, apr_pool_t *pool)
Like svn_repos_hotcopy2(), but with incremental always passed as FALSE and without cancellation suppo...
svn_error_t * svn_repos_stat(svn_dirent_t **dirent, svn_fs_root_t *root, const char *path, apr_pool_t *pool)
Set *dirent to an svn_dirent_t associated with path in root.
const char * svn_repos_db_lockfile(svn_repos_t *repos, apr_pool_t *pool)
Return path to repos's db lockfile, allocated in pool.
svn_repos_log_entry_t * svn_repos_log_entry_create(apr_pool_t *result_pool)
Return an svn_repos_log_entry_t, allocated in result_pool, with all fields initialized to their respe...
svn_error_t * svn_repos_freeze(const apr_array_header_t *paths, svn_repos_freeze_func_t freeze_func, void *freeze_baton, apr_pool_t *pool)
Take an exclusive lock on each of the repositories in paths to prevent commits and then while holding...
svn_error_t * svn_repos_get_commit_editor5(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url_decoded, const char *base_path, apr_hash_t *revprop_table, svn_commit_callback2_t commit_callback, void *commit_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool)
Return an editor and edit_baton to commit changes to the filesystem of repos, beginning at location '...
svn_error_t *(* svn_repos_file_rev_handler_t)(void *baton, const char *path, svn_revnum_t rev, apr_hash_t *rev_props, svn_txdelta_window_handler_t *delta_handler, void **delta_baton, apr_array_header_t *prop_diffs, apr_pool_t *pool)
Similar to svn_file_rev_handler_t, but without the result_of_merge parameter.
Definition svn_repos.h:2439
svn_error_t * svn_repos_authz_read(svn_authz_t **authz_p, const char *file, svn_boolean_t must_exist, apr_pool_t *pool)
Similar to svn_repos_authz_read2(), but with groups_path and repos_root always passed as NULL.
svn_error_t * svn_repos_link_path3(void *report_baton, const char *path, const char *link_path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool)
Given a report_baton constructed by svn_repos_begin_report3(), record the presence of path in the cur...
svn_error_t *(* svn_repos_history_func_t)(void *baton, const char *path, svn_revnum_t revision, apr_pool_t *pool)
Callback type for use with svn_repos_history().
Definition svn_repos.h:1829
struct svn_repos_t svn_repos_t
The repository object.
Definition svn_repos.h:410
svn_error_t * svn_repos_get_logs3(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool)
Same as svn_repos_get_logs4(), but with receiver being svn_log_message_receiver_t instead of svn_log_...
svn_error_t * svn_repos_upgrade2(const char *path, svn_boolean_t nonblocking, svn_repos_notify_func_t notify_func, void *notify_baton, apr_pool_t *pool)
Upgrade the Subversion repository (and its underlying versioned filesystem) located in the directory ...
svn_fs_t * svn_repos_fs(svn_repos_t *repos)
Return the filesystem associated with repository object repos.
svn_error_t * svn_repos_get_committed_info(svn_revnum_t *committed_rev, const char **committed_date, const char **last_author, svn_fs_root_t *root, const char *path, apr_pool_t *pool)
Given a root/path within some filesystem, return three pieces of information allocated in pool:
svn_error_t * svn_repos_trace_node_locations(svn_fs_t *fs, apr_hash_t **locations, const char *fs_path, svn_revnum_t peg_revision, const apr_array_header_t *location_revisions, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Set *locations to be a mapping of the revisions to the paths of the file fs_path present at the repos...
svn_error_t * svn_repos_recover(const char *path, apr_pool_t *pool)
Similar to svn_repos_recover2(), but with nonblocking set to FALSE, and with no callbacks provided.
svn_error_t * svn_repos_dated_revision(svn_revnum_t *revision, svn_repos_t *repos, apr_time_t tm, apr_pool_t *pool)
Set *revision to the revision number in repos's filesystem that was youngest at time tm.
const char * svn_repos_svnserve_conf(svn_repos_t *repos, apr_pool_t *pool)
Return path to repos's svnserve.conf, allocated in pool.
const svn_version_t * svn_repos_version(void)
Get libsvn_repos version information.
svn_error_t * svn_repos_remember_client_capabilities(svn_repos_t *repos, const apr_array_header_t *capabilities)
Store in repos the client-reported capabilities capabilities, which must be allocated in memory at le...
svn_error_t * svn_repos_authz_parse(svn_authz_t **authz_p, svn_stream_t *stream, svn_stream_t *groups_stream, apr_pool_t *pool)
Similar to svn_repos_authz_parse2(), but with warning_func and warning_baton set to NULL.
svn_fs_mergeinfo_receiver_t svn_repos_mergeinfo_receiver_t
Receives parsed mergeinfo for the file system path path.
Definition svn_repos.h:2311
const char * svn_repos_lock_dir(svn_repos_t *repos, apr_pool_t *pool)
Return path to repos's lock directory, allocated in pool.
svn_error_t * svn_repos_fs_pack2(svn_repos_t *repos, svn_repos_notify_func_t notify_func, void *notify_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Possibly update the repository, repos, to use a more efficient filesystem representation.
svn_error_t * svn_repos_get_commit_editor4(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, svn_fs_txn_t *txn, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback2_t commit_callback, void *commit_baton, svn_repos_authz_callback_t authz_callback, void *authz_baton, apr_pool_t *pool)
Similar to svn_repos_get_commit_editor5(), but with revprop_table set to a hash containing user and l...
svn_error_t * svn_repos_upgrade(const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, apr_pool_t *pool)
Similar to svn_repos_upgrade2(), but with start_callback and baton, rather than a notify_callback / b...
const char * svn_repos_post_revprop_change_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's post-revprop-change hook, allocated in pool.
svn_error_t * svn_repos_history2(svn_fs_t *fs, const char *path, svn_repos_history_func_t history_func, void *history_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_revnum_t start, svn_revnum_t end, svn_boolean_t cross_copies, apr_pool_t *pool)
Call history_func (with history_baton) for each interesting history location in the lifetime of path ...
svn_error_t * svn_repos_hotcopy2(const char *src_path, const char *dst_path, svn_boolean_t clean_logs, svn_boolean_t incremental, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Like svn_repos_hotcopy3(), but with notify_func and notify_baton always passed as NULL.
const char * svn_repos_db_env(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's filesystem directory, allocated in pool.
svn_error_t * svn_repos_get_logs4(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, int limit, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_boolean_t include_merged_revisions, const apr_array_header_t *revprops, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_log_entry_receiver_t receiver, void *receiver_baton, apr_pool_t *pool)
Similar to svn_repos_get_logs5 but using a svn_log_entry_receiver_t receiver to receive revision prop...
svn_error_t * svn_repos_recover3(const char *path, svn_boolean_t nonblocking, svn_error_t *(*start_callback)(void *baton), void *start_callback_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *pool)
Similar to svn_repos_recover4(), but with start callback in place of the notify_func / baton.
const char * svn_repos_fs_type(svn_repos_t *repos, apr_pool_t *result_pool)
Return the type of filesystem associated with repository object repos allocated in result_pool.
svn_error_t * svn_repos_node_location_segments(svn_repos_t *repos, const char *path, svn_revnum_t peg_revision, svn_revnum_t start_rev, svn_revnum_t end_rev, svn_location_segment_receiver_t receiver, void *receiver_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_pool_t *pool)
Call receiver and receiver_baton to report successive location segments in revisions between start_re...
svn_error_t * svn_repos_open(svn_repos_t **repos_p, const char *path, apr_pool_t *pool)
Similar to svn_repos_open2() with fs_config set to NULL.
svn_error_t * svn_repos_get_file_revs2(svn_repos_t *repos, const char *path, svn_revnum_t start, svn_revnum_t end, svn_boolean_t include_merged_revisions, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, svn_file_rev_handler_t handler, void *handler_baton, apr_pool_t *pool)
Retrieve a subset of the interesting revisions of a file path in repos as seen in revision end.
const char * svn_repos_db_logs_lockfile(svn_repos_t *repos, apr_pool_t *pool)
Return path to repos's db logs lockfile, allocated in pool.
svn_error_t * svn_repos_set_path3(void *report_baton, const char *path, svn_revnum_t revision, svn_depth_t depth, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool)
Given a report_baton constructed by svn_repos_begin_report3(), record the presence of path,...
svn_error_t * svn_repos_set_path2(void *report_baton, const char *path, svn_revnum_t revision, svn_boolean_t start_empty, const char *lock_token, apr_pool_t *pool)
Similar to svn_repos_set_path3(), but with depth set to svn_depth_infinity.
svn_error_t * svn_repos_get_logs(svn_repos_t *repos, const apr_array_header_t *paths, svn_revnum_t start, svn_revnum_t end, svn_boolean_t discover_changed_paths, svn_boolean_t strict_node_history, svn_log_message_receiver_t receiver, void *receiver_baton, apr_pool_t *pool)
Same as svn_repos_get_logs2(), but with authz_read_func and authz_read_baton always set to NULL.
svn_error_t * svn_repos_get_commit_editor(const svn_delta_editor_t **editor, void **edit_baton, svn_repos_t *repos, const char *repos_url, const char *base_path, const char *user, const char *log_msg, svn_commit_callback_t callback, void *callback_baton, apr_pool_t *pool)
Similar to svn_repos_get_commit_editor2(), but with txn always set to NULL.
svn_error_t *(* svn_repos_dirent_receiver_t)(const char *path, svn_dirent_t *dirent, void *baton, apr_pool_t *scratch_pool)
Callback type to be used with svn_repos_list().
Definition svn_repos.h:1749
const char * svn_repos_post_commit_hook(svn_repos_t *repos, apr_pool_t *pool)
Return the path to repos's post-commit hook, allocated in pool.
svn_error_t * svn_repos_begin_report3(void **report_baton, svn_revnum_t revnum, svn_repos_t *repos, const char *fs_base, const char *target, const char *tgt_path, svn_boolean_t text_deltas, svn_depth_t depth, svn_boolean_t ignore_ancestry, svn_boolean_t send_copyfrom_args, const svn_delta_editor_t *editor, void *edit_baton, svn_repos_authz_func_t authz_read_func, void *authz_read_baton, apr_size_t zero_copy_limit, apr_pool_t *pool)
Construct and return a report_baton that will be passed to the other functions in this section to des...
Counted-length strings for Subversion, plus some C string goodies.
Subversion's data types.
svn_error_t *(* svn_commit_callback_t)(svn_revnum_t new_revision, const char *date, const char *author, void *baton)
Same as svn_commit_callback2_t, but uses individual data elements instead of the svn_commit_info_t st...
Definition svn_types.h:1007
int svn_boolean_t
YABT: Yet Another Boolean Type.
Definition svn_types.h:137
svn_error_t *(* svn_commit_callback2_t)(const svn_commit_info_t *commit_info, void *baton, apr_pool_t *pool)
Callback function type for commits.
Definition svn_types.h:997
svn_error_t *(* svn_log_entry_receiver_t)(void *baton, svn_log_entry_t *log_entry, apr_pool_t *pool)
The callback invoked by log message loopers, such as svn_ra_plugin_t.get_log() and svn_repos_get_logs...
Definition svn_types.h:963
svn_error_t *(* svn_cancel_func_t)(void *cancel_baton)
A user defined callback that subversion will call with a user defined baton to see if the current ope...
Definition svn_types.h:1081
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
Definition svn_types.h:62
svn_error_t *(* svn_log_message_receiver_t)(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, const char *message, apr_pool_t *pool)
Similar to svn_log_entry_receiver_t, except this uses separate parameters for each part of the log en...
Definition svn_types.h:974
svn_depth_t
The concept of depth for directories.
svn_node_kind_t
The various types of nodes in the Subversion filesystem.
long int svn_revnum_t
A revision number.