You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/23 15:36:52 UTC
svn commit: r1535029 -
/subversion/trunk/subversion/libsvn_fs_fs/transaction.c
Author: stefan2
Date: Wed Oct 23 13:36:51 2013
New Revision: 1535029
URL: http://svn.apache.org/r1535029
Log:
Fix type mismatch in FSFS verify_moves code, currently not inactive
on /trunk.
The problem is that changed path list arrays contain change_t *
instances while hashes contain svn_fs_path_change2_t *. Make sure
to use the correct element type depending on the container type.
* subversion/libsvn_fs_fs/transaction.c
(check_for_duplicate_move_source): use the "smaller" type as argument
since that can always be provided
(verify_moves): use the correct element types
Found by: philip
Modified:
subversion/trunk/subversion/libsvn_fs_fs/transaction.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1535029&r1=1535028&r2=1535029&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Wed Oct 23 13:36:51 2013
@@ -2883,23 +2883,23 @@ verify_locks(svn_fs_t *fs,
Allocate the hashed strings in POOL. */
static svn_error_t *
check_for_duplicate_move_source(apr_hash_t *source_paths,
- change_t *change,
+ svn_fs_path_change2_t *change,
apr_pool_t *pool)
{
- if ( change->info.change_kind == svn_fs_path_change_move
- || change->info.change_kind == svn_fs_path_change_movereplace)
- if (change->info.copyfrom_path)
+ if ( change->change_kind == svn_fs_path_change_move
+ || change->change_kind == svn_fs_path_change_movereplace)
+ if (change->copyfrom_path)
{
- apr_size_t len = strlen(change->info.copyfrom_path);
- if (apr_hash_get(source_paths, change->info.copyfrom_path, len))
+ apr_size_t len = strlen(change->copyfrom_path);
+ if (apr_hash_get(source_paths, change->copyfrom_path, len))
return svn_error_createf(SVN_ERR_FS_AMBIGUOUS_MOVE, NULL,
_("Path '%s' has been moved to more than one target"),
- change->info.copyfrom_path);
+ change->copyfrom_path);
apr_hash_set(source_paths,
- apr_pstrmemdup(pool, change->info.copyfrom_path, len),
+ apr_pstrmemdup(pool, change->copyfrom_path, len),
len,
- change->info.copyfrom_path);
+ change->copyfrom_path);
}
return SVN_NO_ERROR;
@@ -2932,12 +2932,12 @@ verify_moves(svn_fs_t *fs,
{
const char *path;
apr_ssize_t len;
- change_t *change;
+ svn_fs_path_change2_t *change;
apr_hash_this(hi, (const void**)&path, &len, (void**)&change);
- if ( change->info.copyfrom_path
- && ( change->info.change_kind == svn_fs_path_change_move
- || change->info.change_kind == svn_fs_path_change_movereplace))
+ if ( change->copyfrom_path
+ && ( change->change_kind == svn_fs_path_change_move
+ || change->change_kind == svn_fs_path_change_movereplace))
{
svn_sort__item_t *item = apr_array_push(moves);
item->key = path;
@@ -2945,9 +2945,9 @@ verify_moves(svn_fs_t *fs,
item->value = change;
}
- if ( change->info.change_kind == svn_fs_path_change_delete
- || change->info.change_kind == svn_fs_path_change_replace
- || change->info.change_kind == svn_fs_path_change_movereplace)
+ if ( change->change_kind == svn_fs_path_change_delete
+ || change->change_kind == svn_fs_path_change_replace
+ || change->change_kind == svn_fs_path_change_movereplace)
APR_ARRAY_PUSH(deletions, const char *) = path;
}
@@ -2978,10 +2978,9 @@ verify_moves(svn_fs_t *fs,
deleted_path);
if (relpath)
{
- change_t *closed_move = closest_move_item->value;
+ svn_fs_path_change2_t *closed_move = closest_move_item->value;
APR_ARRAY_IDX(deletions, i, const char*)
- = svn_dirent_join(closed_move->info.copyfrom_path, relpath,
- pool);
+ = svn_dirent_join(closed_move->copyfrom_path, relpath, pool);
}
}
}
@@ -3007,7 +3006,8 @@ verify_moves(svn_fs_t *fs,
changes_p = (change_t **)&changes->elts;
for (i = 0; i < changes->nelts; ++i)
- SVN_ERR(check_for_duplicate_move_source(source_paths, changes_p[i],
+ SVN_ERR(check_for_duplicate_move_source(source_paths,
+ &changes_p[i]->info,
pool));
}
@@ -3015,23 +3015,24 @@ verify_moves(svn_fs_t *fs,
for (i = 0; i < moves->nelts; ++i)
{
- change_t *change = APR_ARRAY_IDX(moves, i, svn_sort__item_t).value;
+ svn_fs_path_change2_t *change
+ = APR_ARRAY_IDX(moves, i, svn_sort__item_t).value;
/* there must be a deletion of move's copy-from path
(or any of its parents) */
int closest_deletion_idx
- = svn_sort__bsearch_lower_bound(change->info.copyfrom_path, deletions,
+ = svn_sort__bsearch_lower_bound(change->copyfrom_path, deletions,
svn_sort_compare_paths);
if (closest_deletion_idx < deletions->nelts)
{
const char *closest_deleted_path
= APR_ARRAY_IDX(deletions, closest_deletion_idx, const char *);
if (!svn_dirent_is_ancestor(closest_deleted_path,
- change->info.copyfrom_path))
+ change->copyfrom_path))
return svn_error_createf(SVN_ERR_FS_INCOMPLETE_MOVE, NULL,
_("Path '%s' has been moved without being deleted"),
- change->info.copyfrom_path);
+ change->copyfrom_path);
}
}