subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1389505 [2/3] - in /subversion/branches/auto-props-sdc: ./ build/ build/generator/templates/ subversion/bindings/swig/ subversion/bindings/swig/python/libsvn_swig_py/ subversion/bindings/swig/python/svn/ subversion/include/ subversion/incl...
Date Mon, 24 Sep 2012 18:16:20 GMT
Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.c Mon Sep 24 18:16:17 2012
@@ -738,193 +738,31 @@ svn_error_t *svn_ra_get_commit_editor3(s
                                             lock_tokens, keep_locks, pool);
 }
 
-/* Helper for svn_ra_get_file2 and svn_ra_get_dir3 when those APIs need to
-   find PATH's inherited properties on a legacy server that doesn't have the
-   SVN_RA_CAPABILITY_INHERITED_PROPS capability.
-
-   All arguments are as per the two aforementioned APIs. */
-static svn_error_t*
-get_inherited_props(svn_ra_session_t *session,
-                    const char *path,
-                    svn_revnum_t revision,
-                    apr_array_header_t **inherited_props,
-                    apr_pool_t *result_pool,
-                    apr_pool_t *scratch_pool)
-{
-  const char *repos_root_url;
-  const char *session_url;
-  const char *parent_url;
-  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
-
-  *inherited_props =
-    apr_array_make(result_pool, 1, sizeof(svn_prop_inherited_item_t *));
-
-  /* Walk to the root of the repository getting inherited
-     props for PATH. */
-  SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, scratch_pool));
-  SVN_ERR(svn_ra_get_session_url(session, &session_url, scratch_pool));
-  parent_url = session_url;
-
-  while (strcmp(repos_root_url, parent_url))
-    {
-      apr_hash_index_t *hi;
-      apr_hash_t *parent_props;
-      apr_hash_t *final_hash = apr_hash_make(result_pool);
-      svn_error_t *err;
-
-      svn_pool_clear(iterpool);
-      parent_url = svn_uri_dirname(parent_url, iterpool);
-      SVN_ERR(svn_ra_reparent(session, parent_url, iterpool));
-      err = session->vtable->get_dir(session, NULL, NULL,
-                                     &parent_props, NULL, "",
-                                     revision, SVN_DIRENT_ALL,
-                                     iterpool, iterpool);
-
-      /* If the user doesn't have read access to a parent path then
-         skip, but allow them to inherit from further up. */
-      if (err)
-        {
-          if (err->apr_err == SVN_ERR_RA_NOT_AUTHORIZED)
-            {
-              svn_error_clear(err);
-              continue;
-            }
-          else
-            {
-              return svn_error_trace(err);
-            }
-        }
-
-      for (hi = apr_hash_first(scratch_pool, parent_props);
-           hi;
-           hi = apr_hash_next(hi))
-        {
-          const char *name = svn__apr_hash_index_key(hi);
-          apr_ssize_t klen = svn__apr_hash_index_klen(hi);
-          svn_string_t *value = svn__apr_hash_index_val(hi);
-
-          if (svn_property_kind(NULL, name) == svn_prop_regular_kind)
-            {
-              name = apr_pstrdup(result_pool, name);
-              value = svn_string_dup(value, result_pool);
-              apr_hash_set(final_hash, name, klen, value);
-            }
-        }
-
-      if (apr_hash_count(final_hash))
-        {
-          svn_prop_inherited_item_t *new_iprop =
-            apr_palloc(result_pool, sizeof(*new_iprop));
-          new_iprop->path_or_url = apr_pstrdup(result_pool, parent_url);
-          new_iprop->prop_hash = final_hash;
-          svn_sort__array_insert(&new_iprop, *inherited_props, 0);
-        }
-    }
-
-  /* Reparent session back to original URL. */
-  SVN_ERR(svn_ra_reparent(session, session_url, scratch_pool));
-
-  svn_pool_destroy(iterpool);
-  return SVN_NO_ERROR;
-}
-
-svn_error_t *svn_ra_get_file2(svn_ra_session_t *session,
-                              const char *path,
-                              svn_revnum_t revision,
-                              svn_stream_t *stream,
-                              svn_revnum_t *fetched_rev,
-                              apr_hash_t **props,
-                              apr_array_header_t **inherited_props,
-                              apr_pool_t *result_pool,
-                              apr_pool_t *scratch_pool)
+svn_error_t *svn_ra_get_file(svn_ra_session_t *session,
+                             const char *path,
+                             svn_revnum_t revision,
+                             svn_stream_t *stream,
+                             svn_revnum_t *fetched_rev,
+                             apr_hash_t **props,
+                             apr_pool_t *pool)
 {
   SVN_ERR_ASSERT(*path != '/');
-
-  if (inherited_props)
-    {
-      svn_boolean_t gets_iprops;
-
-      /* We want inherited props too, can the server deliver? */
-      SVN_ERR(svn_ra_has_capability(session, &gets_iprops,
-                                    SVN_RA_CAPABILITY_INHERITED_PROPS,
-                                    scratch_pool));
-      if (gets_iprops)
-        {
-          SVN_ERR(session->vtable->get_file(session, path, revision, stream,
-                                            fetched_rev, props,
-                                            inherited_props, result_pool,
-                                            scratch_pool));
-        }
-      else
-        {
-          /* Get the explicit props on PATH. */
-          SVN_ERR(session->vtable->get_file(session, path, revision, stream,
-                                            fetched_rev, props, NULL,
-                                            result_pool, scratch_pool));
-          SVN_ERR(get_inherited_props(session, path, revision,
-                                      inherited_props, result_pool,
-                                      scratch_pool));
-        }
-    }
-  else
-    {
-      SVN_ERR(session->vtable->get_file(session, path, revision, stream,
-                                        fetched_rev, props, NULL, result_pool,
-                                        scratch_pool));
-    }
-
-  return SVN_NO_ERROR;
+  return session->vtable->get_file(session, path, revision, stream,
+                                   fetched_rev, props, pool);
 }
 
-svn_error_t *
-svn_ra_get_dir3(svn_ra_session_t *session,
-                apr_hash_t **dirents,
-                svn_revnum_t *fetched_rev,
-                apr_hash_t **props,
-                apr_array_header_t **inherited_props,
-                const char *path,
-                svn_revnum_t revision,
-                apr_uint32_t dirent_fields,
-                apr_pool_t *result_pool,
-                apr_pool_t *scratch_pool)
+svn_error_t *svn_ra_get_dir2(svn_ra_session_t *session,
+                             apr_hash_t **dirents,
+                             svn_revnum_t *fetched_rev,
+                             apr_hash_t **props,
+                             const char *path,
+                             svn_revnum_t revision,
+                             apr_uint32_t dirent_fields,
+                             apr_pool_t *pool)
 {
   SVN_ERR_ASSERT(*path != '/');
-
-  if (inherited_props)
-    {
-      svn_boolean_t gets_iprops;
-
-      /* We want inherited props too, can the server deliver? */
-      SVN_ERR(svn_ra_has_capability(session, &gets_iprops,
-                                    SVN_RA_CAPABILITY_INHERITED_PROPS,
-                                    scratch_pool));
-      if (gets_iprops)
-        {
-          SVN_ERR(session->vtable->get_dir(session, dirents, fetched_rev, props,
-                                           inherited_props, path, revision,
-                                           dirent_fields, result_pool,
-                                           scratch_pool));
-        }
-      else
-        {
-          /* Get the explicit props on PATH. */
-          SVN_ERR(session->vtable->get_dir(session, dirents, fetched_rev,
-                                           props, NULL, path, revision,
-                                           dirent_fields, result_pool,
-                                           scratch_pool));
-          SVN_ERR(get_inherited_props(session, path, revision,
-                                      inherited_props, result_pool,
-                                      scratch_pool));
-        }
-    }
-  else
-    {
-      return session->vtable->get_dir(session, dirents, fetched_rev, props,
-                                      NULL, path, revision, dirent_fields,
-                                      result_pool, scratch_pool);
-    }
-
-  return SVN_NO_ERROR;
+  return session->vtable->get_dir(session, dirents, fetched_rev, props,
+                                  path, revision, dirent_fields, pool);
 }
 
 svn_error_t *svn_ra_get_mergeinfo(svn_ra_session_t *session,
@@ -1439,12 +1277,19 @@ svn_ra_get_inherited_props(svn_ra_sessio
                                 scratch_pool));
 
   if (iprop_capable)
-    return svn_error_trace(session->vtable->get_inherited_props(
-      session, iprops, path, revision, result_pool, scratch_pool));
-  /* Fallback for legacy servers. */
-  return svn_error_trace(get_inherited_props(session, path, revision,
-                                             iprops, result_pool,
-                                             scratch_pool));
+    {
+      SVN_ERR(session->vtable->get_inherited_props(session, iprops, path,
+                                                   revision, result_pool,
+                                                   scratch_pool));
+    }
+  else
+    {
+      /* Fallback for legacy servers. */
+      SVN_ERR(svn_ra__get_inherited_props_walk(session, path, revision, iprops,
+                                               result_pool, scratch_pool));
+    }
+
+  return SVN_NO_ERROR;
 }
 
 svn_error_t *

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.h?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra/ra_loader.h Mon Sep 24 18:16:17 2012
@@ -110,27 +110,23 @@ typedef struct svn_ra__vtable_t {
                                     apr_hash_t *lock_tokens,
                                     svn_boolean_t keep_locks,
                                     apr_pool_t *pool);
-  /* See svn_ra_get_file2(). */
+  /* See svn_ra_get_file(). */
   svn_error_t *(*get_file)(svn_ra_session_t *session,
                            const char *path,
                            svn_revnum_t revision,
                            svn_stream_t *stream,
                            svn_revnum_t *fetched_rev,
                            apr_hash_t **props,
-                           apr_array_header_t **inherited_props,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool);
-  /* See svn_ra_get_dir3(). */
+                           apr_pool_t *pool);
+  /* See svn_ra_get_dir2(). */
   svn_error_t *(*get_dir)(svn_ra_session_t *session,
                           apr_hash_t **dirents,
                           svn_revnum_t *fetched_rev,
                           apr_hash_t **props,
-                          apr_array_header_t **inherited_props,
                           const char *path,
                           svn_revnum_t revision,
                           apr_uint32_t dirent_fields,
-                          apr_pool_t *result_pool,
-                          apr_pool_t *scratch_pool);
+                          apr_pool_t *pool);
   /* See svn_ra_get_mergeinfo(). */
   svn_error_t *(*get_mergeinfo)(svn_ra_session_t *session,
                                 svn_mergeinfo_catalog_t *mergeinfo,
@@ -483,6 +479,21 @@ svn_ra__get_deleted_rev_from_log(svn_ra_
                                  apr_pool_t *pool);
 
 
+/**
+ * Fallback logic for svn_ra_get_fileX and svn_ra_get_dirX when those APIs
+ * need to find PATH's inherited properties on a legacy server that
+ * doesn't have the SVN_RA_CAPABILITY_INHERITED_PROPS capability.
+ *
+ * All arguments are as per the two aforementioned APIs.
+ */
+svn_error_t *
+svn_ra__get_inherited_props_walk(svn_ra_session_t *session,
+                                 const char *path,
+                                 svn_revnum_t revision,
+                                 apr_array_header_t **inherited_props,
+                                 apr_pool_t *result_pool,
+                                 apr_pool_t *scratch_pool);
+
 /* Utility function to provide a shim between a returned Ev2 and an RA
    provider's Ev1-based commit editor.
 

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra/wrapper_template.h
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra/wrapper_template.h?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra/wrapper_template.h (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra/wrapper_template.h Mon Sep 24 18:16:17 2012
@@ -179,7 +179,7 @@ static svn_error_t *compat_get_file(void
                                     apr_pool_t *pool)
 {
   return VTBL.get_file(session_baton, path, revision, stream, fetched_rev,
-                       props, NULL, pool, pool);
+                       props, pool);
 }
 
 static svn_error_t *compat_get_dir(void *session_baton,
@@ -191,7 +191,7 @@ static svn_error_t *compat_get_dir(void 
                                    apr_pool_t *pool)
 {
   return VTBL.get_dir(session_baton, dirents, fetched_rev, props,
-                      NULL, path, revision, SVN_DIRENT_ALL, pool, pool);
+                      path, revision, SVN_DIRENT_ALL, pool);
 }
 
 /** Reporter compat code. **/

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra_local/ra_plugin.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra_local/ra_plugin.c Mon Sep 24 18:16:17 2012
@@ -1049,14 +1049,20 @@ get_node_props(apr_hash_t **props,
   const char *cmt_date, *cmt_author;
 
   /* Create a hash with props attached to the fs node. */
-  SVN_ERR(svn_fs_node_proplist2(props, inherited_props, root, path,
-                                result_pool, scratch_pool));
+  if (props)
+    {
+      SVN_ERR(svn_fs_node_proplist(props, root, path, result_pool));
+    }
 
   /* Turn FS-path keys into URLs. */
   if (inherited_props)
     {
       int i;
 
+      SVN_ERR(svn_repos_fs_get_inherited_props(inherited_props, root, path,
+                                               NULL, NULL,
+                                               result_pool, scratch_pool));
+
       for (i = 0; i < (*inherited_props)->nelts; i++)
         {
           svn_prop_inherited_item_t *i_props =
@@ -1109,31 +1115,27 @@ svn_ra_local__get_file(svn_ra_session_t 
                        svn_stream_t *stream,
                        svn_revnum_t *fetched_rev,
                        apr_hash_t **props,
-                       apr_array_header_t **inherited_props,
-                       apr_pool_t *result_pool,
-                       apr_pool_t *scratch_pool)
+                       apr_pool_t *pool)
 {
   svn_fs_root_t *root;
   svn_stream_t *contents;
   svn_revnum_t youngest_rev;
   svn_ra_local__session_baton_t *sess = session->priv;
-  const char *abs_path = svn_fspath__join(sess->fs_path->data, path,
-                                          scratch_pool);
+  const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
   svn_node_kind_t node_kind;
 
   /* Open the revision's root. */
   if (! SVN_IS_VALID_REVNUM(revision))
     {
-      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, scratch_pool));
-      SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev,
-                                   scratch_pool));
+      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, pool));
+      SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev, pool));
       if (fetched_rev != NULL)
         *fetched_rev = youngest_rev;
     }
   else
-    SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, scratch_pool));
+    SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
 
-  SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, scratch_pool));
+  SVN_ERR(svn_fs_check_path(&node_kind, root, abs_path, pool));
   if (node_kind == svn_node_none)
     {
       return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
@@ -1148,7 +1150,7 @@ svn_ra_local__get_file(svn_ra_session_t 
   if (stream)
     {
       /* Get a stream representing the file's contents. */
-      SVN_ERR(svn_fs_file_contents(&contents, root, abs_path, scratch_pool));
+      SVN_ERR(svn_fs_file_contents(&contents, root, abs_path, pool));
 
       /* Now push data from the fs stream back at the caller's stream.
          Note that this particular RA layer does not computing a
@@ -1162,18 +1164,16 @@ svn_ra_local__get_file(svn_ra_session_t 
          Note: we are not supposed to close the passed-in stream, so
          disown the thing.
       */
-      SVN_ERR(svn_stream_copy3(contents, svn_stream_disown(stream,
-                                                           scratch_pool),
+      SVN_ERR(svn_stream_copy3(contents, svn_stream_disown(stream, pool),
                                sess->callbacks
                                  ? sess->callbacks->cancel_func : NULL,
                                sess->callback_baton,
-                               scratch_pool));
+                               pool));
     }
 
   /* Handle props if requested. */
-  if (props || inherited_props)
-    SVN_ERR(get_node_props(props, inherited_props, sess, root, abs_path,
-                           result_pool, scratch_pool));
+  if (props)
+    SVN_ERR(get_node_props(props, NULL, sess, root, abs_path, pool, pool));
 
   return SVN_NO_ERROR;
 }
@@ -1186,61 +1186,55 @@ svn_ra_local__get_dir(svn_ra_session_t *
                       apr_hash_t **dirents,
                       svn_revnum_t *fetched_rev,
                       apr_hash_t **props,
-                      apr_array_header_t **inherited_props,
                       const char *path,
                       svn_revnum_t revision,
                       apr_uint32_t dirent_fields,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool)
+                      apr_pool_t *pool)
 {
   svn_fs_root_t *root;
   svn_revnum_t youngest_rev;
   apr_hash_t *entries;
   apr_hash_index_t *hi;
   svn_ra_local__session_baton_t *sess = session->priv;
-  apr_pool_t *iterpool;
-  const char *abs_path = svn_fspath__join(sess->fs_path->data, path,
-                                          scratch_pool);
+  apr_pool_t *subpool;
+  const char *abs_path = svn_fspath__join(sess->fs_path->data, path, pool);
 
   /* Open the revision's root. */
   if (! SVN_IS_VALID_REVNUM(revision))
     {
-      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, scratch_pool));
-      SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev,
-                                   scratch_pool));
+      SVN_ERR(svn_fs_youngest_rev(&youngest_rev, sess->fs, pool));
+      SVN_ERR(svn_fs_revision_root(&root, sess->fs, youngest_rev, pool));
       if (fetched_rev != NULL)
         *fetched_rev = youngest_rev;
     }
   else
-    SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, scratch_pool));
+    SVN_ERR(svn_fs_revision_root(&root, sess->fs, revision, pool));
 
   if (dirents)
     {
       /* Get the dir's entries. */
-      SVN_ERR(svn_fs_dir_entries(&entries, root, abs_path, result_pool));
+      SVN_ERR(svn_fs_dir_entries(&entries, root, abs_path, pool));
 
       /* Loop over the fs dirents, and build a hash of general
          svn_dirent_t's. */
-      *dirents = apr_hash_make(result_pool);
-      iterpool = svn_pool_create(scratch_pool);
-      for (hi = apr_hash_first(scratch_pool, entries);
-           hi;
-           hi = apr_hash_next(hi))
+      *dirents = apr_hash_make(pool);
+      subpool = svn_pool_create(pool);
+      for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
         {
           const void *key;
           void *val;
           apr_hash_t *prophash;
           const char *datestring, *entryname, *fullpath;
           svn_fs_dirent_t *fs_entry;
-          svn_dirent_t *entry = apr_pcalloc(result_pool, sizeof(*entry));
+          svn_dirent_t *entry = apr_pcalloc(pool, sizeof(*entry));
 
-          svn_pool_clear(iterpool);
+          svn_pool_clear(subpool);
 
           apr_hash_this(hi, &key, NULL, &val);
           entryname = (const char *) key;
           fs_entry = (svn_fs_dirent_t *) val;
 
-          fullpath = svn_dirent_join(abs_path, entryname, iterpool);
+          fullpath = svn_dirent_join(abs_path, entryname, subpool);
 
           if (dirent_fields & SVN_DIRENT_KIND)
             {
@@ -1255,14 +1249,14 @@ svn_ra_local__get_dir(svn_ra_session_t *
                 entry->size = 0;
               else
                 SVN_ERR(svn_fs_file_length(&(entry->size), root,
-                                           fullpath, iterpool));
+                                           fullpath, subpool));
             }
 
           if (dirent_fields & SVN_DIRENT_HAS_PROPS)
             {
               /* has_props? */
               SVN_ERR(svn_fs_node_proplist(&prophash, root, fullpath,
-                                           iterpool));
+                                           subpool));
               entry->has_props = (apr_hash_count(prophash) != 0);
             }
 
@@ -1274,25 +1268,23 @@ svn_ra_local__get_dir(svn_ra_session_t *
               SVN_ERR(svn_repos_get_committed_info(&(entry->created_rev),
                                                    &datestring,
                                                    &(entry->last_author),
-                                                   root, fullpath, iterpool));
+                                                   root, fullpath, subpool));
               if (datestring)
                 SVN_ERR(svn_time_from_cstring(&(entry->time), datestring,
-                                              result_pool));
+                                              pool));
               if (entry->last_author)
-                entry->last_author = apr_pstrdup(result_pool,
-                                                 entry->last_author);
+                entry->last_author = apr_pstrdup(pool, entry->last_author);
             }
 
           /* Store. */
           apr_hash_set(*dirents, entryname, APR_HASH_KEY_STRING, entry);
         }
-      svn_pool_destroy(iterpool);
+      svn_pool_destroy(subpool);
     }
 
   /* Handle props if requested. */
-  if (props || inherited_props)
-    SVN_ERR(get_node_props(props, inherited_props, sess, root, abs_path,
-                           result_pool, scratch_pool));
+  if (props)
+    SVN_ERR(get_node_props(props, NULL, sess, root, abs_path, pool, pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/ra_serf.h?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/ra_serf.h Mon Sep 24 18:16:17 2012
@@ -1543,9 +1543,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
                       svn_stream_t *stream,
                       svn_revnum_t *fetched_rev,
                       apr_hash_t **props,
-                      apr_array_header_t **inherited_props,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool);
+                      apr_pool_t *pool);
 
 /* Implements svn_ra__vtable_t.change_rev_prop(). */
 svn_error_t *

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/serf.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/serf.c Mon Sep 24 18:16:17 2012
@@ -936,23 +936,20 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
                      apr_hash_t **dirents,
                      svn_revnum_t *fetched_rev,
                      apr_hash_t **ret_props,
-                     apr_array_header_t **inherited_props,
                      const char *rel_path,
-                     svn_revnum_t peg_rev,
+                     svn_revnum_t revision,
                      apr_uint32_t dirent_fields,
-                     apr_pool_t *result_pool,
-                     apr_pool_t *scratch_pool)
+                     apr_pool_t *pool)
 {
   svn_ra_serf__session_t *session = ra_session->priv;
   const char *path;
-  svn_revnum_t revision = peg_rev;
 
   path = session->session_url.path;
 
   /* If we have a relative path, URI encode and append it. */
   if (rel_path)
     {
-      path = svn_path_url_add_component2(path, rel_path, scratch_pool);
+      path = svn_path_url_add_component2(path, rel_path, pool);
     }
 
   /* If the user specified a peg revision other than HEAD, we have to fetch
@@ -963,7 +960,7 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
       SVN_ERR(svn_ra_serf__get_stable_url(&path, fetched_rev,
                                           session, NULL /* conn */,
                                           path, revision,
-                                          scratch_pool, scratch_pool));
+                                          pool, pool));
       revision = SVN_INVALID_REVNUM;
     }
   /* REVISION is always SVN_INVALID_REVNUM  */
@@ -983,9 +980,8 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
       SVN_ERR(svn_ra_serf__retrieve_props(&props, session, session->conns[0],
                                           path, SVN_INVALID_REVNUM, "1",
                                           get_dirent_props(dirent_fields,
-                                                           session,
-                                                           scratch_pool),
-                                          result_pool, scratch_pool));
+                                                           session, pool),
+                                          pool, pool));
 
       /* Check if the path is really a directory. */
       rtype = svn_ra_serf__get_prop(props, path, "DAV:", "resourcetype");
@@ -997,15 +993,15 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
        * We're going to return the 2nd one back to the caller as it
        * will have the basenames it expects.
        */
-      dirent_walk.full_paths = apr_hash_make(scratch_pool);
-      dirent_walk.base_paths = apr_hash_make(result_pool);
-      dirent_walk.orig_path = svn_urlpath__canonicalize(path, scratch_pool);
+      dirent_walk.full_paths = apr_hash_make(pool);
+      dirent_walk.base_paths = apr_hash_make(pool);
+      dirent_walk.orig_path = svn_urlpath__canonicalize(path, pool);
       dirent_walk.supports_deadprop_count = svn_tristate_unknown;
-      dirent_walk.result_pool = result_pool;
+      dirent_walk.result_pool = pool;
 
       SVN_ERR(svn_ra_serf__walk_all_paths(props, SVN_INVALID_REVNUM,
                                           path_dirent_walker, &dirent_walk,
-                                          scratch_pool));
+                                          pool));
 
       if (dirent_walk.supports_deadprop_count == svn_tristate_false
           && session->supports_deadprop_count == svn_tristate_unknown
@@ -1018,16 +1014,15 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
                                               session->conns[0],
                                               path, SVN_INVALID_REVNUM, "1",
                                               get_dirent_props(dirent_fields,
-                                                               session,
-                                                               scratch_pool),
-                                              scratch_pool, scratch_pool));
+                                                               session, pool),
+                                              pool, pool));
 
-          SVN_ERR(svn_hash__clear(dirent_walk.full_paths, scratch_pool));
-          SVN_ERR(svn_hash__clear(dirent_walk.base_paths, scratch_pool));
+          SVN_ERR(svn_hash__clear(dirent_walk.full_paths, pool));
+          SVN_ERR(svn_hash__clear(dirent_walk.base_paths, pool));
 
           SVN_ERR(svn_ra_serf__walk_all_paths(props, SVN_INVALID_REVNUM,
                                               path_dirent_walker,
-                                              &dirent_walk, scratch_pool));
+                                              &dirent_walk, pool));
         }
 
       *dirents = dirent_walk.base_paths;
@@ -1044,36 +1039,14 @@ svn_ra_serf__get_dir(svn_ra_session_t *r
       SVN_ERR(svn_ra_serf__fetch_node_props(&props, session->conns[0],
                                             path, SVN_INVALID_REVNUM,
                                             all_props,
-                                            result_pool, scratch_pool));
+                                            pool, pool));
 
       /* Check if the path is really a directory. */
       SVN_ERR(resource_is_directory(props));
 
       /* ### flatten_props() does not copy PROPVALUE, but fetch_node_props()
-         ### put them into RESULT_POOL, so we're okay.  */
-      SVN_ERR(svn_ra_serf__flatten_props(ret_props, props, result_pool,
-                                         scratch_pool));
-    }
-
-  if (inherited_props)
-    {
-      svn_boolean_t supports_iprops;
-
-      SVN_ERR(svn_ra_serf__has_capability(ra_session, &supports_iprops,
-                                          SVN_RA_CAPABILITY_INHERITED_PROPS,
-                                          scratch_pool));
-      if (!supports_iprops)
-        {
-          *inherited_props = NULL;
-        }
-      else
-        {
-          SVN_ERR(svn_ra_serf__get_inherited_props(ra_session,
-                                                   inherited_props,
-                                                   rel_path, peg_rev,
-                                                   result_pool,
-                                                   scratch_pool));
-        }
+         ### put them into POOL, so we're okay.  */
+      SVN_ERR(svn_ra_serf__flatten_props(ret_props, props, pool, pool));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/update.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/update.c Mon Sep 24 18:16:17 2012
@@ -2973,13 +2973,11 @@ try_get_wc_contents(svn_boolean_t *found
 svn_error_t *
 svn_ra_serf__get_file(svn_ra_session_t *ra_session,
                       const char *path,
-                      svn_revnum_t peg_rev,
+                      svn_revnum_t revision,
                       svn_stream_t *stream,
                       svn_revnum_t *fetched_rev,
                       apr_hash_t **props,
-                      apr_array_header_t **inherited_props,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool)
+                      apr_pool_t *pool)
 {
   svn_ra_serf__session_t *session = ra_session->priv;
   svn_ra_serf__connection_t *conn;
@@ -2987,15 +2985,13 @@ svn_ra_serf__get_file(svn_ra_session_t *
   apr_hash_t *fetch_props;
   svn_kind_t res_kind;
   const svn_ra_serf__dav_props_t *which_props;
-  svn_revnum_t revision = peg_rev;
 
   /* What connection should we go on? */
   conn = session->conns[session->cur_conn];
 
   /* Fetch properties. */
 
-  fetch_url = svn_path_url_add_component2(session->session_url.path, path,
-                                          scratch_pool);
+  fetch_url = svn_path_url_add_component2(session->session_url.path, path, pool);
 
   /* The simple case is if we want HEAD - then a GET on the fetch_url is fine.
    *
@@ -3007,7 +3003,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
       SVN_ERR(svn_ra_serf__get_stable_url(&fetch_url, fetched_rev,
                                           session, conn,
                                           fetch_url, revision,
-                                          scratch_pool, scratch_pool));
+                                          pool, pool));
       revision = SVN_INVALID_REVNUM;
     }
   /* REVISION is always SVN_INVALID_REVNUM  */
@@ -3029,7 +3025,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
   SVN_ERR(svn_ra_serf__fetch_node_props(&fetch_props, conn, fetch_url,
                                         SVN_INVALID_REVNUM,
                                         which_props,
-                                        result_pool, scratch_pool));
+                                        pool, pool));
 
   /* Verify that resource type is not collection. */
   SVN_ERR(svn_ra_serf__get_resource_type(&res_kind, fetch_props));
@@ -3043,16 +3039,15 @@ svn_ra_serf__get_file(svn_ra_session_t *
   if (props)
     {
       /* ### flatten_props() does not copy PROPVALUE, but fetch_node_props()
-         ### put them into RESULT_POOL, so we're okay.  */
+         ### put them into POOL, so we're okay.  */
       SVN_ERR(svn_ra_serf__flatten_props(props, fetch_props,
-                                         result_pool, scratch_pool));
+                                         pool, pool));
     }
 
   if (stream)
     {
       svn_boolean_t found;
-      SVN_ERR(try_get_wc_contents(&found, session, fetch_props, stream,
-                                  scratch_pool));
+      SVN_ERR(try_get_wc_contents(&found, session, fetch_props, stream, pool));
 
       /* No contents found in the WC, let's fetch from server. */
       if (!found)
@@ -3061,17 +3056,16 @@ svn_ra_serf__get_file(svn_ra_session_t *
           svn_ra_serf__handler_t *handler;
 
           /* Create the fetch context. */
-          stream_ctx = apr_pcalloc(scratch_pool, sizeof(*stream_ctx));
+          stream_ctx = apr_pcalloc(pool, sizeof(*stream_ctx));
           stream_ctx->target_stream = stream;
           stream_ctx->sess = session;
           stream_ctx->conn = conn;
-          stream_ctx->info = apr_pcalloc(scratch_pool,
-                                         sizeof(*stream_ctx->info));
+          stream_ctx->info = apr_pcalloc(pool, sizeof(*stream_ctx->info));
           stream_ctx->info->name = fetch_url;
 
-          handler = apr_pcalloc(scratch_pool, sizeof(*handler));
+          handler = apr_pcalloc(pool, sizeof(*handler));
 
-          handler->handler_pool = scratch_pool;
+          handler->handler_pool = pool;
           handler->method = "GET";
           handler->path = fetch_url;
           handler->conn = conn;
@@ -3090,27 +3084,7 @@ svn_ra_serf__get_file(svn_ra_session_t *
 
           svn_ra_serf__request_create(handler);
 
-          SVN_ERR(svn_ra_serf__context_run_wait(&stream_ctx->done, session,
-                                                scratch_pool));
-        }
-    }
-
-  if (inherited_props)
-    {
-      svn_boolean_t supports_iprops;
-
-      SVN_ERR(svn_ra_serf__has_capability(ra_session, &supports_iprops,
-                                          SVN_RA_CAPABILITY_INHERITED_PROPS,
-                                          scratch_pool));
-      if (!supports_iprops)
-        {
-          *inherited_props = NULL;
-        }
-      else
-        {
-          SVN_ERR(svn_ra_serf__get_inherited_props(ra_session, inherited_props,
-                                                   path, peg_rev, result_pool,
-                                                   scratch_pool));
+          SVN_ERR(svn_ra_serf__context_run_wait(&stream_ctx->done, session, pool));
         }
     }
 

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/util.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra_serf/util.c Mon Sep 24 18:16:17 2012
@@ -1986,7 +1986,8 @@ handle_response(serf_request_t *request,
 
   if (err
       && (!SERF_BUCKET_READ_ERROR(err->apr_err)
-          || APR_STATUS_IS_ECONNRESET(err->apr_err)))
+          || APR_STATUS_IS_ECONNRESET(err->apr_err)
+          || APR_STATUS_IS_ECONNABORTED(err->apr_err)))
     {
       /* These errors are special cased in serf
          ### We hope no handler returns these by accident. */
@@ -2418,9 +2419,8 @@ expat_response_handler(serf_request_t *r
       XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
     }
 
-  /* ### should we bail on anything < 200 or >= 300 ??
-     ### actually: < 200 should really be handled by the core.  */
-  if (ectx->handler->sline.code == 404)
+  /* ### TODO: sline.code < 200 should really be handled by the core */
+  if ((ectx->handler->sline.code < 200) || (ectx->handler->sline.code >= 300))
     {
       /* By deferring to expect_empty_body(), it will make a choice on
          how to handle the body. Whatever the decision, the core handler

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_ra_svn/client.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_ra_svn/client.c Mon Sep 24 18:16:17 2012
@@ -1034,7 +1034,7 @@ parse_iproplist(apr_array_header_t **inh
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_ra_get_repos_root2(session, &repos_root_url, scratch_pool));
+  SVN_ERR(ra_svn_get_repos_root(session, &repos_root_url, scratch_pool));
 
   *inherited_props = apr_array_make(
     result_pool, iproplist->nelts, sizeof(svn_prop_inherited_item_t *));
@@ -1087,34 +1087,27 @@ static svn_error_t *ra_svn_get_file(svn_
                                     svn_revnum_t rev, svn_stream_t *stream,
                                     svn_revnum_t *fetched_rev,
                                     apr_hash_t **props,
-                                    apr_array_header_t **inherited_props,
-                                    apr_pool_t *result_pool,
-                                    apr_pool_t *scratch_pool)
+                                    apr_pool_t *pool)
 {
   svn_ra_svn__session_baton_t *sess_baton = session->priv;
   svn_ra_svn_conn_t *conn = sess_baton->conn;
   apr_array_header_t *proplist;
-  apr_array_header_t *iproplist;
   const char *expected_digest;
   svn_checksum_t *expected_checksum = NULL;
   svn_checksum_ctx_t *checksum_ctx;
   apr_pool_t *iterpool;
 
-  SVN_ERR(svn_ra_svn_write_cmd(conn, scratch_pool, "get-file", "c(?r)bbb",
-                               path, rev, (props != NULL), (stream != NULL),
-                               (inherited_props != NULL)));
-  SVN_ERR(handle_auth_request(sess_baton, scratch_pool));
-  SVN_ERR(svn_ra_svn_read_cmd_response(conn, scratch_pool, "(?c)rl?l",
+  SVN_ERR(svn_ra_svn_write_cmd(conn, pool, "get-file", "c(?r)bb", path,
+                               rev, (props != NULL), (stream != NULL)));
+  SVN_ERR(handle_auth_request(sess_baton, pool));
+  SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "(?c)rl",
                                        &expected_digest,
-                                       &rev, &proplist, &iproplist));
+                                       &rev, &proplist));
 
   if (fetched_rev)
     *fetched_rev = rev;
   if (props)
-    SVN_ERR(svn_ra_svn_parse_proplist(proplist, result_pool, props));
-  if (inherited_props)
-    SVN_ERR(parse_iproplist(inherited_props, iproplist, session, result_pool,
-                            scratch_pool));
+    SVN_ERR(svn_ra_svn_parse_proplist(proplist, pool, props));
 
   /* We're done if the contents weren't wanted. */
   if (!stream)
@@ -1123,12 +1116,12 @@ static svn_error_t *ra_svn_get_file(svn_
   if (expected_digest)
     {
       SVN_ERR(svn_checksum_parse_hex(&expected_checksum, svn_checksum_md5,
-                                     expected_digest, scratch_pool));
-      checksum_ctx = svn_checksum_ctx_create(svn_checksum_md5, scratch_pool);
+                                     expected_digest, pool));
+      checksum_ctx = svn_checksum_ctx_create(svn_checksum_md5, pool);
     }
 
   /* Read the file's contents. */
-  iterpool = svn_pool_create(scratch_pool);
+  iterpool = svn_pool_create(pool);
   while (1)
     {
       svn_ra_svn_item_t *item;
@@ -1150,15 +1143,15 @@ static svn_error_t *ra_svn_get_file(svn_
     }
   svn_pool_destroy(iterpool);
 
-  SVN_ERR(svn_ra_svn_read_cmd_response(conn, scratch_pool, ""));
+  SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, ""));
 
   if (expected_checksum)
     {
       svn_checksum_t *checksum;
 
-      SVN_ERR(svn_checksum_final(&checksum, checksum_ctx, scratch_pool));
+      SVN_ERR(svn_checksum_final(&checksum, checksum_ctx, pool));
       if (!svn_checksum_match(checksum, expected_checksum))
-        return svn_checksum_mismatch_err(expected_checksum, checksum, scratch_pool,
+        return svn_checksum_mismatch_err(expected_checksum, checksum, pool,
                                          _("Checksum mismatch for '%s'"),
                                          path);
     }
@@ -1170,61 +1163,48 @@ static svn_error_t *ra_svn_get_dir(svn_r
                                    apr_hash_t **dirents,
                                    svn_revnum_t *fetched_rev,
                                    apr_hash_t **props,
-                                   apr_array_header_t **inherited_props,
                                    const char *path,
                                    svn_revnum_t rev,
                                    apr_uint32_t dirent_fields,
-                                   apr_pool_t *result_pool,
-                                   apr_pool_t *scratch_pool)
+                                   apr_pool_t *pool)
 {
   svn_ra_svn__session_baton_t *sess_baton = session->priv;
   svn_ra_svn_conn_t *conn = sess_baton->conn;
-  apr_array_header_t *proplist, *dirlist, *iproplist;
+  apr_array_header_t *proplist, *dirlist;
   int i;
 
-  SVN_ERR(svn_ra_svn_write_tuple(conn, scratch_pool, "w(c(?r)bb(!", "get-dir",
-                                 path, rev, (props != NULL),
-                                 (dirents != NULL)));
+  SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w(c(?r)bb(!", "get-dir", path,
+                                 rev, (props != NULL), (dirents != NULL)));
   if (dirent_fields & SVN_DIRENT_KIND)
-    SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
-                                  SVN_RA_SVN_DIRENT_KIND));
+    SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_KIND));
   if (dirent_fields & SVN_DIRENT_SIZE)
-    SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
-                                  SVN_RA_SVN_DIRENT_SIZE));
+    SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_SIZE));
   if (dirent_fields & SVN_DIRENT_HAS_PROPS)
-    SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
-                                  SVN_RA_SVN_DIRENT_HAS_PROPS));
+    SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_HAS_PROPS));
   if (dirent_fields & SVN_DIRENT_CREATED_REV)
-    SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
-                                  SVN_RA_SVN_DIRENT_CREATED_REV));
+    SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_CREATED_REV));
   if (dirent_fields & SVN_DIRENT_TIME)
-    SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
-                                  SVN_RA_SVN_DIRENT_TIME));
+    SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_TIME));
   if (dirent_fields & SVN_DIRENT_LAST_AUTHOR)
-    SVN_ERR(svn_ra_svn_write_word(conn, scratch_pool,
-                                  SVN_RA_SVN_DIRENT_LAST_AUTHOR));
+    SVN_ERR(svn_ra_svn_write_word(conn, pool, SVN_RA_SVN_DIRENT_LAST_AUTHOR));
 
-  SVN_ERR(svn_ra_svn_write_tuple(conn, scratch_pool, "!)b)",
-                                 (inherited_props != NULL)));
+  SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!))"));
 
-  SVN_ERR(handle_auth_request(sess_baton, scratch_pool));
-  SVN_ERR(svn_ra_svn_read_cmd_response(conn, scratch_pool, "rll?l", &rev,
-                                       &proplist, &dirlist, &iproplist));
+  SVN_ERR(handle_auth_request(sess_baton, pool));
+  SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "rll", &rev, &proplist,
+                                       &dirlist));
 
   if (fetched_rev)
     *fetched_rev = rev;
   if (props)
-    SVN_ERR(svn_ra_svn_parse_proplist(proplist, result_pool, props));
-  if (inherited_props)
-    SVN_ERR(parse_iproplist(inherited_props, iproplist, session, result_pool,
-                            scratch_pool));
+    SVN_ERR(svn_ra_svn_parse_proplist(proplist, pool, props));
 
   /* We're done if dirents aren't wanted. */
   if (!dirents)
     return SVN_NO_ERROR;
 
   /* Interpret the directory list. */
-  *dirents = apr_hash_make(result_pool);
+  *dirents = apr_hash_make(pool);
   for (i = 0; i < dirlist->nelts; i++)
     {
       const char *name, *kind, *cdate, *cauthor;
@@ -1237,12 +1217,11 @@ static svn_error_t *ra_svn_get_dir(svn_r
       if (elt->kind != SVN_RA_SVN_LIST)
         return svn_error_create(SVN_ERR_RA_SVN_MALFORMED_DATA, NULL,
                                 _("Dirlist element not a list"));
-      SVN_ERR(svn_ra_svn_parse_tuple(elt->u.list, scratch_pool,
-                                     "cwnbr(?c)(?c)",
+      SVN_ERR(svn_ra_svn_parse_tuple(elt->u.list, pool, "cwnbr(?c)(?c)",
                                      &name, &kind, &size, &has_props,
                                      &crev, &cdate, &cauthor));
-      name = svn_relpath_canonicalize(name, result_pool);
-      dirent = apr_palloc(result_pool, sizeof(*dirent));
+      name = svn_relpath_canonicalize(name, pool);
+      dirent = apr_palloc(pool, sizeof(*dirent));
       dirent->kind = svn_node_kind_from_word(kind);
       dirent->size = size;/* FIXME: svn_filesize_t */
       dirent->has_props = has_props;
@@ -1258,7 +1237,7 @@ static svn_error_t *ra_svn_get_dir(svn_r
       if (cdate == NULL)
         dirent->time = 0;
       else
-        SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, result_pool));
+        SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
       dirent->last_author = cauthor;
       apr_hash_set(*dirents, name, APR_HASH_KEY_STRING, dirent);
     }

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_repos/fs-wrap.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_repos/fs-wrap.c Mon Sep 24 18:16:17 2012
@@ -36,6 +36,7 @@
 #include "svn_private_config.h"
 #include "private/svn_repos_private.h"
 #include "private/svn_utf_private.h"
+#include "private/svn_fspath.h"
 
 
 /*** Commit wrappers ***/
@@ -718,41 +719,51 @@ svn_repos_fs_pack2(svn_repos_t *repos,
 }
 
 svn_error_t *
-svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props,
-                                 svn_repos_t *repos,
+svn_repos_fs_get_inherited_props(apr_array_header_t **inherited_props_p,
+                                 svn_fs_root_t *root,
                                  const char *path,
-                                 svn_revnum_t revision,
                                  svn_repos_authz_func_t authz_read_func,
                                  void *authz_read_baton,
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool)
 {
-  svn_fs_root_t *root;
-  int i;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_array_header_t *inherited_props;
+  const char *parent_path = path;
 
-  if (!SVN_IS_VALID_REVNUM(revision))
-    SVN_ERR(svn_fs_youngest_rev(&revision, repos->fs, iterpool));
-  SVN_ERR(svn_fs_revision_root(&root, repos->fs, revision, scratch_pool));
-  SVN_ERR(svn_fs_node_proplist2(NULL, inherited_props, root, path,
-                                result_pool, scratch_pool));
-  for (i = 0; i < (*inherited_props)->nelts; i++)
+  inherited_props = apr_array_make(result_pool, 1,
+                                   sizeof(svn_prop_inherited_item_t *));
+  while (!(parent_path[0] == '/' && parent_path[1] == '\0'))
     {
       svn_boolean_t allowed = TRUE;
-      svn_prop_inherited_item_t *iprop =
-        APR_ARRAY_IDX(*inherited_props, i, svn_prop_inherited_item_t *);
+      apr_hash_t *parent_properties;
+
+      svn_pool_clear(iterpool);
+      parent_path = svn_fspath__dirname(parent_path, iterpool);
 
       if (authz_read_func)
-        SVN_ERR(authz_read_func(&allowed, root, iprop->path_or_url,
+        SVN_ERR(authz_read_func(&allowed, root, parent_path,
                                 authz_read_baton, iterpool));
-      if (!allowed)
+      if (allowed)
         {
-          svn_sort__array_delete(*inherited_props, i, 1);
-          i--;
+          SVN_ERR(svn_fs_node_proplist(&parent_properties, root,
+                                       parent_path, result_pool));
+          if (parent_properties && apr_hash_count(parent_properties))
+            {
+              svn_prop_inherited_item_t *i_props =
+                apr_pcalloc(result_pool, sizeof(*i_props));
+              i_props->path_or_url =
+                apr_pstrdup(result_pool, parent_path + 1);
+              i_props->prop_hash = parent_properties;
+              /* Build the output array in depth-first order. */
+              svn_sort__array_insert(&i_props, inherited_props, 0);
+            }
         }
     }
 
   svn_pool_destroy(iterpool);
+
+  *inherited_props_p = inherited_props;
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_subr/gpg_agent.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_subr/gpg_agent.c Mon Sep 24 18:16:17 2012
@@ -110,7 +110,7 @@ receive_from_gpg_agent(int sd, char *buf
   int recvd;
   char c;
 
-  /* Clear existing buffer concent before reading response. */
+  /* Clear existing buffer content before reading response. */
   if (n > 0)
     *buf = '\0';
 

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_subr/properties.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_subr/properties.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_subr/properties.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_subr/properties.c Mon Sep 24 18:16:17 2012
@@ -396,51 +396,3 @@ svn_prop_get_value(apr_hash_t *props,
 
   return NULL;
 }
-
-svn_prop_inherited_item_t *
-svn_prop_inherited_item_dup(const svn_prop_inherited_item_t *inherited_prop,
-                            apr_pool_t *result_pool,
-                            apr_pool_t *scratch_pool)
-{
-  apr_hash_index_t *hi;
-  svn_prop_inherited_item_t *new_iprop = apr_palloc(result_pool,
-                                                    sizeof(*new_iprop));
-
-  new_iprop->path_or_url = apr_pstrdup(
-    result_pool, inherited_prop->path_or_url);
-  new_iprop->prop_hash = apr_hash_make(result_pool);
-
-  for (hi = apr_hash_first(scratch_pool, inherited_prop->prop_hash);
-       hi;
-       hi = apr_hash_next(hi))
-    {
-      const char *name = svn__apr_hash_index_key(hi);
-      svn_string_t *value = svn__apr_hash_index_val(hi);
-      apr_hash_set(new_iprop->prop_hash,
-                   apr_pstrdup(result_pool, name),
-                   APR_HASH_KEY_STRING,
-                   svn_string_dup(value, result_pool));
-    }
-
-  return new_iprop;
-}
-
-apr_array_header_t *
-svn_prop_inherited_array_dup(const apr_array_header_t *prop_array,
-                             apr_pool_t *result_pool,
-                             apr_pool_t *scratch_pool)
-{
-  int i;
-  apr_array_header_t *new_array = apr_array_make(
-    result_pool, prop_array->nelts, sizeof(svn_prop_inherited_item_t *));
-
-  for (i = 0; i < prop_array->nelts; ++i)
-    {
-      svn_prop_inherited_item_t *elt =
-        APR_ARRAY_IDX(prop_array, i, svn_prop_inherited_item_t *);
-
-      elt = svn_prop_inherited_item_dup(elt, result_pool, scratch_pool);
-      APR_ARRAY_PUSH(new_array, svn_prop_inherited_item_t *) = elt;
-    }
-  return new_array;
-}

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_subr/skel.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_subr/skel.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_subr/skel.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_subr/skel.c Mon Sep 24 18:16:17 2012
@@ -822,7 +822,7 @@ svn_skel__unparse_proplist(svn_skel_t **
 
 svn_error_t *
 svn_skel__unparse_iproplist(svn_skel_t **skel_p,
-                            apr_array_header_t *inherited_props,
+                            const apr_array_header_t *inherited_props,
                             apr_pool_t *result_pool)
 {
   svn_skel_t *skel = svn_skel__make_empty_list(result_pool);

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.c Mon Sep 24 18:16:17 2012
@@ -1907,6 +1907,153 @@ svn_wc__conflict_invoke_resolver(svn_wc_
   return SVN_NO_ERROR;
 }
 
+/* Read all property conflicts contained in CONFLICT_SKEL into
+ * individual conflict descriptions, and append those descriptions
+ * to the CONFLICTS array. Allocate results in RESULT_POOL.
+ * SCRATCH_POOL is used for temporary allocations. */
+static svn_error_t *
+read_prop_conflicts(apr_array_header_t *conflicts,
+                    svn_wc__db_t *db,
+                    const char *local_abspath,
+                    svn_skel_t *conflict_skel,
+                    apr_pool_t *result_pool,
+                    apr_pool_t *scratch_pool)
+{
+  const char *prop_reject_file;
+  apr_hash_t *my_props;
+  apr_hash_t *their_old_props;
+  apr_hash_t *their_props;
+  apr_hash_t *conflicted_props;
+  apr_hash_index_t *hi;
+  apr_pool_t *iterpool;
+  
+  SVN_ERR(svn_wc__conflict_read_prop_conflict(&prop_reject_file,
+                                              &my_props,
+                                              &their_old_props,
+                                              &their_props,
+                                              &conflicted_props,
+                                              db, local_abspath,
+                                              conflict_skel,
+                                              scratch_pool, scratch_pool));
+
+  if (apr_hash_count(conflicted_props) == 0)
+    {
+      /* Legacy prop conflict with only a .reject file. */
+      svn_wc_conflict_description2_t *desc;
+
+      desc  = svn_wc_conflict_description_create_prop2(local_abspath,
+                                                       svn_node_unknown,
+                                                       "", result_pool);
+
+      /* ### This should be changed. The prej file should be stored
+       * ### separately from the other files. We need to rev the
+       * ### conflict description struct for this. */
+      desc->their_abspath = apr_pstrdup(result_pool, prop_reject_file);
+
+      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t*) = desc;
+
+      return SVN_NO_ERROR;
+    }
+
+  iterpool = svn_pool_create(scratch_pool);
+  for (hi = apr_hash_first(scratch_pool, conflicted_props);
+       hi;
+       hi = apr_hash_next(hi))
+    {
+      const char *propname = svn__apr_hash_index_key(hi);
+      svn_string_t *old_value;
+      svn_string_t *my_value;
+      svn_string_t *their_value;
+      svn_wc_conflict_description2_t *desc;
+
+      svn_pool_clear(iterpool);
+
+      desc  = svn_wc_conflict_description_create_prop2(local_abspath,
+                                                       svn_node_unknown,
+                                                       propname,
+                                                       result_pool);
+
+      desc->property_name = apr_pstrdup(result_pool, propname);
+
+      my_value = apr_hash_get(my_props, propname, APR_HASH_KEY_STRING);
+      their_value = apr_hash_get(their_props, propname,
+                                 APR_HASH_KEY_STRING);
+
+      /* Compute the incoming side of the conflict ('action'). */
+      if (their_value == NULL)
+        desc->action = svn_wc_conflict_action_delete;
+      else if (my_value == NULL)
+        desc->action = svn_wc_conflict_action_add;
+      else
+        desc->action = svn_wc_conflict_action_edit;
+
+      /* Compute the local side of the conflict ('reason'). */
+      if (my_value == NULL)
+        desc->reason = svn_wc_conflict_reason_deleted;
+      else if (their_value == NULL)
+        desc->action = svn_wc_conflict_reason_added;
+      else
+        desc->action = svn_wc_conflict_reason_edited;
+
+      /* ### This should be changed. The prej file should be stored
+       * ### separately from the other files. We need to rev the
+       * ### conflict description struct for this. */
+      desc->their_abspath = apr_pstrdup(result_pool, prop_reject_file);
+
+      /* ### This should be changed. The conflict description for
+       * ### props should contain these values as svn_string_t,
+       * ### rather than in temporary files. We need to rev the
+       * ### conflict description struct for this. */
+      if (my_value)
+        {
+          svn_stream_t *s;
+          apr_size_t len;
+
+          SVN_ERR(svn_stream_open_unique(&s, &desc->my_abspath, NULL,
+                                         svn_io_file_del_on_pool_cleanup,
+                                         result_pool, iterpool));
+          len = my_value->len;
+          SVN_ERR(svn_stream_write(s, my_value->data, &len));
+          SVN_ERR(svn_stream_close(s));
+        }
+
+      if (their_value)
+        {
+          svn_stream_t *s;
+          apr_size_t len;
+
+          /* ### Currently, their_abspath is used for the prop reject file.
+           * ### Put their value into merged instead...
+           * ### We need to rev the conflict description struct to fix this. */
+          SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
+                                         svn_io_file_del_on_pool_cleanup,
+                                         result_pool, iterpool));
+          len = their_value->len;
+          SVN_ERR(svn_stream_write(s, their_value->data, &len));
+          SVN_ERR(svn_stream_close(s));
+        }
+
+      old_value = apr_hash_get(their_old_props, propname, APR_HASH_KEY_STRING);
+      if (old_value)
+        {
+          svn_stream_t *s;
+          apr_size_t len;
+
+          SVN_ERR(svn_stream_open_unique(&s, &desc->base_abspath, NULL,
+                                         svn_io_file_del_on_pool_cleanup,
+                                         result_pool, iterpool));
+          len = old_value->len;
+          SVN_ERR(svn_stream_write(s, old_value->data, &len));
+          SVN_ERR(svn_stream_close(s));
+        }
+
+      APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t*) = desc;
+    }
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_wc__read_conflicts(const apr_array_header_t **conflicts,
                        svn_wc__db_t *db,
@@ -1942,21 +2089,8 @@ svn_wc__read_conflicts(const apr_array_h
                           sizeof(svn_wc_conflict_description2_t*));
 
   if (prop_conflicted)
-    {
-      svn_wc_conflict_description2_t *desc;
-      desc  = svn_wc_conflict_description_create_prop2(local_abspath,
-                                                       svn_node_unknown,
-                                                       "",
-                                                       result_pool);
-
-      SVN_ERR(svn_wc__conflict_read_prop_conflict(&desc->their_abspath,
-                                                  NULL, NULL,  NULL, NULL,
-                                                  db, local_abspath,
-                                                  conflict_skel,
-                                                  result_pool, scratch_pool));
-
-      APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t*) = desc;
-    }
+    SVN_ERR(read_prop_conflicts(cflcts, db, local_abspath, conflict_skel,
+                                result_pool, scratch_pool));
 
   if (text_conflicted)
     {

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.h?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.h (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/conflicts.h Mon Sep 24 18:16:17 2012
@@ -260,6 +260,8 @@ svn_wc__conflict_skel_resolve(svn_boolea
  *
  * Output arguments can be NULL if the value is not necessary.
  *
+ * ### stsp asks: what is LOCATIONS?
+ *
  * TEXT_, PROP_ and TREE_CONFLICTED (when not NULL) will be set to TRUE
  * when the conflict contains the specified kind of conflict, otherwise
  * to false.

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/entries.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/entries.c Mon Sep 24 18:16:17 2012
@@ -1459,7 +1459,7 @@ insert_node(svn_sqlite__db_t *sdb,
   else if (node->presence == svn_wc__db_status_excluded)
     SVN_ERR(svn_sqlite__bind_text(stmt, 8, "excluded"));
   else if (node->presence == svn_wc__db_status_server_excluded)
-    SVN_ERR(svn_sqlite__bind_text(stmt, 8, "absent"));
+    SVN_ERR(svn_sqlite__bind_text(stmt, 8, "server-excluded"));
 
   if (node->kind == svn_node_none)
     SVN_ERR(svn_sqlite__bind_text(stmt, 10, "unknown"));

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/update_editor.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/update_editor.c Mon Sep 24 18:16:17 2012
@@ -1668,7 +1668,7 @@ delete_entry(const char *path,
 
 
 
-    /* Receive the remote removal of excluded/absent/not present node.
+    /* Receive the remote removal of excluded/server-excluded/not present node.
        Do not notify, but perform the change even when the node is shadowed */
   if (base_status == svn_wc__db_status_not_present
       || base_status == svn_wc__db_status_excluded

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/upgrade.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/upgrade.c Mon Sep 24 18:16:17 2012
@@ -1380,7 +1380,11 @@ svn_wc__upgrade_conflict_skel_from_raw(s
                                        apr_pool_t *scratch_pool)
 {
   svn_skel_t *conflict_data = NULL;
+  const char *wcroot_abspath;
   
+  SVN_ERR(svn_wc__db_get_wcroot(&wcroot_abspath, db, wri_abspath,
+                                scratch_pool, scratch_pool));
+
   if (conflict_old || conflict_new || conflict_wrk)
     {
       const char *old_abspath = NULL;
@@ -1390,19 +1394,16 @@ svn_wc__upgrade_conflict_skel_from_raw(s
       conflict_data = svn_wc__conflict_skel_create(result_pool);
 
       if (conflict_old)
-        SVN_ERR(svn_wc__db_from_relpath(&old_abspath, db, wri_abspath,
-                                        conflict_old,
-                                        scratch_pool, scratch_pool));
+        old_abspath = svn_dirent_join(wcroot_abspath, conflict_old,
+                                      scratch_pool);
 
       if (conflict_new)
-        SVN_ERR(svn_wc__db_from_relpath(&new_abspath, db, wri_abspath,
-                                        conflict_new,
-                                        scratch_pool, scratch_pool));
+        new_abspath = svn_dirent_join(wcroot_abspath, conflict_new,
+                                      scratch_pool);
 
       if (conflict_wrk)
-        SVN_ERR(svn_wc__db_from_relpath(&wrk_abspath, db, wri_abspath,
-                                        conflict_wrk,
-                                        scratch_pool, scratch_pool));
+        wrk_abspath = svn_dirent_join(wcroot_abspath, conflict_wrk,
+                                      scratch_pool);
 
       SVN_ERR(svn_wc__conflict_skel_add_text_conflict(conflict_data,
                                                       db, wri_abspath,
@@ -1420,9 +1421,7 @@ svn_wc__upgrade_conflict_skel_from_raw(s
       if (!conflict_data)
         conflict_data = svn_wc__conflict_skel_create(result_pool);
 
-      SVN_ERR(svn_wc__db_from_relpath(&prej_abspath, db, wri_abspath,
-                                      prej_file,
-                                      scratch_pool, scratch_pool));
+      prej_abspath = svn_dirent_join(wcroot_abspath, prej_file, scratch_pool);
 
       SVN_ERR(svn_wc__conflict_skel_add_prop_conflict(conflict_data,
                                                       db, wri_abspath,
@@ -1445,9 +1444,8 @@ svn_wc__upgrade_conflict_skel_from_raw(s
       tc_skel = svn_skel__parse(tree_conflict_data, tree_conflict_len,
                                 scratch_pool);
 
-      SVN_ERR(svn_wc__db_from_relpath(&local_abspath, db, wri_abspath,
-                                      local_relpath,
-                                      scratch_pool, scratch_pool));
+      local_abspath = svn_dirent_join(wcroot_abspath, local_relpath,
+                                      scratch_pool);
 
       SVN_ERR(svn_wc__deserialize_conflict(&tc, tc_skel,
                                            svn_dirent_dirname(local_abspath,
@@ -1497,20 +1495,15 @@ svn_wc__upgrade_conflict_skel_from_raw(s
 }
 
 static svn_error_t *
-bump_to_30(void *baton,
-           svn_sqlite__db_t *sdb,
-           apr_pool_t *scratch_pool)
+bump_to_30(void *baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
 {
   struct bump_baton *bb = baton;
   svn_boolean_t have_row;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_sqlite__stmt_t *stmt;
   svn_sqlite__stmt_t *stmt_store;
-  svn_sqlite__stmt_t *stmt_mark_switch_roots;
   svn_wc__db_t *db; /* Read only temp db */
   const char *wri_abspath = bb->wcroot_abspath;
-  apr_array_header_t *empty_iprops = apr_array_make(
-    scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
 
   SVN_ERR(svn_wc__db_open(&db, NULL, FALSE, FALSE,
                           scratch_pool, scratch_pool));
@@ -1559,11 +1552,27 @@ bump_to_30(void *baton,
 
       SVN_ERR(svn_sqlite__step(&have_row, stmt));
     }
-
   SVN_ERR(svn_sqlite__reset(stmt));
 
   SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_30));
- 
+  SVN_ERR(svn_wc__db_close(db));
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+bump_to_31(void *baton,
+           svn_sqlite__db_t *sdb,
+           apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt, *stmt_mark_switch_roots;
+  svn_boolean_t have_row;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  apr_array_header_t *empty_iprops = apr_array_make(
+    scratch_pool, 0, sizeof(svn_prop_inherited_item_t *));
+
+  /* Add the inherited_props column to NODES. */
+  SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_UPGRADE_TO_31));
+
   /* Set inherited_props to an empty array for the roots of all
      switched subtrees in the WC.  This allows subsequent updates
      to recognize these roots as needing an iprops cache. */
@@ -1587,8 +1596,7 @@ bump_to_30(void *baton,
     }
 
   SVN_ERR(svn_sqlite__reset(stmt));
-
-  SVN_ERR(svn_wc__db_close(db));
+  svn_pool_destroy(iterpool);
   return SVN_NO_ERROR;
 }
 
@@ -1869,6 +1877,11 @@ svn_wc__upgrade_sdb(int *result_format,
         SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_30, &bb,
                                              scratch_pool));
         *result_format = 30;
+
+      case 30:
+        SVN_ERR(svn_sqlite__with_transaction(sdb, bump_to_31, &bb,
+                                             scratch_pool));
+        *result_format = 31;
         /* FALLTHROUGH  */
       /* ### future bumps go here.  */
 #if 0

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-metadata.sql
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-metadata.sql?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-metadata.sql (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-metadata.sql Mon Sep 24 18:16:17 2012
@@ -32,7 +32,7 @@
  * the PRESENCE column in these tables has one of the following values
  * (see also the C type #svn_wc__db_status_t):
  *   "normal"
- *   "absent" -- server has declared it "absent" (ie. authz failure)
+ *   "server-excluded" -- server has declared it excluded (ie. authz failure)
  *   "excluded" -- administratively excluded (ie. sparse WC)
  *   "not-present" -- node not present at this REV
  *   "incomplete" -- state hasn't been filled in
@@ -367,7 +367,7 @@ CREATE TABLE NODES (
        current 'op_depth'.  This state is badly named, it should be
        something like 'deleted'.
 
-     absent: in the 'BASE' tree this is a node that is excluded by
+     server-excluded: in the 'BASE' tree this is a node that is excluded by
        authz.  The name of the node is known from the parent, but no
        other information is available.  Not valid in the 'WORKING'
        tree as there is no way to commit such a node.
@@ -779,20 +779,27 @@ PRAGMA user_version = 29;
 
 /* ------------------------------------------------------------------------- */
 
-/* Format 30 adds the inherited_props column to the NODES table. */
+/* Format 30 creates a new NODES index for move information, and a new
+   PRISTINE index for the md5_checksum column. It also activates use of
+   skel-based conflict storage -- see notes/wc-ng/conflict-storage-2.0.
+   It also renames the "absent" presence to "server-excluded". */
 -- STMT_UPGRADE_TO_30
-ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
-
 CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED
 ON NODES (wc_id, moved_to, op_depth);
 
 CREATE INDEX IF NOT EXISTS I_PRISTINE_MD5 ON PRISTINE (md5_checksum);
 
+UPDATE nodes SET presence = "server-excluded" WHERE presence = "absent";
+
 /* Just to be sure clear out file external skels from pre 1.7.0 development
    working copies that were never updated by 1.7.0+ style clients */
 UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL;
 
-PRAGMA user_version = 30;
+/* Format 31 adds the inherited_props column to the NODES table. */
+-- STMT_UPGRADE_TO_31
+ALTER TABLE NODES ADD COLUMN inherited_props BLOB;
+
+PRAGMA user_version = 31;
 
 -- STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE
 SELECT wc_id, local_relpath,
@@ -825,9 +832,6 @@ WHERE wc_id = ?1 and local_relpath = ?2
    number will be, however, so we're just marking it as 99 for now.  */
 -- format: 99
 
-/* TODO: Rename the "absent" presence value to "server-excluded". wc_db.c
-   and this file have references to "absent" which still need to be changed
-   to "server-excluded". */
 /* TODO: Un-confuse *_revision column names in the EXTERNALS table to
    "-r<operative> foo@<peg>", as suggested by the patch attached to
    http://svn.haxx.se/dev/archive-2011-09/0478.shtml */

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-queries.sql?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc-queries.sql Mon Sep 24 18:16:17 2012
@@ -880,7 +880,7 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = ?3
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'absent')
+  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'server-excluded')
 
 -- STMT_INSERT_WORKING_NODE_FROM_BASE_COPY
 INSERT INTO nodes (
@@ -918,7 +918,7 @@ LIMIT 1
 SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
-  AND op_depth = 0 AND presence = 'absent'
+  AND op_depth = 0 AND presence = 'server-excluded'
 LIMIT 1
 
 /* Select all excluded nodes. Not valid on the WC-root */
@@ -927,7 +927,7 @@ SELECT local_relpath FROM nodes
 WHERE wc_id = ?1
   AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
   AND op_depth = 0
-  AND (presence = 'absent' OR presence = 'excluded')
+  AND (presence = 'server-excluded' OR presence = 'excluded')
 
 /* Creates a copy from one top level NODE to a different location */
 -- STMT_INSERT_WORKING_NODE_COPY_FROM
@@ -1332,7 +1332,7 @@ WHERE wc_id = ?1
   AND op_depth = (SELECT MAX(s.op_depth) FROM nodes AS s
                   WHERE s.wc_id = ?1
                     AND s.local_relpath = n.local_relpath)
-  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'absent')
+  AND presence NOT IN ('base-deleted', 'not-present', 'excluded', 'server-excluded')
 
 -- STMT_SELECT_DELETE_LIST
 SELECT local_relpath FROM delete_list
@@ -1362,7 +1362,7 @@ WHERE wc_id = ?1
   AND (local_relpath = ?2
        OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
   AND op_depth = 0
-  AND (presence IN ('absent', 'excluded')
+  AND (presence IN ('server-excluded', 'excluded')
         OR depth NOT IN ('infinity', 'unknown'))
   AND file_external IS NULL
 LIMIT 1

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc.h?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc.h Mon Sep 24 18:16:17 2012
@@ -151,16 +151,16 @@ extern "C" {
  *
  * == 1.7.x shipped with format 29
  *
- * The bump to 30 added the inherited_props column in the NODES table.
- * Bumped in r????????.
- *
- * The bump to 31 switched the conflict storage to a skel inside conflict_data.
+ * The bump to 30 switched the conflict storage to a skel inside conflict_data.
  * Also clears some known invalid state.
  *
+ * The bump to 31 added the inherited_props column in the NODES table.
+ * Bumped in r????????.
+ *
  * Please document any further format changes here.
  */
 
-#define SVN_WC__VERSION 30
+#define SVN_WC__VERSION 31
 
 
 /* Formats <= this have no concept of "revert text-base/props".  */

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.c Mon Sep 24 18:16:17 2012
@@ -299,9 +299,7 @@ static const svn_token_map_t kind_map[] 
    of all the status values. */
 static const svn_token_map_t presence_map[] = {
   { "normal", svn_wc__db_status_normal },
-  /* ### "absent" is the former name of the "server-excluded" presence.
-   * ### We should change it to "server-excluded" with a format bump. */
-  { "absent", svn_wc__db_status_server_excluded },
+  { "server-excluded", svn_wc__db_status_server_excluded },
   { "excluded", svn_wc__db_status_excluded },
   { "not-present", svn_wc__db_status_not_present },
   { "incomplete", svn_wc__db_status_incomplete },
@@ -6339,15 +6337,18 @@ revert_list_read(void *baton,
                                                   scratch_pool);
           if (conflict_data)
             {
+              const apr_array_header_t *marker_paths;
               svn_skel_t *conflicts = svn_skel__parse(conflict_data,
                                                       conflict_len,
                                                       scratch_pool);
 
-              SVN_ERR(svn_wc__conflict_read_markers(&b->marker_paths,
+              SVN_ERR(svn_wc__conflict_read_markers(&marker_paths,
                                                     b->db, wcroot->abspath,
                                                     conflicts,
                                                     b->result_pool,
                                                     scratch_pool));
+              /* De-const-ify. */
+              b->marker_paths = (apr_array_header_t *)marker_paths;
             }
 #endif
 
@@ -9336,7 +9337,7 @@ svn_wc__db_read_cached_iprops(apr_array_
 }
 
 /* Recursive body of svn_wc__db_get_children_with_cached_iprops. */
-svn_error_t *
+static svn_error_t *
 get_children_with_cached_iprops(apr_hash_t *iprop_paths,
                                 svn_depth_t depth,
                                 const char *local_abspath,

Modified: subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.h?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/auto-props-sdc/subversion/libsvn_wc/wc_db.h Mon Sep 24 18:16:17 2012
@@ -370,7 +370,7 @@ svn_wc__db_get_wcroot(const char **wcroo
    In the BASE tree, each node corresponds to a particular node-rev in the
    repository.  It can be a mixed-revision tree.  Each node holds either a
    copy of the node-rev as it exists in the repository (if presence =
-   'normal'), or a place-holder (if presence = 'absent' or 'excluded' or
+   'normal'), or a place-holder (if presence = 'server-excluded' or 'excluded' or
    'not-present').
 
    @{
@@ -1362,7 +1362,7 @@ svn_wc__db_op_copy_symlink(svn_wc__db_t 
                            apr_pool_t *scratch_pool);
 
 
-/* ### do we need svn_wc__db_op_copy_absent() ??  */
+/* ### do we need svn_wc__db_op_copy_server_excluded() ??  */
 
 
 /* ### add a new versioned directory. a list of children is NOT passed

Modified: subversion/branches/auto-props-sdc/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/mod_authz_svn/mod_authz_svn.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/auto-props-sdc/subversion/mod_authz_svn/mod_authz_svn.c Mon Sep 24 18:16:17 2012
@@ -44,6 +44,7 @@
 #include "svn_config.h"
 #include "svn_string.h"
 #include "svn_repos.h"
+#include "svn_pools.h"
 #include "svn_dirent_uri.h"
 #include "private/svn_fspath.h"
 
@@ -164,7 +165,8 @@ static const command_rec authz_svn_cmds[
  * Get the, possibly cached, svn_authz_t for this request.
  */
 static svn_authz_t *
-get_access_conf(request_rec *r, authz_svn_config_rec *conf)
+get_access_conf(request_rec *r, authz_svn_config_rec *conf,
+                apr_pool_t *scratch_pool)
 {
   const char *cache_key = NULL;
   const char *access_file;
@@ -182,7 +184,7 @@ get_access_conf(request_rec *r, authz_sv
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "%s", dav_err->desc);
         return NULL;
       }
-      access_file = svn_dirent_join_many(r->pool, repos_path, "conf",
+      access_file = svn_dirent_join_many(scratch_pool, repos_path, "conf",
                                          conf->repo_relative_access_file,
                                          NULL);
     }
@@ -194,7 +196,7 @@ get_access_conf(request_rec *r, authz_sv
   ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                 "Path to authz file is %s", access_file);
 
-  cache_key = apr_pstrcat(r->pool, "mod_authz_svn:",
+  cache_key = apr_pstrcat(scratch_pool, "mod_authz_svn:",
                           access_file, (char *)NULL);
   apr_pool_userdata_get(&user_data, cache_key, r->connection->pool);
   access_conf = user_data;
@@ -243,12 +245,13 @@ convert_case(char *text, svn_boolean_t t
 /* Return the username to authorize, with case-conversion performed if
    CONF->force_username_case is set. */
 static char *
-get_username_to_authorize(request_rec *r, authz_svn_config_rec *conf)
+get_username_to_authorize(request_rec *r, authz_svn_config_rec *conf,
+                          apr_pool_t *pool)
 {
   char *username_to_authorize = r->user;
   if (username_to_authorize && conf->force_username_case)
     {
-      username_to_authorize = apr_pstrdup(r->pool, r->user);
+      username_to_authorize = apr_pstrdup(pool, r->user);
       convert_case(username_to_authorize,
                    strcasecmp(conf->force_username_case, "upper") == 0);
     }
@@ -283,7 +286,8 @@ req_check_access(request_rec *r,
   svn_authz_t *access_conf = NULL;
   svn_error_t *svn_err;
   char errbuf[256];
-  const char *username_to_authorize = get_username_to_authorize(r, conf);
+  const char *username_to_authorize = get_username_to_authorize(r, conf,
+                                                                r->pool);
 
   switch (r->method_number)
     {
@@ -419,7 +423,7 @@ req_check_access(request_rec *r,
     }
 
   /* Retrieve/cache authorization file */
-  access_conf = get_access_conf(r,conf);
+  access_conf = get_access_conf(r,conf, r->pool);
   if (access_conf == NULL)
     return DECLINED;
 
@@ -577,14 +581,13 @@ log_access_verdict(LOG_ARGS_SIGNATURE,
 }
 
 /*
- * This function is used as a provider to allow mod_dav_svn to bypass the
- * generation of an apache request when checking GET access from
- * "mod_dav_svn/authz.c" .
+ * Implementation of subreq_bypass with scratch_pool parameter.
  */
 static int
-subreq_bypass(request_rec *r,
-              const char *repos_path,
-              const char *repos_name)
+subreq_bypass2(request_rec *r,
+               const char *repos_path,
+               const char *repos_name,
+               apr_pool_t *scratch_pool)
 {
   svn_error_t *svn_err = NULL;
   svn_authz_t *access_conf = NULL;
@@ -595,7 +598,7 @@ subreq_bypass(request_rec *r,
 
   conf = ap_get_module_config(r->per_dir_config,
                               &authz_svn_module);
-  username_to_authorize = get_username_to_authorize(r, conf);
+  username_to_authorize = get_username_to_authorize(r, conf, scratch_pool);
 
   /* If configured properly, this should never be true, but just in case. */
   if (!conf->anonymous
@@ -606,7 +609,7 @@ subreq_bypass(request_rec *r,
     }
 
   /* Retrieve authorization file */
-  access_conf = get_access_conf(r, conf);
+  access_conf = get_access_conf(r, conf, scratch_pool);
   if (access_conf == NULL)
     return HTTP_FORBIDDEN;
 
@@ -620,7 +623,7 @@ subreq_bypass(request_rec *r,
                                              username_to_authorize,
                                              svn_authz_none|svn_authz_read,
                                              &authz_access_granted,
-                                             r->pool);
+                                             scratch_pool);
       if (svn_err)
         {
           ap_log_rerror(APLOG_MARK, APLOG_ERR,
@@ -650,6 +653,26 @@ subreq_bypass(request_rec *r,
 }
 
 /*
+ * This function is used as a provider to allow mod_dav_svn to bypass the
+ * generation of an apache request when checking GET access from
+ * "mod_dav_svn/authz.c" .
+ */
+static int
+subreq_bypass(request_rec *r,
+              const char *repos_path,
+              const char *repos_name)
+{
+  int status;
+  apr_pool_t *scratch_pool;
+
+  scratch_pool = svn_pool_create(r->pool);
+  status = subreq_bypass2(r, repos_path, repos_name, scratch_pool);
+  svn_pool_destroy(scratch_pool);
+
+  return status;
+}
+
+/*
  * Hooks
  */
 

Modified: subversion/branches/auto-props-sdc/subversion/mod_dav_svn/reports/inherited-props.c
URL: http://svn.apache.org/viewvc/subversion/branches/auto-props-sdc/subversion/mod_dav_svn/reports/inherited-props.c?rev=1389505&r1=1389504&r2=1389505&view=diff
==============================================================================
--- subversion/branches/auto-props-sdc/subversion/mod_dav_svn/reports/inherited-props.c (original)
+++ subversion/branches/auto-props-sdc/subversion/mod_dav_svn/reports/inherited-props.c Mon Sep 24 18:16:17 2012
@@ -113,9 +113,7 @@ dav_svn__get_inherited_props_report(cons
                                 "couldn't retrieve revision root",
                                 resource->pool);
 
-  serr = svn_repos_fs_get_inherited_props(&inherited_props,
-                                          resource->info->repos->repos,
-                                          path, rev,
+  serr = svn_repos_fs_get_inherited_props(&inherited_props, root, path,
                                           dav_svn__authz_read_func(&arb),
                                           &arb, resource->pool, iterpool);
   if (serr)



Mime
View raw message