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/02/01 20:57:36 UTC

svn commit: r1727993 - in /subversion/trunk/subversion: include/private/svn_fs_private.h include/private/svn_fs_util.h libsvn_fs/fs-loader.c libsvn_fs_util/fs-util.c

Author: stefan2
Date: Mon Feb  1 19:57:35 2016
New Revision: 1727993

URL: http://svn.apache.org/viewvc?rev=1727993&view=rev
Log:
Follow-up to r1727838: (Hopefully) fix the cyclic library dependecy between
lib_fs and lib_fs_util that broke the Windows build.

Reported by: rhuijben

* subversion/include/private/svn_fs_util.h
  (svn_fs__get_deleted_node): Move declaration from here ...

* subversion/include/private/svn_fs_private.h
  (svn_fs__get_deleted_node): ... to here. Use Doxygen comments like in the
                              rest of that file.

* subversion/libsvn_fs_util/fs-util.c
  (svn_fs__get_deleted_node): Move implementation from here ...

* subversion/libsvn_fs/fs-loader.c
  (svn_fs__get_deleted_node): ... to here.

Modified:
    subversion/trunk/subversion/include/private/svn_fs_private.h
    subversion/trunk/subversion/include/private/svn_fs_util.h
    subversion/trunk/subversion/libsvn_fs/fs-loader.c
    subversion/trunk/subversion/libsvn_fs_util/fs-util.c

Modified: subversion/trunk/subversion/include/private/svn_fs_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_fs_private.h?rev=1727993&r1=1727992&r2=1727993&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_fs_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_fs_private.h Mon Feb  1 19:57:35 2016
@@ -195,6 +195,22 @@ svn_fs__get_mergeinfo_for_path(svn_merge
                                apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool);
 
+/** Determine the previous location of @a path under @a root and return it
+ * as @a *node_path under @a *node_root.  This may be called for arbitrary
+ * nodes but is intended for nodes that got deleted in @a root, i.e. when
+ * standard navigation fails.  It also works if @a root is transaction root.
+ *
+ * Allocate @a *node_path and @a *node_root in @a result_pool while using
+ * @a scratch_pool for temporaries.
+ */
+svn_error_t *
+svn_fs__get_deleted_node(svn_fs_root_t **node_root,
+                         const char **node_path,
+                         svn_fs_root_t *root,
+                         const char *path,
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool);
+
 
 /** @} */
 

Modified: subversion/trunk/subversion/include/private/svn_fs_util.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_fs_util.h?rev=1727993&r1=1727992&r2=1727993&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_fs_util.h (original)
+++ subversion/trunk/subversion/include/private/svn_fs_util.h Mon Feb  1 19:57:35 2016
@@ -244,22 +244,6 @@ svn_fs__prop_lists_equal(apr_hash_t *a,
                          apr_hash_t *b,
                          apr_pool_t *pool);
 
-/* Determine the previous location of PATH under ROOT and return it as
- * *NODE_PATH under *NODE_ROOT.  This may be called for arbitrary nodes
- * but is intended for nodes that got deleted in ROOT, i.e. when standard
- * navigation fails.  It also works if ROOT is transaction root.
- *
- * Allocate *NODE_PATH and *NODE_ROOT in RESULT_POOL while using
- * SCRATCH_POOL for temporaries.
- */
-svn_error_t *
-svn_fs__get_deleted_node(svn_fs_root_t **node_root,
-                         const char **node_path,
-                         svn_fs_root_t *root,
-                         const char *path,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-loader.c?rev=1727993&r1=1727992&r2=1727993&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Mon Feb  1 19:57:35 2016
@@ -45,6 +45,7 @@
 #include "private/svn_atomic.h"
 #include "private/svn_fs_private.h"
 #include "private/svn_fs_util.h"
+#include "private/svn_fspath.h"
 #include "private/svn_utf_private.h"
 #include "private/svn_mutex.h"
 #include "private/svn_subr_private.h"
@@ -1672,6 +1673,64 @@ svn_fs_get_file_delta_stream(svn_txdelta
 }
 
 svn_error_t *
+svn_fs__get_deleted_node(svn_fs_root_t **node_root,
+                         const char **node_path,
+                         svn_fs_root_t *root,
+                         const char *path,
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
+{
+  const char *parent_path, *name;
+  svn_fs_root_t *copy_root;
+  const char *copy_path;
+
+  /* History traversal does not work with transaction roots.
+   * Therefore, do it "by hand". */
+
+  /* If the parent got copied in ROOT, PATH got copied with it.
+   * Otherwise, we will find the node at PATH in the revision prior to ROOT.
+   */
+  svn_fspath__split(&parent_path, &name, path, scratch_pool);
+  SVN_ERR(svn_fs_closest_copy(&copy_root, &copy_path, root, parent_path,
+                              scratch_pool));
+
+  /* Copied in ROOT? */
+  if (   copy_root
+      && (   svn_fs_revision_root_revision(copy_root)
+          == svn_fs_revision_root_revision(root)))
+    {
+      svn_revnum_t copyfrom_rev;
+      const char *copyfrom_path;
+      const char *rel_path;
+      SVN_ERR(svn_fs_copied_from(&copyfrom_rev, &copyfrom_path,
+                                 copy_root, copy_path, scratch_pool));
+
+      SVN_ERR(svn_fs_revision_root(node_root, svn_fs_root_fs(root),
+                                   copyfrom_rev, result_pool));
+      rel_path = svn_fspath__skip_ancestor(copy_path, path);
+      *node_path = svn_fspath__join(copyfrom_path, rel_path, result_pool);
+    }
+  else
+    {
+      svn_revnum_t revision;
+      svn_revnum_t previous_rev;
+
+      /* Determine the latest revision before ROOT. */
+      revision = svn_fs_revision_root_revision(root);
+      if (SVN_IS_VALID_REVNUM(revision))
+        previous_rev = revision - 1;
+      else
+        previous_rev = svn_fs_txn_root_base_revision(root);
+
+      SVN_ERR(svn_fs_revision_root(node_root, svn_fs_root_fs(root),
+                                   previous_rev, result_pool));
+      *node_path = apr_pstrdup(result_pool, path);
+    }
+
+  return SVN_NO_ERROR;
+}
+
+svn_error_t *
 svn_fs_get_uuid(svn_fs_t *fs, const char **uuid, apr_pool_t *pool)
 {
   /* If you change this, consider changing svn_fs__identifier(). */

Modified: subversion/trunk/subversion/libsvn_fs_util/fs-util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_util/fs-util.c?rev=1727993&r1=1727992&r2=1727993&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_util/fs-util.c (original)
+++ subversion/trunk/subversion/libsvn_fs_util/fs-util.c Mon Feb  1 19:57:35 2016
@@ -347,61 +347,3 @@ svn_fs__prop_lists_equal(apr_hash_t *a,
   /* No difference found. */
   return TRUE;
 }
-
-svn_error_t *
-svn_fs__get_deleted_node(svn_fs_root_t **node_root,
-                         const char **node_path,
-                         svn_fs_root_t *root,
-                         const char *path,
-                         apr_pool_t *result_pool,
-                         apr_pool_t *scratch_pool)
-{
-  const char *parent_path, *name;
-  svn_fs_root_t *copy_root;
-  const char *copy_path;
-
-  /* History traversal does not work with transaction roots.
-   * Therefore, do it "by hand". */
-
-  /* If the parent got copied in ROOT, PATH got copied with it.
-   * Otherwise, we will find the node at PATH in the revision prior to ROOT.
-   */
-  svn_fspath__split(&parent_path, &name, path, scratch_pool);
-  SVN_ERR(svn_fs_closest_copy(&copy_root, &copy_path, root, parent_path,
-                              scratch_pool));
-
-  /* Copied in ROOT? */
-  if (   copy_root
-      && (   svn_fs_revision_root_revision(copy_root)
-          == svn_fs_revision_root_revision(root)))
-    {
-      svn_revnum_t copyfrom_rev;
-      const char *copyfrom_path;
-      const char *rel_path;
-      SVN_ERR(svn_fs_copied_from(&copyfrom_rev, &copyfrom_path,
-                                 copy_root, copy_path, scratch_pool));
-
-      SVN_ERR(svn_fs_revision_root(node_root, svn_fs_root_fs(root),
-                                   copyfrom_rev, result_pool));
-      rel_path = svn_fspath__skip_ancestor(copy_path, path);
-      *node_path = svn_fspath__join(copyfrom_path, rel_path, result_pool);
-    }
-  else
-    {
-      svn_revnum_t revision;
-      svn_revnum_t previous_rev;
-
-      /* Determine the latest revision before ROOT. */
-      revision = svn_fs_revision_root_revision(root);
-      if (SVN_IS_VALID_REVNUM(revision))
-        previous_rev = revision - 1;
-      else
-        previous_rev = svn_fs_txn_root_base_revision(root);
-
-      SVN_ERR(svn_fs_revision_root(node_root, svn_fs_root_fs(root),
-                                   previous_rev, result_pool));
-      *node_path = apr_pstrdup(result_pool, path);
-    }
-
-  return SVN_NO_ERROR;
-}