Author: hwright
Date: Thu Sep 22 11:37:43 2011
New Revision: 1174074

URL: http://svn.apache.org/viewvc?rev=1174074&view=rev
Log:
Implement a props fecthing function for the Ev2 shims in the update editor.

* subversion/libsvn_wc/update_editor.c
  (fetch_props_baton): Rename to...
  (fetch_baton): ...this.
  (fetch_props_func): Update reference.
  (fetch_kind_func): New.
  (make_editor): Use the kind fetcher.

Modified:
    subversion/trunk/subversion/libsvn_wc/update_editor.c

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1174074&r1=1174073&r2=1174074&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Sep 22 11:37:43 
2011
@@ -4546,7 +4546,7 @@ close_edit(void *edit_baton,
 
 /*** Returning editors. ***/
 
-struct fetch_props_baton
+struct fetch_baton
 {
   svn_wc__db_t *db;
   const char *target_abspath;
@@ -4559,7 +4559,7 @@ fetch_props_func(apr_hash_t **props,
                  apr_pool_t *result_pool,
                  apr_pool_t *scratch_pool)
 {
-  struct fetch_props_baton *fpb = baton;
+  struct fetch_baton *fpb = baton;
   const char *local_abspath = svn_dirent_join(fpb->target_abspath, path,
                                               scratch_pool);
   svn_error_t *err;
@@ -4579,6 +4579,31 @@ fetch_props_func(apr_hash_t **props,
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+fetch_kind_func(svn_node_kind_t *kind,
+                void *baton,
+                const char *path,
+                apr_pool_t *scratch_pool)
+{
+  struct fetch_baton *fpb = baton;
+  const char *local_abspath = svn_dirent_join(fpb->target_abspath, path,
+                                              scratch_pool);
+  svn_error_t *err;
+  svn_wc__db_kind_t db_kind;
+
+  SVN_ERR(svn_wc__db_read_kind(&db_kind, fpb->db, local_abspath, FALSE,
+                               scratch_pool));
+
+  if (db_kind == svn_wc__db_kind_dir)
+    *kind = svn_node_dir;
+  else if (db_kind == svn_wc__db_kind_file)
+    *kind = svn_node_file;
+  else
+    *kind = svn_node_none;
+  
+  return SVN_NO_ERROR;
+}
+
 /* Helper for the three public editor-supplying functions. */
 static svn_error_t *
 make_editor(svn_revnum_t *target_revision,
@@ -4616,7 +4641,7 @@ make_editor(svn_revnum_t *target_revisio
   svn_delta_editor_t *tree_editor = svn_delta_default_editor(edit_pool);
   const svn_delta_editor_t *inner_editor;
   const char *repos_root, *repos_uuid;
-  struct fetch_props_baton *fpb;
+  struct fetch_baton *fpb;
 
   /* An unknown depth can't be sticky. */
   if (depth == svn_depth_unknown)
@@ -4848,7 +4873,7 @@ make_editor(svn_revnum_t *target_revisio
   fpb->db = db;
   fpb->target_abspath = eb->target_abspath;
   SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   fetch_props_func, fpb, NULL, NULL,
+                                   fetch_props_func, fpb, fetch_kind_func, fpb,
                                    result_pool, scratch_pool));
 
   return SVN_NO_ERROR;


Reply via email to