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/06 17:36:20 UTC
svn commit: r1649868 - in /subversion/trunk/subversion/libsvn_fs_x: dag.c
dag.h
Author: stefan2
Date: Tue Jan 6 16:36:20 2015
New Revision: 1649868
URL: http://svn.apache.org/r1649868
Log:
Get rid of a small non-static DAG function in FSX and merge it
with its sole caller.
* subversion/libsvn_fs_x/dag.h
(svn_fs_x__dag_dir_entries): Remove.
* subversion/libsvn_fs_x/dag.c
(dir_entry_id_from_node): Instead of calling it, insert the logic of ...
(svn_fs_x__dag_dir_entries): ... this function. Delete it.
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=1649868&r1=1649867&r2=1649868&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.c Tue Jan 6 16:36:20 2015
@@ -366,9 +366,16 @@ dir_entry_id_from_node(svn_fs_x__id_t *i
apr_pool_t *scratch_pool)
{
svn_fs_x__dirent_t *dirent;
+ svn_fs_x__noderev_t *noderev;
+
+ SVN_ERR(get_node_revision(&noderev, parent));
+ if (noderev->kind != svn_node_dir)
+ return svn_error_create(SVN_ERR_FS_NOT_DIRECTORY, NULL,
+ _("Can't get entries of non-directory"));
- SVN_ERR(svn_fs_x__dag_dir_entry(&dirent, parent, name, scratch_pool,
- scratch_pool));
+ /* Get a dirent hash for this directory. */
+ SVN_ERR(svn_fs_x__rep_contents_dir_entry(&dirent, parent->fs, noderev,
+ name, scratch_pool, scratch_pool));
if (dirent)
*id_p = dirent->id;
else
@@ -486,25 +493,6 @@ svn_fs_x__dag_dir_entries(apr_array_head
return svn_fs_x__rep_contents_dir(entries, node->fs, noderev, pool, pool);
}
-svn_error_t *
-svn_fs_x__dag_dir_entry(svn_fs_x__dirent_t **dirent,
- dag_node_t *node,
- const char* name,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- svn_fs_x__noderev_t *noderev;
- SVN_ERR(get_node_revision(&noderev, node));
-
- if (noderev->kind != svn_node_dir)
- return svn_error_create(SVN_ERR_FS_NOT_DIRECTORY, NULL,
- _("Can't get entries of non-directory"));
-
- /* Get a dirent hash for this directory. */
- return svn_fs_x__rep_contents_dir_entry(dirent, node->fs, noderev, name,
- result_pool, scratch_pool);
-}
-
svn_error_t *
svn_fs_x__dag_set_entry(dag_node_t *node,
Modified: subversion/trunk/subversion/libsvn_fs_x/dag.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/dag.h?rev=1649868&r1=1649867&r2=1649868&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/dag.h (original)
+++ subversion/trunk/subversion/libsvn_fs_x/dag.h Tue Jan 6 16:36:20 2015
@@ -319,19 +319,6 @@ svn_fs_x__dag_dir_entries(apr_array_head
dag_node_t *node,
apr_pool_t *pool);
-/* Fetches the NODE's entries and returns a copy of the entry selected
- by the key value given in NAME and set *DIRENT to a copy of that
- entry. If such entry was found, the copy will be allocated in
- RESULT_POOL. Temporary data will be used in SCRATCH_POOL.
- Otherwise, the *DIRENT will be set to NULL.
- */
-/* ### This function is currently only called from dag.c. */
-svn_error_t * svn_fs_x__dag_dir_entry(svn_fs_x__dirent_t **dirent,
- dag_node_t *node,
- const char* name,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* Set ENTRY_NAME in NODE to point to ID (with kind KIND), allocating
from POOL. NODE must be a mutable directory. ID can refer to a
mutable or immutable node. If ENTRY_NAME does not exist, it will