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 2016/01/27 14:02:25 UTC
svn commit: r1727028 - in /subversion/trunk/subversion/libsvn_fs_fs: dag.c
transaction.c
Author: stefan2
Date: Wed Jan 27 13:02:24 2016
New Revision: 1727028
URL: http://svn.apache.org/viewvc?rev=1727028&view=rev
Log:
In FSFS, remove unnecessary and misleading checks for NODE.PREDECESSOR_COUNT
of -1. These seem to have been carried over from BDB.
History digging found that even SVN 1.1 FSFS would not check for -1 when
bumping the counter in a transactions. So, it never has been something to
worry about in FSFS.
Suggested by: philipm
* subversion/libsvn_fs_fs/dag.c
(svn_fs_fs__dag_clone_child,
svn_fs_fs__dag_copy,
svn_fs_fs__dag_update_ancestry): Predecessor_count can never be -1
for non-corrupted data.
* subversion/libsvn_fs_fs/transaction.c
(validate_root_noderev): Same.
Modified:
subversion/trunk/subversion/libsvn_fs_fs/dag.c
subversion/trunk/subversion/libsvn_fs_fs/transaction.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?rev=1727028&r1=1727027&r2=1727028&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.c Wed Jan 27 13:02:24 2016
@@ -753,8 +753,7 @@ svn_fs_fs__dag_clone_child(dag_node_t **
noderev->copyfrom_rev = SVN_INVALID_REVNUM;
noderev->predecessor_id = svn_fs_fs__id_copy(cur_entry->id, pool);
- if (noderev->predecessor_count != -1)
- noderev->predecessor_count++;
+ noderev->predecessor_count++;
noderev->created_path = svn_fspath__join(parent_path, name, pool);
SVN_ERR(svn_fs_fs__create_successor(&new_node_id, fs, cur_entry->id,
@@ -1267,8 +1266,7 @@ svn_fs_fs__dag_copy(dag_node_t *to_node,
/* Create a successor with its predecessor pointing at the copy
source. */
to_noderev->predecessor_id = svn_fs_fs__id_copy(src_id, pool);
- if (to_noderev->predecessor_count != -1)
- to_noderev->predecessor_count++;
+ to_noderev->predecessor_count++;
to_noderev->created_path =
svn_fspath__join(svn_fs_fs__dag_get_created_path(to_node), entry,
pool);
@@ -1423,8 +1421,7 @@ svn_fs_fs__dag_update_ancestry(dag_node_
target_noderev->predecessor_id = source->id;
target_noderev->predecessor_count = source_noderev->predecessor_count;
- if (target_noderev->predecessor_count != -1)
- target_noderev->predecessor_count++;
+ target_noderev->predecessor_count++;
return svn_fs_fs__put_node_revision(target->fs, target->id, target_noderev,
FALSE, pool);
Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1727028&r1=1727027&r2=1727028&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Wed Jan 27 13:02:24 2016
@@ -2922,9 +2922,8 @@ validate_root_noderev(svn_fs_t *fs,
to a repository that has triggered the bug somewhere in its root
noderev's history.
*/
- if (root_noderev->predecessor_count != -1
- && (root_noderev->predecessor_count - head_predecessor_count)
- != (rev - head_revnum))
+ if ( (root_noderev->predecessor_count - head_predecessor_count)
+ != (rev - head_revnum))
{
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
_("predecessor count for "