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 2015/01/09 15:19:36 UTC

svn commit: r1650538 - in /subversion/trunk/subversion/libsvn_fs_x: dag.c dag.h fs.h transaction.c

Author: stefan2
Date: Fri Jan  9 14:19:35 2015
New Revision: 1650538

URL: http://svn.apache.org/r1650538
Log:
In FSX, a noderev's predecessor count is always known.  There is no need
to handle "unknown" values.

This is a remnant of BDB carried over from FSFS.  The situation in FSFS
seems to be the same since its release in 1.1 but there might have been
incidents of "unknown" counts in later releases.  So, keep FSFS as it is.

* subversion/libsvn_fs_x/fs.h
  (svn_fs_x__noderev_t): Fix commentary.

* subversion/libsvn_fs_x/dag.h
  (svn_fs_x__dag_get_predecessor_id): Same.

* subversion/libsvn_fs_x/dag.c
  (svn_fs_x__dag_clone_child,
   svn_fs_x__dag_copy,
   svn_fs_x__dag_update_ancestry): No need to test for "unknown" values.

* subversion/libsvn_fs_x/transaction.c
  (validate_root_noderev): Same.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/dag.c
    subversion/trunk/subversion/libsvn_fs_x/dag.h
    subversion/trunk/subversion/libsvn_fs_x/fs.h
    subversion/trunk/subversion/libsvn_fs_x/transaction.c

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.c?rev=1650538&r1=1650537&r2=1650538&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Fri Jan  9 14:19:35 2015
@@ -760,8 +760,7 @@ svn_fs_x__dag_clone_child(dag_node_t **c
       noderev->copyfrom_rev = SVN_INVALID_REVNUM;
 
       noderev->predecessor_id = noderev->noderev_id;
-      if (noderev->predecessor_count != -1)
-        noderev->predecessor_count++;
+      noderev->predecessor_count++;
       noderev->created_path = svn_fspath__join(parent_path, name, pool);
 
       if (copy_id == NULL)
@@ -1248,8 +1247,7 @@ svn_fs_x__dag_copy(dag_node_t *to_node,
       /* Create a successor with its predecessor pointing at the copy
          source. */
       to_noderev->predecessor_id = to_noderev->noderev_id;
-      if (to_noderev->predecessor_count != -1)
-        to_noderev->predecessor_count++;
+      to_noderev->predecessor_count++;
       to_noderev->created_path =
         svn_fspath__join(svn_fs_x__dag_get_created_path(to_node), entry,
                          pool);
@@ -1377,8 +1375,7 @@ svn_fs_x__dag_update_ancestry(dag_node_t
 
   target_noderev->predecessor_id = source_noderev->noderev_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_x__put_node_revision(target->fs, target_noderev, FALSE,
                                      scratch_pool);

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.h?rev=1650538&r1=1650537&r2=1650538&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Fri Jan  9 14:19:35 2015
@@ -163,8 +163,7 @@ svn_fs_x__dag_get_predecessor_id(svn_fs_
                                  dag_node_t *node);
 
 
-/* Set *COUNT to the number of predecessors NODE has (recursively), or
-   -1 if not known.
+/* Set *COUNT to the number of predecessors NODE has (recursively).
  */
 /* ### This function is currently only used by 'verify'. */
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/fs.h?rev=1650538&r1=1650537&r2=1650538&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/fs.h Fri Jan  9 14:19:35 2015
@@ -501,8 +501,7 @@ typedef struct svn_fs_x__noderev_t
   /* node kind */
   svn_node_kind_t kind;
 
-  /* number of predecessors this node revision has (recursively), or
-     -1 if not known (for backward compatibility). */
+  /* number of predecessors this node revision has (recursively). */
   int predecessor_count;
 
   /* representation key for this node's properties.  may be NULL if

Modified: subversion/trunk/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/transaction.c?rev=1650538&r1=1650537&r2=1650538&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/transaction.c Fri Jan  9 14:19:35 2015
@@ -2712,9 +2712,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 "