65
65
/** An object representing a Subversion filesystem. */
66
66
typedef struct svn_fs_t svn_fs_t;
69
* @defgroup svn_fs_backend_names Built-in back-ends
70
* Constants defining the currently supported built-in filesystem backends.
75
/** @since New in 1.1. */
76
#define SVN_FS_TYPE_BDB "bdb"
77
/** @since New in 1.1. */
78
#define SVN_FS_TYPE_FSFS "fsfs"
81
* EXPERIMENTAL filesystem backend.
83
* It is not ready for general production use. Please consult the
84
* respective release notes on suggested usage scenarios.
88
#define SVN_FS_TYPE_FSX "fsx"
70
94
* @name Filesystem configuration options
111
135
#define SVN_FS_CONFIG_FSFS_CACHE_NS "fsfs-cache-namespace"
137
/** Enable / disable the FSFS format 7 "block read" feature.
141
#define SVN_FS_CONFIG_FSFS_BLOCK_READ "fsfs-block-read"
143
/** String with a decimal representation of the FSFS format shard size.
144
* Zero ("0") means that a repository with linear layout should be created.
146
* This option will only be used during the creation of new repositories
147
* and is otherwise ignored.
151
#define SVN_FS_CONFIG_FSFS_SHARD_SIZE "fsfs-shard-size"
153
/** Enable / disable the FSFS format 7 logical addressing feature for a
154
* newly created repository.
156
* This option will only be used during the creation of new repositories
157
* and is otherwise ignored.
161
#define SVN_FS_CONFIG_FSFS_LOG_ADDRESSING "fsfs-log-addressing"
113
163
/* Note to maintainers: if you add further SVN_FS_CONFIG_FSFS_CACHE_* knobs,
114
164
update fs_fs.c:verify_as_revision_before_current_plus_plus(). */
116
/* See also svn_fs_type(). */
117
/** @since New in 1.1. */
166
/** Select the filesystem type. See also #svn_fs_type().
168
* @since New in 1.1. */
118
169
#define SVN_FS_CONFIG_FS_TYPE "fs-type"
119
/** @since New in 1.1. */
120
#define SVN_FS_TYPE_BDB "bdb"
121
/** @since New in 1.1. */
122
#define SVN_FS_TYPE_FSFS "fsfs"
124
171
/** Create repository format compatible with Subversion versions
125
172
* earlier than 1.4.
242
302
* return a pointer to it in @a *fs_p. If @a fs_config is not @c
243
303
* NULL, the options it contains modify the behavior of the
244
304
* filesystem. The interpretation of @a fs_config is specific to the
245
* filesystem back-end. The opened filesystem may be closed by
246
* destroying @a pool.
305
* filesystem back-end. The opened filesystem will be allocated in
306
* @a result_pool may be closed by clearing or destroying that pool.
307
* Use @a scratch_pool for temporary allocations.
248
309
* @note The lifetime of @a fs_config must not be shorter than @a
249
* pool's. It's a good idea to allocate @a fs_config from @a pool or
250
* one of its ancestors.
310
* result_pool's. It's a good idea to allocate @a fs_config from
311
* @a result_pool or one of its ancestors.
252
313
* Only one thread may operate on any given filesystem object at once.
253
314
* Two threads may access the same filesystem simultaneously only if
254
315
* they open separate filesystem objects.
256
317
* @note You probably don't want to use this directly. Take a look at
257
* svn_repos_open2() instead.
318
* svn_repos_open3() instead.
323
svn_fs_open2(svn_fs_t **fs_p,
325
apr_hash_t *fs_config,
326
apr_pool_t *result_pool,
327
apr_pool_t *scratch_pool);
330
* Like svn_fs_open2(), but without @a scratch_pool.
332
* @deprecated Provided for backward compatibility with the 1.8 API.
259
333
* @since New in 1.1.
262
337
svn_fs_open(svn_fs_t **fs_p,
263
338
const char *path,
264
339
apr_hash_t *fs_config,
265
340
apr_pool_t *pool);
342
/** The kind of action being taken by 'upgrade'.
346
typedef enum svn_fs_upgrade_notify_action_t
348
/** Packing of the revprop shard has completed.
349
* The number parameter is the shard being processed. */
350
svn_fs_upgrade_pack_revprops = 0,
352
/** Removal of the non-packed revprop shard is completed.
353
* The number parameter is the shard being processed */
354
svn_fs_upgrade_cleanup_revprops,
356
/** DB format has been set to the new value.
357
* The number parameter is the new format number. */
358
svn_fs_upgrade_format_bumped
359
} svn_fs_upgrade_notify_action_t;
361
/** The type of an upgrade notification function. @a number is specifc
362
* to @a action (see #svn_fs_upgrade_notify_action_t); @a action is the
363
* type of action being performed. @a baton is the corresponding baton
364
* for the notification function, and @a scratch_pool can be used for
365
* temporary allocations, but will be cleared between invocations.
369
typedef svn_error_t *(*svn_fs_upgrade_notify_t)(void *baton,
371
svn_fs_upgrade_notify_action_t action,
372
apr_pool_t *scratch_pool);
268
375
* Upgrade the Subversion filesystem located in the directory @a path
269
376
* to the latest version supported by this library. Return
270
377
* #SVN_ERR_FS_UNSUPPORTED_UPGRADE and make no changes to the
271
* filesystem if the requested upgrade is not supported. Use @a pool
272
* for necessary allocations.
378
* filesystem if the requested upgrade is not supported. Use
379
* @a scratch_pool for temporary allocations.
381
* The optional @a notify_func callback is only a general feedback that
382
* the operation is still in process but may be called in e.g. random shard
383
* order and more than once for the same shard.
385
* The optional @a cancel_func callback will be invoked as usual to allow
386
* the user to preempt this potentially lengthy operation.
274
388
* @note You probably don't want to use this directly. Take a look at
275
* svn_repos_upgrade() instead.
389
* svn_repos_upgrade2() instead.
391
* @note Canceling an upgrade is legal but may leave remnants of previous
392
* format data that may not be cleaned up automatically by later calls.
397
svn_fs_upgrade2(const char *path,
398
svn_fs_upgrade_notify_t notify_func,
400
svn_cancel_func_t cancel_func,
402
apr_pool_t *scratch_pool);
405
* Like svn_fs_upgrade2 but with notify_func, notify_baton, cancel_func
406
* and cancel_baton being set to NULL.
408
* @deprecated Provided for backward compatibility with the 1.8 API.
277
409
* @since New in 1.5.
280
413
svn_fs_upgrade(const char *path,
281
414
apr_pool_t *pool);
351
484
svn_fs_delete_fs(const char *path,
352
485
apr_pool_t *pool);
487
/** The type of a hotcopy notification function. @a start_revision and
488
* @a end_revision indicate the copied revision range. @a baton is the
489
* corresponding baton for the notification function, and @a scratch_pool
490
* can be used for temporary allocations, but will be cleared between
493
typedef void (*svn_fs_hotcopy_notify_t)(void *baton,
494
svn_revnum_t start_revision,
495
svn_revnum_t end_revision,
496
apr_pool_t *scratch_pool);
355
499
* Copy a possibly live Subversion filesystem from @a src_path to
356
500
* @a dest_path. If @a clean is @c TRUE, perform cleanup on the
363
507
* incremental hotcopy is not implemented, raise
364
508
* #SVN_ERR_UNSUPPORTED_FEATURE.
510
* For each revision range copied, @a notify_func will be called with
511
* staring and ending revision numbers (both inclusive and not necessarily
512
* different) and with the @a notify_baton. Currently, this notification
513
* is not triggered by the BDB backend. @a notify_func may be @c NULL
514
* if this notification is not required.
516
* The optional @a cancel_func callback will be invoked with
517
* @a cancel_baton as usual to allow the user to preempt this potentially
366
520
* Use @a scratch_pool for temporary allocations.
525
svn_fs_hotcopy3(const char *src_path,
526
const char *dest_path,
528
svn_boolean_t incremental,
529
svn_fs_hotcopy_notify_t notify_func,
531
svn_cancel_func_t cancel_func,
533
apr_pool_t *scratch_pool);
536
* Like svn_fs_hotcopy3(), but with @a notify_func and @a notify_baton
537
* always passed as @c NULL.
539
* @deprecated Provided for backward compatibility with the 1.8 API.
368
540
* @since New in 1.8.
371
544
svn_fs_hotcopy2(const char *src_path,
372
545
const char *dest_path,
891
/** Defines the possible ways two arbitrary (root, path)-pairs may be
896
typedef enum svn_fs_node_relation_t
898
/** The (root, path)-pairs are not related, i.e. none of the other cases
899
* apply. If the roots refer to different @c svn_fs_t instances, then
900
* they are always considered unrelated - even if the underlying
901
* repository is the same.
903
svn_fs_node_unrelated = 0,
905
/** No changes have been made between the (root, path)-pairs, i.e. they
906
* have the same (relative) nodes in their sub-trees, corresponding sub-
907
* tree nodes have the same contents as well as properties and report the
908
* same "created-path" and "created-rev" data. This implies having a
911
* However, due to efficiency considerations, the FS implementation may
912
* report some combinations as merely having a common ancestor
913
* (@a svn_fs_node_common_ancestor) instead of actually being unchanged.
915
svn_fs_node_unchanged,
917
/** The (root, path)-pairs have a common ancestor (which may be one of
918
* them) but there are changes between them, i.e. they don't fall into
919
* the @c svn_fs_node_unchanged category.
921
* Due to efficiency considerations, the FS implementation may falsely
922
* classify some combinations as merely having a common ancestor that
923
* are, in fact, unchanged (@a svn_fs_node_unchanged).
925
svn_fs_node_common_ancestor
927
} svn_fs_node_relation_t;
713
929
/** An object representing a node-revision id. */
714
930
typedef struct svn_fs_id_t svn_fs_id_t;
717
933
/** Return -1, 0, or 1 if node revisions @a a and @a b are respectively
718
934
* unrelated, equivalent, or otherwise related (part of the same node).
936
* @note Consider using the more expressive #svn_fs_node_relation() instead.
938
* @see #svn_fs_node_relation
721
941
svn_fs_compare_ids(const svn_fs_id_t *a,
827
1051
* pairs. When you commit a transaction, all of its properties become
828
1052
* unversioned revision properties of the new revision. (There is one
829
1053
* exception: the svn:date property will be automatically set on new
830
* transactions to the date that the transaction was created, and will
1054
* transactions to the date that the transaction was created, and can
831
1055
* be overwritten when the transaction is committed by the current
832
* time; changes to a transaction's svn:date property will not affect
833
* its committed value.)
1056
* time; see svn_fs_commit_txn.)
835
1058
* Transaction names are guaranteed to contain only letters (upper-
836
1059
* and lower-case), digits, `-', and `.', from the ASCII character
925
1156
* a new filesystem revision containing the changes made in @a txn,
926
1157
* storing that new revision number in @a *new_rev, and return zero.
1159
* If #SVN_FS_TXN_CLIENT_DATE was passed to #svn_fs_begin_txn2 any
1160
* svn:date on the transaction will be become the unversioned property
1161
* svn:date on the revision. svn:date can have any value, it does not
1162
* have to be a timestamp. If the transaction has no svn:date the
1163
* revision will have no svn:date.
1165
* If #SVN_FS_TXN_CLIENT_DATE was not passed to #svn_fs_begin_txn2 the
1166
* new revision will have svn:date set to the current time at some
1167
* point during the commit and any svn:date on the transaction will be
928
1170
* If @a conflict_p is non-zero, use it to provide details on any
929
1171
* conflicts encountered merging @a txn with the most recent committed
930
1172
* revisions. If a conflict occurs, set @a *conflict_p to the path of
1236
1483
/** kind of change */
1237
1484
svn_fs_path_change_kind_t change_kind;
1239
/** were there text mods? */
1486
/** was the text touched?
1487
* For node_kind=dir: always false. For node_kind=file:
1488
* modify: true iff text touched.
1489
* add (copy): true iff text touched.
1490
* add (plain): always true.
1491
* delete: always false.
1492
* replace: as for the add/copy part of the replacement.
1240
1494
svn_boolean_t text_mod;
1242
/** were there property mods? */
1496
/** were the properties touched?
1497
* modify: true iff props touched.
1498
* add (copy): true iff props touched.
1499
* add (plain): true iff props touched.
1500
* delete: always false.
1501
* replace: as for the add/copy part of the replacement.
1243
1503
svn_boolean_t prop_mod;
1245
1505
/** what node kind is the path?
1383
1668
* the same age as the revision of that path in @a root. That is, if
1384
1669
* @a root is a revision root based on revision X, and @a path was
1385
1670
* modified in some revision(s) younger than X, those revisions
1386
* younger than X will not be included for @a path. */
1671
* younger than X will not be included for @a path.
1673
* Allocate the result in @a result_pool and use @a scratch_pool for
1674
* temporary allocations.
1676
* @since New in 1.9. */
1678
svn_fs_history_prev2(svn_fs_history_t **prev_history_p,
1679
svn_fs_history_t *history,
1680
svn_boolean_t cross_copies,
1681
apr_pool_t *result_pool,
1682
apr_pool_t *scratch_pool);
1684
/** Same as svn_fs_history_prev2() but using a single @a pool for all
1687
* @deprecated Provided for backward compatibility with the 1.8 API.
1388
1691
svn_fs_history_prev(svn_fs_history_t **prev_history_p,
1389
1692
svn_fs_history_t *history,
1437
1740
const char *path,
1438
1741
apr_pool_t *pool);
1743
/** Determine how @a path_a under @a root_a and @a path_b under @a root_b
1744
* are related and return the result in @a relation. There is no restriction
1745
* concerning the roots: They may refer to different repositories, be in
1746
* arbitrary revision order and any of them may pertain to a transaction.
1747
* @a scratch_pool is used for temporary allocations.
1749
* @note Paths from different svn_fs_t will be reported as unrelated even
1750
* if the underlying physical repository is the same.
1752
* @since New in 1.9.
1755
svn_fs_node_relation(svn_fs_node_relation_t *relation,
1756
svn_fs_root_t *root_a,
1758
svn_fs_root_t *root_b,
1760
apr_pool_t *scratch_pool);
1440
1762
/** Set @a *revision to the revision in which @a path under @a root was
1441
1763
* created. Use @a pool for any temporary allocations. @a *revision will
1442
1764
* be set to #SVN_INVALID_REVNUM for uncommitted nodes (i.e. modified nodes
1522
1856
/** Determine if the properties of two path/root combinations are different.
1524
* Set @a *changed_p to 1 if the properties at @a path1 under @a root1 differ
1525
* from those at @a path2 under @a root2, or set it to 0 if they are the
1526
* same. Both paths must exist under their respective roots, and both
1527
* roots must be in the same filesystem.
1858
* Set @a *different_p to #TRUE if the properties at @a path1 under @a root1
1859
* differ from those at @a path2 under @a root2, or set it to #FALSE if they
1860
* are the same. Both paths must exist under their respective roots, and
1861
* both roots must be in the same filesystem.
1862
* Do any necessary temporary allocation in @a scratch_pool.
1864
* @since New in 1.9.
1867
svn_fs_props_different(svn_boolean_t *different_p,
1868
svn_fs_root_t *root1,
1870
svn_fs_root_t *root2,
1872
apr_pool_t *scratch_pool);
1875
/** Determine if the properties of two path/root combinations are different.
1876
* In contrast to #svn_fs_props_different, we only perform a quick test and
1877
* allow for false positives.
1879
* Set @a *changed_p to #TRUE if the properties at @a path1 under @a root1
1880
* differ from those at @a path2 under @a root2, or set it to #FALSE if they
1881
* are the same. Both paths must exist under their respective roots, and
1882
* both roots must be in the same filesystem.
1883
* Do any necessary temporary allocation in @a pool.
1885
* @note The behavior is implementation dependent in that the false
1886
* positives reported may differ from release to release and backend to
1887
* backend. There is also no guarantee that there will be false positives
1890
* @note Prior to Subversion 1.9, this function would return false negatives
1891
* for FSFS: If @a root1 and @a root2 were both transaction roots
1892
* and the proplists of both paths had been changed in their respective
1893
* transactions, @a changed_p would be set to #FALSE.
1530
1896
svn_fs_props_changed(svn_boolean_t *changed_p,
1625
1991
* If @a adjust_inherited_mergeinfo is @c TRUE, then any inherited
1626
1992
* mergeinfo returned in @a *catalog is normalized to represent the
1627
* inherited mergeinfo on the path which inherits it. If
1993
* inherited mergeinfo on the path which inherits it. This adjusted
1994
* mergeinfo is keyed by the path which inherits it. If
1628
1995
* @a adjust_inherited_mergeinfo is @c FALSE, then any inherited
1629
1996
* mergeinfo is the raw explicit mergeinfo from the nearest parent
1630
1997
* of the path with explicit mergeinfo, unadjusted for the path-wise
1631
1998
* difference between the path and its parent. This may include
1632
* non-inheritable mergeinfo.
1999
* non-inheritable mergeinfo. This unadjusted mergeinfo is keyed by
2000
* the path at which it was found.
1634
2002
* If @a include_descendants is TRUE, then additionally return the
1635
2003
* mergeinfo for any descendant of any element of @a paths which has
1738
2106
const char *path,
1739
2107
apr_pool_t *pool);
2109
/** Take the #svn_fs_dirent_t structures in @a entries as returned by
2110
* #svn_fs_dir_entries for @a root and determine an optimized ordering
2111
* in which data access would most likely be efficient. Set @a *ordered_p
2112
* to a newly allocated APR array of pointers to these #svn_fs_dirent_t
2113
* structures. Allocate the array (but not its contents) in @a result_pool
2114
* and use @a scratch_pool for temporaries.
2116
* @since New in 1.9.
2119
svn_fs_dir_optimal_order(apr_array_header_t **ordered_p,
2120
svn_fs_root_t *root,
2121
apr_hash_t *entries,
2122
apr_pool_t *result_pool,
2123
apr_pool_t *scratch_pool);
1742
2125
/** Create a new directory named @a path in @a root. The new directory has
1743
2126
* no entries, and no properties. @a root must be the root of a transaction,
1921
2305
* upon doing so. Use @a pool for allocations.
1923
2307
* 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.
2308
* not be implemented for all data backends or not be applicable for certain
2309
* content. In those cases, @a *success will always be @c FALSE. Also,
2310
* this is a best-effort function which means that there is no guarantee
2311
* that @a processor gets called at all.
1929
* @note @a processor is expected to be relatively short function with
1930
* at most O(content size) runtime.
2313
* @note @a processor is expected to be a relatively simple function with
2314
* a runtime of O(content size) or less.
1932
2316
* @since New in 1.8.
2032
2413
/** Check if the contents of two root/path combos have changed.
2034
* Set @a *changed_p to 1 if the contents at @a path1 under @a root1 differ
2035
* from those at @a path2 under @a root2, or set it to 0 if they are the
2036
* same. Both paths must exist under their respective roots, and both
2037
* roots must be in the same filesystem.
2415
* Set @a *different_p to #TRUE if the file contents at @a path1 under
2416
* @a root1 differ from those at @a path2 under @a root2, or set it to
2417
* #FALSE if they are the same. Both paths must exist under their
2418
* respective roots, and both roots must be in the same filesystem.
2419
* Do any necessary temporary allocation in @a scratch_pool.
2421
* @since New in 1.9.
2424
svn_fs_contents_different(svn_boolean_t *different_p,
2425
svn_fs_root_t *root1,
2427
svn_fs_root_t *root2,
2429
apr_pool_t *scratch_pool);
2431
/** Check if the contents of two root/path combos have changed. In
2432
* contrast to #svn_fs_contents_different, we only perform a quick test
2433
* and allow for false positives.
2435
* Set @a *changed_p to #TRUE if the file contents at @a path1 under
2436
* @a root1 differ from those at @a path2 under @a root2, or set it to
2437
* #FALSE if they are the same. Both paths must exist under their
2438
* respective roots, and both roots must be in the same filesystem.
2439
* Do any necessary temporary allocation in @a pool.
2441
* @note The behavior is implementation dependent in that the false
2442
* positives reported may differ from release to release and backend to
2443
* backend. There is also no guarantee that there will be false positives
2040
2447
svn_fs_contents_changed(svn_boolean_t *changed_p,
2060
2467
apr_pool_t *pool);
2471
* Return filesystem format information for @a fs.
2473
* Set @a *fs_format to the filesystem format number of @a fs, which is
2474
* an integer that increases when incompatible changes are made (such as
2475
* by #svn_fs_upgrade).
2477
* Set @a *supports_version to the version number of the minimum Subversion GA
2478
* release that can read and write @a fs.
2480
* @see svn_repos_info_format
2482
* @since New in 1.9.
2485
svn_fs_info_format(int *fs_format,
2486
svn_version_t **supports_version,
2488
apr_pool_t *result_pool,
2489
apr_pool_t *scratch_pool);
2492
* Return a list of admin-serviceable config files for @a fs. @a *files
2493
* will be set to an array containing paths as C strings.
2495
* @since New in 1.9.
2498
svn_fs_info_config_files(apr_array_header_t **files,
2500
apr_pool_t *result_pool,
2501
apr_pool_t *scratch_pool);
2063
2505
/** Provide filesystem @a fs the opportunity to compress storage relating to
2064
2506
* associated with @a revision in filesystem @a fs. Use @a pool for all
2220
2656
* expiration error (depending on the API).
2224
/** Lock @a path in @a fs, and set @a *lock to a lock
2225
* representing the new lock, allocated in @a pool.
2227
* @warning You may prefer to use svn_repos_fs_lock() instead,
2659
/** Lock information for use with svn_fs_lock_many() [and svn_repos_fs_...].
2661
* @see svn_fs_lock_target_create
2663
* @since New in 1.9.
2665
typedef struct svn_fs_lock_target_t svn_fs_lock_target_t;
2667
/** Create an <tt>svn_fs_lock_target_t</tt> allocated in @a result_pool.
2668
* @a token can be NULL and @a current_rev can be SVN_INVALID_REVNUM.
2670
* The @a token is not duplicated and so must have a lifetime at least as
2671
* long as the returned target object.
2673
* @since New in 1.9.
2675
svn_fs_lock_target_t *svn_fs_lock_target_create(const char *token,
2676
svn_revnum_t current_rev,
2677
apr_pool_t *result_pool);
2679
/** Update @a target changing the token to @a token, @a token can be NULL.
2681
* The @a token is not duplicated and so must have a lifetime at least as
2682
* long as @a target.
2684
* @since New in 1.9.
2686
void svn_fs_lock_target_set_token(svn_fs_lock_target_t *target,
2689
/** The callback invoked by svn_fs_lock_many() and svn_fs_unlock_many().
2691
* @a path and @a lock are allocated in the result_pool passed to
2692
* svn_fs_lock_many/svn_fs_unlock_many and so will persist beyond the
2693
* callback invocation. @a fs_err will be cleared after the callback
2694
* returns, use svn_error_dup() to preserve the error.
2696
* If the callback returns an error no further callbacks will be made
2697
* and svn_fs_lock_many/svn_fs_unlock_many will return an error. The
2698
* caller cannot rely on any particular order for these callbacks and
2699
* cannot rely on interrupting the underlying operation by returning
2700
* an error. Returning an error stops the callbacks but any locks
2701
* that would have been reported in further callbacks may, or may not,
2702
* still be created/released.
2704
* @since New in 1.9.
2706
typedef svn_error_t *(*svn_fs_lock_callback_t)(void *baton,
2708
const svn_lock_t *lock,
2709
svn_error_t *fs_err,
2710
apr_pool_t *scratch_pool);
2712
/** Lock the paths in @a lock_targets in @a fs.
2230
2714
* @a fs must have a username associated with it (see
2231
2715
* #svn_fs_access_t), else return #SVN_ERR_FS_NO_USER. Set the
2232
* 'owner' field in the new lock to the fs username.
2716
* 'owner' field in each new lock to the fs username.
2234
2718
* @a comment is optional: it's either an xml-escapable UTF8 string
2235
2719
* which describes the lock, or it is @c NULL.
2238
2722
* generic DAV client; only mod_dav_svn's autoversioning feature needs
2239
2723
* to use it. If in doubt, pass 0.
2241
* If path is already locked, then return #SVN_ERR_FS_PATH_ALREADY_LOCKED,
2725
* The paths to be locked are passed as the <tt>const char *</tt> keys
2726
* of the @a lock_targets hash. The hash values are
2727
* <tt>svn_fs_lock_target_t *</tt> and provide the token and
2728
* @a current_rev for each path. The token is a lock token such as can
2729
* be generated using svn_fs_generate_lock_token() (indicating that
2730
* the caller wants to dictate the lock token used), or it is @c NULL
2731
* (indicating that the caller wishes to have a new token generated by
2732
* this function). If the token is not @c NULL, and represents an
2733
* existing lock, then the path must match the path associated with
2734
* that existing lock. If @a current_rev is a valid revnum, then do an
2735
* out-of-dateness check. If the revnum is less than the
2736
* last-changed-revision of the path (or if the path doesn't exist in
2737
* HEAD), yield an #SVN_ERR_FS_OUT_OF_DATE error for this path.
2739
* If a path is already locked, then yield #SVN_ERR_FS_PATH_ALREADY_LOCKED,
2242
2740
* unless @a steal_lock is TRUE, in which case "steal" the existing
2243
2741
* lock, even if the FS access-context's username does not match the
2244
* current lock's owner: delete the existing lock on @a path, and
2742
* current lock's owner: delete the existing lock on the path, and
2245
2743
* create a new one.
2247
* @a token is a lock token such as can be generated using
2248
* svn_fs_generate_lock_token() (indicating that the caller wants to
2249
* dictate the lock token used), or it is @c NULL (indicating that the
2250
* caller wishes to have a new token generated by this function). If
2251
* @a token is not @c NULL, and represents an existing lock, then @a
2252
* path must match the path associated with that existing lock.
2254
2745
* If @a expiration_date is zero, then create a non-expiring lock.
2255
2746
* Else, the lock will expire at @a expiration_date.
2257
* If @a current_rev is a valid revnum, then do an out-of-dateness
2258
* check. If the revnum is less than the last-changed-revision of @a
2259
* path (or if @a path doesn't exist in HEAD), return
2260
* #SVN_ERR_FS_OUT_OF_DATE.
2748
* For each path in @a lock_targets @a lock_callback will be invoked
2749
* passing @a lock_baton and the lock and error that apply to path.
2750
* @a lock_callback can be NULL in which case it is not called and any
2751
* errors that would have been passed to the callback are not reported.
2753
* The lock and path passed to @a lock_callback will be allocated in
2754
* @a result_pool. Use @a scratch_pool for temporary allocations.
2262
2756
* @note At this time, only files can be locked.
2758
* @note This function is not atomic. If it returns an error, some targets
2759
* may remain unlocked while others may have been locked.
2761
* @note You probably don't want to use this directly. Take a look at
2762
* svn_repos_fs_lock_many() instead.
2764
* @since New in 1.9.
2767
svn_fs_lock_many(svn_fs_t *fs,
2768
apr_hash_t *lock_targets,
2769
const char *comment,
2770
svn_boolean_t is_dav_comment,
2771
apr_time_t expiration_date,
2772
svn_boolean_t steal_lock,
2773
svn_fs_lock_callback_t lock_callback,
2775
apr_pool_t *result_pool,
2776
apr_pool_t *scratch_pool);
2778
/** Similar to svn_fs_lock_many() but locks only a single @a path and
2779
* returns the lock in @a *lock, allocated in @a pool, or an error.
2781
* @since New in 1.2.
2265
2784
svn_fs_lock(svn_lock_t **lock,
2286
2805
apr_pool_t *pool);
2289
/** Remove the lock on @a path represented by @a token in @a fs.
2291
* If @a token doesn't point to a lock, return #SVN_ERR_FS_BAD_LOCK_TOKEN.
2292
* If @a token points to an expired lock, return #SVN_ERR_FS_LOCK_EXPIRED.
2293
* If @a fs has no username associated with it, return #SVN_ERR_FS_NO_USER
2294
* unless @a break_lock is specified.
2296
* If @a token points to a lock, but the username of @a fs's access
2297
* context doesn't match the lock's owner, return
2298
* #SVN_ERR_FS_LOCK_OWNER_MISMATCH. If @a break_lock is TRUE, however, don't
2299
* return error; allow the lock to be "broken" in any case. In the latter
2300
* case, @a token shall be @c NULL.
2302
* Use @a pool for temporary allocations.
2808
/** Remove the locks on the paths in @a unlock_targets in @a fs.
2810
* The paths to be unlocked are passed as <tt>const char *</tt> keys
2811
* of the @a unlock_targets hash with the corresponding lock tokens as
2812
* <tt>const char *</tt> values. If the token doesn't point to a
2813
* lock, yield an #SVN_ERR_FS_BAD_LOCK_TOKEN error for this path. If
2814
* the token points to an expired lock, yield an
2815
* #SVN_ERR_FS_LOCK_EXPIRED error for this path. If @a fs has no
2816
* username associated with it, yield an #SVN_ERR_FS_NO_USER unless @a
2817
* break_lock is specified.
2819
* If the token points to a lock, but the username of @a fs's access
2820
* context doesn't match the lock's owner, yield an
2821
* #SVN_ERR_FS_LOCK_OWNER_MISMATCH. If @a break_lock is TRUE,
2822
* however, don't return error; allow the lock to be "broken" in any
2823
* case. In the latter case, the token shall be @c NULL.
2825
* For each path in @a unlock_targets @a lock_callback will be invoked
2826
* passing @a lock_baton and error that apply to path. The @a lock
2827
* passed to the callback will be NULL. @a lock_callback can be NULL
2828
* in which case it is not called and any errors that would have been
2829
* passed to the callback are not reported.
2831
* The path passed to lock_callback will be allocated in @a result_pool.
2832
* Use @a scratch_pool for temporary allocations.
2834
* @note This function is not atomic. If it returns an error, some targets
2835
* may remain locked while others may have been unlocked.
2837
* @note You probably don't want to use this directly. Take a look at
2838
* svn_repos_fs_unlock_many() instead.
2840
* @since New in 1.9.
2843
svn_fs_unlock_many(svn_fs_t *fs,
2844
apr_hash_t *unlock_targets,
2845
svn_boolean_t break_lock,
2846
svn_fs_lock_callback_t lock_callback,
2848
apr_pool_t *result_pool,
2849
apr_pool_t *scratch_pool);
2851
/** Similar to svn_fs_unlock_many() but only unlocks a single path.
2853
* @since New in 1.2.
2305
2856
svn_fs_unlock(svn_fs_t *fs,
3078
* @defgroup fs_info Filesystem information subsystem
3083
* A structure that provides some information about a filesystem.
3084
* Returned by svn_fs_info() for #SVN_FS_TYPE_FSFS filesystems.
3086
* @note Fields may be added to the end of this structure in future
3087
* versions. Therefore, users shouldn't allocate structures of this
3088
* type, to preserve binary compatibility.
3090
* @since New in 1.9.
3092
typedef struct svn_fs_fsfs_info_t {
3094
/** Filesystem backend (#fs_type), i.e., the string #SVN_FS_TYPE_FSFS. */
3095
const char *fs_type;
3097
/** Shard size, or 0 if the filesystem is not currently sharded. */
3100
/** The smallest revision (as #svn_revnum_t) which is not in a pack file.
3101
* @note Zero (0) if (but not iff) the format does not support packing. */
3102
svn_revnum_t min_unpacked_rev;
3104
/** TRUE if logical addressing is enabled for this repository.
3105
* FALSE if repository uses physical addressing. */
3106
svn_boolean_t log_addressing;
3107
/* ### TODO: information about fsfs.conf? rep-cache.db? write locks? */
3109
/* If you add fields here, check whether you need to extend svn_fs_info()
3110
or svn_fs_info_dup(). */
3111
} svn_fs_fsfs_info_t;
3114
* A structure that provides some information about a filesystem.
3115
* Returned by svn_fs_info() for #SVN_FS_TYPE_FSX filesystems.
3117
* @note Fields may be added to the end of this structure in future
3118
* versions. Therefore, users shouldn't allocate structures of this
3119
* type, to preserve binary compatibility.
3121
* @since New in 1.9.
3123
typedef struct svn_fs_fsx_info_t {
3125
/** Filesystem backend (#fs_type), i.e., the string #SVN_FS_TYPE_FSX. */
3126
const char *fs_type;
3128
/** Shard size, always > 0. */
3131
/** The smallest revision which is not in a pack file. */
3132
svn_revnum_t min_unpacked_rev;
3134
/* If you add fields here, check whether you need to extend svn_fs_info()
3135
or svn_fs_info_dup(). */
3137
} svn_fs_fsx_info_t;
3139
/** @see svn_fs_info
3140
* @since New in 1.9. */
3141
typedef struct svn_fs_info_placeholder_t {
3142
/** @see svn_fs_type */
3143
const char *fs_type;
3145
/* Do not add new fields here, to maintain compatibility with the first
3146
released version of svn_fs_fsfs_info_t. */
3147
} svn_fs_info_placeholder_t;
3150
* Set @a *fs_info to a struct describing @a fs. The type of the
3151
* struct depends on the backend: for #SVN_FS_TYPE_FSFS, the struct will be
3152
* of type #svn_fs_fsfs_info_t; for #SVN_FS_TYPE_FSX, it will be of type
3153
* #svn_fs_fsx_info_t; otherwise, the struct is guaranteed to be
3154
* (compatible with) #svn_fs_info_placeholder_t.
3156
* @see #svn_fs_fsfs_info_t, #svn_fs_fsx_info_t
3158
* @since New in 1.9.
3161
svn_fs_info(const svn_fs_info_placeholder_t **fs_info,
3163
apr_pool_t *result_pool,
3164
apr_pool_t *scratch_pool);
3167
* Return a duplicate of @a info, allocated in @a result_pool. The returned
3168
* struct will be of the same type as the passed-in struct, which itself
3169
* must have been returned from svn_fs_info() or svn_fs_info_dup(). No part
3170
* of the new structure will be shared with @a info (except static string
3171
* constants). Use @a scratch_pool for temporary allocations.
3173
* @see #svn_fs_info_placeholder_t, #svn_fs_fsfs_info_t
3175
* @since New in 1.9.
3178
svn_fs_info_dup(const void *info,
3179
apr_pool_t *result_pool,
3180
apr_pool_t *scratch_pool);
2526
3184
#ifdef __cplusplus
2528
3186
#endif /* __cplusplus */