86
86
#define SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS "fsfs-cache-fulltexts"
88
/** Enable / disable revprop caching for a FSFS repository.
90
* "2" is allowed, too and means "enable if efficient",
91
* i.e. this will not create warning at runtime if there
92
* if no efficient support for revprop caching.
96
#define SVN_FS_CONFIG_FSFS_CACHE_REVPROPS "fsfs-cache-revprops"
98
/** Select the cache namespace. If you potentially share the cache with
99
* another FS object for the same repository, objects read through one FS
100
* will not need to be read again for the other. In most cases, that is
101
* a very desirable behavior and the default is, therefore, an empty
104
* If you want to be sure that your FS instance will actually read all
105
* requested data at least once, you need to specify a separate namespace
106
* for it. All repository verification code, for instance, should use
107
* some GUID here that is different each time you open an FS instance.
111
#define SVN_FS_CONFIG_FSFS_CACHE_NS "fsfs-cache-namespace"
113
/* Note to maintainers: if you add further SVN_FS_CONFIG_FSFS_CACHE_* knobs,
114
update fs_fs.c:verify_as_revision_before_current_plus_plus(). */
88
116
/* See also svn_fs_type(). */
89
117
/** @since New in 1.1. */
90
118
#define SVN_FS_CONFIG_FS_TYPE "fs-type"
246
281
apr_pool_t *pool);
284
* Callback function type for progress notification.
286
* @a revision is the number of the revision currently begin processed,
287
* #SVN_INVALID_REVNUM if the current stage is not linked to any specific
288
* revision. @a baton is the callback baton.
292
typedef void (*svn_fs_progress_notify_func_t)(svn_revnum_t revision,
249
297
* Return, in @a *fs_type, a string identifying the back-end type of
250
298
* the Subversion filesystem located in @a path. Allocate @a *fs_type
277
325
apr_pool_t *pool);
328
* Return a shallow copy of the configuration parameters used to open
329
* @a fs, allocated in @a pool. It may be @c NULL. The contents of the
330
* hash contents remains valid only for @a fs's lifetime.
332
* @note This is just what was passed to svn_fs_create() or svn_fs_open().
333
* You may not modify it.
338
svn_fs_config(svn_fs_t *fs,
280
342
* Delete the filesystem at @a path.
344
* @note: Deleting a filesystem that has an open svn_fs_t is not
345
* supported. Clear/destroy all pools used to create/open @a path.
282
348
* @since New in 1.1.
292
358
* means deleting copied, unused logfiles for a Berkeley DB source
361
* If @a incremental is TRUE, make an effort to avoid re-copying
362
* information already present in the destination where possible. If
363
* incremental hotcopy is not implemented, raise
364
* #SVN_ERR_UNSUPPORTED_FEATURE.
366
* Use @a scratch_pool for temporary allocations.
371
svn_fs_hotcopy2(const char *src_path,
372
const char *dest_path,
374
svn_boolean_t incremental,
375
svn_cancel_func_t cancel_func,
377
apr_pool_t *scratch_pool);
380
* Like svn_fs_hotcopy2(), but with @a incremental always passed as @c
381
* TRUE and without cancellation support.
383
* @deprecated Provided for backward compatibility with the 1.7 API.
295
384
* @since New in 1.1.
298
388
svn_fs_hotcopy(const char *src_path,
299
389
const char *dest_path,
342
432
apr_pool_t *pool);
436
* Callback for svn_fs_freeze().
440
typedef svn_error_t *(*svn_fs_freeze_func_t)(void *baton, apr_pool_t *pool);
443
* Take an exclusive lock on @a fs to prevent commits and then invoke
444
* @a freeze_func passing @a freeze_baton.
446
* @note The BDB backend doesn't implement this feature so most
447
* callers should not call this function directly but should use the
448
* higher level svn_repos_freeze() instead.
450
* @see svn_repos_freeze()
455
svn_fs_freeze(svn_fs_t *fs,
456
svn_fs_freeze_func_t freeze_func,
345
461
/** Subversion filesystems based on Berkeley DB.
347
463
* The following functions are specific to Berkeley DB filesystems.
811
928
* If @a conflict_p is non-zero, use it to provide details on any
812
929
* conflicts encountered merging @a txn with the most recent committed
813
930
* revisions. If a conflict occurs, set @a *conflict_p to the path of
814
* the conflict in @a txn, with the same lifetime as @a txn;
931
* the conflict in @a txn, allocated within @a pool;
815
932
* otherwise, set @a *conflict_p to NULL.
817
934
* If the commit succeeds, @a txn is invalid.
826
943
* the value is a valid revision number, the commit was successful,
827
944
* even though a non-@c NULL function return value may indicate that
828
945
* something else went wrong in post commit FS processing.
947
* @note See api-errata/1.8/fs001.txt for information on how this
948
* function was documented in versions prior to 1.8.
950
* ### need to document this better. there are four combinations of
952
* ### 1) err=NULL. conflict=NULL. new_rev is valid
953
* ### 2) err=SVN_ERR_FS_CONFLICT. conflict is set. new_rev=SVN_INVALID_REVNUM
954
* ### 3) err=!NULL. conflict=NULL. new_rev is valid
955
* ### 4) err=!NULL. conflict=NULL. new_rev=SVN_INVALID_REVNUM
957
* ### some invariants:
958
* ### *conflict_p will be non-NULL IFF SVN_ERR_FS_CONFLICT
959
* ### if *conflict_p is set (and SVN_ERR_FS_CONFLICT), then new_rev
960
* ### will always be SVN_INVALID_REVNUM
961
* ### *conflict_p will always be initialized to NULL, or to a valid
962
* ### conflict string
963
* ### *new_rev will always be initialized to SVN_INVALID_REVNUM, or
964
* ### to a valid, committed revision number
831
967
svn_fs_commit_txn(const char **conflict_p,
1454
1590
/** Set @a *root_p and @a *path_p to the revision root and path of the
1455
1591
* destination of the most recent copy event that caused @a path to
1456
1592
* exist where it does in @a root, or to NULL if no such copy exists.
1457
* When non-NULL, allocate @a *root_p and @a *path_p in @a pool.
1459
1594
* @a *path_p might be a parent of @a path, rather than @a path
1460
1595
* itself. However, it will always be the deepest relevant path.
1484
1622
* @a inherit indicates whether to retrieve explicit,
1485
1623
* explicit-or-inherited, or only inherited mergeinfo.
1625
* If @a adjust_inherited_mergeinfo is @c TRUE, then any inherited
1626
* mergeinfo returned in @a *catalog is normalized to represent the
1627
* inherited mergeinfo on the path which inherits it. If
1628
* @a adjust_inherited_mergeinfo is @c FALSE, then any inherited
1629
* mergeinfo is the raw explicit mergeinfo from the nearest parent
1630
* of the path with explicit mergeinfo, unadjusted for the path-wise
1631
* difference between the path and its parent. This may include
1632
* non-inheritable mergeinfo.
1487
1634
* If @a include_descendants is TRUE, then additionally return the
1488
1635
* mergeinfo for any descendant of any element of @a paths which has
1489
1636
* the #SVN_PROP_MERGEINFO property explicitly set on it. (Note
1491
1638
* paths; descendants of the elements in @a paths which get their
1492
1639
* mergeinfo via inheritance are not included in @a *catalog.)
1494
* Do any necessary temporary allocation in @a pool.
1496
* @since New in 1.5.
1641
* Allocate @a *catalog in result_pool. Do any necessary temporary
1642
* allocations in @a scratch_pool.
1644
* @since New in 1.8.
1647
svn_fs_get_mergeinfo2(svn_mergeinfo_catalog_t *catalog,
1648
svn_fs_root_t *root,
1649
const apr_array_header_t *paths,
1650
svn_mergeinfo_inheritance_t inherit,
1651
svn_boolean_t include_descendants,
1652
svn_boolean_t adjust_inherited_mergeinfo,
1653
apr_pool_t *result_pool,
1654
apr_pool_t *scratch_pool);
1657
* Same as svn_fs_get_mergeinfo2(), but with @a adjust_inherited_mergeinfo
1658
* set always set to @c TRUE and with only one pool.
1660
* @deprecated Provided for backward compatibility with the 1.5 API.
1499
1664
svn_fs_get_mergeinfo(svn_mergeinfo_catalog_t *catalog,
1500
1665
svn_fs_root_t *root,
1736
1901
const char *path,
1737
1902
apr_pool_t *pool);
1905
* Callback function type used with svn_fs_try_process_file_contents()
1906
* that delivers the immutable, non-NULL @a contents of @a len bytes.
1907
* @a baton is an implementation-specific closure.
1909
* Use @a scratch_pool for allocations.
1911
* @since New in 1.8.
1913
typedef svn_error_t *
1914
(*svn_fs_process_contents_func_t)(const unsigned char *contents,
1917
apr_pool_t *scratch_pool);
1919
/** Efficiently deliver the contents of the file @a path in @a root
1920
* via @a processor (with @a baton), setting @a *success to @c TRUE
1921
* upon doing so. Use @a pool for allocations.
1923
* This function is intended to support zero copy data processing. It may
1924
* not be implemented for all data backends or not applicable for certain
1925
* content. In that case, @a *success will always be @c FALSE. Also, this
1926
* is a best-effort function which means that there is no guarantee that
1927
* @a processor gets called at all for some content.
1929
* @note @a processor is expected to be relatively short function with
1930
* at most O(content size) runtime.
1932
* @since New in 1.8.
1935
svn_fs_try_process_file_contents(svn_boolean_t *success,
1936
svn_fs_root_t *root,
1938
svn_fs_process_contents_func_t processor,
1740
1942
/** Create a new file named @a path in @a root. The file's initial contents
1741
1943
* are the empty string, and it has no properties. @a root must be the
2237
2440
apr_pool_t *pool);
2444
* Perform backend-specific data consistency and correctness validations
2445
* to the Subversion filesystem (mainly the meta-data) located in the
2446
* directory @a path. Use the backend-specific configuration @a fs_config
2447
* when opening the filesystem. @a NULL is valid for all backends.
2448
* Use @a scratch_pool for temporary allocations.
2450
* @a start and @a end define the (minimum) range of revisions to check.
2451
* If @a start is #SVN_INVALID_REVNUM, it defaults to @c r0. Likewise,
2452
* @a end will default to the current youngest repository revision when
2453
* given as #SVN_INVALID_REVNUM. Since meta data checks may have to touch
2454
* other revisions as well, you may receive notifications for revisions
2455
* outside the specified range. In fact, it is perfectly legal for a FS
2456
* implementation to always check all revisions.
2458
* Global invariants are only guaranteed to get verified when @a r0 has
2459
* been included in the range of revisions to check.
2461
* The optional @a notify_func callback is only a general feedback that
2462
* the operation is still in process but may be called in random revisions
2463
* order and more than once for the same revision, i.e. r2, r1, r2 would
2464
* be a valid sequence.
2466
* The optional @a cancel_func callback will be invoked as usual to allow
2467
* the user to preempt this potentially lengthy operation.
2469
* @note You probably don't want to use this directly. Take a look at
2470
* svn_repos_verify_fs2() instead, which does non-backend-specific
2471
* verifications as well.
2473
* @note To ensure a full verification using all tests and covering all
2474
* revisions, you must call this function *and* #svn_fs_verify_root.
2476
* @note Implementors, please do tests that can be done efficiently for
2477
* a single revision in #svn_fs_verify_root. This function is meant for
2478
* global checks or tests that require an expensive context setup.
2480
* @see svn_repos_verify_fs2()
2481
* @see svn_fs_verify_root()
2483
* @since New in 1.8.
2486
svn_fs_verify(const char *path,
2487
apr_hash_t *fs_config,
2490
svn_fs_progress_notify_func_t notify_func,
2492
svn_cancel_func_t cancel_func,
2494
apr_pool_t *scratch_pool);
2497
* Perform backend-specific data consistency and correctness validations
2498
* of @a root in the Subversion filesystem @a fs. @a root is typically
2499
* a revision root (see svn_fs_revision_root()), but may be a
2500
* transaction root. Use @a scratch_pool for temporary allocations.
2502
* @note You probably don't want to use this directly. Take a look at
2503
* svn_repos_verify_fs2() instead, which does non-backend-specific
2504
* verifications as well.
2506
* @note To ensure a full verification using all available tests and
2507
* covering all revisions, you must call both this function and
2510
* @note Implementors, please perform tests that cannot be done
2511
* efficiently for a single revision in #svn_fs_verify. This function
2512
* is intended for local checks that don't require an expensive context
2515
* @see svn_repos_verify_fs2()
2516
* @see svn_fs_verify()
2518
* @since New in 1.8.
2521
svn_fs_verify_root(svn_fs_root_t *root,
2522
apr_pool_t *scratch_pool);
2243
2526
#ifdef __cplusplus
2245
2528
#endif /* __cplusplus */