You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2011/10/13 11:24:44 UTC

svn commit: r1182739 - in /subversion/branches/tree-read-api/subversion/libsvn_client: diff.c list.c tree.c tree.h

Author: julianfoad
Date: Thu Oct 13 09:24:43 2011
New Revision: 1182739

URL: http://svn.apache.org/viewvc?rev=1182739&view=rev
Log:
On the 'tree-read-api' branch: Rename svn_client_tree_t to svn_tree_t and
hide its structure definition.

* subversion/libsvn_client/tree.h
  (svn_client_tree_t): Rename to svn_tree_t. Rewrite the doc string. Move
    the structure definition to tree.c.
  (svn_client_tree__vtable_t): Move this typedef to tree.c; rename to
    svn_tree__vtable_t.
  (everywhere): Track the renames.

* subversion/libsvn_client/tree.c
  (svn_tree_t): Moved and renamed from svn_client_tree_t in tree.h.
  (svn_tree__vtable_t): Renamed from svn_client_tree__vtable_t and typedef'd
    here.
  (everywhere): Track the renames.

* subversion/libsvn_client/diff.c
  (tree_get_tmp_file, compare_two_trees, do_diff): Track the rename.

* subversion/libsvn_client/list.c
  (list_tree, svn_client_list2): Track the rename.

Modified:
    subversion/branches/tree-read-api/subversion/libsvn_client/diff.c
    subversion/branches/tree-read-api/subversion/libsvn_client/list.c
    subversion/branches/tree-read-api/subversion/libsvn_client/tree.c
    subversion/branches/tree-read-api/subversion/libsvn_client/tree.h

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/diff.c?rev=1182739&r1=1182738&r2=1182739&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/diff.c Thu Oct 13 09:24:43 2011
@@ -71,7 +71,7 @@ static const char under_string[] =
 
 /* */
 static svn_error_t *
-tree_get_tmp_file(svn_client_tree_t *tree,
+tree_get_tmp_file(svn_tree_t *tree,
                   const char **tmpfile_abspath,
                   apr_hash_t **props,
                   const char *relpath,
@@ -97,9 +97,9 @@ tree_get_tmp_file(svn_client_tree_t *tre
 
 /* Compare two (independent) trees */
 static svn_error_t *
-compare_two_trees(svn_client_tree_t *tree1,
+compare_two_trees(svn_tree_t *tree1,
                   const char *relpath1,
-                  svn_client_tree_t *tree2,
+                  svn_tree_t *tree2,
                   const char *relpath2,
                   const svn_wc_diff_callbacks4_t *callbacks,
                   void *callback_baton,
@@ -2183,7 +2183,7 @@ do_diff(const svn_wc_diff_callbacks4_t *
 
   /* Compare two independent trees */
   {
-    svn_client_tree_t *tree1, *tree2;
+    svn_tree_t *tree1, *tree2;
 
     SVN_ERR(svn_client__open_tree(&tree1, path1, revision1, peg_revision,
                                   ctx, pool, pool));

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/list.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/list.c?rev=1182739&r1=1182738&r2=1182739&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/list.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/list.c Thu Oct 13 09:24:43 2011
@@ -124,7 +124,7 @@ get_dir_contents(apr_uint32_t dirent_fie
 
 /* */
 static svn_error_t *
-list_tree(svn_client_tree_t *tree,
+list_tree(svn_tree_t *tree,
           const char *relpath,
           const char *abs_path,
           svn_depth_t depth,
@@ -298,7 +298,7 @@ svn_client_list2(const char *path_or_url
   {
     static svn_opt_revision_t head_rev = { svn_opt_revision_head, { 0 } };
     static svn_opt_revision_t work_rev = { svn_opt_revision_working, { 0 } };
-    svn_client_tree_t *tree;
+    svn_tree_t *tree;
 
     /* Look at the local tree if given a local path.  This is a departure
      * from the semantics svn <= 1.7 which always looked at the repository. */

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/tree.c?rev=1182739&r1=1182738&r2=1182739&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/tree.c (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/tree.c Thu Oct 13 09:24:43 2011
@@ -31,17 +31,17 @@
 /*-----------------------------------------------------------------*/
 
 
-/* V-table for #svn_client_tree_t. */
-struct svn_client_tree__vtable_t
+/* V-table for #svn_tree_t. */
+typedef struct svn_tree__vtable_t
 {
   /* See svn_tree_get_kind(). */
-  svn_error_t *(*get_kind)(svn_client_tree_t *tree,
+  svn_error_t *(*get_kind)(svn_tree_t *tree,
                            svn_kind_t *kind,
                            const char *relpath,
                            apr_pool_t *scratch_pool);
 
   /* See svn_tree_get_file(). */
-  svn_error_t *(*get_file)(svn_client_tree_t *tree,
+  svn_error_t *(*get_file)(svn_tree_t *tree,
                            svn_stream_t **stream,
                            apr_hash_t **props,
                            const char *relpath,
@@ -49,7 +49,7 @@ struct svn_client_tree__vtable_t
                            apr_pool_t *scratch_pool);
 
   /* See svn_tree_get_dir(). */
-  svn_error_t *(*get_dir)(svn_client_tree_t *tree,
+  svn_error_t *(*get_dir)(svn_tree_t *tree,
                           apr_hash_t **dirents,
                           apr_hash_t **props,
                           const char *relpath,
@@ -57,16 +57,29 @@ struct svn_client_tree__vtable_t
                           apr_pool_t *scratch_pool);
 
   /* See svn_tree_get_symlink(). */
-  svn_error_t *(*get_symlink)(svn_client_tree_t *tree,
+  svn_error_t *(*get_symlink)(svn_tree_t *tree,
                               const char **link_target,
                               apr_hash_t **props,
                               const char *relpath,
                               apr_pool_t *result_pool,
                               apr_pool_t *scratch_pool);
+} svn_tree__vtable_t;
+
+/* The implementation of the typedef svn_tree_t. */
+struct svn_tree_t
+{
+  const svn_tree__vtable_t *vtable;
+
+  /* Pool used to manage this session. */
+  apr_pool_t *pool;
+
+  /* Private data for the tree implementation. */
+  void *priv;
 };
 
+
 svn_error_t *
-svn_tree_get_kind(svn_client_tree_t *tree,
+svn_tree_get_kind(svn_tree_t *tree,
                   svn_kind_t *kind,
                   const char *relpath,
                   apr_pool_t *scratch_pool)
@@ -75,7 +88,7 @@ svn_tree_get_kind(svn_client_tree_t *tre
 }
 
 svn_error_t *
-svn_tree_get_file(svn_client_tree_t *tree,
+svn_tree_get_file(svn_tree_t *tree,
                   svn_stream_t **stream,
                   apr_hash_t **props,
                   const char *relpath,
@@ -87,7 +100,7 @@ svn_tree_get_file(svn_client_tree_t *tre
 }
 
 svn_error_t *
-svn_tree_get_dir(svn_client_tree_t *tree,
+svn_tree_get_dir(svn_tree_t *tree,
                  apr_hash_t **dirents,
                  apr_hash_t **props,
                  const char *relpath,
@@ -99,7 +112,7 @@ svn_tree_get_dir(svn_client_tree_t *tree
 }
 
 svn_error_t *
-svn_tree_get_symlink(svn_client_tree_t *tree,
+svn_tree_get_symlink(svn_tree_t *tree,
                      const char **link_target,
                      apr_hash_t **props,
                      const char *relpath,
@@ -122,7 +135,7 @@ typedef struct disk_tree_baton_t
 
 /* */
 static svn_error_t *
-disk_tree_get_kind(svn_client_tree_t *tree,
+disk_tree_get_kind(svn_tree_t *tree,
                    svn_kind_t *kind,
                    const char *relpath,
                    apr_pool_t *scratch_pool)
@@ -137,7 +150,7 @@ disk_tree_get_kind(svn_client_tree_t *tr
 
 /* */
 static svn_error_t *
-disk_tree_get_file(svn_client_tree_t *tree,
+disk_tree_get_file(svn_tree_t *tree,
                    svn_stream_t **stream,
                    apr_hash_t **props,
                    const char *relpath,
@@ -159,7 +172,7 @@ disk_tree_get_file(svn_client_tree_t *tr
 
 /* */
 static svn_error_t *
-disk_tree_get_dir(svn_client_tree_t *tree,
+disk_tree_get_dir(svn_tree_t *tree,
                   apr_hash_t **dirents,
                   apr_hash_t **props,
                   const char *relpath,
@@ -183,7 +196,7 @@ disk_tree_get_dir(svn_client_tree_t *tre
 
 /* */
 static svn_error_t *
-disk_tree_get_symlink(svn_client_tree_t *tree,
+disk_tree_get_symlink(svn_tree_t *tree,
                       const char **link_target,
                       apr_hash_t **props,
                       const char *relpath,
@@ -207,7 +220,7 @@ disk_tree_get_symlink(svn_client_tree_t 
 }
 
 /* */
-static const svn_client_tree__vtable_t disk_tree_vtable =
+static const svn_tree__vtable_t disk_tree_vtable =
 {
   disk_tree_get_kind,
   disk_tree_get_file,
@@ -216,11 +229,11 @@ static const svn_client_tree__vtable_t d
 };
 
 svn_error_t *
-svn_client__disk_tree(svn_client_tree_t **tree_p,
+svn_client__disk_tree(svn_tree_t **tree_p,
                       const char *abspath,
                       apr_pool_t *result_pool)
 {
-  svn_client_tree_t *tree = apr_palloc(result_pool, sizeof(*tree));
+  svn_tree_t *tree = apr_palloc(result_pool, sizeof(*tree));
   disk_tree_baton_t *baton = apr_palloc(result_pool, sizeof(*baton));
 
   baton->tree_abspath = abspath;
@@ -246,7 +259,7 @@ typedef struct wc_tree_baton_t
 
 /* */
 static svn_error_t *
-wc_tree_get_kind(svn_client_tree_t *tree,
+wc_tree_get_kind(svn_tree_t *tree,
                  svn_kind_t *kind,
                  const char *relpath,
                  apr_pool_t *scratch_pool)
@@ -268,7 +281,7 @@ wc_tree_get_kind(svn_client_tree_t *tree
 
 /* */
 static svn_error_t *
-wc_tree_get_file(svn_client_tree_t *tree,
+wc_tree_get_file(svn_tree_t *tree,
                  svn_stream_t **stream,
                  apr_hash_t **props,
                  const char *relpath,
@@ -303,7 +316,7 @@ wc_tree_get_file(svn_client_tree_t *tree
 
 /* */
 static svn_error_t *
-wc_tree_get_dir(svn_client_tree_t *tree,
+wc_tree_get_dir(svn_tree_t *tree,
                 apr_hash_t **dirents,
                 apr_hash_t **props,
                 const char *relpath,
@@ -352,7 +365,7 @@ wc_tree_get_dir(svn_client_tree_t *tree,
 
 /* */
 static svn_error_t *
-wc_tree_get_symlink(svn_client_tree_t *tree,
+wc_tree_get_symlink(svn_tree_t *tree,
                     const char **link_target,
                     apr_hash_t **props,
                     const char *relpath,
@@ -388,7 +401,7 @@ wc_tree_get_symlink(svn_client_tree_t *t
 }
 
 /* */
-static const svn_client_tree__vtable_t wc_tree_vtable =
+static const svn_tree__vtable_t wc_tree_vtable =
 {
   wc_tree_get_kind,
   wc_tree_get_file,
@@ -397,12 +410,12 @@ static const svn_client_tree__vtable_t w
 };
 
 svn_error_t *
-svn_client__wc_base_tree(svn_client_tree_t **tree_p,
+svn_client__wc_base_tree(svn_tree_t **tree_p,
                          const char *abspath,
                          svn_client_ctx_t *ctx,
                          apr_pool_t *result_pool)
 {
-  svn_client_tree_t *tree = apr_pcalloc(result_pool, sizeof(*tree));
+  svn_tree_t *tree = apr_pcalloc(result_pool, sizeof(*tree));
   wc_tree_baton_t *baton = apr_palloc(result_pool, sizeof(*baton));
 
   baton->tree_abspath = abspath;
@@ -418,12 +431,12 @@ svn_client__wc_base_tree(svn_client_tree
 }
 
 svn_error_t *
-svn_client__wc_working_tree(svn_client_tree_t **tree_p,
+svn_client__wc_working_tree(svn_tree_t **tree_p,
                             const char *abspath,
                             svn_client_ctx_t *ctx,
                             apr_pool_t *result_pool)
 {
-  svn_client_tree_t *tree = apr_pcalloc(result_pool, sizeof(*tree));
+  svn_tree_t *tree = apr_pcalloc(result_pool, sizeof(*tree));
   wc_tree_baton_t *baton = apr_palloc(result_pool, sizeof(*baton));
 
   baton->tree_abspath = abspath;
@@ -450,7 +463,7 @@ typedef struct ra_tree_baton_t
 
 /* */
 static svn_error_t *
-ra_tree_get_kind(svn_client_tree_t *tree,
+ra_tree_get_kind(svn_tree_t *tree,
                  svn_kind_t *kind,
                  const char *relpath,
                  apr_pool_t *scratch_pool)
@@ -464,7 +477,7 @@ ra_tree_get_kind(svn_client_tree_t *tree
 
 /* */
 static svn_error_t *
-ra_tree_get_file(svn_client_tree_t *tree,
+ra_tree_get_file(svn_tree_t *tree,
                  svn_stream_t **stream,
                  apr_hash_t **props,
                  const char *relpath,
@@ -486,7 +499,7 @@ ra_tree_get_file(svn_client_tree_t *tree
 
 /* */
 static svn_error_t *
-ra_tree_get_dir(svn_client_tree_t *tree,
+ra_tree_get_dir(svn_tree_t *tree,
                 apr_hash_t **dirents,
                 apr_hash_t **props,
                 const char *relpath,
@@ -505,7 +518,7 @@ ra_tree_get_dir(svn_client_tree_t *tree,
 
 /* */
 static svn_error_t *
-ra_tree_get_symlink(svn_client_tree_t *tree,
+ra_tree_get_symlink(svn_tree_t *tree,
                     const char **link_target,
                     apr_hash_t **props,
                     const char *relpath,
@@ -520,7 +533,7 @@ ra_tree_get_symlink(svn_client_tree_t *t
 }
 
 /* */
-static const svn_client_tree__vtable_t ra_tree_vtable =
+static const svn_tree__vtable_t ra_tree_vtable =
 {
   ra_tree_get_kind,
   ra_tree_get_file,
@@ -530,12 +543,12 @@ static const svn_client_tree__vtable_t r
 
 /* */
 static svn_error_t *
-read_ra_tree(svn_client_tree_t **tree_p,
+read_ra_tree(svn_tree_t **tree_p,
              svn_ra_session_t *ra_session,
              svn_revnum_t revnum,
              apr_pool_t *result_pool)
 {
-  svn_client_tree_t *tree = apr_pcalloc(result_pool, sizeof(*tree));
+  svn_tree_t *tree = apr_pcalloc(result_pool, sizeof(*tree));
   ra_tree_baton_t *baton = apr_palloc(result_pool, sizeof(*baton));
 
   baton->ra_session = ra_session;
@@ -550,7 +563,7 @@ read_ra_tree(svn_client_tree_t **tree_p,
 }
 
 svn_error_t *
-svn_client__repository_tree(svn_client_tree_t **tree_p,
+svn_client__repository_tree(svn_tree_t **tree_p,
                             const char *path_or_url,
                             const svn_opt_revision_t *peg_revision,
                             const svn_opt_revision_t *revision,
@@ -575,7 +588,7 @@ svn_client__repository_tree(svn_client_t
 /*-----------------------------------------------------------------*/
 
 svn_error_t *
-svn_client__open_tree(svn_client_tree_t **tree,
+svn_client__open_tree(svn_tree_t **tree,
                       const char *path,
                       const svn_opt_revision_t *revision,
                       const svn_opt_revision_t *peg_revision,

Modified: subversion/branches/tree-read-api/subversion/libsvn_client/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/tree-read-api/subversion/libsvn_client/tree.h?rev=1182739&r1=1182738&r2=1182739&view=diff
==============================================================================
--- subversion/branches/tree-read-api/subversion/libsvn_client/tree.h (original)
+++ subversion/branches/tree-read-api/subversion/libsvn_client/tree.h Thu Oct 13 09:24:43 2011
@@ -21,45 +21,20 @@ extern "C" {
 #endif
 
 
-/* Present as a tree:
- *   an unversioned disk tree;
- *   a WC base tree
- *   a WC working tree
- *   a repository tree
- * 
- * The consumer "pulls" parts of the tree and can omit unwanted parts.
- * Consumer can pull any subtree "recursively" for efficient streaming.
- */
-
-/**
- * A readable tree.  This object is used to perform read requests to a
- * repository tree or a working-copy (base or working) tree or any other
- * readable tree.
+/** A readable tree.  This object presents an interface for reading from
+ * a generic version-controlled tree in which each node is a file, a
+ * directory or a symbolic link, and each node can have properties.
+ *
+ * An implementation of this interface could read from a tree that exists
+ * at some revision of a repository, or the base or working version of
+ * a Working Copy tree, or an unversioned tree on disk, or something else.
  *
- * @since New in 1.8.
- */
-typedef struct svn_client_tree_t svn_client_tree_t;
-
-/*
- * Paths are relpaths, relative to the tree root.
+ * Paths are relpaths, relative to the tree root, unless otherwise stated.
  *
- * Revision numbers and repository ids are #SVN_INVALID_REVNUM and NULL
- * for an unversioned node (including a node that is a local add/copy/move
- * in a WC working tree).
+ * @since New in 1.8.
  */
-typedef struct svn_client_tree__vtable_t svn_client_tree__vtable_t;
+typedef struct svn_tree_t svn_tree_t;
 
-/* */
-struct svn_client_tree_t
-{
-  const svn_client_tree__vtable_t *vtable;
-
-  /* Pool used to manage this session. */
-  apr_pool_t *pool;
-
-  /* Private data for the tree implementation. */
-  void *priv;
-};
 
 /* Fetch the node kind of the node at @a relpath.
  * (### and other metadata? revnum? props?)
@@ -69,7 +44,7 @@ struct svn_client_tree_t
  * Set @a *kind to the node kind.
  */
 svn_error_t *
-svn_tree_get_kind(svn_client_tree_t *tree,
+svn_tree_get_kind(svn_tree_t *tree,
                   svn_kind_t *kind,
                   const char *relpath,
                   apr_pool_t *scratch_pool);
@@ -88,7 +63,7 @@ svn_tree_get_kind(svn_client_tree_t *tre
  * #SVN_ERR_WRONG_KIND error.
  */
 svn_error_t *
-svn_tree_get_file(svn_client_tree_t *tree,
+svn_tree_get_file(svn_tree_t *tree,
                   svn_stream_t **stream,
                   apr_hash_t **props,
                   const char *relpath,
@@ -111,7 +86,7 @@ svn_tree_get_file(svn_client_tree_t *tre
  * #SVN_ERR_WRONG_KIND error.
  */
 svn_error_t *
-svn_tree_get_dir(svn_client_tree_t *tree,
+svn_tree_get_dir(svn_tree_t *tree,
                  apr_hash_t **dirents,
                  apr_hash_t **props,
                  const char *relpath,
@@ -131,7 +106,7 @@ svn_tree_get_dir(svn_client_tree_t *tree
  * #SVN_ERR_WRONG_KIND error.
  */
 svn_error_t *
-svn_tree_get_symlink(svn_client_tree_t *tree,
+svn_tree_get_symlink(svn_tree_t *tree,
                      const char **link_target,
                      apr_hash_t **props,
                      const char *relpath,
@@ -143,27 +118,27 @@ svn_tree_get_symlink(svn_client_tree_t *
 
 /* */
 svn_error_t *
-svn_client__disk_tree(svn_client_tree_t **tree_p,
+svn_client__disk_tree(svn_tree_t **tree_p,
                       const char *abspath,
                       apr_pool_t *result_pool);
 
 /* */
 svn_error_t *
-svn_client__wc_base_tree(svn_client_tree_t **tree_p,
+svn_client__wc_base_tree(svn_tree_t **tree_p,
                          const char *abspath,
                          svn_client_ctx_t *ctx,
                          apr_pool_t *result_pool);
 
 /* */
 svn_error_t *
-svn_client__wc_working_tree(svn_client_tree_t **tree_p,
+svn_client__wc_working_tree(svn_tree_t **tree_p,
                             const char *abspath,
                             svn_client_ctx_t *ctx,
                             apr_pool_t *result_pool);
 
 /* */
 svn_error_t *
-svn_client__repository_tree(svn_client_tree_t **tree_p,
+svn_client__repository_tree(svn_tree_t **tree_p,
                             const char *path_or_url,
                             const svn_opt_revision_t *peg_revision,
                             const svn_opt_revision_t *revision,
@@ -172,7 +147,7 @@ svn_client__repository_tree(svn_client_t
 
 /* Open a tree, whether in the repository or a WC or unversioned on disk. */
 svn_error_t *
-svn_client__open_tree(svn_client_tree_t **tree,
+svn_client__open_tree(svn_tree_t **tree,
                       const char *path,
                       const svn_opt_revision_t *revision,
                       const svn_opt_revision_t *peg_revision,