~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, Peter Samuelson, James McCoy
  • Date: 2014-01-12 19:48:33 UTC
  • mfrom: (0.2.10)
  • Revision ID: package-import@ubuntu.com-20140112194833-w3axfwksn296jn5x
Tags: 1.8.5-1
[ Peter Samuelson ]
* New upstream release.  (Closes: #725787) Rediff patches:
  - Remove apr-abi1 (applied upstream), rename apr-abi2 to apr-abi
  - Remove loosen-sqlite-version-check (shouldn't be needed)
  - Remove java-osgi-metadata (applied upstream)
  - svnmucc prompts for a changelog if none is provided. (Closes: #507430)
  - Remove fix-bdb-version-detection, upstream uses "apu-config --dbm-libs"
  - Remove ruby-test-wc (applied upstream)
  - Fix “svn diff -r N file” when file has svn:mime-type set.
    (Closes: #734163)
  - Support specifying an encoding for mod_dav_svn's environment in which
    hooks are run.  (Closes: #601544)
  - Fix ordering of “svnadmin dump” paths with certain APR versions.
    (Closes: #687291)
  - Provide a better error message when authentication fails with an
    svn+ssh:// URL.  (Closes: #273874)
  - Updated Polish translations.  (Closes: #690815)

[ James McCoy ]
* Remove all traces of libneon, replaced by libserf.
* patches/sqlite_3.8.x_workaround: Upstream fix for wc-queries-test test
  failurse.
* Run configure with --with-apache-libexecdir, which allows removing part of
  patches/rpath.
* Re-enable auth-test as upstream has fixed the problem of picking up
  libraries from the environment rather than the build tree.
  (Closes: #654172)
* Point LD_LIBRARY_PATH at the built auth libraries when running the svn
  command during the build.  (Closes: #678224)
* Add a NEWS entry describing how to configure mod_dav_svn to understand
  UTF-8.  (Closes: #566148)
* Remove ancient transitional package, libsvn-ruby.
* Enable compatibility with Sqlite3 versions back to Wheezy.
* Enable hardening flags.  (Closes: #734918)
* patches/build-fixes: Enable verbose build logs.
* Build against the default ruby version.  (Closes: #722393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 */
86
86
#define SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS      "fsfs-cache-fulltexts"
87
87
 
 
88
/** Enable / disable revprop caching for a FSFS repository.
 
89
 *
 
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.
 
93
 *
 
94
 * @since New in 1.8.
 
95
 */
 
96
#define SVN_FS_CONFIG_FSFS_CACHE_REVPROPS       "fsfs-cache-revprops"
 
97
 
 
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
 
102
 * namespace.
 
103
 *
 
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.
 
108
 *
 
109
 * @since New in 1.8.
 
110
 */
 
111
#define SVN_FS_CONFIG_FSFS_CACHE_NS             "fsfs-cache-namespace"
 
112
 
 
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(). */
 
115
 
88
116
/* See also svn_fs_type(). */
89
117
/** @since New in 1.1. */
90
118
#define SVN_FS_CONFIG_FS_TYPE                   "fs-type"
113
141
 * @since New in 1.6.
114
142
 */
115
143
#define SVN_FS_CONFIG_PRE_1_6_COMPATIBLE        "pre-1.6-compatible"
 
144
 
 
145
/** Create repository format compatible with Subversion versions
 
146
 * earlier than 1.8.
 
147
 *
 
148
 * @since New in 1.8.
 
149
 */
 
150
#define SVN_FS_CONFIG_PRE_1_8_COMPATIBLE        "pre-1.8-compatible"
116
151
/** @} */
117
152
 
118
153
 
246
281
               apr_pool_t *pool);
247
282
 
248
283
/**
 
284
 * Callback function type for progress notification.
 
285
 *
 
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.
 
289
 *
 
290
 * @since New in 1.8.
 
291
 */
 
292
typedef void (*svn_fs_progress_notify_func_t)(svn_revnum_t revision,
 
293
                                              void *baton,
 
294
                                              apr_pool_t *pool);
 
295
 
 
296
/**
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
251
299
 * in @a pool.
277
325
            apr_pool_t *pool);
278
326
 
279
327
/**
 
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.
 
331
 * 
 
332
 * @note This is just what was passed to svn_fs_create() or svn_fs_open().
 
333
 * You may not modify it.
 
334
 *
 
335
 * @since New in 1.8.
 
336
 */
 
337
apr_hash_t *
 
338
svn_fs_config(svn_fs_t *fs,
 
339
              apr_pool_t *pool);
 
340
 
 
341
/**
280
342
 * Delete the filesystem at @a path.
281
343
 *
 
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.
 
346
 * See issue 4264.
 
347
 *
282
348
 * @since New in 1.1.
283
349
 */
284
350
svn_error_t *
292
358
 * means deleting copied, unused logfiles for a Berkeley DB source
293
359
 * filesystem.
294
360
 *
 
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.
 
365
 *
 
366
 * Use @a scratch_pool for temporary allocations.
 
367
 *
 
368
 * @since New in 1.8.
 
369
 */
 
370
svn_error_t *
 
371
svn_fs_hotcopy2(const char *src_path,
 
372
                const char *dest_path,
 
373
                svn_boolean_t clean,
 
374
                svn_boolean_t incremental,
 
375
                svn_cancel_func_t cancel_func,
 
376
                void *cancel_baton,
 
377
                apr_pool_t *scratch_pool);
 
378
 
 
379
/**
 
380
 * Like svn_fs_hotcopy2(), but with @a incremental always passed as @c
 
381
 * TRUE and without cancellation support.
 
382
 *
 
383
 * @deprecated Provided for backward compatibility with the 1.7 API.
295
384
 * @since New in 1.1.
296
385
 */
 
386
SVN_DEPRECATED
297
387
svn_error_t *
298
388
svn_fs_hotcopy(const char *src_path,
299
389
               const char *dest_path,
342
432
               apr_pool_t *pool);
343
433
 
344
434
 
 
435
/**
 
436
 * Callback for svn_fs_freeze().
 
437
 *
 
438
 * @since New in 1.8.
 
439
 */
 
440
typedef svn_error_t *(*svn_fs_freeze_func_t)(void *baton, apr_pool_t *pool);
 
441
 
 
442
/**
 
443
 * Take an exclusive lock on @a fs to prevent commits and then invoke
 
444
 * @a freeze_func passing @a freeze_baton.
 
445
 *
 
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.
 
449
 *
 
450
 * @see svn_repos_freeze()
 
451
 *
 
452
 * @since New in 1.8.
 
453
 */
 
454
svn_error_t *
 
455
svn_fs_freeze(svn_fs_t *fs,
 
456
              svn_fs_freeze_func_t freeze_func,
 
457
              void *freeze_baton,
 
458
              apr_pool_t *pool);
 
459
 
 
460
 
345
461
/** Subversion filesystems based on Berkeley DB.
346
462
 *
347
463
 * The following functions are specific to Berkeley DB filesystems.
755
871
 * if a caller tries to edit a locked item without having rights to the lock.
756
872
 */
757
873
#define SVN_FS_TXN_CHECK_LOCKS                   0x00002
 
874
 
758
875
/** @} */
759
876
 
760
877
/**
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.
816
933
 *
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.
 
946
 *
 
947
 * @note See api-errata/1.8/fs001.txt for information on how this
 
948
 * function was documented in versions prior to 1.8.
 
949
 *
 
950
 * ### need to document this better. there are four combinations of
 
951
 * ### return values:
 
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
 
956
 * ###
 
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
829
965
 */
830
966
svn_error_t *
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.
1458
1593
 *
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.
1462
1597
 * this function makes sure to set @a *path_p to the longest copy
1463
1598
 * destination path that is still a parent of or equal to @a path.
1464
1599
 *
 
1600
 * Values returned in @a *root_p and @a *path_p will be allocated
 
1601
 * from @a pool.
 
1602
 *
1465
1603
 * @since New in 1.3.
1466
1604
 */
1467
1605
svn_error_t *
1484
1622
 * @a inherit indicates whether to retrieve explicit,
1485
1623
 * explicit-or-inherited, or only inherited mergeinfo.
1486
1624
 *
 
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.
 
1633
 *
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.)
1493
1640
 *
1494
 
 * Do any necessary temporary allocation in @a pool.
1495
 
 *
1496
 
 * @since New in 1.5.
1497
 
 */
 
1641
 * Allocate @a *catalog in result_pool.  Do any necessary temporary
 
1642
 * allocations in @a scratch_pool.
 
1643
 *
 
1644
 * @since New in 1.8.
 
1645
 */
 
1646
svn_error_t *
 
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);
 
1655
 
 
1656
/**
 
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.
 
1659
 *
 
1660
 * @deprecated Provided for backward compatibility with the 1.5 API.
 
1661
 */
 
1662
SVN_DEPRECATED
1498
1663
svn_error_t *
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);
1738
1903
 
 
1904
/**
 
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.
 
1908
 *
 
1909
 * Use @a scratch_pool for allocations.
 
1910
 *
 
1911
 * @since New in 1.8.
 
1912
 */
 
1913
typedef svn_error_t *
 
1914
(*svn_fs_process_contents_func_t)(const unsigned char *contents,
 
1915
                                  apr_size_t len,
 
1916
                                  void *baton,
 
1917
                                  apr_pool_t *scratch_pool);
 
1918
 
 
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.
 
1922
 *
 
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.
 
1928
 *
 
1929
 * @note @a processor is expected to be relatively short function with
 
1930
 * at most O(content size) runtime.
 
1931
 *
 
1932
 * @since New in 1.8.
 
1933
 */
 
1934
svn_error_t *
 
1935
svn_fs_try_process_file_contents(svn_boolean_t *success,
 
1936
                                 svn_fs_root_t *root,
 
1937
                                 const char *path,
 
1938
                                 svn_fs_process_contents_func_t processor,
 
1939
                                 void* baton,
 
1940
                                 apr_pool_t *pool);
1739
1941
 
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
2184
2386
 
2185
2387
/**
2186
2388
 * Append a textual list of all available FS modules to the stringbuf
2187
 
 * @a output.
 
2389
 * @a output.  Third-party modules are only included if repository
 
2390
 * access has caused them to be loaded.
2188
2391
 *
2189
2392
 * @since New in 1.2.
2190
2393
 */
2237
2440
            apr_pool_t *pool);
2238
2441
 
2239
2442
 
 
2443
/**
 
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.
 
2449
 *
 
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.
 
2457
 *
 
2458
 * Global invariants are only guaranteed to get verified when @a r0 has
 
2459
 * been included in the range of revisions to check.
 
2460
 *
 
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.
 
2465
 *
 
2466
 * The optional @a cancel_func callback will be invoked as usual to allow
 
2467
 * the user to preempt this potentially lengthy operation.
 
2468
 *
 
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.
 
2472
 *
 
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.
 
2475
 *
 
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.
 
2479
 *
 
2480
 * @see svn_repos_verify_fs2()
 
2481
 * @see svn_fs_verify_root()
 
2482
 *
 
2483
 * @since New in 1.8.
 
2484
 */
 
2485
svn_error_t *
 
2486
svn_fs_verify(const char *path,
 
2487
              apr_hash_t *fs_config,
 
2488
              svn_revnum_t start,
 
2489
              svn_revnum_t end,
 
2490
              svn_fs_progress_notify_func_t notify_func,
 
2491
              void *notify_baton,
 
2492
              svn_cancel_func_t cancel_func,
 
2493
              void *cancel_baton,
 
2494
              apr_pool_t *scratch_pool);
 
2495
 
 
2496
/**
 
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.
 
2501
 *
 
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.
 
2505
 *
 
2506
 * @note To ensure a full verification using all available tests and
 
2507
 * covering all revisions, you must call both this function and
 
2508
 * #svn_fs_verify.
 
2509
 *
 
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
 
2513
 * setup.
 
2514
 *
 
2515
 * @see svn_repos_verify_fs2()
 
2516
 * @see svn_fs_verify()
 
2517
 *
 
2518
 * @since New in 1.8.
 
2519
 */
 
2520
svn_error_t *
 
2521
svn_fs_verify_root(svn_fs_root_t *root,
 
2522
                   apr_pool_t *scratch_pool);
 
2523
 
2240
2524
/** @} */
2241
2525
 
2242
 
 
2243
2526
#ifdef __cplusplus
2244
2527
}
2245
2528
#endif /* __cplusplus */