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

[PATCH]svn_fs_base__txn_proplist_in_trail never sets a null txnproplist(leverage on this fact).

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-10-05 21:36:16 CEST

Hi All,
Find the attached log and patch.

With regards
Kamesh Jayachandran

[[[
Patch by: Kamesh Jayachandran <kamesh@collab.net>

'svn_fs_base__txn_proplist_in_trail' never sets the
'proplist(a.k.a table_p*) as null, leverage the same in its usage.

* subversion/libsvn_fs_base/tree.c
  (txn_body_txn_root):
   Never bother about 'txnprops', if 'svn_fs_base__txn_proplist_in_trail'
   successfully returns 'txnprops' should be in a usable state.

* subversion/libsvn_fs_base/dag.c
  (svn_fs_base__dag_commit_txn):
   Never bother about 'txnprops', if 'svn_fs_base__txn_proplist_in_trail'
   successfully returns 'txnprops' should be in a usable state.

* subversion/libsvn_fs_base/revs-txn.h
  (svn_fs_base__txn_proplist_in_trail): Improve the docstring.
]]]

Index: subversion/libsvn_fs_base/tree.c
===================================================================
--- subversion/libsvn_fs_base/tree.c (revision 21673)
+++ subversion/libsvn_fs_base/tree.c (working copy)
@@ -297,16 +297,11 @@
   /* Look for special txn props that represent the 'flags' behavior of
      the transaction. */
   SVN_ERR(svn_fs_base__txn_proplist_in_trail(&txnprops, svn_txn_id, trail));
- if (txnprops)
- {
- if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_OOD,
- APR_HASH_KEY_STRING))
- flags |= SVN_FS_TXN_CHECK_OOD;
+ if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_OOD, APR_HASH_KEY_STRING))
+ flags |= SVN_FS_TXN_CHECK_OOD;
 
- if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_LOCKS,
- APR_HASH_KEY_STRING))
- flags |= SVN_FS_TXN_CHECK_LOCKS;
- }
+ if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_LOCKS, APR_HASH_KEY_STRING))
+ flags |= SVN_FS_TXN_CHECK_LOCKS;
 
   root = make_txn_root(fs, svn_txn_id, flags, trail->pool);
 
Index: subversion/libsvn_fs_base/dag.c
===================================================================
--- subversion/libsvn_fs_base/dag.c (revision 21673)
+++ subversion/libsvn_fs_base/dag.c (working copy)
@@ -1428,18 +1428,13 @@
   /* Remove any temporary transaction properties initially created by
      begin_txn(). */
   SVN_ERR(svn_fs_base__txn_proplist_in_trail(&txnprops, txn_id, trail));
- if (txnprops)
- {
- if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_OOD,
- APR_HASH_KEY_STRING))
- SVN_ERR(svn_fs_base__set_txn_prop
- (fs, txn_id, SVN_FS_PROP_TXN_CHECK_OOD, NULL, trail, pool));
+ if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_OOD, APR_HASH_KEY_STRING))
+ SVN_ERR(svn_fs_base__set_txn_prop
+ (fs, txn_id, SVN_FS_PROP_TXN_CHECK_OOD, NULL, trail, pool));
 
- if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_LOCKS,
- APR_HASH_KEY_STRING))
- SVN_ERR(svn_fs_base__set_txn_prop
- (fs, txn_id, SVN_FS_PROP_TXN_CHECK_LOCKS, NULL, trail, pool));
- }
+ if (apr_hash_get(txnprops, SVN_FS_PROP_TXN_CHECK_LOCKS, APR_HASH_KEY_STRING))
+ SVN_ERR(svn_fs_base__set_txn_prop
+ (fs, txn_id, SVN_FS_PROP_TXN_CHECK_LOCKS, NULL, trail, pool));
 
   /* Add new revision entry to `revisions' table. */
   revision.txn_id = txn_id;
Index: subversion/libsvn_fs_base/revs-txns.h
===================================================================
--- subversion/libsvn_fs_base/revs-txns.h (revision 21673)
+++ subversion/libsvn_fs_base/revs-txns.h (working copy)
@@ -200,7 +200,10 @@
                                        svn_fs_txn_t *txn,
                                        apr_pool_t *pool);
 
-/* Helper func: variant of __txn_proplist that uses an existing trail. */
+/* Helper func: variant of __txn_proplist that uses an existing TRAIL.
+ * TXN_ID identifies the transaction.
+ * *TABLE_P will be non-null upon success.
+ */
 svn_error_t *svn_fs_base__txn_proplist_in_trail(apr_hash_t **table_p,
                                                 const char *txn_id,
                                                 trail_t *trail);

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 6 00:55:27 2006

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.