Author: danielsh Date: Fri Jul 9 00:55:50 2010 New Revision: 962378 URL: http://svn.apache.org/viewvc?rev=962378&view=rev Log: Fix issue #3641: improve svn_repos_replay2()'s handling of dir replaces.
See these threads: http://thread.gmane.org/[email protected] (dev@) http://thread.gmane.org/[email protected] (users@) * subversion/libsvn_repos/replay.c (add_subdir): Set SOURCE_PATH and SOURCE_ROOT correctly when recursing. * subversion/tests/cmdline/svnsync_tests.py (descend_into_replace): Expect it to pass. Modified: subversion/trunk/subversion/libsvn_repos/replay.c subversion/trunk/subversion/tests/cmdline/svnsync_tests.py Modified: subversion/trunk/subversion/libsvn_repos/replay.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/replay.c?rev=962378&r1=962377&r2=962378&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_repos/replay.c (original) +++ subversion/trunk/subversion/libsvn_repos/replay.c Fri Jul 9 00:55:50 2010 @@ -199,6 +199,8 @@ add_subdir(svn_fs_root_t *source_root, svn_fs_path_change2_t *change; svn_boolean_t readable = TRUE; svn_fs_dirent_t *dent; + const char *copyfrom_path = NULL; + svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM; const char *new_path; void *val; @@ -221,6 +223,13 @@ add_subdir(svn_fs_root_t *source_root, /* If it's a delete, skip this entry. */ if (change->change_kind == svn_fs_path_change_delete) continue; + else if (change->change_kind == svn_fs_path_change_replace) + { + /* ### Can this assert fail? */ + SVN_ERR_ASSERT(change->copyfrom_known); + copyfrom_path = change->copyfrom_path; + copyfrom_rev = change->copyfrom_rev; + } } if (authz_read_func) @@ -232,12 +241,31 @@ add_subdir(svn_fs_root_t *source_root, if (dent->kind == svn_node_dir) { + svn_fs_root_t *new_source_root; + const char *new_source_path; void *new_dir_baton; - SVN_ERR(add_subdir(source_root, target_root, editor, edit_baton, + if (copyfrom_path) + { + svn_fs_t *fs = svn_fs_root_fs(source_root); + SVN_ERR(svn_fs_revision_root(&new_source_root, fs, copyfrom_rev, pool)); + new_source_path = copyfrom_path; + } + else + { + new_source_root = source_root; + new_source_path = svn_path_join(source_path, dent->name, + subpool); + } + + /* ### authz considerations? + * + * I think not; when path_driver_cb_func() calls add_subdir(), it + * passes SOURCE_ROOT and SOURCE_PATH that are unreadable. + */ + SVN_ERR(add_subdir(new_source_root, target_root, editor, edit_baton, new_path, *dir_baton, - svn_path_join(source_path, dent->name, - subpool), + new_source_path, authz_read_func, authz_read_baton, changed_paths, subpool, &new_dir_baton)); Modified: subversion/trunk/subversion/tests/cmdline/svnsync_tests.py URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnsync_tests.py?rev=962378&r1=962377&r2=962378&view=diff ============================================================================== --- subversion/trunk/subversion/tests/cmdline/svnsync_tests.py (original) +++ subversion/trunk/subversion/tests/cmdline/svnsync_tests.py Fri Jul 9 00:55:50 2010 @@ -820,7 +820,7 @@ test_list = [ None, copy_bad_line_endings, delete_svn_props, commit_a_copy_of_root, - XFail(descend_into_replace), + descend_into_replace, ] if __name__ == '__main__':
