~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/include/svn_fs.h

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
/** An object representing a Subversion filesystem.  */
66
66
typedef struct svn_fs_t svn_fs_t;
67
67
 
 
68
/**
 
69
 * @defgroup svn_fs_backend_names Built-in back-ends
 
70
 * Constants defining the currently supported built-in filesystem backends.
 
71
 *
 
72
 * @see svn_fs_type
 
73
 * @{
 
74
 */
 
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"
 
79
 
 
80
/**
 
81
 * EXPERIMENTAL filesystem backend.
 
82
 *
 
83
 * It is not ready for general production use.  Please consult the
 
84
 * respective release notes on suggested usage scenarios.
 
85
 *
 
86
 * @since New in 1.9.
 
87
 */
 
88
#define SVN_FS_TYPE_FSX                         "fsx"
 
89
 
 
90
/** @} */
 
91
 
68
92
 
69
93
/**
70
94
 * @name Filesystem configuration options
110
134
 */
111
135
#define SVN_FS_CONFIG_FSFS_CACHE_NS             "fsfs-cache-namespace"
112
136
 
 
137
/** Enable / disable the FSFS format 7 "block read" feature.
 
138
 *
 
139
 * @since New in 1.9.
 
140
 */
 
141
#define SVN_FS_CONFIG_FSFS_BLOCK_READ           "fsfs-block-read"
 
142
 
 
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.
 
145
 *
 
146
 * This option will only be used during the creation of new repositories
 
147
 * and is otherwise ignored.
 
148
 *
 
149
 * @since New in 1.9.
 
150
 */
 
151
#define SVN_FS_CONFIG_FSFS_SHARD_SIZE           "fsfs-shard-size"
 
152
 
 
153
/** Enable / disable the FSFS format 7 logical addressing feature for a
 
154
 * newly created repository.
 
155
 *
 
156
 * This option will only be used during the creation of new repositories
 
157
 * and is otherwise ignored.
 
158
 *
 
159
 * @since New in 1.9.
 
160
 */
 
161
#define SVN_FS_CONFIG_FSFS_LOG_ADDRESSING       "fsfs-log-addressing"
 
162
 
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(). */
115
165
 
116
 
/* See also svn_fs_type(). */
117
 
/** @since New in 1.1. */
 
166
/** Select the filesystem type. See also #svn_fs_type().
 
167
 *
 
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"
123
170
 
124
171
/** Create repository format compatible with Subversion versions
125
172
 * earlier than 1.4.
148
195
 * @since New in 1.8.
149
196
 */
150
197
#define SVN_FS_CONFIG_PRE_1_8_COMPATIBLE        "pre-1.8-compatible"
 
198
 
 
199
/** Create repository format compatible with the specified Subversion
 
200
 * release.  The value must be a version in the same format as
 
201
 * #SVN_VER_NUMBER and cannot exceed the current version.
 
202
 *
 
203
 * @note The @c patch component would often be ignored, due to our forward
 
204
 * compatibility promises within minor release lines.  It should therefore
 
205
 * usually be set to @c 0.
 
206
 *
 
207
 * @since New in 1.9.
 
208
 */
 
209
#define SVN_FS_CONFIG_COMPATIBLE_VERSION        "compatible-version"
151
210
/** @} */
152
211
 
153
212
 
222
281
 *
223
282
 *   SVN_FS_TYPE_BDB   Berkeley-DB implementation
224
283
 *   SVN_FS_TYPE_FSFS  Native-filesystem implementation
 
284
 *   SVN_FS_TYPE_FSX   Experimental filesystem implementation
225
285
 *
226
286
 * If @a fs_config is @c NULL or does not contain a value for
227
287
 * #SVN_FS_CONFIG_FS_TYPE then the default filesystem type will be used.
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.
247
308
 *
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.
251
312
 *
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.
255
316
 *
256
317
 * @note You probably don't want to use this directly.  Take a look at
257
 
 * svn_repos_open2() instead.
258
 
 *
 
318
 * svn_repos_open3() instead.
 
319
 *
 
320
 * @since New in 1.9.
 
321
 */
 
322
svn_error_t *
 
323
svn_fs_open2(svn_fs_t **fs_p,
 
324
             const char *path,
 
325
             apr_hash_t *fs_config,
 
326
             apr_pool_t *result_pool,
 
327
             apr_pool_t *scratch_pool);
 
328
 
 
329
/**
 
330
 * Like svn_fs_open2(), but without @a scratch_pool.
 
331
 *
 
332
 * @deprecated Provided for backward compatibility with the 1.8 API.
259
333
 * @since New in 1.1.
260
334
 */
 
335
SVN_DEPRECATED
261
336
svn_error_t *
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);
266
341
 
 
342
/** The kind of action being taken by 'upgrade'.
 
343
 *
 
344
 * @since New in 1.9.
 
345
 */
 
346
typedef enum svn_fs_upgrade_notify_action_t
 
347
{
 
348
  /** Packing of the revprop shard has completed.
 
349
   *  The number parameter is the shard being processed. */
 
350
  svn_fs_upgrade_pack_revprops = 0,
 
351
 
 
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,
 
355
 
 
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;
 
360
 
 
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.
 
366
 *
 
367
 * @since New in 1.9.
 
368
 */
 
369
typedef svn_error_t *(*svn_fs_upgrade_notify_t)(void *baton,
 
370
                                      apr_uint64_t number,
 
371
                                      svn_fs_upgrade_notify_action_t action,
 
372
                                      apr_pool_t *scratch_pool);
 
373
 
267
374
/**
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.
 
380
 *
 
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.
 
384
 *
 
385
 * The optional @a cancel_func callback will be invoked as usual to allow
 
386
 * the user to preempt this potentially lengthy operation.
273
387
 *
274
388
 * @note You probably don't want to use this directly.  Take a look at
275
 
 * svn_repos_upgrade() instead.
276
 
 *
 
389
 * svn_repos_upgrade2() instead.
 
390
 *
 
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.
 
393
 *
 
394
 * @since New in 1.9.
 
395
 */
 
396
svn_error_t *
 
397
svn_fs_upgrade2(const char *path,
 
398
                svn_fs_upgrade_notify_t notify_func,
 
399
                void *notify_baton,
 
400
                svn_cancel_func_t cancel_func,
 
401
                void *cancel_baton,
 
402
                apr_pool_t *scratch_pool);
 
403
 
 
404
/**
 
405
 * Like svn_fs_upgrade2 but with notify_func, notify_baton, cancel_func
 
406
 * and cancel_baton being set to NULL.
 
407
 *
 
408
 * @deprecated Provided for backward compatibility with the 1.8 API.
277
409
 * @since New in 1.5.
278
410
 */
 
411
SVN_DEPRECATED
279
412
svn_error_t *
280
413
svn_fs_upgrade(const char *path,
281
414
               apr_pool_t *pool);
283
416
/**
284
417
 * Callback function type for progress notification.
285
418
 *
286
 
 * @a revision is the number of the revision currently begin processed,
 
419
 * @a revision is the number of the revision currently being processed,
287
420
 * #SVN_INVALID_REVNUM if the current stage is not linked to any specific
288
421
 * revision. @a baton is the callback baton.
289
422
 *
328
461
 * Return a shallow copy of the configuration parameters used to open
329
462
 * @a fs, allocated in @a pool.  It may be @c NULL.  The contents of the
330
463
 * hash contents remains valid only for @a fs's lifetime.
331
 
 * 
 
464
 *
332
465
 * @note This is just what was passed to svn_fs_create() or svn_fs_open().
333
466
 * You may not modify it.
334
467
 *
351
484
svn_fs_delete_fs(const char *path,
352
485
                 apr_pool_t *pool);
353
486
 
 
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
 
491
 * invocations.
 
492
 */
 
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);
 
497
 
354
498
/**
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.
365
509
 *
 
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.
 
515
 *
 
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
 
518
 * lengthy operation.
 
519
 *
366
520
 * Use @a scratch_pool for temporary allocations.
367
521
 *
 
522
 * @since New in 1.9.
 
523
 */
 
524
svn_error_t *
 
525
svn_fs_hotcopy3(const char *src_path,
 
526
                const char *dest_path,
 
527
                svn_boolean_t clean,
 
528
                svn_boolean_t incremental,
 
529
                svn_fs_hotcopy_notify_t notify_func,
 
530
                void *notify_baton,
 
531
                svn_cancel_func_t cancel_func,
 
532
                void *cancel_baton,
 
533
                apr_pool_t *scratch_pool);
 
534
 
 
535
/**
 
536
 * Like svn_fs_hotcopy3(), but with @a notify_func and @a notify_baton
 
537
 * always passed as @c NULL.
 
538
 *
 
539
 * @deprecated Provided for backward compatibility with the 1.8 API.
368
540
 * @since New in 1.8.
369
541
 */
 
542
SVN_DEPRECATED
370
543
svn_error_t *
371
544
svn_fs_hotcopy2(const char *src_path,
372
545
                const char *dest_path,
443
616
 * Take an exclusive lock on @a fs to prevent commits and then invoke
444
617
 * @a freeze_func passing @a freeze_baton.
445
618
 *
 
619
 * @note @a freeze_func must not, directly or indirectly, call any function
 
620
 * that attempts to take out a lock on the underlying repository.  These
 
621
 * include functions for packing, hotcopying, setting revprops and commits.
 
622
 * Attempts to do so may result in a deadlock.
 
623
 *
446
624
 * @note The BDB backend doesn't implement this feature so most
447
625
 * callers should not call this function directly but should use the
448
626
 * higher level svn_repos_freeze() instead.
710
888
 * @{
711
889
 */
712
890
 
 
891
/** Defines the possible ways two arbitrary (root, path)-pairs may be
 
892
 * related.
 
893
 *
 
894
 * @since New in 1.9.
 
895
 */
 
896
typedef enum svn_fs_node_relation_t
 
897
{
 
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.
 
902
   */
 
903
  svn_fs_node_unrelated = 0,
 
904
 
 
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
 
909
   * common ancestor.
 
910
   *
 
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.
 
914
   */
 
915
  svn_fs_node_unchanged,
 
916
 
 
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.
 
920
   *
 
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).
 
924
   */
 
925
  svn_fs_node_common_ancestor
 
926
 
 
927
} svn_fs_node_relation_t;
 
928
 
713
929
/** An object representing a node-revision id.  */
714
930
typedef struct svn_fs_id_t svn_fs_id_t;
715
931
 
716
932
 
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).
 
935
 *
 
936
 * @note Consider using the more expressive #svn_fs_node_relation() instead.
 
937
 *
 
938
 * @see #svn_fs_node_relation
719
939
 */
720
940
int
721
941
svn_fs_compare_ids(const svn_fs_id_t *a,
725
945
 
726
946
/** Return TRUE if node revisions @a id1 and @a id2 are related (part of the
727
947
 * same node), else return FALSE.
 
948
 *
 
949
 * @note Consider using the more expressive #svn_fs_node_relation() instead.
 
950
 *
 
951
 * @see #svn_fs_node_relation
728
952
 */
729
953
svn_boolean_t
730
954
svn_fs_check_related(const svn_fs_id_t *id1,
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.)
834
1057
 *
835
1058
 * Transaction names are guaranteed to contain only letters (upper-
836
1059
 * and lower-case), digits, `-', and `.', from the ASCII character
872
1095
 */
873
1096
#define SVN_FS_TXN_CHECK_LOCKS                   0x00002
874
1097
 
 
1098
/** Allow the client to specify the final svn:date of the revision by
 
1099
 * setting or deleting the corresponding transaction property rather
 
1100
 * than have it set automatically when the transaction is committed.
 
1101
 *
 
1102
 * @since New in 1.9.
 
1103
 */
 
1104
#define SVN_FS_TXN_CLIENT_DATE                   0x00004
 
1105
 
875
1106
/** @} */
876
1107
 
877
1108
/**
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.
927
1158
 *
 
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.
 
1164
 *
 
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
 
1168
 * lost.
 
1169
 *
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
962
1204
 * ###     conflict string
963
1205
 * ###   *new_rev will always be initialized to SVN_INVALID_REVNUM, or
964
1206
 * ###     to a valid, committed revision number
 
1207
 *
965
1208
 */
966
1209
svn_error_t *
967
1210
svn_fs_commit_txn(const char **conflict_p,
1218
1461
 
1219
1462
  /** ignore all previous change items for path (internal-use only) */
1220
1463
  svn_fs_path_change_reset
1221
 
 
1222
1464
} svn_fs_path_change_kind_t;
1223
1465
 
1224
1466
/** Change descriptor.
1227
1469
 * versions.  Therefore, to preserve binary compatibility, users
1228
1470
 * should not directly allocate structures of this type.
1229
1471
 *
 
1472
 * @note The @c text_mod, @c prop_mod and @c mergeinfo_mod flags mean the
 
1473
 * text, properties and mergeinfo property (respectively) were "touched"
 
1474
 * by the commit API; this does not mean the new value is different from
 
1475
 * the old value.
 
1476
 *
1230
1477
 * @since New in 1.6. */
1231
1478
typedef struct svn_fs_path_change2_t
1232
1479
{
1236
1483
  /** kind of change */
1237
1484
  svn_fs_path_change_kind_t change_kind;
1238
1485
 
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.
 
1493
   */
1240
1494
  svn_boolean_t text_mod;
1241
1495
 
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.
 
1502
   */
1243
1503
  svn_boolean_t prop_mod;
1244
1504
 
1245
1505
  /** what node kind is the path?
1252
1512
  svn_revnum_t copyfrom_rev;
1253
1513
  const char *copyfrom_path;
1254
1514
 
 
1515
  /** was the mergeinfo property touched?
 
1516
   *   modify:      } true iff svn:mergeinfo property add/del/mod
 
1517
   *   add (copy):  }          and fs format supports this flag.
 
1518
   *   add (plain): }
 
1519
   *   delete:      always false.
 
1520
   *   replace:     as for the add/copy part of the replacement.
 
1521
   * (Note: Pre-1.9 repositories will report #svn_tristate_unknown.)
 
1522
   * @since New in 1.9. */
 
1523
  svn_tristate_t mergeinfo_mod;
1255
1524
  /* NOTE! Please update svn_fs_path_change2_create() when adding new
1256
1525
     fields here. */
1257
1526
} svn_fs_path_change2_t;
1349
1618
 
1350
1619
/** Set @a *history_p to an opaque node history object which
1351
1620
 * represents @a path under @a root.  @a root must be a revision root.
1352
 
 * Use @a pool for all allocations.
1353
 
 */
 
1621
 * Allocate the result in @a result_pool and use @a scratch_pool for
 
1622
 * temporary allocations.
 
1623
 *
 
1624
 * @since New in 1.9.
 
1625
 */
 
1626
svn_error_t *
 
1627
svn_fs_node_history2(svn_fs_history_t **history_p,
 
1628
                     svn_fs_root_t *root,
 
1629
                     const char *path,
 
1630
                     apr_pool_t *result_pool,
 
1631
                     apr_pool_t *scratch_pool);
 
1632
 
 
1633
/** Same as svn_fs_node_history2() but using a single @a pool for all
 
1634
 * allocations.
 
1635
 *
 
1636
 * @deprecated Provided for backward compatibility with the 1.8 API.
 
1637
 */
 
1638
SVN_DEPRECATED
1354
1639
svn_error_t *
1355
1640
svn_fs_node_history(svn_fs_history_t **history_p,
1356
1641
                    svn_fs_root_t *root,
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.
 
1672
 *
 
1673
 * Allocate the result in @a result_pool and use @a scratch_pool for
 
1674
 * temporary allocations.
 
1675
 *
 
1676
 * @since New in 1.9. */
 
1677
svn_error_t *
 
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);
 
1683
 
 
1684
/** Same as svn_fs_history_prev2() but using a single @a pool for all
 
1685
 * allocations.
 
1686
 *
 
1687
 * @deprecated Provided for backward compatibility with the 1.8 API.
 
1688
 */
 
1689
SVN_DEPRECATED
1387
1690
svn_error_t *
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);
1439
1742
 
 
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.
 
1748
 *
 
1749
 * @note Paths from different svn_fs_t will be reported as unrelated even
 
1750
 * if the underlying physical repository is the same.
 
1751
 *
 
1752
 * @since New in 1.9.
 
1753
 */
 
1754
svn_error_t *
 
1755
svn_fs_node_relation(svn_fs_node_relation_t *relation,
 
1756
                     svn_fs_root_t *root_a,
 
1757
                     const char *path_a,
 
1758
                     svn_fs_root_t *root_b,
 
1759
                     const char *path_b,
 
1760
                     apr_pool_t *scratch_pool);
 
1761
 
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
1501
1823
                     const char *path,
1502
1824
                     apr_pool_t *pool);
1503
1825
 
 
1826
/** Set @a *has_props to TRUE if the node @a path in @a root has properties
 
1827
 * and to FALSE if it doesn't have properties. Perform temporary allocations
 
1828
 * in @a scratch_pool.
 
1829
 *
 
1830
 * @since New in 1.9.
 
1831
 */
 
1832
svn_error_t *
 
1833
svn_fs_node_has_props(svn_boolean_t *has_props,
 
1834
                      svn_fs_root_t *root,
 
1835
                      const char *path,
 
1836
                      apr_pool_t *scratch_pool);
 
1837
 
1504
1838
 
1505
1839
/** Change a node's property's value, or add/delete a property.
1506
1840
 *
1521
1855
 
1522
1856
/** Determine if the properties of two path/root combinations are different.
1523
1857
 *
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.
 
1863
 *
 
1864
 * @since New in 1.9.
 
1865
 */
 
1866
svn_error_t *
 
1867
svn_fs_props_different(svn_boolean_t *different_p,
 
1868
                       svn_fs_root_t *root1,
 
1869
                       const char *path1,
 
1870
                       svn_fs_root_t *root2,
 
1871
                       const char *path2,
 
1872
                       apr_pool_t *scratch_pool);
 
1873
 
 
1874
 
 
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.
 
1878
 *
 
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.
 
1884
 *
 
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
 
1888
 * at all.
 
1889
 *
 
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.
1528
1894
 */
1529
1895
svn_error_t *
1530
1896
svn_fs_props_changed(svn_boolean_t *changed_p,
1624
1990
 *
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.
1633
2001
 *
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);
1740
2108
 
 
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.
 
2115
 *
 
2116
 * @since New in 1.9.
 
2117
 */
 
2118
svn_error_t *
 
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);
1741
2124
 
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,
1811
2194
                     svn_fs_root_t *to_root,
1812
2195
                     const char *path,
1813
2196
                     apr_pool_t *pool);
 
2197
 
1814
2198
 
1815
2199
/* Files.  */
1816
2200
 
1921
2305
 * upon doing so.  Use @a pool for allocations.
1922
2306
 *
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.
1928
2312
 *
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.
1931
2315
 *
1932
2316
 * @since New in 1.8.
1933
2317
 */
2015
2399
 *
2016
2400
 * Do any necessary temporary allocation in @a pool.
2017
2401
 *
2018
 
 * ### This is like svn_fs_apply_textdelta(), but takes the text
2019
 
 * straight.  It is currently used only by the loader, see
2020
 
 * libsvn_repos/load.c.  It should accept a checksum, of course, which
2021
 
 * would come from an (optional) header in the dump file.  See
2022
 
 * http://subversion.tigris.org/issues/show_bug.cgi?id=1102 for more.
 
2402
 * @note This is like svn_fs_apply_textdelta(), but takes the text
 
2403
 * straight.
2023
2404
 */
2024
2405
svn_error_t *
2025
2406
svn_fs_apply_text(svn_stream_t **contents_p,
2031
2412
 
2032
2413
/** Check if the contents of two root/path combos have changed.
2033
2414
 *
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.
 
2420
 *
 
2421
 * @since New in 1.9.
 
2422
 */
 
2423
svn_error_t *
 
2424
svn_fs_contents_different(svn_boolean_t *different_p,
 
2425
                          svn_fs_root_t *root1,
 
2426
                          const char *path1,
 
2427
                          svn_fs_root_t *root2,
 
2428
                          const char *path2,
 
2429
                          apr_pool_t *scratch_pool);
 
2430
 
 
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.
 
2434
 *
 
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.
 
2440
 *
 
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
 
2444
 * at all.
2038
2445
 */
2039
2446
svn_error_t *
2040
2447
svn_fs_contents_changed(svn_boolean_t *changed_p,
2060
2467
                    apr_pool_t *pool);
2061
2468
 
2062
2469
 
 
2470
/**
 
2471
 * Return filesystem format information for @a fs.
 
2472
 *
 
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).
 
2476
 *
 
2477
 * Set @a *supports_version to the version number of the minimum Subversion GA
 
2478
 * release that can read and write @a fs.
 
2479
 *
 
2480
 * @see svn_repos_info_format
 
2481
 *
 
2482
 * @since New in 1.9.
 
2483
 */
 
2484
svn_error_t *
 
2485
svn_fs_info_format(int *fs_format,
 
2486
                   svn_version_t **supports_version,
 
2487
                   svn_fs_t *fs,
 
2488
                   apr_pool_t *result_pool,
 
2489
                   apr_pool_t *scratch_pool);
 
2490
 
 
2491
/**
 
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.
 
2494
 *
 
2495
 * @since New in 1.9.
 
2496
 */
 
2497
svn_error_t *
 
2498
svn_fs_info_config_files(apr_array_header_t **files,
 
2499
                         svn_fs_t *fs,
 
2500
                         apr_pool_t *result_pool,
 
2501
                         apr_pool_t *scratch_pool);
 
2502
 
 
2503
 
 
2504
 
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
2065
2507
 * allocations.
2186
2628
                apr_pool_t *pool);
2187
2629
 
2188
2630
 
2189
 
/* Non-historical properties.  */
2190
 
 
2191
 
/* [[Yes, do tell.]] */
2192
 
 
2193
 
 
2194
 
 
2195
2631
/** @defgroup svn_fs_locks Filesystem locks
2196
2632
 * @{
2197
2633
 * @since New in 1.2. */
2210
2646
 * mainly due to the serialization for tokens for pre-commit hook.
2211
2647
 *
2212
2648
 * Locks are not secret; anyone can view existing locks in a
2213
 
 * filesystem.  Locks are not omnipotent: they can broken and stolen
 
2649
 * filesystem.  Locks are not omnipotent: they can be broken and stolen
2214
2650
 * by people who don't "own" the lock.  (Though admins can tailor a
2215
2651
 * custom break/steal policy via libsvn_repos pre-lock hook script.)
2216
2652
 *
2220
2656
 * expiration error (depending on the API).
2221
2657
 */
2222
2658
 
2223
 
 
2224
 
/** Lock @a path in @a fs, and set @a *lock to a lock
2225
 
 * representing the new lock, allocated in @a pool.
2226
 
 *
2227
 
 * @warning You may prefer to use svn_repos_fs_lock() instead,
2228
 
 * which see.
 
2659
/** Lock information for use with svn_fs_lock_many() [and svn_repos_fs_...].
 
2660
 *
 
2661
 * @see svn_fs_lock_target_create
 
2662
 *
 
2663
 * @since New in 1.9.
 
2664
 */
 
2665
typedef struct svn_fs_lock_target_t svn_fs_lock_target_t;
 
2666
 
 
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.
 
2669
 *
 
2670
 * The @a token is not duplicated and so must have a lifetime at least as
 
2671
 * long as the returned target object.
 
2672
 *
 
2673
 * @since New in 1.9.
 
2674
 */
 
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);
 
2678
 
 
2679
/** Update @a target changing the token to @a token, @a token can be NULL.
 
2680
 *
 
2681
 * The @a token is not duplicated and so must have a lifetime at least as
 
2682
 * long as @a target.
 
2683
 *
 
2684
 * @since New in 1.9.
 
2685
 */
 
2686
void svn_fs_lock_target_set_token(svn_fs_lock_target_t *target,
 
2687
                                  const char *token);
 
2688
 
 
2689
/** The callback invoked by svn_fs_lock_many() and svn_fs_unlock_many().
 
2690
 *
 
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.
 
2695
 *
 
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.
 
2703
 *
 
2704
 * @since New in 1.9.
 
2705
 */
 
2706
typedef svn_error_t *(*svn_fs_lock_callback_t)(void *baton,
 
2707
                                               const char *path,
 
2708
                                               const svn_lock_t *lock,
 
2709
                                               svn_error_t *fs_err,
 
2710
                                               apr_pool_t *scratch_pool);
 
2711
 
 
2712
/** Lock the paths in @a lock_targets in @a fs.
2229
2713
 *
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.
2233
2717
 *
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.
2240
2724
 *
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.
 
2738
 *
 
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.
2246
2744
 *
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.
2253
 
 *
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.
2256
2747
 *
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.
 
2752
 *
 
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.
2261
2755
 *
2262
2756
 * @note At this time, only files can be locked.
 
2757
 *
 
2758
 * @note This function is not atomic.  If it returns an error, some targets
 
2759
 * may remain unlocked while others may have been locked.
 
2760
 *
 
2761
 * @note You probably don't want to use this directly.  Take a look at
 
2762
 * svn_repos_fs_lock_many() instead.
 
2763
 *
 
2764
 * @since New in 1.9.
 
2765
 */
 
2766
svn_error_t *
 
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,
 
2774
                 void *lock_baton,
 
2775
                 apr_pool_t *result_pool,
 
2776
                 apr_pool_t *scratch_pool);
 
2777
 
 
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.
 
2780
 *
 
2781
 * @since New in 1.2.
2263
2782
 */
2264
2783
svn_error_t *
2265
2784
svn_fs_lock(svn_lock_t **lock,
2286
2805
                           apr_pool_t *pool);
2287
2806
 
2288
2807
 
2289
 
/** Remove the lock on @a path represented by @a token in @a fs.
2290
 
 *
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.
2295
 
 *
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.
2301
 
 *
2302
 
 * Use @a pool for temporary allocations.
 
2808
/** Remove the locks on the paths in @a unlock_targets in @a fs.
 
2809
 *
 
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.
 
2818
 *
 
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.
 
2824
 *
 
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.
 
2830
 *
 
2831
 * The path passed to lock_callback will be allocated in @a result_pool.
 
2832
 * Use @a scratch_pool for temporary allocations.
 
2833
 *
 
2834
 * @note This function is not atomic.  If it returns an error, some targets
 
2835
 * may remain locked while others may have been unlocked.
 
2836
 *
 
2837
 * @note You probably don't want to use this directly.  Take a look at
 
2838
 * svn_repos_fs_unlock_many() instead.
 
2839
 *
 
2840
 * @since New in 1.9.
 
2841
 */
 
2842
svn_error_t *
 
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,
 
2847
                   void *lock_baton,
 
2848
                   apr_pool_t *result_pool,
 
2849
                   apr_pool_t *scratch_pool);
 
2850
 
 
2851
/** Similar to svn_fs_unlock_many() but only unlocks a single path.
 
2852
 *
 
2853
 * @since New in 1.2.
2303
2854
 */
2304
2855
svn_error_t *
2305
2856
svn_fs_unlock(svn_fs_t *fs,
2312
2863
/** If @a path is locked in @a fs, set @a *lock to an svn_lock_t which
2313
2864
 *  represents the lock, allocated in @a pool.
2314
2865
 *
2315
 
 * If @a path is not locked, set @a *lock to NULL.
 
2866
 * If @a path is not locked or does not exist in HEAD, set @a *lock to NULL.
2316
2867
 */
2317
2868
svn_error_t *
2318
2869
svn_fs_get_lock(svn_lock_t **lock,
2523
3074
 
2524
3075
/** @} */
2525
3076
 
 
3077
/**
 
3078
 * @defgroup fs_info Filesystem information subsystem
 
3079
 * @{
 
3080
 */
 
3081
 
 
3082
/**
 
3083
 * A structure that provides some information about a filesystem.
 
3084
 * Returned by svn_fs_info() for #SVN_FS_TYPE_FSFS filesystems.
 
3085
 *
 
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.
 
3089
 *
 
3090
 * @since New in 1.9.
 
3091
 */
 
3092
typedef struct svn_fs_fsfs_info_t {
 
3093
 
 
3094
  /** Filesystem backend (#fs_type), i.e., the string #SVN_FS_TYPE_FSFS. */
 
3095
  const char *fs_type;
 
3096
 
 
3097
  /** Shard size, or 0 if the filesystem is not currently sharded. */
 
3098
  int shard_size;
 
3099
 
 
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;
 
3103
 
 
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? */
 
3108
 
 
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;
 
3112
 
 
3113
/**
 
3114
 * A structure that provides some information about a filesystem.
 
3115
 * Returned by svn_fs_info() for #SVN_FS_TYPE_FSX filesystems.
 
3116
 *
 
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.
 
3120
 *
 
3121
 * @since New in 1.9.
 
3122
 */
 
3123
typedef struct svn_fs_fsx_info_t {
 
3124
 
 
3125
  /** Filesystem backend (#fs_type), i.e., the string #SVN_FS_TYPE_FSX. */
 
3126
  const char *fs_type;
 
3127
 
 
3128
  /** Shard size, always > 0. */
 
3129
  int shard_size;
 
3130
 
 
3131
  /** The smallest revision which is not in a pack file. */
 
3132
  svn_revnum_t min_unpacked_rev;
 
3133
 
 
3134
  /* If you add fields here, check whether you need to extend svn_fs_info()
 
3135
     or svn_fs_info_dup(). */
 
3136
 
 
3137
} svn_fs_fsx_info_t;
 
3138
 
 
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;
 
3144
 
 
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;
 
3148
 
 
3149
/**
 
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.
 
3155
 *
 
3156
 * @see #svn_fs_fsfs_info_t, #svn_fs_fsx_info_t
 
3157
 *
 
3158
 * @since New in 1.9.
 
3159
 */
 
3160
svn_error_t *
 
3161
svn_fs_info(const svn_fs_info_placeholder_t **fs_info,
 
3162
            svn_fs_t *fs,
 
3163
            apr_pool_t *result_pool,
 
3164
            apr_pool_t *scratch_pool);
 
3165
 
 
3166
/**
 
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.
 
3172
 *
 
3173
 * @see #svn_fs_info_placeholder_t, #svn_fs_fsfs_info_t
 
3174
 *
 
3175
 * @since New in 1.9.
 
3176
 */
 
3177
void *
 
3178
svn_fs_info_dup(const void *info,
 
3179
                apr_pool_t *result_pool,
 
3180
                apr_pool_t *scratch_pool);
 
3181
 
 
3182
/** @} */
 
3183
 
2526
3184
#ifdef __cplusplus
2527
3185
}
2528
3186
#endif /* __cplusplus */