svnrdump.h revision 362181
1/*
2 *  svnrdump.h: Internal header file for svnrdump.
3 *
4 * ====================================================================
5 *    Licensed to the Apache Software Foundation (ASF) under one
6 *    or more contributor license agreements.  See the NOTICE file
7 *    distributed with this work for additional information
8 *    regarding copyright ownership.  The ASF licenses this file
9 *    to you under the Apache License, Version 2.0 (the
10 *    "License"); you may not use this file except in compliance
11 *    with the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 *    Unless required by applicable law or agreed to in writing,
16 *    software distributed under the License is distributed on an
17 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 *    KIND, either express or implied.  See the License for the
19 *    specific language governing permissions and limitations
20 *    under the License.
21 * ====================================================================
22 */
23
24
25#ifndef SVNRDUMP_H
26#define SVNRDUMP_H
27
28/*** Includes. ***/
29#include "svn_error.h"
30#include "svn_pools.h"
31#include "svn_hash.h"
32#include "svn_delta.h"
33#include "svn_ra.h"
34
35#include "private/svn_editor.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif /* __cplusplus */
40
41
42/**
43 * Get a dump editor @a editor along with a @a edit_baton allocated in
44 * @a pool.  The editor will write output to @a stream.
45 *
46 * @a update_anchor_relpath is the repository relative path of the
47 * anchor of the update-style drive which will happen on @a *editor;
48 * if a replay-style drive will instead be used, it should be passed
49 * as @c NULL.
50 *
51 * Use @a cancel_func and @a cancel_baton to check for user
52 * cancellation of the operation (for timely-but-safe termination).
53 */
54svn_error_t *
55svn_rdump__get_dump_editor(const svn_delta_editor_t **editor,
56                           void **edit_baton,
57                           svn_revnum_t revision,
58                           svn_stream_t *stream,
59                           svn_ra_session_t *ra_session,
60                           const char *update_anchor_relpath,
61                           svn_cancel_func_t cancel_func,
62                           void *cancel_baton,
63                           apr_pool_t *pool);
64
65/* Same as above, only returns an Ev2 editor. */
66svn_error_t *
67svn_rdump__get_dump_editor_v2(svn_editor_t **editor,
68                              svn_revnum_t revision,
69                              svn_stream_t *stream,
70                              svn_ra_session_t *ra_session,
71                              const char *edit_root_relpath,
72                              svn_cancel_func_t cancel_func,
73                              void *cancel_baton,
74                              apr_pool_t *scratch_pool,
75                              apr_pool_t *result_pool);
76
77
78/**
79 * Load the dumpstream carried in @a stream to the location described
80 * by @a session.
81 *
82 * Use @a aux_session (which is opened to the same URL as @a session)
83 * for any secondary, out-of-band RA communications required. This is
84 * needed when loading a non-deltas dump, and for Ev2.
85 *
86 * Print feedback to the console for each revision, unless @a quiet is true.
87 *
88 * Ignore (don't set) any revision property whose name is a key in
89 * @a skip_revprops. The values in the hash are unimportant.
90 *
91 * Use @a cancel_func and @a cancel_baton to check for user cancellation
92 * of the operation (for timely-but-safe termination).
93 *
94 * Use @a pool for all memory allocations.
95 */
96svn_error_t *
97svn_rdump__load_dumpstream(svn_stream_t *stream,
98                           svn_ra_session_t *session,
99                           svn_ra_session_t *aux_session,
100                           svn_boolean_t quiet,
101                           apr_hash_t *skip_revprops,
102                           svn_cancel_func_t cancel_func,
103                           void *cancel_baton,
104                           apr_pool_t *pool);
105
106
107/* Normalize the line ending style of the values of properties in PROPS
108 * that "need translation" (according to svn_prop_needs_translation(),
109 * currently all svn:* props) so that they contain only LF (\n) line endings.
110 *
111 * Put the normalized props into NORMAL_PROPS, allocated in RESULT_POOL.
112 */
113svn_error_t *
114svn_rdump__normalize_props(apr_hash_t **normal_props,
115                           apr_hash_t *props,
116                           apr_pool_t *result_pool);
117
118#ifdef __cplusplus
119}
120#endif /* __cplusplus */
121
122#endif /* SVNRDUMP_H */
123