2 * migrate.c: Migrate history from non-move-tracking revisions
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
13 * http://www.apache.org/licenses/LICENSE-2.0
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
21 * ====================================================================
24 #include "svn_types.h"
25 #include "svn_error.h"
26 #include "svn_delta.h"
29 #include "private/svn_branch.h"
30 #include "private/svn_branch_compat.h"
32 #include "svn_private_config.h"
37 svn_branch__txn_t *edit_txn;
38 svn_ra_session_t *from_session;
39 svn_revnum_t revision;
44 struct edit_baton *edit_baton;
49 struct edit_baton *edit_baton;
53 set_target_revision(void *edit_baton,
54 svn_revnum_t target_revision,
57 /*struct edit_baton *eb = edit_baton;*/
59 /*SVN_ERR(eb->wrapped_editor->set_target_revision(eb->wrapped_edit_baton,
66 open_root(void *edit_baton,
67 svn_revnum_t base_revision,
71 struct edit_baton *eb = edit_baton;
72 struct dir_baton *dir_baton = apr_palloc(pool, sizeof(*dir_baton));
74 /*SVN_ERR(eb->wrapped_editor->open_root(eb->wrapped_edit_baton,
77 &dir_baton->wrapped_dir_baton));*/
79 dir_baton->edit_baton = eb;
81 *root_baton = dir_baton;
87 delete_entry(const char *path,
88 svn_revnum_t base_revision,
92 /*struct dir_baton *pb = parent_baton;
93 struct edit_baton *eb = pb->edit_baton;*/
95 /*SVN_ERR(eb->wrapped_editor->delete_entry(path,
97 pb->wrapped_dir_baton,
103 add_directory(const char *path,
105 const char *copyfrom_path,
106 svn_revnum_t copyfrom_revision,
110 struct dir_baton *pb = parent_baton;
111 struct edit_baton *eb = pb->edit_baton;
112 struct dir_baton *db = apr_palloc(pool, sizeof(*db));
114 /*SVN_ERR(eb->wrapped_editor->add_directory(path,
115 pb->wrapped_dir_baton,
119 &db->wrapped_dir_baton));*/
128 open_directory(const char *path,
130 svn_revnum_t base_revision,
134 struct dir_baton *pb = parent_baton;
135 struct edit_baton *eb = pb->edit_baton;
136 struct dir_baton *db = apr_palloc(pool, sizeof(*db));
138 /*SVN_ERR(eb->wrapped_editor->open_directory(path,
139 pb->wrapped_dir_baton,
142 &db->wrapped_dir_baton));*/
151 add_file(const char *path,
153 const char *copyfrom_path,
154 svn_revnum_t copyfrom_revision,
158 struct dir_baton *pb = parent_baton;
159 struct edit_baton *eb = pb->edit_baton;
160 struct file_baton *fb = apr_palloc(pool, sizeof(*fb));
162 /*SVN_ERR(eb->wrapped_editor->add_file(path,
163 pb->wrapped_dir_baton,
167 &fb->wrapped_file_baton));*/
176 open_file(const char *path,
178 svn_revnum_t base_revision,
182 struct dir_baton *pb = parent_baton;
183 struct edit_baton *eb = pb->edit_baton;
184 struct file_baton *fb = apr_palloc(pool, sizeof(*fb));
186 /*SVN_ERR(eb->wrapped_editor->open_file(path,
187 pb->wrapped_dir_baton,
190 &fb->wrapped_file_baton));*/
199 apply_textdelta(void *file_baton,
200 const char *base_checksum,
202 svn_txdelta_window_handler_t *handler,
203 void **handler_baton)
205 /*struct file_baton *fb = file_baton;
206 struct edit_baton *eb = fb->edit_baton;*/
208 /*SVN_ERR(eb->wrapped_editor->apply_textdelta(fb->wrapped_file_baton,
218 close_file(void *file_baton,
219 const char *text_checksum,
222 /*struct file_baton *fb = file_baton;
223 struct edit_baton *eb = fb->edit_baton;*/
225 /*SVN_ERR(eb->wrapped_editor->close_file(fb->wrapped_file_baton,
226 text_checksum, pool));*/
232 absent_file(const char *path,
236 /*struct file_baton *fb = file_baton;
237 struct edit_baton *eb = fb->edit_baton;*/
239 /*SVN_ERR(eb->wrapped_editor->absent_file(path, fb->wrapped_file_baton,
246 close_directory(void *dir_baton,
249 /*struct dir_baton *db = dir_baton;
250 struct edit_baton *eb = db->edit_baton;*/
252 /*SVN_ERR(eb->wrapped_editor->close_directory(db->wrapped_dir_baton,
259 absent_directory(const char *path,
263 /*struct dir_baton *db = dir_baton;
264 struct edit_baton *eb = db->edit_baton;*/
266 /*SVN_ERR(eb->wrapped_editor->absent_directory(path, db->wrapped_dir_baton,
273 change_file_prop(void *file_baton,
275 const svn_string_t *value,
278 /*struct file_baton *fb = file_baton;
279 struct edit_baton *eb = fb->edit_baton;*/
281 /*SVN_ERR(eb->wrapped_editor->change_file_prop(fb->wrapped_file_baton,
290 change_dir_prop(void *dir_baton,
292 const svn_string_t *value,
295 /*struct dir_baton *db = dir_baton;
296 struct edit_baton *eb = db->edit_baton;*/
298 /*SVN_ERR(eb->wrapped_editor->change_dir_prop(db->wrapped_dir_baton,
307 close_edit(void *edit_baton,
310 /*struct edit_baton *eb = edit_baton;*/
312 /*SVN_ERR(eb->wrapped_editor->close_edit(eb->wrapped_edit_baton, pool));*/
318 abort_edit(void *edit_baton,
321 /*struct edit_baton *eb = edit_baton;*/
323 /*SVN_ERR(eb->wrapped_editor->abort_edit(eb->wrapped_edit_baton, pool));*/
329 svn_branch__compat_get_migration_editor(
330 const svn_delta_editor_t **old_editor,
331 void **old_edit_baton,
332 svn_branch__txn_t *edit_txn,
333 svn_ra_session_t *from_session,
334 svn_revnum_t revision,
335 apr_pool_t *result_pool)
337 static const svn_delta_editor_t editor = {
355 struct edit_baton *eb = apr_palloc(result_pool, sizeof(*eb));
357 eb->edit_txn = edit_txn;
358 eb->from_session = from_session;
359 eb->revision = revision;
361 *old_editor = &editor;
362 *old_edit_baton = eb;