[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1716548 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 26 Nov 2015 18:17:07 +0000

Philip Martin <philip.martin_at_wandisco.com> writes:

> I suppose one way to fix this would be to ensure that every BDB revision
> generates a new node-revision-id.

To do this we make '/' mutable either when creating the txn, or when
commiting the txn. Patches to do both below. Not sure which one is
best.

Index: subversion/libsvn_fs_base/revs-txns.c
===================================================================
--- subversion/libsvn_fs_base/revs-txns.c (revision 1716725)
+++ subversion/libsvn_fs_base/revs-txns.c (working copy)
@@ -695,6 +695,7 @@ txn_body_begin_txn(void *baton, trail_t *trail)
   struct begin_txn_args *args = baton;
   const svn_fs_id_t *root_id;
   const char *txn_id;
+ dag_node_t *clone;
 
   SVN_ERR(svn_fs_base__rev_get_root(&root_id, trail->fs, args->base_rev,
                                     trail, trail->pool));
@@ -751,6 +752,13 @@ txn_body_begin_txn(void *baton, trail_t *trail)
       SVN_ERR(txn_body_change_txn_prop(&cpargs, trail));
     }
 
+#if 0
+ /* We want every txn to have a mutable root as then the new revision
+ will have a distinct root node-revision-id. */
+ SVN_ERR(svn_fs_base__dag_clone_root(&clone, trail->fs, txn_id,
+ trail, trail->pool));
+#endif
+
   *args->txn_p = make_txn(trail->fs, txn_id, args->base_rev, trail->pool);
   return SVN_NO_ERROR;
 }
Index: subversion/libsvn_fs_base/tree.c
===================================================================
--- subversion/libsvn_fs_base/tree.c (revision 1716725)
+++ subversion/libsvn_fs_base/tree.c (working copy)
@@ -2661,7 +2661,7 @@ txn_body_commit(void *baton, trail_t *trail)
 
   svn_revnum_t youngest_rev;
   const svn_fs_id_t *y_rev_root_id;
- dag_node_t *txn_base_root_node;
+ dag_node_t *txn_base_root_node, *txn_root_node;
 
   /* Getting the youngest revision locks the revisions table until
      this trail is done. */
@@ -2694,6 +2694,19 @@ txn_body_commit(void *baton, trail_t *trail)
      discovered locks. */
   SVN_ERR(verify_locks(txn_name, trail, trail->pool));
 
+#if 0
+ /* We want every txn to have a mutable root as then the new revision
+ will have a distinct root node-revision-id. */
+ SVN_ERR(svn_fs_base__dag_txn_root(&txn_root_node, fs, txn_name,
+ trail, trail->pool));
+ if (!svn_fs_base__dag_check_mutable(txn_root_node, txn->id))
+ {
+ dag_node_t *clone;
+ SVN_ERR(svn_fs_base__dag_clone_root(&clone, fs, txn->id,
+ trail, trail->pool));
+ }
+#endif
+
   /* Else, commit the txn. */
   return svn_fs_base__dag_commit_txn(&(args->new_rev), txn, trail,
                                      trail->pool);

-- 
Philip Martin
WANdisco
Received on 2015-11-26 19:17:22 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.