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

« back to all changes in this revision

Viewing changes to subversion/include/svn_repos.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:
66
66
  svn_node_action_replace
67
67
};
68
68
 
69
 
/** The different policies for processing the UUID in the dumpfile. */
70
 
enum svn_repos_load_uuid
71
 
{
72
 
  /** only update uuid if the repos has no revisions. */
73
 
  svn_repos_load_uuid_default,
74
 
  /** never update uuid. */
75
 
  svn_repos_load_uuid_ignore,
76
 
  /** always update uuid. */
77
 
  svn_repos_load_uuid_force
78
 
};
79
 
 
80
69
 
81
 
/** Callback type for checking authorization on paths produced by (at
82
 
 * least) svn_repos_dir_delta2().
 
70
/** @defgroup svn_repos_authz_callbacks Repository authorization callbacks
 
71
 * @{
 
72
 */
 
73
 
 
74
/** Callback type for checking authorization on a path.
83
75
 *
84
76
 * Set @a *allowed to TRUE to indicate that some operation is
85
77
 * authorized for @a path in @a root, or set it to FALSE to indicate
167
159
   void *baton,
168
160
   apr_pool_t *pool);
169
161
 
170
 
/**
171
 
 * Similar to #svn_file_rev_handler_t, but without the @a
172
 
 * result_of_merge parameter.
173
 
 *
174
 
 * @deprecated Provided for backward compatibility with 1.4 API.
175
 
 * @since New in 1.1.
 
162
/** @} */
 
163
 
 
164
 
 
165
/** @defgroup svn_repos_notifications Repository notifications
 
166
 * @{
176
167
 */
177
 
typedef svn_error_t *(*svn_repos_file_rev_handler_t)
178
 
  (void *baton,
179
 
   const char *path,
180
 
   svn_revnum_t rev,
181
 
   apr_hash_t *rev_props,
182
 
   svn_txdelta_window_handler_t *delta_handler,
183
 
   void **delta_baton,
184
 
   apr_array_header_t *prop_diffs,
185
 
   apr_pool_t *pool);
186
168
 
187
 
 
188
169
/* Notification system. */
189
170
 
190
171
/** The type of action occurring.
251
232
  svn_repos_notify_load_skipped_rev,
252
233
 
253
234
  /** The structure of a revision is being verified.  @since New in 1.8. */
254
 
  svn_repos_notify_verify_rev_structure
255
 
 
 
235
  svn_repos_notify_verify_rev_structure,
 
236
 
 
237
  /** A revprop shard got packed. @since New in 1.9. */
 
238
  svn_repos_notify_pack_revprops,
 
239
 
 
240
  /** A non-packed revprop shard got removed. @since New in 1.9. */
 
241
  svn_repos_notify_cleanup_revprops,
 
242
 
 
243
  /** The repository format got bumped. @since New in 1.9. */
 
244
  svn_repos_notify_format_bumped,
 
245
 
 
246
  /** A revision range was copied. @since New in 1.9. */
 
247
  svn_repos_notify_hotcopy_rev_range
256
248
} svn_repos_notify_action_t;
257
249
 
258
 
/** The type of error occurring.
 
250
/** The type of warning occurring.
259
251
 *
260
252
 * @since New in 1.7.
261
253
 */
273
265
   * @see svn_fs.h:"Directory entry names and directory paths" */
274
266
  /* ### TODO(doxygen): make that a proper doxygen link */
275
267
  /* See svn_fs__path_valid(). */
276
 
  svn_repos_notify_warning_invalid_fspath
277
 
 
 
268
  svn_repos_notify_warning_invalid_fspath,
 
269
 
 
270
  /**
 
271
   * Detected a name collision. Reported when the names of two or more
 
272
   * entries in the same directory differ only in character
 
273
   * representation (normalization), but are otherwise identical.
 
274
   *
 
275
   * @since New in 1.9.
 
276
   */
 
277
  svn_repos_notify_warning_name_collision,
 
278
 
 
279
  /**
 
280
   * Detected a mergeinfo path collision. Reported when the paths in
 
281
   * two or more entries in the same svn:mergeinfo property differ
 
282
   * only in character representation (normalization), but are
 
283
   * otherwise identical.
 
284
   *
 
285
   * @since New in 1.9.
 
286
   */
 
287
  svn_repos_notify_warning_mergeinfo_collision,
 
288
 
 
289
  /**
 
290
   * Detected invalid mergeinfo.
 
291
   *
 
292
   * @since New in 1.9.
 
293
   */
 
294
  svn_repos_notify_warning_invalid_mergeinfo
278
295
} svn_repos_notify_warning_t;
279
296
 
280
297
/**
295
312
  svn_repos_notify_action_t action;
296
313
 
297
314
  /** For #svn_repos_notify_dump_rev_end and #svn_repos_notify_verify_rev_end,
298
 
   * the revision which just completed. */
 
315
   * the revision which just completed.
 
316
   * For #svn_fs_upgrade_format_bumped, the new format version. */
299
317
  svn_revnum_t revision;
300
318
 
301
 
  /** For #svn_repos_notify_warning, the warning object. */
 
319
  /** For #svn_repos_notify_warning, the warning message. */
302
320
  const char *warning_str;
 
321
  /** For #svn_repos_notify_warning, the warning type. */
303
322
  svn_repos_notify_warning_t warning;
304
323
 
305
324
  /** For #svn_repos_notify_pack_shard_start,
306
325
      #svn_repos_notify_pack_shard_end,
 
326
      #svn_repos_notify_pack_revprops,
 
327
      #svn_repos_notify_cleanup_revprops
307
328
      #svn_repos_notify_pack_shard_start_revprop, and
308
329
      #svn_repos_notify_pack_shard_end_revprop, the shard processed. */
309
330
  apr_int64_t shard;
310
331
 
311
 
  /** For #svn_repos_notify_load_node_done, the revision committed. */
 
332
  /** For #svn_repos_notify_load_txn_committed, the revision committed. */
312
333
  svn_revnum_t new_revision;
313
334
 
314
 
  /** For #svn_repos_notify_load_node_done, the source revision, if
 
335
  /** For #svn_repos_notify_load_txn_committed, the source revision, if
315
336
      different from @a new_revision, otherwise #SVN_INVALID_REVNUM.
316
 
      For #svn_repos_notify_load_txn_start, the source revision. */
 
337
      For #svn_repos_notify_load_txn_start and
 
338
      #svn_repos_notify_load_skipped_rev, the source revision. */
317
339
  svn_revnum_t old_revision;
318
340
 
319
341
  /** For #svn_repos_notify_load_node_start, the action being taken on the
323
345
  /** For #svn_repos_notify_load_node_start, the path of the node. */
324
346
  const char *path;
325
347
 
 
348
  /** For #svn_repos_notify_hotcopy_rev_range, the start of the copied
 
349
      revision range.
 
350
      @since New in 1.9. */
 
351
  svn_revnum_t start_revision;
 
352
 
 
353
  /** For #svn_repos_notify_hotcopy_rev_range, the end of the copied
 
354
      revision range (might be the same as @a start_revision).
 
355
      @since New in 1.9. */
 
356
  svn_revnum_t end_revision;
 
357
 
326
358
  /* NOTE: Add new fields at the end to preserve binary compatibility.
327
359
     Also, if you add fields here, you have to update
328
360
     svn_repos_notify_create(). */
347
379
svn_repos_notify_create(svn_repos_notify_action_t action,
348
380
                        apr_pool_t *result_pool);
349
381
 
350
 
 
 
382
/** @} */
 
383
 
 
384
 
351
385
/** The repository object. */
352
386
typedef struct svn_repos_t svn_repos_t;
353
387
 
366
400
 
367
401
/** Set @a *repos_p to a repository object for the repository at @a path.
368
402
 *
369
 
 * Allocate @a *repos_p in @a pool.
 
403
 * Allocate @a *repos_p in @a result_pool.
370
404
 *
371
405
 * Acquires a shared lock on the repository, and attaches a cleanup
372
 
 * function to @a pool to remove the lock.  If no lock can be acquired,
 
406
 * function to @a result_pool to remove the lock.  If no lock can be acquired,
373
407
 * returns error, with undefined effect on @a *repos_p.  If an exclusive
374
408
 * lock is present, this blocks until it's gone.  @a fs_config will be
375
409
 * passed to the filesystem initialization function and may be @c NULL.
376
410
 *
 
411
 * Use @a scratch_pool for temporary allocations.
 
412
 *
 
413
 * @since New in 1.9.
 
414
 */
 
415
svn_error_t *
 
416
svn_repos_open3(svn_repos_t **repos_p,
 
417
                const char *path,
 
418
                apr_hash_t *fs_config,
 
419
                apr_pool_t *result_pool,
 
420
                apr_pool_t *scratch_pool);
 
421
 
 
422
/** Similar to svn_repos_open3() but without @a scratch_pool.
 
423
 *
 
424
 * @deprecated Provided for backward compatibility with 1.8 API.
377
425
 * @since New in 1.7.
378
426
 */
 
427
SVN_DEPRECATED
379
428
svn_error_t *
380
429
svn_repos_open2(svn_repos_t **repos_p,
381
430
                const char *path,
478
527
svn_repos_delete(const char *path,
479
528
                 apr_pool_t *pool);
480
529
 
 
530
 
 
531
/** @defgroup svn_repos_capabilities Repository capabilities
 
532
 * @{
 
533
 */
 
534
 
481
535
/**
482
536
 * Set @a *has to TRUE if @a repos has @a capability (one of the
483
537
 * capabilities beginning with @c "SVN_REPOS_CAPABILITY_"), else set
496
550
                         const char *capability,
497
551
                         apr_pool_t *pool);
498
552
 
499
 
/** @} */
 
553
/**
 
554
 * Return a set of @a capabilities supported by the running Subversion
 
555
 * library and by @a repos.  (Capabilities supported by this version of
 
556
 * Subversion but not by @a repos are not listed.  This may happen when
 
557
 * svn_repos_upgrade2() has not been called after a software upgrade.)
 
558
 *
 
559
 * The set is represented as a hash whose const char * keys are the set
 
560
 * members.  The values are not defined.
 
561
 *
 
562
 * Allocate @a capabilities in @a result_pool and use @a scratch_pool for
 
563
 * temporary allocations.
 
564
 *
 
565
 * @see svn_repos_info_format
 
566
 *
 
567
 * @since New in 1.9.
 
568
 */
 
569
svn_error_t *
 
570
svn_repos_capabilities(apr_hash_t **capabilities,
 
571
                       svn_repos_t *repos,
 
572
                       apr_pool_t *result_pool,
 
573
                       apr_pool_t *scratch_pool);
500
574
 
501
575
/**
502
576
 * The capability of doing the right thing with merge-tracking
516
590
 * If you add a capability, update svn_repos_capabilities().
517
591
 */
518
592
 
 
593
/** @} */
 
594
 
 
595
 
 
596
/**
 
597
 * Store in @a repos the client-reported capabilities @a capabilities,
 
598
 * which must be allocated in memory at least as long-lived as @a repos.
 
599
 *
 
600
 * The elements of @a capabilities are 'const char *', a subset of
 
601
 * the constants beginning with @c SVN_RA_CAPABILITY_.
 
602
 * @a capabilities is not copied, so changing it later will affect
 
603
 * what is remembered by @a repos.
 
604
 *
 
605
 * @note The capabilities are passed along to the start-commit hook;
 
606
 * see that hook's template for details.
 
607
 *
 
608
 * @note As of Subversion 1.5, there are no error conditions defined,
 
609
 * so this always returns SVN_NO_ERROR.  In future releases it may
 
610
 * return error, however, so callers should check.
 
611
 *
 
612
 * @since New in 1.5.
 
613
 */
 
614
svn_error_t *
 
615
svn_repos_remember_client_capabilities(svn_repos_t *repos,
 
616
                                       const apr_array_header_t *capabilities);
 
617
 
519
618
 
520
619
/** Return the filesystem associated with repository object @a repos. */
521
620
svn_fs_t *
522
621
svn_repos_fs(svn_repos_t *repos);
523
622
 
 
623
/** Return the type of filesystem associated with repository object
 
624
 * @a repos allocated in @a result_pool.
 
625
 *
 
626
 * @see #svn_fs_backend_names
 
627
 *
 
628
 * @since New in 1.9.
 
629
 */
 
630
const char *
 
631
svn_repos_fs_type(svn_repos_t *repos,
 
632
                  apr_pool_t *result_pool);
524
633
 
525
634
/** Make a hot copy of the Subversion repository found at @a src_path
526
635
 * to @a dst_path.
535
644
 * already present in the destination. If incremental hotcopy is not
536
645
 * implemented by the filesystem backend, raise SVN_ERR_UNSUPPORTED_FEATURE.
537
646
 *
 
647
 * For each revision range copied, the @a notify_func function will be
 
648
 * called with the @a notify_baton and a notification structure containing
 
649
 * appropriate values in @c start_revision and @c end_revision (both
 
650
 * inclusive). @c start_revision might be equal to @c end_revision in
 
651
 * case the copied range consists of a single revision.  Currently, this
 
652
 * notification is not triggered by the BDB backend. @a notify_func
 
653
 * may be @c NULL if this notification is not required.
 
654
 *
 
655
 * The optional @a cancel_func callback will be invoked with
 
656
 * @a cancel_baton as usual to allow the user to preempt this potentially
 
657
 * lengthy operation.
 
658
 * 
 
659
 * Use @a scratch_pool for temporary allocations.
 
660
 *
 
661
 * @since New in 1.9.
 
662
 */
 
663
svn_error_t *
 
664
svn_repos_hotcopy3(const char *src_path,
 
665
                   const char *dst_path,
 
666
                   svn_boolean_t clean_logs,
 
667
                   svn_boolean_t incremental,
 
668
                   svn_repos_notify_func_t notify_func,
 
669
                   void *notify_baton,
 
670
                   svn_cancel_func_t cancel_func,
 
671
                   void *cancel_baton,
 
672
                   apr_pool_t *scratch_pool);
 
673
 
 
674
/**
 
675
 * Like svn_repos_hotcopy3(), but with @a notify_func and @a notify_baton
 
676
 * always passed as @c NULL.
 
677
 *
538
678
 * @since New in 1.8.
 
679
 * @deprecated Provided for backward compatibility with the 1.8 API.
539
680
 */
 
681
SVN_DEPRECATED
540
682
svn_error_t *
541
683
svn_repos_hotcopy2(const char *src_path,
542
684
                   const char *dst_path,
682
824
 * FS backend the repository uses.  Repositories are locked in the
683
825
 * order in which they are specified in the array.
684
826
 *
 
827
 * @note @a freeze_func must not, directly or indirectly, call any function
 
828
 * that attempts to take out a lock on the underlying repository.  These
 
829
 * include functions for packing, hotcopying, setting revprops and commits.
 
830
 * Attempts to do so may result in a deadlock.
 
831
 *
685
832
 * @note On some platforms the exclusive lock does not exclude other
686
833
 * threads in the same process so this function should only be called
687
834
 * by a single threaded process, or by a multi-threaded process when
879
1026
 * when using larger values here.  Pass 0 for @a zero_copy_limit to
880
1027
 * disable this optimization altogether.
881
1028
 *
882
 
 * @a note Never activate this optimization if @a editor might access
 
1029
 * @note Never activate this optimization if @a editor might access
883
1030
 * any FSFS data structures (and, hence, caches).  So, it is basically
884
1031
 * safe for networked editors only.
885
1032
 *
1355
1502
 * filesystem of @a repos, beginning at location 'rev:@a base_path',
1356
1503
 * where "rev" is the argument given to open_root().
1357
1504
 *
1358
 
 * @a repos is a previously opened repository.  @a repos_url is the
 
1505
 * @a repos is a previously opened repository.  @a repos_url_decoded is the
1359
1506
 * decoded URL to the base of the repository, and is used to check
1360
 
 * copyfrom paths.  copyfrom paths passed to the editor must be full,
1361
 
 * URI-encoded, URLs.  @a txn is a filesystem transaction object to use
 
1507
 * copyfrom paths.  @a txn is a filesystem transaction object to use
1362
1508
 * during the commit, or @c NULL to indicate that this function should
1363
1509
 * create (and fully manage) a new transaction.
1364
1510
 *
1380
1526
 * If @a commit_callback is non-NULL, then before @c close_edit returns (but
1381
1527
 * after the commit has succeeded) @c close_edit will invoke
1382
1528
 * @a commit_callback with a filled-in #svn_commit_info_t *, @a commit_baton,
1383
 
 * and @a pool or some subpool thereof as arguments.  If @a commit_callback
 
1529
 * and @a pool or some subpool thereof as arguments.  The @c repos_root field
 
1530
 * of the #svn_commit_info_t is @c NULL.  If @a commit_callback
1384
1531
 * returns an error, that error will be returned from @c close_edit,
1385
1532
 * otherwise if there was a post-commit hook failure, then that error
1386
1533
 * will be returned with code SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED.
1387
 
 * (Note that prior to Subversion 1.6, @a commit_callback cannot be NULL; if
1388
 
 * you don't need a callback, pass a dummy function.)
 
1534
 * (Note that prior to Subversion 1.6, @a commit_callback cannot be @c NULL;
 
1535
 * if you don't need a callback, pass a dummy function.)
1389
1536
 *
1390
1537
 * Calling @a (*editor)->abort_edit aborts the commit, and will also
1391
1538
 * abort the commit transaction unless @a txn was supplied (not @c
1392
1539
 * NULL).  Callers who supply their own transactions are responsible
1393
1540
 * for cleaning them up (either by committing them, or aborting them).
1394
1541
 *
1395
 
 * @since New in 1.5.
 
1542
 * @since New in 1.5. Since 1.6, @a commit_callback can be @c NULL.
1396
1543
 *
1397
 
 * @note Yes, @a repos_url is a <em>decoded</em> URL.  We realize
 
1544
 * @note Yes, @a repos_url_decoded is a <em>decoded</em> URL.  We realize
1398
1545
 * that's sorta wonky.  Sorry about that.
 
1546
 *
 
1547
 * @note Like most commit editors, the returned editor requires that the
 
1548
 * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
 
1549
 * methods is a full, URI-encoded URL, not a relative path.
1399
1550
 */
1400
1551
svn_error_t *
1401
1552
svn_repos_get_commit_editor5(const svn_delta_editor_t **editor,
1402
1553
                             void **edit_baton,
1403
1554
                             svn_repos_t *repos,
1404
1555
                             svn_fs_txn_t *txn,
1405
 
                             const char *repos_url,
 
1556
                             const char *repos_url_decoded,
1406
1557
                             const char *base_path,
1407
1558
                             apr_hash_t *revprop_table,
1408
1559
                             svn_commit_callback2_t commit_callback,
1709
1860
                                 apr_pool_t *pool);
1710
1861
 
1711
1862
 
1712
 
/* ### other queries we can do someday --
1713
 
 
1714
 
     * fetch the last revision created by <user>
1715
 
         (once usernames become revision properties!)
1716
 
     * fetch the last revision where <path> was modified
1717
 
 
1718
 
*/
1719
 
 
1720
 
 
1721
 
 
1722
1863
/* ---------------------------------------------------------------*/
1723
1864
 
1724
1865
/* Retrieving log messages. */
1740
1881
 * show all revisions regardless of what paths were changed in those
1741
1882
 * revisions.
1742
1883
 *
1743
 
 * If @a limit is non-zero then only invoke @a receiver on the first
 
1884
 * If @a limit is greater than zero then only invoke @a receiver on the first
1744
1885
 * @a limit logs.
1745
1886
 *
1746
1887
 * If @a discover_changed_paths, then each call to @a receiver passes a
1946
2087
 * the revision range for @a include_merged_revision @c FALSE reporting by
1947
2088
 * switching @a start with @a end.
1948
2089
 *
 
2090
 * @note Prior to Subversion 1.9, this function may request delta handlers
 
2091
 * from @a handler even for empty text deltas.  Starting with 1.9, the
 
2092
 * delta handler / baton return arguments passed to @a handler will be
 
2093
 * #NULL unless there is an actual difference in the file contents between
 
2094
 * the current and the previous call.
 
2095
 *
1949
2096
 * @since New in 1.5.
1950
2097
 */
1951
2098
svn_error_t *
1961
2108
                         apr_pool_t *pool);
1962
2109
 
1963
2110
/**
 
2111
 * Similar to #svn_file_rev_handler_t, but without the @a
 
2112
 * result_of_merge parameter.
 
2113
 *
 
2114
 * @deprecated Provided for backward compatibility with 1.4 API.
 
2115
 * @since New in 1.1.
 
2116
 */
 
2117
typedef svn_error_t *(*svn_repos_file_rev_handler_t)
 
2118
  (void *baton,
 
2119
   const char *path,
 
2120
   svn_revnum_t rev,
 
2121
   apr_hash_t *rev_props,
 
2122
   svn_txdelta_window_handler_t *delta_handler,
 
2123
   void **delta_baton,
 
2124
   apr_array_header_t *prop_diffs,
 
2125
   apr_pool_t *pool);
 
2126
 
 
2127
/**
1964
2128
 * Similar to svn_repos_get_file_revs2(), with @a include_merged_revisions
1965
2129
 * set to FALSE.
1966
2130
 *
2087
2251
 * @{
2088
2252
 */
2089
2253
 
2090
 
/** Like svn_fs_lock(), but invoke the @a repos's pre- and
2091
 
 * post-lock hooks before and after the locking action.  Use @a pool
2092
 
 * for any necessary allocations.
2093
 
 *
2094
 
 * If the pre-lock hook or svn_fs_lock() fails, throw the original
2095
 
 * error to caller.  If an error occurs when running the post-lock
2096
 
 * hook, return the original error wrapped with
2097
 
 * SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED.  If the caller sees this
2098
 
 * error, it knows that the lock succeeded anyway.
 
2254
/** Like svn_fs_lock_many(), but invoke the @a repos's pre- and
 
2255
 * post-lock hooks before and after the locking action.
 
2256
 *
 
2257
 * The pre-lock is run for every path in @a targets. Those targets for
 
2258
 * which the pre-lock is successful are passed to svn_fs_lock_many and
 
2259
 * the post-lock is run for those that are successfully locked.
 
2260
 * Pre-lock hook errors are passed to @a lock_callback.
 
2261
 *
 
2262
 * For each path in @a targets @a lock_callback will be invoked
 
2263
 * passing @a lock_baton and the lock and error that apply to path.
 
2264
 * @a lock_callback can be NULL in which case it is not called and any
 
2265
 * errors that would have been passed to the callback are not reported.
 
2266
 *
 
2267
 * If an error occurs when running the post-lock hook the error is
 
2268
 * returned wrapped with #SVN_ERR_REPOS_POST_LOCK_HOOK_FAILED.  If the
 
2269
 * caller sees this error, it knows that some locks succeeded.
2099
2270
 *
2100
2271
 * The pre-lock hook may cause a different token to be used for the
2101
 
 * lock, instead of @a token; see the pre-lock-hook documentation for
2102
 
 * more.
 
2272
 * lock, instead of the token supplied; see the pre-lock-hook
 
2273
 * documentation for more.
 
2274
 *
 
2275
 * The lock and path passed to @a lock_callback will be allocated in
 
2276
 * @a result_pool.  Use @a scratch_pool for temporary allocations.
 
2277
 *
 
2278
 * @note This function is not atomic.  If it returns an error, some targets
 
2279
 * may remain unlocked while others may have been locked.
 
2280
 *
 
2281
 * @see svn_fs_lock_many
 
2282
 *
 
2283
 * @since New in 1.9.
 
2284
 */
 
2285
svn_error_t *
 
2286
svn_repos_fs_lock_many(svn_repos_t *repos,
 
2287
                       apr_hash_t *lock_targets,
 
2288
                       const char *comment,
 
2289
                       svn_boolean_t is_dav_comment,
 
2290
                       apr_time_t expiration_date,
 
2291
                       svn_boolean_t steal_lock,
 
2292
                       svn_fs_lock_callback_t lock_callback,
 
2293
                       void *lock_baton,
 
2294
                       apr_pool_t *result_pool,
 
2295
                       apr_pool_t *scratch_pool);
 
2296
 
 
2297
/** Similar to svn_repos_fs_lock_many() but locks only a single path.
2103
2298
 *
2104
2299
 * @since New in 1.2.
2105
2300
 */
2116
2311
                  apr_pool_t *pool);
2117
2312
 
2118
2313
 
2119
 
/** Like svn_fs_unlock(), but invoke the @a repos's pre- and
2120
 
 * post-unlock hooks before and after the unlocking action.  Use @a
2121
 
 * pool for any necessary allocations.
2122
 
 *
2123
 
 * If the pre-unlock hook or svn_fs_unlock() fails, throw the original
2124
 
 * error to caller.  If an error occurs when running the post-unlock
2125
 
 * hook, return the original error wrapped with
2126
 
 * SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED.  If the caller sees this
2127
 
 * error, it knows that the unlock succeeded anyway.
 
2314
/** Like svn_fs_unlock_many(), but invoke the @a repos's pre- and
 
2315
 * post-unlock hooks before and after the unlocking action.
 
2316
 *
 
2317
 * The pre-unlock hook is run for every path in @a targets. Those
 
2318
 * targets for which the pre-unlock is successful are passed to
 
2319
 * svn_fs_unlock_many and the post-unlock is run for those that are
 
2320
 * successfully unlocked. Pre-unlock hook errors are passed to @a
 
2321
 * lock_callback.
 
2322
 *
 
2323
 * For each path in @a targets @a lock_callback will be invoked
 
2324
 * passing @a lock_baton and error that apply to path.  The lock
 
2325
 * passed to the callback will be NULL.  @a lock_callback can be NULL
 
2326
 * in which case it is not called and any errors that would have been
 
2327
 * passed to the callback are not reported.
 
2328
 *
 
2329
 * If an error occurs when running the post-unlock hook, return the
 
2330
 * original error wrapped with #SVN_ERR_REPOS_POST_UNLOCK_HOOK_FAILED.
 
2331
 * If the caller sees this error, it knows that some unlocks
 
2332
 * succeeded.
 
2333
 *
 
2334
 * The path passed to @a lock_callback will be allocated in @a result_pool.
 
2335
 * Use @a scratch_pool for temporary allocations.
 
2336
 *
 
2337
 * @note This function is not atomic.  If it returns an error, some targets
 
2338
 * may remain locked while others may have been unlocked.
 
2339
 *
 
2340
 * @see svn_fs_unlock_many
 
2341
 *
 
2342
 * @since New in 1.9.
 
2343
 */
 
2344
svn_error_t *
 
2345
svn_repos_fs_unlock_many(svn_repos_t *repos,
 
2346
                         apr_hash_t *unlock_targets,
 
2347
                         svn_boolean_t break_lock,
 
2348
                         svn_fs_lock_callback_t lock_callback,
 
2349
                         void *lock_baton,
 
2350
                         apr_pool_t *result_pool,
 
2351
                         apr_pool_t *scratch_pool);
 
2352
 
 
2353
/** Similar to svn_repos_fs_unlock_many() but only unlocks a single path.
2128
2354
 *
2129
2355
 * @since New in 1.2.
2130
2356
 */
2178
2404
 
2179
2405
/** @} */
2180
2406
 
 
2407
/** @defgroup svn_repos_properties Versioned and Unversioned Properties
 
2408
 *
 
2409
 * Prop-changing and prop-reading wrappers for libsvn_fs routines.
 
2410
 * @{
 
2411
 */
 
2412
 
2181
2413
/**
2182
2414
 * Like svn_fs_change_rev_prop2(), but validate the name and value of the
2183
2415
 * property and invoke the @a repos's pre- and post-revprop-change hooks
2210
2442
                              const char *name,
2211
2443
                              const svn_string_t *const *old_value_p,
2212
2444
                              const svn_string_t *new_value,
2213
 
                              svn_boolean_t
2214
 
                              use_pre_revprop_change_hook,
2215
 
                              svn_boolean_t
2216
 
                              use_post_revprop_change_hook,
2217
 
                              svn_repos_authz_func_t
2218
 
                              authz_read_func,
 
2445
                              svn_boolean_t use_pre_revprop_change_hook,
 
2446
                              svn_boolean_t use_post_revprop_change_hook,
 
2447
                              svn_repos_authz_func_t authz_read_func,
2219
2448
                              void *authz_read_baton,
2220
2449
                              apr_pool_t *pool);
2221
2450
 
2234
2463
                              const char *author,
2235
2464
                              const char *name,
2236
2465
                              const svn_string_t *new_value,
2237
 
                              svn_boolean_t
2238
 
                              use_pre_revprop_change_hook,
2239
 
                              svn_boolean_t
2240
 
                              use_post_revprop_change_hook,
2241
 
                              svn_repos_authz_func_t
2242
 
                              authz_read_func,
 
2466
                              svn_boolean_t use_pre_revprop_change_hook,
 
2467
                              svn_boolean_t use_post_revprop_change_hook,
 
2468
                              svn_repos_authz_func_t authz_read_func,
2243
2469
                              void *authz_read_baton,
2244
2470
                              apr_pool_t *pool);
2245
2471
 
2257
2483
                              const char *author,
2258
2484
                              const char *name,
2259
2485
                              const svn_string_t *new_value,
2260
 
                              svn_repos_authz_func_t
2261
 
                              authz_read_func,
 
2486
                              svn_repos_authz_func_t authz_read_func,
2262
2487
                              void *authz_read_baton,
2263
2488
                              apr_pool_t *pool);
2264
2489
 
2299
2524
                           svn_repos_t *repos,
2300
2525
                           svn_revnum_t rev,
2301
2526
                           const char *propname,
2302
 
                           svn_repos_authz_func_t
2303
 
                           authz_read_func,
 
2527
                           svn_repos_authz_func_t authz_read_func,
2304
2528
                           void *authz_read_baton,
2305
2529
                           apr_pool_t *pool);
2306
2530
 
2325
2549
svn_repos_fs_revision_proplist(apr_hash_t **table_p,
2326
2550
                               svn_repos_t *repos,
2327
2551
                               svn_revnum_t rev,
2328
 
                               svn_repos_authz_func_t
2329
 
                               authz_read_func,
 
2552
                               svn_repos_authz_func_t authz_read_func,
2330
2553
                               void *authz_read_baton,
2331
2554
                               apr_pool_t *pool);
2332
2555
 
2333
 
 
2334
 
 
2335
 
/* ---------------------------------------------------------------*/
2336
 
 
2337
 
/* Prop-changing wrappers for libsvn_fs routines. */
2338
 
 
2339
 
/* NOTE: svn_repos_fs_change_rev_prop() also exists, but is located
2340
 
   above with the hook-related functions. */
2341
 
 
2342
 
 
2343
2556
/** Validating wrapper for svn_fs_change_node_prop() (which see for
2344
2557
 * argument descriptions).
2345
2558
 *
2348
2561
 * @a value and return SVN_ERR_BAD_PROPERTY_VALUE if it is invalid for the
2349
2562
 * property.
2350
2563
 *
2351
 
 * @note Currently, the only properties validated are the "svn:" properties
2352
 
 * #SVN_PROP_REVISION_LOG and #SVN_PROP_REVISION_DATE. This may change
2353
 
 * in future releases.
 
2564
 * @note Originally, the only properties validated were the "svn:" properties
 
2565
 * #SVN_PROP_REVISION_LOG and #SVN_PROP_REVISION_DATE. For the current
 
2566
 * validation rules see the private function svn_repos__validate_prop().
2354
2567
 */
2355
2568
svn_error_t *
2356
2569
svn_repos_fs_change_node_prop(svn_fs_root_t *root,
2359
2572
                              const svn_string_t *value,
2360
2573
                              apr_pool_t *pool);
2361
2574
 
 
2575
/**
 
2576
 * Set @a *inherited_values to a depth-first ordered array of
 
2577
 * #svn_prop_inherited_item_t * structures (the path_or_url members of
 
2578
 * which are relative filesystem paths) representing the properties
 
2579
 * inherited by @a path in @a root.  If no properties are inherited,
 
2580
 * then set @a *inherited_values to an empty array.
 
2581
 *
 
2582
 * if @a propname is NULL then retrieve all explicit and/or inherited
 
2583
 * properties.  Otherwise retrieve only the properties named @a propname.
 
2584
 *
 
2585
 * If optional @a authz_read_func is non-NULL, then use this function
 
2586
 * (along with optional @a authz_read_baton) to check the readability
 
2587
 * of each parent path from which properties are inherited. Silently omit
 
2588
 * properties for unreadable parent paths.
 
2589
 *
 
2590
 * Allocate @a *inherited_props in @a result_pool.  Use @a scratch_pool for
 
2591
 * temporary allocations.
 
2592
 *
 
2593
 * @since New in 1.8.
 
2594
 */
 
2595
svn_error_t *
 
2596
svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props,
 
2597
                                 svn_fs_root_t *root,
 
2598
                                 const char *path,
 
2599
                                 const char *propname,
 
2600
                                 svn_repos_authz_func_t authz_read_func,
 
2601
                                 void *authz_read_baton,
 
2602
                                 apr_pool_t *result_pool,
 
2603
                                 apr_pool_t *scratch_pool);
 
2604
 
2362
2605
/** Validating wrapper for svn_fs_change_txn_prop() (which see for
2363
2606
 * argument descriptions).  See svn_repos_fs_change_txn_props() for more
2364
2607
 * information.
2380
2623
                              const apr_array_header_t *props,
2381
2624
                              apr_pool_t *pool);
2382
2625
 
 
2626
/** @} */
 
2627
 
2383
2628
 
2384
2629
/* ---------------------------------------------------------------*/
2385
2630
 
2470
2715
svn_repos_node_t *
2471
2716
svn_repos_node_from_baton(void *edit_baton);
2472
2717
 
 
2718
/**
 
2719
 * Return repository format information for @a repos.
 
2720
 *
 
2721
 * Set @a *repos_format to the repository format number of @a repos, which is
 
2722
 * an integer that increases when incompatible changes are made (such as
 
2723
 * by #svn_repos_upgrade2).
 
2724
 *
 
2725
 * Set @a *supports_version to the version number of the minimum Subversion
 
2726
 * GA release that can read and write @a repos; allocate it in
 
2727
 * @a result_pool.  Use @a scratch_pool for temporary allocations.
 
2728
 *
 
2729
 * @see svn_fs_info_format, svn_repos_capabilities
 
2730
 *
 
2731
 * @since New in 1.9.
 
2732
 */
 
2733
svn_error_t *
 
2734
svn_repos_info_format(int *repos_format,
 
2735
                      svn_version_t **supports_version,
 
2736
                      svn_repos_t *repos,
 
2737
                      apr_pool_t *result_pool,
 
2738
                      apr_pool_t *scratch_pool);
 
2739
 
2473
2740
/** @} */
2474
2741
 
2475
2742
/* ---------------------------------------------------------------*/
2476
2743
 
2477
2744
/**
2478
 
 * @defgroup svn_repos_dump_load Dumping and loading filesystem data
 
2745
 * @defgroup svn_repos_dump_load Dumping, loading and verifying filesystem data
2479
2746
 * @{
2480
2747
 *
2481
2748
 * The filesystem 'dump' format contains nothing but the abstract
2539
2806
#define SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_CHECKSUM  \
2540
2807
                                        SVN_REPOS_DUMPFILE_TEXT_DELTA_BASE_MD5
2541
2808
 
 
2809
/** The different policies for processing the UUID in the dumpfile. */
 
2810
enum svn_repos_load_uuid
 
2811
{
 
2812
  /** only update uuid if the repos has no revisions. */
 
2813
  svn_repos_load_uuid_default,
 
2814
  /** never update uuid. */
 
2815
  svn_repos_load_uuid_ignore,
 
2816
  /** always update uuid. */
 
2817
  svn_repos_load_uuid_force
 
2818
};
 
2819
 
 
2820
/** Callback type for use with svn_repos_verify_fs3().  @a revision
 
2821
 * and @a verify_err are the details of a single verification failure
 
2822
 * that occurred during the svn_repos_verify_fs3() call.  @a baton is
 
2823
 * the same baton given to svn_repos_verify_fs3().  @a scratch_pool is
 
2824
 * provided for the convenience of the implementor, who should not
 
2825
 * expect it to live longer than a single callback call.
 
2826
 *
 
2827
 * @a verify_err will be cleared and becomes invalid after the callback
 
2828
 * returns, use svn_error_dup() to preserve the error.  If a callback uses
 
2829
 * @a verify_err as the return value or as a part of the return value, it
 
2830
 * should also call svn_error_dup() for @a verify_err.  Implementors of this
 
2831
 * callback are forbidden to call svn_error_clear() for @a verify_err.
 
2832
 *
 
2833
 * @see svn_repos_verify_fs3
 
2834
 *
 
2835
 * @since New in 1.9.
 
2836
 */
 
2837
typedef svn_error_t *(*svn_repos_verify_callback_t)(void *baton,
 
2838
                                                    svn_revnum_t revision,
 
2839
                                                    svn_error_t *verify_err,
 
2840
                                                    apr_pool_t *scratch_pool);
 
2841
 
2542
2842
/**
2543
2843
 * Verify the contents of the file system in @a repos.
2544
2844
 *
2545
 
 * If @a feedback_stream is not @c NULL, write feedback to it (lines of
2546
 
 * the form "* Verified revision %ld\n").
2547
 
 *
2548
 
 * If @a start_rev is #SVN_INVALID_REVNUM, then start verifying at
2549
 
 * revision 0.  If @a end_rev is #SVN_INVALID_REVNUM, then verify
2550
 
 * through the @c HEAD revision.
2551
 
 *
2552
 
 * For every verified revision call @a notify_func with @a rev set to
2553
 
 * the verified revision and @a warning_text @c NULL. For warnings call @a
2554
 
 * notify_func with @a warning_text set.
 
2845
 * Verify the revisions from @a start_rev to @a end_rev inclusive.  If
 
2846
 * @a start_rev is #SVN_INVALID_REVNUM, start at revision 0; if @a end_rev
 
2847
 * is #SVN_INVALID_REVNUM, end at the head revision.  @a start_rev must be
 
2848
 * older than or equal to @a end_rev.  If revision 0 is included in the
 
2849
 * range, then also verify "global invariants" of the repository, as
 
2850
 * described in svn_fs_verify().
 
2851
 *
 
2852
 * If @a check_normalization is @c TRUE, report any name collisions
 
2853
 * within the same directory or svn:mergeinfo property where the names
 
2854
 * differ only in character representation, but are otherwise
 
2855
 * identical.
 
2856
 *
 
2857
 * If @a metadata_only is @c TRUE, backends that have a concept of separate
 
2858
 * metadata verification will only perform that and skip the more expensive
 
2859
 * file context reconstruction and verification.  For FSFS format 7+ and
 
2860
 * FSX, this allows for a very fast check against external corruption.
 
2861
 *
 
2862
 * If @a verify_callback is not @c NULL, call it with @a verify_baton upon
 
2863
 * receiving an FS-specific structure failure or a revision verification
 
2864
 * failure.  Set @c revision callback argument to #SVN_INVALID_REVNUM or
 
2865
 * to the revision number respectively.  Set @c verify_err to svn_error_t
 
2866
 * describing the reason of the failure.  @c verify_err will be cleared
 
2867
 * after the callback returns, use svn_error_dup() to preserve the error.
 
2868
 * If @a verify_callback returns an error different from #SVN_NO_ERROR,
 
2869
 * stop verifying the repository and immediately return the error from
 
2870
 * @a verify_callback.
 
2871
 *
 
2872
 * If @a verify_callback is @c NULL, this function returns the first
 
2873
 * encountered verification error or #SVN_NO_ERROR if there were no failures
 
2874
 * during the verification.  Errors that prevent the verification process
 
2875
 * from continuing, such as #SVN_ERR_CANCELLED, are returned immediately
 
2876
 * and do not trigger an invocation of @a verify_callback.
 
2877
 *
 
2878
 * If @a notify_func is not null, then call it with @a notify_baton and
 
2879
 * with a notification structure in which the fields are set as follows.
 
2880
 * (For a warning that does not apply to a specific revision, the revision
 
2881
 * number is #SVN_INVALID_REVNUM.)
 
2882
 *
 
2883
 *   For each FS-specific structure warning:
 
2884
 *      @c action = svn_repos_notify_verify_rev_structure
 
2885
 *      @c revision = the revision or #SVN_INVALID_REVNUM
 
2886
 *
 
2887
 *   For each revision verification warning:
 
2888
 *      @c action = #svn_repos_notify_warning
 
2889
 *      @c warning and @c warning_str fields set accordingly
 
2890
 *        ### TODO: Set @c revision = the revision?
 
2891
 *
 
2892
 *   For each successfully verified revision:
 
2893
 *      @c action = #svn_repos_notify_verify_rev_end
 
2894
 *      @c revision = the revision
 
2895
 *
 
2896
 *   At the end:
 
2897
 *      @c action = svn_repos_notify_verify_end
 
2898
 *        ### Do we really need a callback to tell us the function we
 
2899
 *            called has reached its end and is about to return?
 
2900
 *        ### Not sent, currently, if a FS structure error is found.
2555
2901
 *
2556
2902
 * If @a cancel_func is not @c NULL, call it periodically with @a
2557
2903
 * cancel_baton as argument to see if the caller wishes to cancel the
2558
2904
 * verification.
2559
2905
 *
 
2906
 * Use @a scratch_pool for temporary allocation.
 
2907
 *
 
2908
 * @see svn_repos_verify_callback_t
 
2909
 *
 
2910
 * @since New in 1.9.
 
2911
 */
 
2912
svn_error_t *
 
2913
svn_repos_verify_fs3(svn_repos_t *repos,
 
2914
                     svn_revnum_t start_rev,
 
2915
                     svn_revnum_t end_rev,
 
2916
                     svn_boolean_t check_normalization,
 
2917
                     svn_boolean_t metadata_only,
 
2918
                     svn_repos_notify_func_t notify_func,
 
2919
                     void *notify_baton,
 
2920
                     svn_repos_verify_callback_t verify_callback,
 
2921
                     void *verify_baton,
 
2922
                     svn_cancel_func_t cancel,
 
2923
                     void *cancel_baton,
 
2924
                     apr_pool_t *scratch_pool);
 
2925
 
 
2926
/**
 
2927
 * Like svn_repos_verify_fs3(), but with @a verify_callback and
 
2928
 * @a verify_baton set to @c NULL and with @a check_normalization
 
2929
 * and @a metadata_only set to @c FALSE.
 
2930
 *
2560
2931
 * @since New in 1.7.
 
2932
 * @deprecated Provided for backward compatibility with the 1.8 API.
2561
2933
 */
 
2934
SVN_DEPRECATED
2562
2935
svn_error_t *
2563
2936
svn_repos_verify_fs2(svn_repos_t *repos,
2564
2937
                     svn_revnum_t start_rev,
2571
2944
 
2572
2945
/**
2573
2946
 * Similar to svn_repos_verify_fs2(), but with a feedback_stream instead of
2574
 
 * handling feedback via the notify_func handler
 
2947
 * handling feedback via the notify_func handler.
 
2948
 *
 
2949
 * If @a feedback_stream is not @c NULL, write feedback to it (lines of
 
2950
 * the form "* Verified revision %ld\n").
2575
2951
 *
2576
2952
 * @since New in 1.5.
2577
2953
 * @deprecated Provided for backward compatibility with the 1.6 API.
2588
2964
 
2589
2965
/**
2590
2966
 * Dump the contents of the filesystem within already-open @a repos into
2591
 
 * writable @a dumpstream.  Begin at revision @a start_rev, and dump every
2592
 
 * revision up through @a end_rev.  Use @a pool for all allocation.  If
2593
 
 * non-@c NULL, send feedback to @a feedback_stream.  If @a dumpstream is
 
2967
 * writable @a dumpstream.  If @a dumpstream is
2594
2968
 * @c NULL, this is effectively a primitive verify.  It is not complete,
2595
 
 * however; svn_repos_verify_fs2() and svn_fs_verify().
 
2969
 * however; see instead svn_repos_verify_fs3().
2596
2970
 *
2597
 
 * If @a start_rev is #SVN_INVALID_REVNUM, then start dumping at revision
2598
 
 * 0.  If @a end_rev is #SVN_INVALID_REVNUM, then dump through the @c HEAD
2599
 
 * revision.
 
2971
 * Begin at revision @a start_rev, and dump every revision up through
 
2972
 * @a end_rev.  If @a start_rev is #SVN_INVALID_REVNUM, start at revision
 
2973
 * 0.  If @a end_rev is #SVN_INVALID_REVNUM, end at the head revision.
2600
2974
 *
2601
2975
 * If @a incremental is @c TRUE, the first revision dumped will be a diff
2602
2976
 * against the previous revision (usually it looks like a full dump of
2609
2983
 * be done with full plain text.  A dump with @a use_deltas set cannot
2610
2984
 * be loaded by Subversion 1.0.x.
2611
2985
 *
2612
 
 * If @a notify_func is not @c NULL, then for every dumped revision call
2613
 
 * @a notify_func with @a rev set to the dumped revision and @a warning_text
2614
 
 * @c NULL. For warnings call @a notify_func with @a warning_text.
 
2986
 * If @a notify_func is not null, then call it with @a notify_baton and
 
2987
 * with a notification structure in which the fields are set as follows.
 
2988
 * (For a warning or error notification that does not apply to a specific
 
2989
 * revision, the revision number is #SVN_INVALID_REVNUM.)
 
2990
 *
 
2991
 *   For each warning:
 
2992
 *      @c action = #svn_repos_notify_warning
 
2993
 *      @c warning and @c warning_str fields set accordingly
 
2994
 *        ### TODO: Set @c revision = the revision or #SVN_INVALID_REVNUM?
 
2995
 *
 
2996
 *   For each successfully dumped revision:
 
2997
 *      @c action = #svn_repos_notify_dump_rev_end
 
2998
 *      @c revision = the revision
 
2999
 *
 
3000
 *   At the end:
 
3001
 *      @c action = svn_repos_notify_verify_end
 
3002
 *        ### Do we really need a callback to tell us the function we
 
3003
 *            called has reached its end and is about to return?
 
3004
 *
 
3005
 *   At the end, if there were certain warnings previously:
 
3006
 *      @c action = #svn_repos_notify_warning
 
3007
 *      @c warning and @c warning_str fields set accordingly,
 
3008
 *            reiterating the existence of previous warnings
 
3009
 *        ### This is a presentation issue. Caller could do this itself.
2615
3010
 *
2616
3011
 * If @a cancel_func is not @c NULL, it is called periodically with
2617
3012
 * @a cancel_baton as argument to see if the client wishes to cancel
2618
3013
 * the dump.
2619
3014
 *
 
3015
 * Use @a scratch_pool for temporary allocation.
 
3016
 *
2620
3017
 * @since New in 1.7.
2621
3018
 */
2622
3019
svn_error_t *
2709
3106
 * node properties (those in the svn: namespace) against established
2710
3107
 * rules for those things.
2711
3108
 *
 
3109
 * If @a ignore_dates is set, ignore any revision datestamps found in
 
3110
 * @a dumpstream, allowing the revisions created by the load process
 
3111
 * to be stamped as if they were newly created via the normal commit
 
3112
 * process.
 
3113
 *
2712
3114
 * If non-NULL, use @a notify_func and @a notify_baton to send notification
2713
3115
 * of events to the caller.
2714
3116
 *
2716
3118
 * @a cancel_baton as argument to see if the client wishes to cancel
2717
3119
 * the load.
2718
3120
 *
 
3121
 * @since New in 1.9.
 
3122
 */
 
3123
svn_error_t *
 
3124
svn_repos_load_fs5(svn_repos_t *repos,
 
3125
                   svn_stream_t *dumpstream,
 
3126
                   svn_revnum_t start_rev,
 
3127
                   svn_revnum_t end_rev,
 
3128
                   enum svn_repos_load_uuid uuid_action,
 
3129
                   const char *parent_dir,
 
3130
                   svn_boolean_t use_pre_commit_hook,
 
3131
                   svn_boolean_t use_post_commit_hook,
 
3132
                   svn_boolean_t validate_props,
 
3133
                   svn_boolean_t ignore_dates,
 
3134
                   svn_repos_notify_func_t notify_func,
 
3135
                   void *notify_baton,
 
3136
                   svn_cancel_func_t cancel_func,
 
3137
                   void *cancel_baton,
 
3138
                   apr_pool_t *pool);
 
3139
 
 
3140
/** Similar to svn_repos_load_fs5(), but with @a ignore_dates
 
3141
 * always passed as FALSE.
 
3142
 *
2719
3143
 * @since New in 1.8.
 
3144
 * @deprecated Provided for backward compatibility with the 1.8 API.
2720
3145
 */
 
3146
SVN_DEPRECATED
2721
3147
svn_error_t *
2722
3148
svn_repos_load_fs4(svn_repos_t *repos,
2723
3149
                   svn_stream_t *dumpstream,
2856
3282
  /** For a given @a node_baton, remove all properties. */
2857
3283
  svn_error_t *(*remove_node_props)(void *node_baton);
2858
3284
 
2859
 
  /** For a given @a node_baton, receive a writable @a stream capable of
2860
 
   * receiving the node's fulltext.  After writing the fulltext, call
2861
 
   * the stream's close() function.
 
3285
  /** For a given @a node_baton, set @a stream to a writable stream
 
3286
   * capable of receiving the node's fulltext.  The parser will write
 
3287
   * the fulltext to the stream and then close the stream to signal
 
3288
   * completion.
2862
3289
   *
2863
3290
   * If a @c NULL is returned instead of a stream, the vtable is
2864
3291
   * indicating that no text is desired, and the parser will not
2869
3296
 
2870
3297
  /** For a given @a node_baton, set @a handler and @a handler_baton
2871
3298
   * to a window handler and baton capable of receiving a delta
2872
 
   * against the node's previous contents.  A NULL window will be
2873
 
   * sent to the handler after all the windows are sent.
 
3299
   * against the node's previous contents.  The parser will send all
 
3300
   * the windows of data to this handler, and will then send a NULL
 
3301
   * window to signal completion.
2874
3302
   *
2875
3303
   * If a @c NULL is returned instead of a handler, the vtable is
2876
3304
   * indicating that no delta is desired, and the parser will not
2927
3355
 * but still allow expansion of the format: most headers do not have
2928
3356
 * to be handled explicitly.
2929
3357
 *
 
3358
 * ### [JAF] Wouldn't it be more efficient to support a start/end rev
 
3359
 *     range here than only supporting it in receivers such as
 
3360
 *     svn_repos_get_fs_build_parser4()? This parser could then skip over
 
3361
 *     chunks of the input stream before the oldest required rev, and
 
3362
 *     could stop reading entirely after the youngest required rev.
 
3363
 *
2930
3364
 * @since New in 1.8.
2931
3365
 */
2932
3366
svn_error_t *
2946
3380
 * to operate on the fs.
2947
3381
 *
2948
3382
 * @a start_rev and @a end_rev act as filters, the lower and upper
2949
 
 * (inclusive) range values of revisions in @a dumpstream which will
 
3383
 * (inclusive) range values of revisions which will
2950
3384
 * be loaded.  Either both of these values are #SVN_INVALID_REVNUM (in
2951
3385
 * which case no revision-based filtering occurs at all), or both are
2952
3386
 * valid revisions (where @a start_rev is older than or equivalent to
2953
 
 * @a end_rev).
2954
 
 *
2955
 
 * If @a use_history is set, then the parser will require relative
2956
 
 * 'copyfrom' history to exist in the repository when it encounters
2957
 
 * nodes that are added-with-history.
 
3387
 * @a end_rev).  They refer to dump stream revision numbers rather than
 
3388
 * committed revision numbers.
 
3389
 *
 
3390
 * If @a use_history is true, then when the parser encounters a node that
 
3391
 * is added-with-history, it will require 'copy-from' history to exist in
 
3392
 * the repository at the relative (adjusted) copy-from revision and path.
 
3393
 * It will perform a copy from that source location, and will fail if no
 
3394
 * suitable source exists there. If @a use_history is false, then it will
 
3395
 * instead convert every copy to a plain add.
 
3396
 *
 
3397
 * ### The 'use_history=FALSE' case is unused and untested in Subversion.
 
3398
 *     It seems to me it would not work with a deltas dumpfile (a driver
 
3399
 *     that calls the @c apply_textdelta method), as it would not have
 
3400
 *     access to the delta base text.
 
3401
 *
 
3402
 * If @a use_pre_commit_hook is set, call the repository's pre-commit
 
3403
 * hook before committing each loaded revision.
 
3404
 *
 
3405
 * If @a use_post_commit_hook is set, call the repository's
 
3406
 * post-commit hook after committing each loaded revision.
2958
3407
 *
2959
3408
 * If @a validate_props is set, then validate Subversion revision and
2960
3409
 * node properties (those in the svn: namespace) against established
2961
3410
 * rules for those things.
2962
3411
 *
 
3412
 * If @a ignore_dates is set, ignore any revision datestamps found in
 
3413
 * @a dumpstream, allowing the revisions created by the load process
 
3414
 * to be stamped as if they were newly created via the normal commit
 
3415
 * process.
 
3416
 *
2963
3417
 * If @a parent_dir is not NULL, then the parser will reparent all the
2964
3418
 * loaded nodes, from root to @a parent_dir.  The directory @a parent_dir
2965
3419
 * must be an existing directory in the repository.
2966
3420
 *
 
3421
 * @since New in 1.9.
 
3422
 */
 
3423
svn_error_t *
 
3424
svn_repos_get_fs_build_parser5(const svn_repos_parse_fns3_t **callbacks,
 
3425
                               void **parse_baton,
 
3426
                               svn_repos_t *repos,
 
3427
                               svn_revnum_t start_rev,
 
3428
                               svn_revnum_t end_rev,
 
3429
                               svn_boolean_t use_history,
 
3430
                               svn_boolean_t validate_props,
 
3431
                               enum svn_repos_load_uuid uuid_action,
 
3432
                               const char *parent_dir,
 
3433
                               svn_boolean_t use_pre_commit_hook,
 
3434
                               svn_boolean_t use_post_commit_hook,
 
3435
                               svn_boolean_t ignore_dates,
 
3436
                               svn_repos_notify_func_t notify_func,
 
3437
                               void *notify_baton,
 
3438
                               apr_pool_t *pool);
 
3439
 
 
3440
/**
 
3441
 * Similar to svn_repos_get_fs_build_parser5(), but with the
 
3442
 * @c use_pre_commit_hook, @c use_post_commit_hook and @c ignore_dates
 
3443
 * arguments all false.
 
3444
 *
2967
3445
 * @since New in 1.8.
 
3446
 * @deprecated Provided for backward compatibility with the 1.8 API.
2968
3447
 */
 
3448
SVN_DEPRECATED
2969
3449
svn_error_t *
2970
3450
svn_repos_get_fs_build_parser4(const svn_repos_parse_fns3_t **parser,
2971
3451
                               void **parse_baton,
2981
3461
                               apr_pool_t *pool);
2982
3462
 
2983
3463
 
 
3464
 
2984
3465
/**
2985
3466
 * A vtable that is driven by svn_repos_parse_dumpstream2().
2986
3467
 * Similar to #svn_repos_parse_fns3_t except that it lacks
2987
 
 * the delete_node_property and apply_textdelta callbacks.
 
3468
 * the magic_header_record callback.
2988
3469
 *
2989
3470
 * @deprecated Provided for backward compatibility with the 1.7 API.
2990
3471
 */
3312
3793
typedef enum svn_repos_revision_access_level_t
3313
3794
{
3314
3795
  /** no access allowed to the revision properties and all changed-paths
3315
 
   * information. */ 
 
3796
   * information. */
3316
3797
  svn_repos_revision_access_none,
3317
3798
  /** access granted to some (svn:date and svn:author) revision properties and
3318
3799
   * changed-paths information on paths the read has access to. */
3342
3823
                                void *authz_read_baton,
3343
3824
                                apr_pool_t *pool);
3344
3825
 
3345
 
/**
3346
 
 * Set @a *inherited_values to a depth-first ordered array of
3347
 
 * #svn_prop_inherited_item_t * structures (the path_or_url members of
3348
 
 * which are relative filesystem paths) representing the properties
3349
 
 * inherited by @a path in @a root.  If no properties are inherited,
3350
 
 * then set @a *inherited_values to an empty array.
3351
 
 *
3352
 
 * if @a propname is NULL then retrieve all explicit and/or inherited
3353
 
 * properties.  Otherwise retrieve only the properties named @a propname.
3354
 
 *
3355
 
 * If optional @a authz_read_func is non-NULL, then use this function
3356
 
 * (along with optional @a authz_read_baton) to check the readability
3357
 
 * of each parent path from which properties are inherited. Silently omit
3358
 
 * properties for unreadable parent paths.
3359
 
 *
3360
 
 * Allocate @a *inherited_props in @a result_pool.  Use @a scratch_pool for
3361
 
 * temporary allocations.
3362
 
 *
3363
 
 * @since New in 1.8.
3364
 
 */
3365
 
svn_error_t *
3366
 
svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props,
3367
 
                                 svn_fs_root_t *root,
3368
 
                                 const char *path,
3369
 
                                 const char *propname,
3370
 
                                 svn_repos_authz_func_t authz_read_func,
3371
 
                                 void *authz_read_baton,
3372
 
                                 apr_pool_t *result_pool,
3373
 
                                 apr_pool_t *scratch_pool);
3374
 
 
3375
 
 
3376
 
/** Capabilities **/
3377
 
 
3378
 
/**
3379
 
 * Store in @a repos the client-reported capabilities @a capabilities,
3380
 
 * which must be allocated in memory at least as long-lived as @a repos.
3381
 
 *
3382
 
 * The elements of @a capabilities are 'const char *', a subset of
3383
 
 * the constants beginning with @c SVN_RA_CAPABILITY_.
3384
 
 * @a capabilities is not copied, so changing it later will affect
3385
 
 * what is remembered by @a repos.
3386
 
 *
3387
 
 * @note The capabilities are passed along to the start-commit hook;
3388
 
 * see that hook's template for details.
3389
 
 *
3390
 
 * @note As of Subversion 1.5, there are no error conditions defined,
3391
 
 * so this always returns SVN_NO_ERROR.  In future releases it may
3392
 
 * return error, however, so callers should check.
3393
 
 *
3394
 
 * @since New in 1.5.
3395
 
 */
3396
 
svn_error_t *
3397
 
svn_repos_remember_client_capabilities(svn_repos_t *repos,
3398
 
                                       const apr_array_header_t *capabilities);
3399
 
 
3400
3826
 
3401
3827
#ifdef __cplusplus
3402
3828
}