Author: julianfoad
Date: Tue Jan 19 15:21:09 2010
New Revision: 900817
URL: http://svn.apache.org/viewvc?rev=900817&view=rev
Log:
For Obliterate, make a fix to the cloning of the BDB 'changes' table.
* subversion/libsvn_fs_base/revs-txns.c
(changes_dup): Update all references to the current txn: don't assume that
the node-rev id in a 'delete' refers to a different txn, because we find
that some 'delete' rows have a node-rev id referring to their own txn.
Modified:
subversion/trunk/subversion/libsvn_fs_base/revs-txns.c
Modified: subversion/trunk/subversion/libsvn_fs_base/revs-txns.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/revs-txns.c?rev=900817&r1=900816&r2=900817&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/revs-txns.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/revs-txns.c Tue Jan 19 15:21:09
2010
@@ -437,9 +437,10 @@
/* Duplicate all entries in the "changes" table that are keyed by OLD_TXN_ID,
* creating new entries that are keyed by NEW_TXN_ID.
*
- * Each new "change" has the same content as the old one, except that if the
+ * Give each new "change" the same content as the old one, except that if the
* txn-id component of its noderev-id is OLD_TXN_ID (which is the case for
- * all changes except deletes) then that is changed to NEW_TXN_ID.
+ * all changes except deletes, and for some deletes, it seems) then change
+ * that to NEW_TXN_ID.
*
* Work within TRAIL. */
static svn_error_t *
@@ -456,17 +457,15 @@
for (i = 0; i < changes->nelts; i++)
{
change_t *change = APR_ARRAY_IDX(changes, i, change_t *);
-
- if (change->kind != svn_fs_path_change_delete
- && change->kind != svn_fs_path_change_reset)
+ const char *node_id = svn_fs_base__id_node_id(change->noderev_id);
+ const char *copy_id = svn_fs_base__id_copy_id(change->noderev_id);
+ const char *txn_id = svn_fs_base__id_txn_id(change->noderev_id);
+
+ /* if (change->kind != svn_fs_path_change_delete
+ * && change->kind != svn_fs_path_change_reset) */
+ if (svn_fs_base__key_compare(txn_id, old_txn_id) == 0)
{
- const char *node_id, *copy_id;
-
/* Modify the "change": change noderev_id's txn_id to NEW_TXN_ID */
- node_id = svn_fs_base__id_node_id(change->noderev_id);
- copy_id = svn_fs_base__id_copy_id(change->noderev_id);
- SVN_ERR_ASSERT(svn_fs_base__key_compare(
- svn_fs_base__id_txn_id(change->noderev_id), old_txn_id) == 0);
change->noderev_id = svn_fs_base__id_create(node_id, copy_id,
new_txn_id,
scratch_pool);