Tweak “svnrdump load” tests to pass with svnadmin 1.6
[svnrdump.git] / load_editor.h
blob8602248e864295794b1c13257ab35a953527c891
1 /**
2 * @copyright
3 * ====================================================================
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 * ====================================================================
21 * @endcopyright
23 * @file load_editor.h
24 * @brief The svn_delta_editor_t editor used by svnrdump to load
25 * revisions.
28 #ifndef LOAD_EDITOR_H_
29 #define LOAD_EDITOR_H_
31 /**
32 * General baton used by the parser functions.
34 struct parse_baton
36 const svn_delta_editor_t *commit_editor;
37 void *commit_edit_baton;
38 svn_ra_session_t *session;
39 const char *uuid;
40 const char *root_url;
41 apr_pool_t *pool;
44 /**
45 * Baton used to represent a node; to be used by the parser
46 * functions. Contains a link to the revision baton.
48 struct node_baton
50 const char *path;
51 svn_node_kind_t kind;
52 enum svn_node_action action;
54 svn_revnum_t copyfrom_rev;
55 const char *copyfrom_path;
57 void *file_baton;
58 struct revision_baton *rb;
61 /**
62 * Baton used to represet a revision; used by the parser
63 * functions. Contains a link to the parser baton.
65 struct revision_baton
67 svn_revnum_t rev;
68 apr_hash_t *revprop_table;
70 const svn_string_t *datestamp;
71 const svn_string_t *author;
73 struct parse_baton *pb;
74 apr_pool_t *pool;
75 void *dir_baton; /* Keep track of dirs */
78 /**
79 * Build up a load editor @a parser for parsing a dumpfile stream from @a stream
80 * set to fire the appropriate callbacks in load editor along with a
81 * @a parser_baton, using @a pool for all memory allocations. The
82 * @a editor/ @a edit_baton are central to the functionality of the
83 * parser.
85 svn_error_t *
86 get_dumpstream_loader(const svn_repos_parse_fns2_t **parser,
87 void **parse_baton,
88 svn_ra_session_t *session,
89 apr_pool_t *pool);
91 /**
92 * Drive the load editor @a editor using the data in @a stream using
93 * @a pool for all memory allocations.
95 svn_error_t *
96 drive_dumpstream_loader(svn_stream_t *stream,
97 const svn_repos_parse_fns2_t *parser,
98 void *parse_baton,
99 svn_ra_session_t *session,
100 apr_pool_t *pool);
102 #endif