delete.c (251886) | delete.c (269833) |
---|---|
1/* 2 * delete.c: wrappers around wc delete functionality. 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 --- 179 unchanged lines hidden (view full) --- 188{ 189 const svn_delta_editor_t *editor = callback_baton; 190 *dir_baton = NULL; 191 return editor->delete_entry(path, SVN_INVALID_REVNUM, parent_baton, pool); 192} 193 194static svn_error_t * 195single_repos_delete(svn_ra_session_t *ra_session, | 1/* 2 * delete.c: wrappers around wc delete functionality. 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 --- 179 unchanged lines hidden (view full) --- 188{ 189 const svn_delta_editor_t *editor = callback_baton; 190 *dir_baton = NULL; 191 return editor->delete_entry(path, SVN_INVALID_REVNUM, parent_baton, pool); 192} 193 194static svn_error_t * 195single_repos_delete(svn_ra_session_t *ra_session, |
196 const char *repos_root, | 196 const char *base_uri, |
197 const apr_array_header_t *relpaths, 198 const apr_hash_t *revprop_table, 199 svn_commit_callback2_t commit_callback, 200 void *commit_baton, 201 svn_client_ctx_t *ctx, 202 apr_pool_t *pool) 203{ 204 const svn_delta_editor_t *editor; --- 11 unchanged lines hidden (view full) --- 216 apr_array_header_t *commit_items 217 = apr_array_make(pool, relpaths->nelts, sizeof(item)); 218 219 for (i = 0; i < relpaths->nelts; i++) 220 { 221 const char *relpath = APR_ARRAY_IDX(relpaths, i, const char *); 222 223 item = svn_client_commit_item3_create(pool); | 197 const apr_array_header_t *relpaths, 198 const apr_hash_t *revprop_table, 199 svn_commit_callback2_t commit_callback, 200 void *commit_baton, 201 svn_client_ctx_t *ctx, 202 apr_pool_t *pool) 203{ 204 const svn_delta_editor_t *editor; --- 11 unchanged lines hidden (view full) --- 216 apr_array_header_t *commit_items 217 = apr_array_make(pool, relpaths->nelts, sizeof(item)); 218 219 for (i = 0; i < relpaths->nelts; i++) 220 { 221 const char *relpath = APR_ARRAY_IDX(relpaths, i, const char *); 222 223 item = svn_client_commit_item3_create(pool); |
224 item->url = svn_path_url_add_component2(repos_root, relpath, pool); | 224 item->url = svn_path_url_add_component2(base_uri, relpath, pool); |
225 item->state_flags = SVN_CLIENT_COMMIT_ITEM_DELETE; 226 APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; 227 } 228 SVN_ERR(svn_client__get_log_msg(&log_msg, &tmp_file, commit_items, 229 ctx, pool)); 230 if (! log_msg) 231 return SVN_NO_ERROR; 232 } --- 123 unchanged lines hidden (view full) --- 356 "URL '%s' does not exist", uri); 357 } 358 359 /* Now we iterate over the DELETABLES hash, issuing a commit for 360 each repository with its associated collected targets. */ 361 iterpool = svn_pool_create(pool); 362 for (hi = apr_hash_first(pool, deletables); hi; hi = apr_hash_next(hi)) 363 { | 225 item->state_flags = SVN_CLIENT_COMMIT_ITEM_DELETE; 226 APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item; 227 } 228 SVN_ERR(svn_client__get_log_msg(&log_msg, &tmp_file, commit_items, 229 ctx, pool)); 230 if (! log_msg) 231 return SVN_NO_ERROR; 232 } --- 123 unchanged lines hidden (view full) --- 356 "URL '%s' does not exist", uri); 357 } 358 359 /* Now we iterate over the DELETABLES hash, issuing a commit for 360 each repository with its associated collected targets. */ 361 iterpool = svn_pool_create(pool); 362 for (hi = apr_hash_first(pool, deletables); hi; hi = apr_hash_next(hi)) 363 { |
364 const char *repos_root = svn__apr_hash_index_key(hi); | |
365 struct repos_deletables_t *repos_deletables = svn__apr_hash_index_val(hi); 366 const char *base_uri; 367 apr_array_header_t *target_relpaths; 368 369 svn_pool_clear(iterpool); 370 371 /* We want to anchor the commit on the longest common path 372 across the targets for this one repository. If, however, one --- 20 unchanged lines hidden (view full) --- 393 { 394 const char *target_relpath; 395 396 svn_uri_split(&base_uri, &target_relpath, base_uri, iterpool); 397 APR_ARRAY_IDX(target_relpaths, 0, const char *) = target_relpath; 398 } 399 400 SVN_ERR(svn_ra_reparent(repos_deletables->ra_session, base_uri, pool)); | 364 struct repos_deletables_t *repos_deletables = svn__apr_hash_index_val(hi); 365 const char *base_uri; 366 apr_array_header_t *target_relpaths; 367 368 svn_pool_clear(iterpool); 369 370 /* We want to anchor the commit on the longest common path 371 across the targets for this one repository. If, however, one --- 20 unchanged lines hidden (view full) --- 392 { 393 const char *target_relpath; 394 395 svn_uri_split(&base_uri, &target_relpath, base_uri, iterpool); 396 APR_ARRAY_IDX(target_relpaths, 0, const char *) = target_relpath; 397 } 398 399 SVN_ERR(svn_ra_reparent(repos_deletables->ra_session, base_uri, pool)); |
401 SVN_ERR(single_repos_delete(repos_deletables->ra_session, repos_root, | 400 SVN_ERR(single_repos_delete(repos_deletables->ra_session, base_uri, |
402 target_relpaths, 403 revprop_table, commit_callback, 404 commit_baton, ctx, iterpool)); 405 } 406 svn_pool_destroy(iterpool); 407 408 return SVN_NO_ERROR; 409} --- 186 unchanged lines hidden --- | 401 target_relpaths, 402 revprop_table, commit_callback, 403 commit_baton, ctx, iterpool)); 404 } 405 svn_pool_destroy(iterpool); 406 407 return SVN_NO_ERROR; 408} --- 186 unchanged lines hidden --- |