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 2012/03/05 19:31:47 UTC
svn commit: r1297152 -
/subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c
Author: stsp
Date: Mon Mar 5 18:31:46 2012
New Revision: 1297152
URL: http://svn.apache.org/viewvc?rev=1297152&view=rev
Log:
On the multi-layer-moves branch, repair 'svn status' output for moved-away
nodes. Such nodes where only shown as moved-away if they were the status root.
Move information for children of the status root was still being searched
in the BASE tree.
* subversion/libsvn_wc/wc_db.c
(read_children_info): Read moved-to columns for op_depth > 0 rows,
rather than op_depth == 0 rows. While here, add a sanity check that
triggers on rows which have both moved_here and moved_to set -- this
is an invalid row state.
Modified:
subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c
Modified: subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c?rev=1297152&r1=1297151&r2=1297152&view=diff
==============================================================================
--- subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/multi-layer-moves/subversion/libsvn_wc/wc_db.c Mon Mar 5 18:31:46 2012
@@ -7413,31 +7413,40 @@ read_children_info(void *baton,
if (op_depth == 0)
{
- const char *moved_to_relpath;
-
child_item->info.have_base = TRUE;
/* Get the lock info, available only at op_depth 0. */
child_item->info.lock = lock_from_columns(stmt, 15, 16, 17, 18,
result_pool);
- /* Moved-to is only stored at op_depth 0. */
- moved_to_relpath = svn_sqlite__column_text(stmt, 21, NULL);
- if (moved_to_relpath)
- child_item->info.moved_to_abspath =
- svn_dirent_join(wcroot->abspath, moved_to_relpath, result_pool);
-
/* FILE_EXTERNAL flag only on op_depth 0. */
child_item->info.file_external = svn_sqlite__column_boolean(stmt,
22);
}
else
{
+ const char *moved_to_relpath;
+
child_item->nr_layers++;
child_item->info.have_more_work = (child_item->nr_layers > 1);
+ /* Moved-to can only exist at op_depth > 0. */
+ moved_to_relpath = svn_sqlite__column_text(stmt, 21, NULL);
+ if (moved_to_relpath)
+ child_item->info.moved_to_abspath =
+ svn_dirent_join(wcroot->abspath, moved_to_relpath, result_pool);
+
/* Moved-here can only exist at op_depth > 0. */
child_item->info.moved_here = svn_sqlite__column_boolean(stmt, 20);
+
+ /* Sanity check: A child is either moved-here, or moved-away. */
+ if (child_item->info.moved_here && moved_to_relpath)
+ return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+ _("The node '%s' has ambiguous move information"),
+ svn_dirent_local_style(svn_dirent_join(wcroot->abspath,
+ child_relpath,
+ scratch_pool),
+ scratch_pool));
}
SVN_ERR(svn_sqlite__step(&have_row, stmt));