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/16 17:48:05 UTC

svn commit: r1652452 - in /subversion/trunk/subversion/libsvn_fs_x: dag.c dag.h

Author: stefan2
Date: Fri Jan 16 16:48:04 2015
New Revision: 1652452

URL: http://svn.apache.org/r1652452
Log:
Remove a function declaration from FSX/dag.h that is not used outside dag.c .

* subversion/libsvn_fs_x/dag.h
  (svn_fs_x__dag_delete_if_mutable): Remove from header.

* subversion/libsvn_fs_x/dag.c
  (delete_if_mutable): Renamed from svn_fs_x__dag_delete_if_mutable and
                       moved up for correct declaration / usage order.
  (svn_fs_x__dag_delete): Update caller.
  (svn_fs_x__dag_delete_if_mutable): Renamed to delete_if_mutable and moved.

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

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.c?rev=1652452&r1=1652451&r2=1652452&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Fri Jan 16 16:48:04 2015
@@ -796,6 +796,55 @@ svn_fs_x__dag_clone_root(dag_node_t **ro
 }
 
 
+/* Delete all mutable node revisions reachable from node ID, including
+   ID itself, from FS's `nodes' table.  Also delete any mutable
+   representations and strings associated with that node revision.
+   ID may refer to a file or directory, which may be mutable or immutable.
+
+   Use SCRATCH_POOL for temporary allocations.
+ */
+static svn_error_t *
+delete_if_mutable(svn_fs_t *fs,
+                  const svn_fs_x__id_t *id,
+                  apr_pool_t *scratch_pool)
+{
+  dag_node_t *node;
+
+  /* Get the node. */
+  SVN_ERR(svn_fs_x__dag_get_node(&node, fs, id, scratch_pool));
+
+  /* If immutable, do nothing and return immediately. */
+  if (! svn_fs_x__dag_check_mutable(node))
+    return SVN_NO_ERROR;
+
+  /* Else it's mutable.  Recurse on directories... */
+  if (node->kind == svn_node_dir)
+    {
+      apr_array_header_t *entries;
+      int i;
+      apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+
+      /* Loop over directory entries */
+      SVN_ERR(svn_fs_x__dag_dir_entries(&entries, node, scratch_pool));
+      if (entries)
+        for (i = 0; i < entries->nelts; ++i)
+          {
+            const svn_fs_x__id_t *noderev_id
+              = &APR_ARRAY_IDX(entries, i, svn_fs_x__dirent_t *)->id;
+
+            svn_pool_clear(iterpool);
+            SVN_ERR(delete_if_mutable(fs, noderev_id, iterpool));
+          }
+
+      svn_pool_destroy(iterpool);
+    }
+
+  /* ... then delete the node itself, after deleting any mutable
+     representations and strings it points to. */
+  return svn_fs_x__delete_node_revision(fs, id, scratch_pool);
+}
+
+
 svn_error_t *
 svn_fs_x__dag_delete(dag_node_t *parent,
                      const char *name,
@@ -843,8 +892,7 @@ svn_fs_x__dag_delete(dag_node_t *parent,
        "Delete failed--directory has no entry '%s'", name);
 
   /* If mutable, remove it and any mutable children from db. */
-  SVN_ERR(svn_fs_x__dag_delete_if_mutable(parent->fs, &dirent->id,
-                                          scratch_pool));
+  SVN_ERR(delete_if_mutable(parent->fs, &dirent->id, scratch_pool));
   svn_pool_destroy(subpool);
 
   /* Remove this entry from its parent's entries list. */
@@ -854,48 +902,6 @@ svn_fs_x__dag_delete(dag_node_t *parent,
 
 
 svn_error_t *
-svn_fs_x__dag_delete_if_mutable(svn_fs_t *fs,
-                                const svn_fs_x__id_t *id,
-                                apr_pool_t *scratch_pool)
-{
-  dag_node_t *node;
-
-  /* Get the node. */
-  SVN_ERR(svn_fs_x__dag_get_node(&node, fs, id, scratch_pool));
-
-  /* If immutable, do nothing and return immediately. */
-  if (! svn_fs_x__dag_check_mutable(node))
-    return SVN_NO_ERROR;
-
-  /* Else it's mutable.  Recurse on directories... */
-  if (node->kind == svn_node_dir)
-    {
-      apr_array_header_t *entries;
-      int i;
-      apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
-      /* Loop over directory entries */
-      SVN_ERR(svn_fs_x__dag_dir_entries(&entries, node, scratch_pool));
-      if (entries)
-        for (i = 0; i < entries->nelts; ++i)
-          {
-            const svn_fs_x__id_t *noderev_id
-              = &APR_ARRAY_IDX(entries, i, svn_fs_x__dirent_t *)->id;
-
-            svn_pool_clear(iterpool);
-            SVN_ERR(svn_fs_x__dag_delete_if_mutable(fs, noderev_id,
-                                                    scratch_pool));
-          }
-
-      svn_pool_destroy(iterpool);
-    }
-
-  /* ... then delete the node itself, after deleting any mutable
-     representations and strings it points to. */
-  return svn_fs_x__delete_node_revision(fs, id, scratch_pool);
-}
-
-svn_error_t *
 svn_fs_x__dag_make_file(dag_node_t **child_p,
                         dag_node_t *parent,
                         const char *parent_path,

Modified: subversion/trunk/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.h?rev=1652452&r1=1652451&r2=1652452&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Fri Jan 16 16:48:04 2015
@@ -384,19 +384,6 @@ svn_fs_x__dag_delete(dag_node_t *parent,
                      apr_pool_t *scratch_pool);
 
 
-/* Delete all mutable node revisions reachable from node ID, including
-   ID itself, from FS's `nodes' table.  Also delete any mutable
-   representations and strings associated with that node revision.
-   ID may refer to a file or directory, which may be mutable or immutable.
-
-   Use SCRATCH_POOL for temporary allocations.
- */
-svn_error_t *
-svn_fs_x__dag_delete_if_mutable(svn_fs_t *fs,
-                                const svn_fs_x__id_t *id,
-                                apr_pool_t *scratch_pool);
-
-
 /* Create a new mutable directory named NAME in PARENT.  Set *CHILD_P
    to a reference to the new node, allocated in POOL.  The new
    directory has no contents, and no properties.  PARENT must be