You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pb...@apache.org on 2012/04/26 00:04:40 UTC

svn commit: r1330583 [2/7] - in /subversion/branches/inheritable-props: ./ build/ build/generator/ build/generator/templates/ notes/ notes/merge-tracking/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/swig/ruby/test/ ...

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/commit.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/commit.c Wed Apr 25 22:04:36 2012
@@ -49,6 +49,7 @@
 
 #include "client.h"
 #include "private/svn_wc_private.h"
+#include "private/svn_subr_private.h"
 #include "private/svn_ra_private.h"
 #include "private/svn_magic.h"
 
@@ -269,75 +270,48 @@ import_file(const svn_delta_editor_t *ed
 
   /* Finally, close the file. */
   text_checksum =
-    svn_checksum_to_cstring(svn_checksum__from_digest(digest, svn_checksum_md5,
-                                                      pool), pool);
+    svn_checksum_to_cstring(svn_checksum__from_digest_md5(digest, pool), pool);
 
   return editor->close_file(file_baton, text_checksum, pool);
 }
 
 
-/* Import directory LOCAL_ABSPATH into the repository directory indicated by
- * DIR_BATON in EDITOR.  EDIT_PATH is the path imported as the root
- * directory, so all edits are relative to that.
- *
- * DEPTH is the depth at this point in the descent (it may be changed
- * for recursive calls).
- *
- * Accumulate file paths and their batons in FILES, which must be
- * non-null.  (These are used to send postfix textdeltas later).
+/* Return in CHILDREN a mapping of basenames to dirents for the importable
+ * children of DIR_ABSPATH.  EXCLUDES is a hash of absolute paths to filter
+ * out.  IGNORES, if non-NULL, is a list of basenames to filter out.
+ * FILTER_CALLBACK and FILTER_BATON will be called for each absolute path,
+ * allowing users to further filter the list of returned entries.
  *
- * EXCLUDES is a hash whose keys are absolute paths to exclude from
- * the import (values are unused).
- *
- * If NO_IGNORE is FALSE, don't import files or directories that match
- * ignore patterns.
- *
- * If FILTER_CALLBACK is not NULL, call it with FILTER_BATON on each to be
- * imported node below LOCAL_ABSPATH to allow filtering nodes.
- *
- * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for each
- * directory.
- *
- * Use POOL for any temporary allocation.  */
+ * Results are returned in RESULT_POOL; use SCRATCH_POOL for temporary data.*/
 static svn_error_t *
-import_dir(const svn_delta_editor_t *editor,
-           void *dir_baton,
-           const char *local_abspath,
-           const char *edit_path,
-           svn_depth_t depth,
-           apr_hash_t *excludes,
-           svn_boolean_t no_ignore,
-           svn_boolean_t ignore_unknown_node_types,
-           svn_client_import_filter_func_t filter_callback,
-           void *filter_baton,
-           import_ctx_t *import_ctx,
-           svn_client_ctx_t *ctx,
-           apr_pool_t *pool)
+get_filtered_children(apr_hash_t **children,
+                      const char *dir_abspath,
+                      apr_hash_t *excludes,
+                      apr_array_header_t *ignores,
+                      svn_client_import_filter_func_t filter_callback,
+                      void *filter_baton,
+                      svn_client_ctx_t *ctx,
+                      apr_pool_t *result_pool,
+                      apr_pool_t *scratch_pool)
 {
-  apr_pool_t *subpool = svn_pool_create(pool);  /* iteration pool */
   apr_hash_t *dirents;
   apr_hash_index_t *hi;
-  apr_array_header_t *ignores;
-
-  SVN_ERR(svn_path_check_valid(local_abspath, pool));
-
-  if (!no_ignore)
-    SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
-  SVN_ERR(svn_io_get_dirents3(&dirents, local_abspath, TRUE, pool, pool));
+  SVN_ERR(svn_io_get_dirents3(&dirents, dir_abspath, TRUE, result_pool,
+                              scratch_pool));
 
-  for (hi = apr_hash_first(pool, dirents); hi; hi = apr_hash_next(hi))
+  for (hi = apr_hash_first(scratch_pool, dirents); hi; hi = apr_hash_next(hi))
     {
-      const char *this_abspath, *this_edit_path;
-      const char *filename = svn__apr_hash_index_key(hi);
+      const char *base_name = svn__apr_hash_index_key(hi);
       const svn_io_dirent2_t *dirent = svn__apr_hash_index_val(hi);
+      const char *local_abspath;
 
-      svn_pool_clear(subpool);
+      svn_pool_clear(iterpool);
 
-      if (ctx->cancel_func)
-        SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+      local_abspath = svn_dirent_join(dir_abspath, base_name, iterpool);
 
-      if (svn_wc_is_adm_dir(filename, subpool))
+      if (svn_wc_is_adm_dir(base_name, iterpool))
         {
           /* If someone's trying to import a directory named the same
              as our administrative directories, that's probably not
@@ -348,95 +322,125 @@ import_dir(const svn_delta_editor_t *edi
           if (ctx->notify_func2)
             {
               svn_wc_notify_t *notify
-                = svn_wc_create_notify(svn_dirent_join(local_abspath, filename,
-                                                       subpool),
-                                       svn_wc_notify_skip, subpool);
+                = svn_wc_create_notify(svn_dirent_join(local_abspath, base_name,
+                                                       iterpool),
+                                       svn_wc_notify_skip, iterpool);
               notify->kind = svn_node_dir;
               notify->content_state = notify->prop_state
                 = svn_wc_notify_state_inapplicable;
               notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-              (*ctx->notify_func2)(ctx->notify_baton2, notify, subpool);
+              (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
             }
+
+          apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
+          continue;
+        }
+            /* If this is an excluded path, exclude it. */
+      if (apr_hash_get(excludes, local_abspath, APR_HASH_KEY_STRING))
+        {
+          apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
           continue;
         }
 
-      /* Typically, we started importing from ".", in which case
-         edit_path is "".  So below, this_path might become "./blah",
-         and this_edit_path might become "blah", for example. */
-      this_abspath = svn_dirent_join(local_abspath, filename, subpool);
-      this_edit_path = svn_relpath_join(edit_path, filename, subpool);
-
-      /* If this is an excluded path, exclude it. */
-      if (apr_hash_get(excludes, this_abspath, APR_HASH_KEY_STRING))
-        continue;
-
-      if ((!no_ignore) && svn_wc_match_ignore_list(filename, ignores,
-                                                   subpool))
-        continue;
+      if (ignores && svn_wc_match_ignore_list(base_name, ignores, iterpool))
+        {
+          apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
+          continue;
+        }
 
-      if (filter_callback != NULL)
+      if (filter_callback)
         {
           svn_boolean_t filter = FALSE;
 
-          SVN_ERR(filter_callback(filter_baton, &filter, this_abspath,
-                                  dirent, subpool));
+          SVN_ERR(filter_callback(filter_baton, &filter, local_abspath,
+                                  dirent, iterpool));
 
           if (filter)
-            continue;
+            {
+              apr_hash_set(dirents, base_name, APR_HASH_KEY_STRING, NULL);
+              continue;
+            }
         }
+    }
+  svn_pool_destroy(iterpool);
 
-      if (dirent->kind == svn_node_dir && depth >= svn_depth_immediates)
-        {
-          void *this_dir_baton;
+  *children = dirents;
+  return SVN_NO_ERROR;
+}
 
-          /* Add the new subdirectory, getting a descent baton from
-             the editor. */
-          SVN_ERR(editor->add_directory(this_edit_path, dir_baton,
-                                        NULL, SVN_INVALID_REVNUM, subpool,
-                                        &this_dir_baton));
+static svn_error_t *
+import_dir(const svn_delta_editor_t *editor,
+           void *dir_baton,
+           const char *local_abspath,
+           const char *edit_path,
+           svn_depth_t depth,
+           apr_hash_t *excludes,
+           svn_boolean_t no_ignore,
+           svn_boolean_t ignore_unknown_node_types,
+           svn_client_import_filter_func_t filter_callback,
+           void *filter_baton,
+           import_ctx_t *import_ctx,
+           svn_client_ctx_t *ctx,
+           apr_pool_t *pool);
 
-          /* Remember that the repository was modified */
-          import_ctx->repos_changed = TRUE;
 
-          /* By notifying before the recursive call below, we display
-             a directory add before displaying adds underneath the
-             directory.  To do it the other way around, just move this
-             after the recursive call. */
-          if (ctx->notify_func2)
-            {
-              svn_wc_notify_t *notify
-                = svn_wc_create_notify(this_abspath,
-                                       svn_wc_notify_commit_added,
-                                       subpool);
-              notify->kind = svn_node_dir;
-              notify->content_state = notify->prop_state
-                = svn_wc_notify_state_inapplicable;
-              notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-              (*ctx->notify_func2)(ctx->notify_baton2, notify, subpool);
-            }
+/* Import the children of DIR_ABSPATH, with other arguments similar to
+ * import_dir(). */
+static svn_error_t *
+import_children(const char *dir_abspath,
+                const char *edit_path,
+                apr_hash_t *dirents,
+                const svn_delta_editor_t *editor,
+                void *dir_baton,
+                svn_depth_t depth,
+                apr_hash_t *excludes,
+                svn_boolean_t no_ignore,
+                svn_boolean_t ignore_unknown_node_types,
+                svn_client_import_filter_func_t filter_callback,
+                void *filter_baton,
+                import_ctx_t *import_ctx,
+                svn_client_ctx_t *ctx,
+                apr_pool_t *scratch_pool)
+{
+  apr_hash_index_t *hi;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
-          /* Recurse. */
-          {
-            svn_depth_t depth_below_here = depth;
-            if (depth == svn_depth_immediates)
-              depth_below_here = svn_depth_empty;
-
-            SVN_ERR(import_dir(editor, this_dir_baton, this_abspath,
-                               this_edit_path, depth_below_here, excludes,
-                               no_ignore, ignore_unknown_node_types,
-                               filter_callback, filter_baton,
-                               import_ctx, ctx,
-                               subpool));
-          }
+  for (hi = apr_hash_first(scratch_pool, dirents); hi; hi = apr_hash_next(hi))
+    {
+      const char *this_abspath, *this_edit_path;
+      const char *filename = svn__apr_hash_index_key(hi);
+      const svn_io_dirent2_t *dirent = svn__apr_hash_index_val(hi);
 
-          /* Finally, close the sub-directory. */
-          SVN_ERR(editor->close_directory(this_dir_baton, subpool));
+      svn_pool_clear(iterpool);
+
+      if (ctx->cancel_func)
+        SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+
+      /* Typically, we started importing from ".", in which case
+         edit_path is "".  So below, this_path might become "./blah",
+         and this_edit_path might become "blah", for example. */
+      this_abspath = svn_dirent_join(dir_abspath, filename, iterpool);
+      this_edit_path = svn_relpath_join(edit_path, filename, iterpool);
+
+      if (dirent->kind == svn_node_dir && depth >= svn_depth_immediates)
+        {
+          /* Recurse. */
+          svn_depth_t depth_below_here = depth;
+          if (depth == svn_depth_immediates)
+            depth_below_here = svn_depth_empty;
+
+          SVN_ERR(import_dir(editor, dir_baton, this_abspath,
+                             this_edit_path, depth_below_here, excludes,
+                             no_ignore, ignore_unknown_node_types,
+                             filter_callback, filter_baton,
+                             import_ctx, ctx,
+                             iterpool));
         }
       else if (dirent->kind == svn_node_file && depth >= svn_depth_files)
         {
           SVN_ERR(import_file(editor, dir_baton, this_abspath,
                               this_edit_path, dirent,
-                              import_ctx, ctx, subpool));
+                              import_ctx, ctx, iterpool));
         }
       else if (dirent->kind != svn_node_dir && dirent->kind != svn_node_file)
         {
@@ -447,23 +451,114 @@ import_dir(const svn_delta_editor_t *edi
                 {
                   svn_wc_notify_t *notify
                     = svn_wc_create_notify(this_abspath,
-                                           svn_wc_notify_skip, subpool);
+                                           svn_wc_notify_skip, iterpool);
                   notify->kind = svn_node_dir;
                   notify->content_state = notify->prop_state
                     = svn_wc_notify_state_inapplicable;
                   notify->lock_state = svn_wc_notify_lock_state_inapplicable;
-                  (*ctx->notify_func2)(ctx->notify_baton2, notify, subpool);
+                  (*ctx->notify_func2)(ctx->notify_baton2, notify, iterpool);
                 }
             }
           else
             return svn_error_createf
               (SVN_ERR_NODE_UNKNOWN_KIND, NULL,
                _("Unknown or unversionable type for '%s'"),
-               svn_dirent_local_style(this_abspath, subpool));
+               svn_dirent_local_style(this_abspath, iterpool));
         }
     }
 
-  svn_pool_destroy(subpool);
+  svn_pool_destroy(iterpool);
+  return SVN_NO_ERROR;
+}
+
+
+/* Import directory LOCAL_ABSPATH into the repository directory indicated by
+ * DIR_BATON in EDITOR.  EDIT_PATH is the path imported as the root
+ * directory, so all edits are relative to that.
+ *
+ * DEPTH is the depth at this point in the descent (it may be changed
+ * for recursive calls).
+ *
+ * Accumulate file paths and their batons in FILES, which must be
+ * non-null.  (These are used to send postfix textdeltas later).
+ *
+ * EXCLUDES is a hash whose keys are absolute paths to exclude from
+ * the import (values are unused).
+ *
+ * If NO_IGNORE is FALSE, don't import files or directories that match
+ * ignore patterns.
+ *
+ * If FILTER_CALLBACK is not NULL, call it with FILTER_BATON on each to be
+ * imported node below LOCAL_ABSPATH to allow filtering nodes.
+ *
+ * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for each
+ * directory.
+ *
+ * Use POOL for any temporary allocation.  */
+static svn_error_t *
+import_dir(const svn_delta_editor_t *editor,
+           void *dir_baton,
+           const char *local_abspath,
+           const char *edit_path,
+           svn_depth_t depth,
+           apr_hash_t *excludes,
+           svn_boolean_t no_ignore,
+           svn_boolean_t ignore_unknown_node_types,
+           svn_client_import_filter_func_t filter_callback,
+           void *filter_baton,
+           import_ctx_t *import_ctx,
+           svn_client_ctx_t *ctx,
+           apr_pool_t *pool)
+{
+  apr_hash_t *dirents;
+  apr_array_header_t *ignores = NULL;
+  void *this_dir_baton;
+
+  SVN_ERR(svn_path_check_valid(local_abspath, pool));
+
+  if (!no_ignore)
+    SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
+
+  SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, ignores,
+                                filter_callback, filter_baton, ctx,
+                                pool, pool));
+
+  /* Import this directory, but not yet its children. */
+  {
+    /* Add the new subdirectory, getting a descent baton from the editor. */
+    SVN_ERR(editor->add_directory(edit_path, dir_baton, NULL,
+                                  SVN_INVALID_REVNUM, pool, &this_dir_baton));
+
+    /* Remember that the repository was modified */
+    import_ctx->repos_changed = TRUE;
+
+    /* By notifying before the recursive call below, we display
+       a directory add before displaying adds underneath the
+       directory.  To do it the other way around, just move this
+       after the recursive call. */
+    if (ctx->notify_func2)
+      {
+        svn_wc_notify_t *notify
+          = svn_wc_create_notify(local_abspath, svn_wc_notify_commit_added,
+                                 pool);
+        notify->kind = svn_node_dir;
+        notify->content_state = notify->prop_state
+          = svn_wc_notify_state_inapplicable;
+        notify->lock_state = svn_wc_notify_lock_state_inapplicable;
+        (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
+      }
+  }
+
+  /* Now import the children recursively. */
+  SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
+                          this_dir_baton, depth, excludes, no_ignore,
+                          ignore_unknown_node_types,
+                          filter_callback, filter_baton,
+                          import_ctx, ctx, pool));
+
+  /* Finally, close the sub-directory. */
+  SVN_ERR(editor->close_directory(this_dir_baton, pool));
+
   return SVN_NO_ERROR;
 }
 
@@ -518,7 +613,7 @@ import(const char *local_abspath,
        apr_pool_t *pool)
 {
   void *root_baton;
-  apr_array_header_t *ignores;
+  apr_array_header_t *ignores = NULL;
   apr_array_header_t *batons = NULL;
   const char *edit_path = "";
   import_ctx_t *import_ctx = apr_pcalloc(pool, sizeof(*import_ctx));
@@ -596,11 +691,20 @@ import(const char *local_abspath,
     }
   else if (dirent->kind == svn_node_dir)
     {
-      SVN_ERR(import_dir(editor, root_baton, local_abspath, edit_path,
-                         depth, excludes, no_ignore,
-                         ignore_unknown_node_types,
-                         filter_callback, filter_baton,
-                         import_ctx, ctx, pool));
+      apr_hash_t *dirents;
+
+      if (!no_ignore)
+        SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, pool));
+
+      SVN_ERR(get_filtered_children(&dirents, local_abspath, excludes, ignores,
+                                    filter_callback, filter_baton, ctx,
+                                    pool, pool));
+
+      SVN_ERR(import_children(local_abspath, edit_path, dirents, editor,
+                              root_baton, depth, excludes, no_ignore,
+                              ignore_unknown_node_types,
+                              filter_callback, filter_baton,
+                              import_ctx, ctx, pool));
 
     }
   else if (dirent->kind == svn_node_none
@@ -655,16 +759,13 @@ capture_commit_info(const svn_commit_inf
 
 
 static svn_error_t *
-get_ra_editor(svn_ra_session_t **ra_session,
-              const svn_delta_editor_t **editor,
+get_ra_editor(const svn_delta_editor_t **editor,
               void **edit_baton,
+              svn_ra_session_t *ra_session,
               svn_client_ctx_t *ctx,
-              const char *base_url,
-              const char *base_dir_abspath,
               const char *log_msg,
               const apr_array_header_t *commit_items,
               const apr_hash_t *revprop_table,
-              svn_boolean_t is_commit,
               apr_hash_t *lock_tokens,
               svn_boolean_t keep_locks,
               svn_commit_callback2_t commit_callback,
@@ -672,55 +773,43 @@ get_ra_editor(svn_ra_session_t **ra_sess
               apr_pool_t *pool)
 {
   apr_hash_t *commit_revprops;
-  const char *anchor_abspath;
-
-  /* Open an RA session to URL. */
-  SVN_ERR(svn_client__open_ra_session_internal(ra_session, NULL, base_url,
-                                               base_dir_abspath, commit_items,
-                                               is_commit, !is_commit,
-                                               ctx, pool));
-
-  /* If this is an import (aka, not a commit), we need to verify that
-     our repository URL exists. */
-  if (! is_commit)
-    {
-      svn_node_kind_t kind;
-
-      SVN_ERR(svn_ra_check_path(*ra_session, "", SVN_INVALID_REVNUM,
-                                &kind, pool));
-      if (kind == svn_node_none)
-        return svn_error_createf(SVN_ERR_FS_NO_SUCH_ENTRY, NULL,
-                                 _("Path '%s' does not exist"),
-                                 base_url);
-    }
+  apr_hash_t *relpath_map = NULL;
 
   SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
                                            log_msg, ctx, pool));
 
 #ifdef ENABLE_EV2_SHIMS
-  /* We need this for the shims. */
-  if (base_dir_abspath)
+  if (commit_items)
     {
-      const char *relpath;
-      const char *wcroot_abspath;
+      int i;
+      apr_pool_t *iterpool = svn_pool_create(pool);
 
-      SVN_ERR(svn_wc__get_wc_root(&wcroot_abspath, ctx->wc_ctx,
-                                  base_dir_abspath, pool, pool));
+      relpath_map = apr_hash_make(pool);
+      for (i = 0; i < commit_items->nelts; i++)
+        {
+          svn_client_commit_item3_t *item = APR_ARRAY_IDX(commit_items, i,
+                                                  svn_client_commit_item3_t *);
+          const char *relpath;
 
-      SVN_ERR(svn_ra_get_path_relative_to_root(*ra_session, &relpath, base_url,
-                                               pool));
-      anchor_abspath = svn_dirent_join(wcroot_abspath, relpath, pool);
+          if (!item->path)
+            continue;
+
+          svn_pool_clear(iterpool);
+          SVN_ERR(svn_wc__node_get_origin(NULL, NULL, &relpath, NULL, NULL, NULL,
+                                          ctx->wc_ctx, item->path, FALSE, pool,
+                                          iterpool));
+          if (relpath)
+            apr_hash_set(relpath_map, relpath, APR_HASH_KEY_STRING, item->path);
+        }
+      svn_pool_destroy(iterpool);
     }
-  else
 #endif
-    anchor_abspath = NULL;
 
   /* Fetch RA commit editor. */
-  SVN_ERR(svn_ra__register_editor_shim_callbacks(*ra_session,
+  SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
                         svn_client__get_shim_callbacks(ctx->wc_ctx,
-                                                       *ra_session,
-                                                       anchor_abspath, pool)));
-  SVN_ERR(svn_ra_get_commit_editor3(*ra_session, editor, edit_baton,
+                                                       relpath_map, pool)));
+  SVN_ERR(svn_ra_get_commit_editor3(ra_session, editor, edit_baton,
                                     commit_revprops, commit_callback,
                                     commit_baton, lock_tokens, keep_locks,
                                     pool));
@@ -757,7 +846,8 @@ svn_client_import5(const char *path,
                                                    sizeof(const char *));
   const char *temp;
   const char *dir;
-  apr_pool_t *subpool;
+  apr_hash_t *commit_revprops;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   if (svn_path_is_url(path))
     return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
@@ -795,37 +885,34 @@ svn_client_import5(const char *path,
 
   SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
 
+  SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, url, NULL,
+                                               NULL, FALSE, TRUE, ctx,
+                                               scratch_pool));
+
   /* Figure out all the path components we need to create just to have
      a place to stick our imported tree. */
-  subpool = svn_pool_create(scratch_pool);
-  do
-    {
-      svn_pool_clear(subpool);
+  SVN_ERR(svn_ra_check_path(ra_session, "", SVN_INVALID_REVNUM, &kind,
+                            iterpool));
 
-      /* See if the user is interested in cancelling this operation. */
-      if (ctx->cancel_func)
-        SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
+  /* We can import into directories, but if a file already exists, that's
+     an error. */
+  if (kind == svn_node_file)
+    return svn_error_createf
+      (SVN_ERR_ENTRY_EXISTS, NULL,
+       _("Path '%s' already exists"), url);
 
-      if (err)
-        {
-          /* If get_ra_editor below failed we either tried to open
-             an invalid url, or else some other kind of error.  In case
-             the url was bad we back up a directory and try again. */
+  while (kind == svn_node_none)
+    {
+      svn_pool_clear(iterpool);
 
-          if (err->apr_err != SVN_ERR_FS_NO_SUCH_ENTRY)
-            return err;
-          else
-            svn_error_clear(err);
+      svn_uri_split(&temp, &dir, url, scratch_pool);
+      APR_ARRAY_PUSH(new_entries, const char *) = dir;
+      url = temp;
+      SVN_ERR(svn_ra_reparent(ra_session, url, iterpool));
 
-          svn_uri_split(&temp, &dir, url, scratch_pool);
-          APR_ARRAY_PUSH(new_entries, const char *) = dir;
-          url = temp;
-        }
+      SVN_ERR(svn_ra_check_path(ra_session, "", SVN_INVALID_REVNUM, &kind,
+                                iterpool));
     }
-  while ((err = get_ra_editor(&ra_session,
-                              &editor, &edit_baton, ctx, url, NULL,
-                              log_msg, NULL, revprop_table, FALSE, NULL, TRUE,
-                              commit_callback, commit_baton, subpool)));
 
   /* Reverse the order of the components we added to our NEW_ENTRIES array. */
   if (new_entries->nelts)
@@ -844,14 +931,6 @@ svn_client_import5(const char *path,
         }
     }
 
-  /* An empty NEW_ENTRIES list the first call to get_ra_editor() above
-     succeeded.  That means that URL corresponds to an already
-     existing filesystem entity. */
-  if (kind == svn_node_file && (! new_entries->nelts))
-    return svn_error_createf
-      (SVN_ERR_ENTRY_EXISTS, NULL,
-       _("Path '%s' already exists"), url);
-
   /* The repository doesn't know about the reserved administrative
      directory. */
   if (new_entries->nelts
@@ -868,6 +947,17 @@ svn_client_import5(const char *path,
        _("'%s' is a reserved name and cannot be imported"),
        svn_dirent_local_style(temp, scratch_pool));
 
+  SVN_ERR(svn_client__ensure_revprop_table(&commit_revprops, revprop_table,
+                                           log_msg, ctx, scratch_pool));
+
+  /* Fetch RA commit editor. */
+  SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
+                        svn_client__get_shim_callbacks(ctx->wc_ctx,
+                                                       NULL, scratch_pool)));
+  SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
+                                    commit_revprops, commit_callback,
+                                    commit_baton, NULL, TRUE,
+                                    scratch_pool));
 
   /* If an error occurred during the commit, abort the edit and return
      the error.  We don't even care if the abort itself fails.  */
@@ -875,13 +965,13 @@ svn_client_import5(const char *path,
                     depth, excludes, no_ignore,
                     ignore_unknown_node_types,
                     filter_callback, filter_baton,
-                    ctx, subpool)))
+                    ctx, iterpool)))
     {
-      svn_error_clear(editor->abort_edit(edit_baton, subpool));
+      svn_error_clear(editor->abort_edit(edit_baton, iterpool));
       return svn_error_trace(err);
     }
 
-  svn_pool_destroy(subpool);
+  svn_pool_destroy(iterpool);
 
   return SVN_NO_ERROR;
 }
@@ -1674,11 +1764,18 @@ svn_client_commit6(const apr_array_heade
   cb.pool = pool;
 
   cmt_err = svn_error_trace(
-                 get_ra_editor(&ra_session, &editor, &edit_baton, ctx,
-                               base_url, base_abspath, log_msg,
-                               commit_items, revprop_table, TRUE, lock_tokens,
-                               keep_locks, capture_commit_info,
-                               &cb, pool));
+              svn_client__open_ra_session_internal(&ra_session, NULL, base_url,
+                                                   base_abspath, commit_items,
+                                                   TRUE, FALSE, ctx, pool));
+
+  if (cmt_err)
+    goto cleanup;
+
+  cmt_err = svn_error_trace(
+              get_ra_editor(&editor, &edit_baton, ra_session, ctx,
+                            log_msg, commit_items, revprop_table,
+                            lock_tokens, keep_locks, capture_commit_info,
+                            &cb, pool));
 
   if (cmt_err)
     goto cleanup;
@@ -1688,9 +1785,9 @@ svn_client_commit6(const apr_array_heade
 
   /* Perform the commit. */
   cmt_err = svn_error_trace(
-            svn_client__do_commit(base_url, commit_items, editor, edit_baton,
-                                  notify_prefix, NULL,
-                                  &sha1_checksums, ctx, pool, iterpool));
+              svn_client__do_commit(base_url, commit_items, editor, edit_baton,
+                                    notify_prefix, &sha1_checksums, ctx, pool,
+                                    iterpool));
 
   /* Handle a successful commit. */
   if ((! cmt_err)

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/commit_util.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/commit_util.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/commit_util.c Wed Apr 25 22:04:36 2012
@@ -674,10 +674,10 @@ harvest_committables(const char *local_a
       svn_revnum_t dir_rev;
 
       if (!copy_mode_root)
-        SVN_ERR(svn_wc__node_get_base_rev(&dir_rev, wc_ctx,
-                                          svn_dirent_dirname(local_abspath,
-                                                             scratch_pool),
-                                          scratch_pool));
+        SVN_ERR(svn_wc__node_get_base(&dir_rev, NULL, NULL, NULL, wc_ctx,
+                                      svn_dirent_dirname(local_abspath,
+                                                         scratch_pool),
+                                      scratch_pool, scratch_pool));
 
       if (copy_mode_root || node_rev != dir_rev)
         {
@@ -1580,10 +1580,7 @@ do_item_commit(void **dir_baton,
                                  parent_baton, pool);
 
       if (err)
-        return svn_error_trace(fixup_commit_error(local_abspath,
-                                                  icb->base_url,
-                                                  path, item->kind,
-                                                  err, ctx, pool));
+        goto fixup_error;
     }
 
   /* If this item is supposed to be added, do so. */
@@ -1607,10 +1604,7 @@ do_item_commit(void **dir_baton,
         }
 
       if (err)
-        return svn_error_trace(fixup_commit_error(local_abspath,
-                                                  icb->base_url,
-                                                  path, kind, err,
-                                                  ctx, pool));
+        goto fixup_error;
 
       /* Set other prop-changes, if available in the baton */
       if (item->outgoing_prop_changes)
@@ -1623,14 +1617,17 @@ do_item_commit(void **dir_baton,
               prop = APR_ARRAY_IDX(prop_changes, ctr, svn_prop_t *);
               if (kind == svn_node_file)
                 {
-                  editor->change_file_prop(file_baton, prop->name,
-                                           prop->value, pool);
+                  err = editor->change_file_prop(file_baton, prop->name,
+                                                 prop->value, pool);
                 }
               else
                 {
-                  editor->change_dir_prop(*dir_baton, prop->name,
-                                          prop->value, pool);
+                  err = editor->change_dir_prop(*dir_baton, prop->name,
+                                                prop->value, pool);
                 }
+
+              if (err)
+                goto fixup_error;
             }
         }
     }
@@ -1648,11 +1645,7 @@ do_item_commit(void **dir_baton,
                                       file_pool, &file_baton);
 
               if (err)
-                return svn_error_trace(fixup_commit_error(local_abspath,
-                                                          icb->base_url,
-                                                          path, kind,
-                                                          err, ctx,
-                                                          pool));
+                goto fixup_error;
             }
         }
       else
@@ -1672,11 +1665,7 @@ do_item_commit(void **dir_baton,
                 }
 
               if (err)
-                return svn_error_trace(fixup_commit_error(local_abspath,
-                                                          icb->base_url,
-                                                          path, kind,
-                                                          err, ctx,
-                                                          pool));
+                goto fixup_error;
             }
         }
 
@@ -1689,10 +1678,7 @@ do_item_commit(void **dir_baton,
               (kind == svn_node_dir) ? *dir_baton : file_baton, pool);
 
       if (err)
-        return svn_error_trace(fixup_commit_error(local_abspath,
-                                                  icb->base_url,
-                                                  path, kind, err,
-                                                  ctx, pool));
+        goto fixup_error;
 
       /* Make any additional client -> repository prop changes. */
       if (item->outgoing_prop_changes)
@@ -1706,14 +1692,17 @@ do_item_commit(void **dir_baton,
                                    svn_prop_t *);
               if (kind == svn_node_file)
                 {
-                  editor->change_file_prop(file_baton, prop->name,
+                  err = editor->change_file_prop(file_baton, prop->name,
                                            prop->value, pool);
                 }
               else
                 {
-                  editor->change_dir_prop(*dir_baton, prop->name,
+                  err = editor->change_dir_prop(*dir_baton, prop->name,
                                           prop->value, pool);
                 }
+
+              if (err)
+                goto fixup_error;
             }
         }
     }
@@ -1734,10 +1723,7 @@ do_item_commit(void **dir_baton,
                                     file_pool, &file_baton);
 
           if (err)
-            return svn_error_trace(fixup_commit_error(local_abspath,
-                                                      icb->base_url,
-                                                      path, kind,
-                                                      err, ctx, pool));
+            goto fixup_error;
         }
 
       /* Add this file mod to the FILE_MODS hash. */
@@ -1752,13 +1738,16 @@ do_item_commit(void **dir_baton,
       err = editor->close_file(file_baton, NULL, file_pool);
 
       if (err)
-        return svn_error_trace(fixup_commit_error(local_abspath,
-                                                  icb->base_url,
-                                                  path, kind,
-                                                  err, ctx, pool));
+        goto fixup_error;
     }
 
   return SVN_NO_ERROR;
+
+fixup_error:
+  return svn_error_trace(fixup_commit_error(local_abspath,
+                                            icb->base_url,
+                                            path, kind,
+                                            err, ctx, pool));
 }
 
 
@@ -1778,7 +1767,6 @@ svn_client__do_commit(const char *base_u
                       const svn_delta_editor_t *editor,
                       void *edit_baton,
                       const char *notify_path_prefix,
-                      apr_hash_t **md5_checksums,
                       apr_hash_t **sha1_checksums,
                       svn_client_ctx_t *ctx,
                       apr_pool_t *result_pool,
@@ -1802,8 +1790,6 @@ svn_client__do_commit(const char *base_u
 #endif /* SVN_CLIENT_COMMIT_DEBUG */
 
   /* Ditto for the checksums. */
-  if (md5_checksums)
-    *md5_checksums = apr_hash_make(result_pool);
   if (sha1_checksums)
     *sha1_checksums = apr_hash_make(result_pool);
 
@@ -1883,9 +1869,6 @@ svn_client__do_commit(const char *base_u
                                                     err, ctx, scratch_pool));
         }
 
-      if (md5_checksums)
-        apr_hash_set(*md5_checksums, item->path, APR_HASH_KEY_STRING,
-                     new_text_base_md5_checksum);
       if (sha1_checksums)
         apr_hash_set(*sha1_checksums, item->path, APR_HASH_KEY_STRING,
                      new_text_base_sha1_checksum);

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/copy.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/copy.c Wed Apr 25 22:04:36 2012
@@ -1051,7 +1051,6 @@ repos_to_repos_copy(const apr_array_head
   /* Fetch RA commit editor. */
   SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
                         svn_client__get_shim_callbacks(ctx->wc_ctx,
-                                                       ra_session,
                                                        NULL, pool)));
   SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
                                     commit_revprops,
@@ -1136,7 +1135,7 @@ wc_to_repos_copy(const apr_array_header_
   const char *top_src_abspath;
   svn_ra_session_t *ra_session;
   const svn_delta_editor_t *editor;
-  const char *common_wc_abspath = NULL;
+  apr_hash_t *relpath_map = NULL;
   void *edit_baton;
   svn_client__committables_t *committables;
   apr_array_header_t *commit_items;
@@ -1166,8 +1165,9 @@ wc_to_repos_copy(const apr_array_header_
                                                     svn_client__copy_pair_t *);
       svn_pool_clear(iterpool);
 
-      SVN_ERR(svn_wc__node_get_base_rev(&pair->src_revnum, ctx->wc_ctx,
-                                        pair->src_abspath_or_url, iterpool));
+      SVN_ERR(svn_wc__node_get_base(&pair->src_revnum, NULL, NULL, NULL,
+                                    ctx->wc_ctx, pair->src_abspath_or_url,
+                                    iterpool, iterpool));
     }
 
   /* Determine the longest common ancestor for the destinations, and open an RA
@@ -1373,22 +1373,25 @@ wc_to_repos_copy(const apr_array_header_
                                             commit_items, pool));
 
 #ifdef ENABLE_EV2_SHIMS
-  for (i = 0; !common_wc_abspath && i < commit_items->nelts; i++)
+  if (commit_items)
     {
-      common_wc_abspath = APR_ARRAY_IDX(commit_items, i,
-                                        svn_client_commit_item3_t *)->path;
-    }
-
-  for (; i < commit_items->nelts; i++)
-    {
-      svn_client_commit_item3_t *item =
-        APR_ARRAY_IDX(commit_items, i, svn_client_commit_item3_t *);
+      relpath_map = apr_hash_make(pool);
+      for (i = 0; i < commit_items->nelts; i++)
+        {
+          svn_client_commit_item3_t *item = APR_ARRAY_IDX(commit_items, i,
+                                                  svn_client_commit_item3_t *);
+          const char *relpath;
 
-      if (!item->path)
-        continue;
+          if (!item->path)
+            continue;
 
-      common_wc_abspath = svn_dirent_get_longest_ancestor(common_wc_abspath,
-                                                          item->path, pool);
+          svn_pool_clear(iterpool);
+          SVN_ERR(svn_wc__node_get_origin(NULL, NULL, &relpath, NULL, NULL, NULL,
+                                          ctx->wc_ctx, item->path, FALSE, pool,
+                                          iterpool));
+          if (relpath)
+            apr_hash_set(relpath_map, relpath, APR_HASH_KEY_STRING, item->path);
+        }
     }
 #endif
 
@@ -1399,9 +1402,7 @@ wc_to_repos_copy(const apr_array_header_
 
   /* Fetch RA commit editor. */
   SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
-                        svn_client__get_shim_callbacks(ctx->wc_ctx,
-                                                       ra_session,
-                                                       common_wc_abspath,
+                        svn_client__get_shim_callbacks(ctx->wc_ctx, relpath_map,
                                                        pool)));
   SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
                                     commit_revprops,
@@ -1414,7 +1415,7 @@ wc_to_repos_copy(const apr_array_header_
   SVN_ERR_W(svn_client__do_commit(top_dst_url, commit_items,
                                   editor, edit_baton,
                                   0, /* ### any notify_path_offset needed? */
-                                  NULL, NULL, ctx, pool, pool),
+                                  NULL, ctx, pool, pool),
             _("Commit failed (details follow):"));
 
   /* Sleep to ensure timestamp integrity. */

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/delete.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/delete.c Wed Apr 25 22:04:36 2012
@@ -190,7 +190,6 @@ single_repos_delete(svn_ra_session_t *ra
   /* Fetch RA commit editor */
   SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
                         svn_client__get_shim_callbacks(ctx->wc_ctx,
-                                                       ra_session,
                                                        NULL, pool)));
   SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
                                     commit_revprops,

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/diff.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/diff.c Wed Apr 25 22:04:36 2012
@@ -1409,7 +1409,8 @@ convert_to_url(const char **url,
 
 /** Check if paths PATH_OR_URL1 and PATH_OR_URL2 are urls and if the
  * revisions REVISION1 and REVISION2 are local. If PEG_REVISION is not
- * unspecified, ensure that at least one of the two revisions is non-local.
+ * unspecified, ensure that at least one of the two revisions is not
+ * BASE or WORKING.
  * If PATH_OR_URL1 can only be found in the repository, set *IS_REPOS1
  * to TRUE. If PATH_OR_URL2 can only be found in the repository, set
  * *IS_REPOS2 to TRUE. */
@@ -1430,8 +1431,8 @@ check_paths(svn_boolean_t *is_repos1,
     return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,
                             _("Not all required revisions are specified"));
 
-  /* Revisions can be said to be local or remote.  BASE and WORKING,
-     for example, are local.  */
+  /* Revisions can be said to be local or remote.
+   * BASE and WORKING are local revisions.  */
   is_local_rev1 =
     ((revision1->kind == svn_opt_revision_base)
      || (revision1->kind == svn_opt_revision_working));
@@ -1439,25 +1440,18 @@ check_paths(svn_boolean_t *is_repos1,
     ((revision2->kind == svn_opt_revision_base)
      || (revision2->kind == svn_opt_revision_working));
 
-  if (peg_revision->kind != svn_opt_revision_unspecified)
-    {
-      if (is_local_rev1 && is_local_rev2)
-        return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,
-                                _("At least one revision must be non-local "
-                                  "for a pegged diff"));
+  if (peg_revision->kind != svn_opt_revision_unspecified &&
+      is_local_rev1 && is_local_rev2)
+    return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL,
+                            _("At least one revision must be something other "
+                              "than BASE or WORKING when diffing a URL"));
 
-      *is_repos1 = ! is_local_rev1;
-      *is_repos2 = ! is_local_rev2;
-    }
-  else
-    {
-      /* Working copy paths with non-local revisions get turned into
-         URLs.  We don't do that here, though.  We simply record that it
-         needs to be done, which is information that helps us choose our
-         diff helper function.  */
-      *is_repos1 = ! is_local_rev1 || svn_path_is_url(path_or_url1);
-      *is_repos2 = ! is_local_rev2 || svn_path_is_url(path_or_url2);
-    }
+  /* Working copy paths with non-local revisions get turned into
+     URLs.  We don't do that here, though.  We simply record that it
+     needs to be done, which is information that helps us choose our
+     diff helper function.  */
+  *is_repos1 = ! is_local_rev1 || svn_path_is_url(path_or_url1);
+  *is_repos2 = ! is_local_rev2 || svn_path_is_url(path_or_url2);
 
   return SVN_NO_ERROR;
 }
@@ -2214,7 +2208,7 @@ arbitrary_diff_walker(void *baton, const
  * and LOCAL_ABSPATH2, using the provided diff callbacks to show changes
  * in files. The files and directories involved may be part of a working
  * copy or they may be unversioned. For versioned files, show property
- * changes, too. */ 
+ * changes, too. */
 static svn_error_t *
 do_arbitrary_nodes_diff(const char *local_abspath1,
                         const char *local_abspath2,

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/export.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/export.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/export.c Wed Apr 25 22:04:36 2012
@@ -42,6 +42,7 @@
 #include "client.h"
 
 #include "svn_private_config.h"
+#include "private/svn_subr_private.h"
 #include "private/svn_wc_private.h"
 
 
@@ -957,8 +958,7 @@ close_file(void *file_baton,
 
   SVN_ERR(svn_checksum_parse_hex(&text_checksum, svn_checksum_md5, text_digest,
                                  pool));
-  actual_checksum = svn_checksum__from_digest(fb->text_digest,
-                                              svn_checksum_md5, pool);
+  actual_checksum = svn_checksum__from_digest_md5(fb->text_digest, pool);
 
   /* Note that text_digest can be NULL when talking to certain repositories.
      In that case text_checksum will be NULL and the following match code

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/locking_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/locking_commands.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/locking_commands.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/locking_commands.c Wed Apr 25 22:04:36 2012
@@ -345,8 +345,9 @@ organize_lock_targets(const char **commo
             {
               svn_revnum_t *revnum;
               revnum = apr_palloc(result_pool, sizeof(* revnum));
-              SVN_ERR(svn_wc__node_get_base_rev(revnum, ctx->wc_ctx,
-                                                abs_path, result_pool));
+              SVN_ERR(svn_wc__node_get_base(revnum, NULL, NULL, NULL,
+                                            ctx->wc_ctx, abs_path,
+                                            result_pool, iterpool));
               apr_hash_set(rel_targets_ret, rel_url,
                            APR_HASH_KEY_STRING, revnum);
             }

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/merge.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/merge.c Wed Apr 25 22:04:36 2012
@@ -895,8 +895,8 @@ filter_self_referential_mergeinfo(apr_ar
 
   SVN_ERR(svn_wc__node_get_url(&target_base.url, ctx->wc_ctx, target_abspath,
                                pool, pool));
-  SVN_ERR(svn_wc__node_get_base_rev(&target_base.rev, ctx->wc_ctx,
-                                    target_abspath, pool));
+  SVN_ERR(svn_wc__node_get_base(&target_base.rev, NULL, NULL, NULL,
+                                ctx->wc_ctx, target_abspath, pool, pool));
   SVN_ERR(svn_wc__node_get_repos_info(&target_base.repos_root_url,
                                       &target_base.repos_uuid,
                                       ctx->wc_ctx, target_abspath, pool, pool));
@@ -2941,30 +2941,56 @@ notification_receiver(void *baton, const
 
       if (notify->action == svn_wc_notify_update_add)
         {
-          svn_boolean_t is_root_of_added_subtree = FALSE;
-          const char *added_path = apr_pstrdup(notify_b->pool,
-                                               notify_abspath);
-          const char *added_path_parent = NULL;
+          svn_boolean_t root_of_added_subtree = TRUE;
 
           /* Stash the root path of any added subtrees. */
           if (notify_b->added_abspaths == NULL)
             {
+              /* The first added path is always a root. */
               notify_b->added_abspaths = apr_hash_make(notify_b->pool);
-              is_root_of_added_subtree = TRUE;
             }
           else
             {
-              added_path_parent = svn_dirent_dirname(added_path, pool);
-              /* ### Bug. Testing whether its immediate parent is in the
-               * hash isn't enough: this is letting every other level of
-               * the added subtree hierarchy into the hash. */
-              if (!apr_hash_get(notify_b->added_abspaths, added_path_parent,
-                                APR_HASH_KEY_STRING))
-                is_root_of_added_subtree = TRUE;
-            }
-          if (is_root_of_added_subtree)
-            apr_hash_set(notify_b->added_abspaths, added_path,
-                         APR_HASH_KEY_STRING, added_path);
+              const char *added_path_parent =
+                svn_dirent_dirname(notify_abspath, pool);
+              apr_pool_t *subpool = svn_pool_create(pool);
+
+              /* Is NOTIFY->PATH the root of an added subtree? */
+              while (strcmp(notify_b->merge_b->target->abspath,
+                            added_path_parent))
+                {
+                  if (apr_hash_get(notify_b->added_abspaths,
+                                   added_path_parent,
+                                   APR_HASH_KEY_STRING))
+                    {
+                      root_of_added_subtree = FALSE;
+                      break;
+                    }
+
+                  added_path_parent = svn_dirent_dirname(
+                    added_path_parent, subpool);
+                }
+
+              svn_pool_destroy(subpool);
+            }
+
+          if (root_of_added_subtree)
+            {
+              const char *added_root_path = apr_pstrdup(notify_b->pool,
+                                                        notify_abspath);
+              apr_hash_set(notify_b->added_abspaths, added_root_path,
+                           APR_HASH_KEY_STRING, added_root_path);
+            }
+        }
+
+      if (notify->action == svn_wc_notify_update_delete
+          && notify_b->added_abspaths)
+        {
+          /* Issue #4166: If a previous merge added NOTIFY_ABSPATH, but we
+             are now deleting it, then remove it from the list of added
+             paths. */
+          apr_hash_set(notify_b->added_abspaths, notify_abspath,
+                       APR_HASH_KEY_STRING, NULL);
         }
     }
 
@@ -4061,8 +4087,9 @@ calculate_remaining_ranges(svn_client__m
      So in the name of user friendliness, return an error suggesting a helpful
      course of action.
   */
-  SVN_ERR(svn_wc__node_get_base_rev(&child_base_revision, ctx->wc_ctx,
-                                     child->abspath, scratch_pool));
+  SVN_ERR(svn_wc__node_get_base(&child_base_revision, NULL, NULL, NULL,
+                                ctx->wc_ctx, child->abspath,
+                                scratch_pool, scratch_pool));
   /* If CHILD has no base revision then it hasn't been committed yet, so it
      can't have any "future" history. */
   if (SVN_IS_VALID_REVNUM(child_base_revision)
@@ -11005,7 +11032,7 @@ find_base_on_source(svn_client__pathrev_
 
 /* Find a merge base location on the target branch, like in a reintegrate
  * merge.
- * 
+ *
  *                     MID    RIGHT
  *          o-----------o-------o---
  *         /    prev.  /         \
@@ -11017,7 +11044,7 @@ find_base_on_source(svn_client__pathrev_
  * Set *BASE_P to the latest location on the history of S_T->target at
  * which all revisions up to *BASE_P are recorded as merged into RIGHT
  * (which is S_T->source).
- * 
+ *
  * ### TODO: Set *MID_P to the first location on the history of
  * S_T->source at which all revisions up to BASE_P are recorded as merged.
  */

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/mergeinfo.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/mergeinfo.c Wed Apr 25 22:04:36 2012
@@ -217,8 +217,9 @@ svn_client__get_wc_mergeinfo(svn_mergein
   if (limit_abspath)
     SVN_ERR_ASSERT(svn_dirent_is_absolute(limit_abspath));
 
-  SVN_ERR(svn_wc__node_get_base_rev(&base_revision, ctx->wc_ctx,
-                                    local_abspath, scratch_pool));
+  SVN_ERR(svn_wc__node_get_base(&base_revision, NULL, NULL, NULL, ctx->wc_ctx,
+                                local_abspath,
+                                scratch_pool, scratch_pool));
 
   iterpool = svn_pool_create(scratch_pool);
   while (TRUE)
@@ -284,9 +285,9 @@ svn_client__get_wc_mergeinfo(svn_mergein
                                           walk_relpath, result_pool);
           local_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
 
-          SVN_ERR(svn_wc__node_get_base_rev(&parent_base_rev,
-                                            ctx->wc_ctx, local_abspath,
-                                            scratch_pool));
+          SVN_ERR(svn_wc__node_get_base(&parent_base_rev, NULL, NULL, NULL,
+                                        ctx->wc_ctx, local_abspath,
+                                        scratch_pool, scratch_pool));
           SVN_ERR(svn_wc__node_get_changed_info(&parent_changed_rev,
                                                 NULL, NULL,
                                                 ctx->wc_ctx, local_abspath,

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/prop_commands.c Wed Apr 25 22:04:36 2012
@@ -245,7 +245,6 @@ propset_on_url(const char *propname,
   /* Fetch RA commit editor. */
   SVN_ERR(svn_ra__register_editor_shim_callbacks(ra_session,
                         svn_client__get_shim_callbacks(ctx->wc_ctx,
-                                                       ra_session,
                                                        NULL, pool)));
   SVN_ERR(svn_ra_get_commit_editor3(ra_session, &editor, &edit_baton,
                                     commit_revprops,

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/repos_diff.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/repos_diff.c Wed Apr 25 22:04:36 2012
@@ -47,6 +47,7 @@
 
 #include "client.h"
 
+#include "private/svn_subr_private.h"
 #include "private/svn_wc_private.h"
 
 /* Overall crawler editor baton.  */
@@ -840,9 +841,8 @@ window_handler(svn_txdelta_window_t *win
 
   if (!window)
     {
-      b->result_md5_checksum = svn_checksum__from_digest(b->result_digest,
-                                                         svn_checksum_md5,
-                                                         b->pool);
+      b->result_md5_checksum = svn_checksum__from_digest_md5(b->result_digest,
+                                                             b->pool);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/switch.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/switch.c Wed Apr 25 22:04:36 2012
@@ -205,8 +205,8 @@ switch_internal(svn_revnum_t *result_rev
                 &switch_loc, ra_session, revnum, switch_rev_url, pool));
       SVN_ERR(svn_wc__node_get_url(&target_url, ctx->wc_ctx, local_abspath,
                                    pool, pool));
-      SVN_ERR(svn_wc__node_get_base_rev(&target_rev, ctx->wc_ctx,
-                                        local_abspath, pool));
+      SVN_ERR(svn_wc__node_get_base(&target_rev, NULL, NULL, NULL, ctx->wc_ctx,
+                                    local_abspath, pool, pool));
       SVN_ERR(svn_client__pathrev_create_with_session(
                 &target_loc, ra_session, target_rev, target_url, pool));
       /* ### It would be nice if this function could reuse the existing

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/update.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/update.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/update.c Wed Apr 25 22:04:36 2012
@@ -232,8 +232,8 @@ update_internal(svn_revnum_t *result_rev
   /* Check if our anchor exists in BASE. If it doesn't we can't update.
      ### For performance reasons this should be handled with the same query
      ### as retrieving the anchor url. */
-  SVN_ERR(svn_wc__node_get_base_rev(&revnum, ctx->wc_ctx, anchor_abspath,
-                                    pool));
+  SVN_ERR(svn_wc__node_get_base(&revnum, NULL, NULL, NULL, ctx->wc_ctx,
+                                anchor_abspath, pool, pool));
 
   /* It does not make sense to update tree-conflict victims. */
   err = svn_wc_conflicted_p3(NULL, NULL, &tree_conflicted,

Modified: subversion/branches/inheritable-props/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_client/util.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_client/util.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_client/util.c Wed Apr 25 22:04:36 2012
@@ -365,39 +365,10 @@ svn_client__assert_homogeneous_target_ty
 struct shim_callbacks_baton
 {
   svn_wc_context_t *wc_ctx;
-  const char *repos_root_url;
-  const char *anchor_abspath;
+  apr_hash_t *relpath_map;
 };
 
 static svn_error_t *
-rationalize_shim_path(const char **local_abspath,
-                      struct shim_callbacks_baton *scb,
-                      const char *repos_relpath,
-                      apr_pool_t *result_pool,
-                      apr_pool_t *scratch_pool)
-{
-  const char *wcroot_abspath;
-  const char *wcroot_url;
-  const char *relpath;
-  const char *node_url = svn_path_url_add_component2(scb->repos_root_url,
-                                                     repos_relpath,
-                                                     scratch_pool);
-
-  /* ### We could probably calculate some of this once, and then cache it for
-         use in this function. */
-  SVN_ERR(svn_wc__get_wc_root(&wcroot_abspath, scb->wc_ctx,
-                              scb->anchor_abspath,
-                              scratch_pool, scratch_pool));
-  SVN_ERR(svn_wc__node_get_url(&wcroot_url, scb->wc_ctx, wcroot_abspath,
-                               scratch_pool, scratch_pool));
-
-  relpath = svn_uri_skip_ancestor(wcroot_url, node_url, scratch_pool);
-  *local_abspath = svn_dirent_join(wcroot_abspath, relpath, result_pool);
-
-  return SVN_NO_ERROR;
-}
-
-static svn_error_t *
 fetch_props_func(apr_hash_t **props,
                  void *baton,
                  const char *path,
@@ -408,17 +379,13 @@ fetch_props_func(apr_hash_t **props,
   struct shim_callbacks_baton *scb = baton;
   const char *local_abspath;
 
-  /* Early out: if we didn't get an anchor_abspath, it means we don't have a
-     working copy, and hence no method of fetching the requisite information. */
-  if (!scb->anchor_abspath)
+  local_abspath = apr_hash_get(scb->relpath_map, path, APR_HASH_KEY_STRING);
+  if (!local_abspath)
     {
       *props = apr_hash_make(result_pool);
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(rationalize_shim_path(&local_abspath, scb, path, scratch_pool,
-                                scratch_pool));
-
   SVN_ERR(svn_wc_get_pristine_props(props, scb->wc_ctx, local_abspath,
                                     result_pool, scratch_pool));
 
@@ -439,17 +406,13 @@ fetch_kind_func(svn_kind_t *kind,
   svn_node_kind_t node_kind;
   const char *local_abspath;
 
-  /* Early out: if we didn't get an anchor_abspath, it means we don't have a
-     working copy, and hence no method of fetching the requisite information. */
-  if (!scb->anchor_abspath)
+  local_abspath = apr_hash_get(scb->relpath_map, path, APR_HASH_KEY_STRING);
+  if (!local_abspath)
     {
       *kind = svn_kind_unknown;
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(rationalize_shim_path(&local_abspath, scb, path, scratch_pool,
-                                scratch_pool));
-
   SVN_ERR(svn_wc_read_kind(&node_kind, scb->wc_ctx, local_abspath, FALSE,
                            scratch_pool));
   *kind = svn__kind_from_node_kind(node_kind, FALSE);
@@ -471,17 +434,13 @@ fetch_base_func(const char **filename,
   svn_stream_t *temp_stream;
   svn_error_t *err;
 
-  /* Early out: if we didn't get an anchor_abspath, it means we don't have a
-     working copy, and hence no method of fetching the requisite information. */
-  if (!scb->anchor_abspath)
+  local_abspath = apr_hash_get(scb->relpath_map, path, APR_HASH_KEY_STRING);
+  if (!local_abspath)
     {
       *filename = NULL;
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(rationalize_shim_path(&local_abspath, scb, path, scratch_pool,
-                                scratch_pool));
-
   err = svn_wc_get_pristine_contents2(&pristine_stream, scb->wc_ctx,
                                       local_abspath, scratch_pool,
                                       scratch_pool);
@@ -505,8 +464,7 @@ fetch_base_func(const char **filename,
 
 svn_delta_shim_callbacks_t *
 svn_client__get_shim_callbacks(svn_wc_context_t *wc_ctx,
-                               svn_ra_session_t *ra_session,
-                               const char *anchor_abspath,
+                               apr_hash_t *relpath_map,
                                apr_pool_t *result_pool)
 {
   svn_delta_shim_callbacks_t *callbacks =
@@ -514,9 +472,10 @@ svn_client__get_shim_callbacks(svn_wc_co
   struct shim_callbacks_baton *scb = apr_pcalloc(result_pool, sizeof(*scb));
 
   scb->wc_ctx = wc_ctx;
-  scb->anchor_abspath = apr_pstrdup(result_pool, anchor_abspath);
-  svn_error_clear(svn_ra_get_repos_root2(ra_session, &scb->repos_root_url,
-                                         result_pool));
+  if (relpath_map)
+    scb->relpath_map = relpath_map;
+  else
+    scb->relpath_map = apr_hash_make(result_pool);
 
   callbacks->fetch_props_func = fetch_props_func;
   callbacks->fetch_kind_func = fetch_kind_func;

Modified: subversion/branches/inheritable-props/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_delta/compat.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_delta/compat.c Wed Apr 25 22:04:36 2012
@@ -33,6 +33,8 @@
 
 #include "svn_private_config.h"
 
+#include "private/svn_delta_private.h"
+
 
 struct file_rev_handler_wrapper_baton {
   void *baton;
@@ -106,28 +108,6 @@ svn_compat_wrap_file_rev_handler(svn_fil
  * details.
  */
 
-typedef svn_error_t *(*start_edit_func_t)(
-    void *baton,
-    svn_revnum_t base_revision);
-
-typedef svn_error_t *(*target_revision_func_t)(
-    void *baton,
-    svn_revnum_t target_revision,
-    apr_pool_t *scratch_pool);
-
-typedef svn_error_t *(*unlock_func_t)(
-    void *baton,
-    const char *path,
-    apr_pool_t *scratch_pool);
-
-/* See svn_editor__insert_shims() for more information. */
-struct extra_baton
-{
-  start_edit_func_t start_edit;
-  target_revision_func_t target_revision;
-  void *baton;
-};
-
 struct ev2_edit_baton
 {
   svn_editor_t *editor;
@@ -143,7 +123,7 @@ struct ev2_edit_baton
   const char *base_relpath;
 
   apr_pool_t *edit_pool;
-  struct extra_baton *exb;
+  struct svn_delta__extra_baton *exb;
   svn_boolean_t closed;
 
   svn_boolean_t *found_abs_paths; /* Did we strip an incoming '/' from the
@@ -155,7 +135,7 @@ struct ev2_edit_baton
   svn_delta_fetch_base_func_t fetch_base_func;
   void *fetch_base_baton;
 
-  unlock_func_t do_unlock;
+  svn_delta__unlock_func_t do_unlock;
   void *unlock_baton;
 };
 
@@ -1071,11 +1051,11 @@ ev2_abort_edit(void *edit_baton,
  *         Its callbacks should be invoked at the appropriate time by this
  *         shim.
  */
-static svn_error_t *
-delta_from_editor(const svn_delta_editor_t **deditor,
+svn_error_t *
+svn_delta__delta_from_editor(const svn_delta_editor_t **deditor,
                   void **dedit_baton,
                   svn_editor_t *editor,
-                  unlock_func_t unlock_func,
+                  svn_delta__unlock_func_t unlock_func,
                   void *unlock_baton,
                   svn_boolean_t *found_abs_paths,
                   const char *repos_root,
@@ -1084,7 +1064,7 @@ delta_from_editor(const svn_delta_editor
                   void *fetch_props_baton,
                   svn_delta_fetch_base_func_t fetch_base_func,
                   void *fetch_base_baton,
-                  struct extra_baton *exb,
+                  struct svn_delta__extra_baton *exb,
                   apr_pool_t *pool)
 {
   /* Static 'cause we don't want it to be on the stack. */
@@ -1108,6 +1088,11 @@ delta_from_editor(const svn_delta_editor
     };
   struct ev2_edit_baton *eb = apr_pcalloc(pool, sizeof(*eb));
 
+  if (!base_relpath)
+    base_relpath = "";
+  else if (base_relpath[0] == '/')
+    base_relpath += 1;
+
   eb->editor = editor;
   eb->changes = apr_hash_make(pool);
   eb->paths = apr_hash_make(pool);
@@ -2019,10 +2004,10 @@ do_unlock(void *baton,
  *         will be used by the shim handlers if they need to determine the
  *         existing properties on a path.
  */
-static svn_error_t *
-editor_from_delta(svn_editor_t **editor_p,
-                  struct extra_baton **exb,
-                  unlock_func_t *unlock_func,
+svn_error_t *
+svn_delta__editor_from_delta(svn_editor_t **editor_p,
+                  struct svn_delta__extra_baton **exb,
+                  svn_delta__unlock_func_t *unlock_func,
                   void **unlock_baton,
                   const svn_delta_editor_t *deditor,
                   void *dedit_baton,
@@ -2055,9 +2040,14 @@ editor_from_delta(svn_editor_t **editor_
       abort_cb
     };
   struct editor_baton *eb = apr_pcalloc(result_pool, sizeof(*eb));
-  struct extra_baton *extra_baton = apr_pcalloc(result_pool,
+  struct svn_delta__extra_baton *extra_baton = apr_pcalloc(result_pool,
                                                 sizeof(*extra_baton));
 
+  if (!base_relpath)
+    base_relpath = "";
+  else if (base_relpath[0] == '/')
+    base_relpath += 1;
+
   eb->deditor = deditor;
   eb->dedit_baton = dedit_baton;
   eb->edit_pool = result_pool;
@@ -2133,9 +2123,9 @@ svn_editor__insert_shims(const svn_delta
 
   /* The "extra baton" is a set of functions and a baton which allows the
      shims to communicate additional events to each other.
-     editor_from_delta() returns a pointer to this baton, which
-     delta_from_editor() should then store. */
-  struct extra_baton *exb;
+     svn_delta__editor_from_delta() returns a pointer to this baton, which
+     svn_delta__delta_from_editor() should then store. */
+  struct svn_delta__extra_baton *exb;
 
   /* The reason this is a pointer is that we don't know the appropriate
      value until we start receiving paths.  So process_actions() sets the
@@ -2143,19 +2133,15 @@ svn_editor__insert_shims(const svn_delta
   svn_boolean_t *found_abs_paths = apr_palloc(result_pool,
                                               sizeof(*found_abs_paths));
 
-  unlock_func_t unlock_func;
+  svn_delta__unlock_func_t unlock_func;
   void *unlock_baton;
 
   SVN_ERR_ASSERT(shim_callbacks->fetch_kind_func != NULL);
   SVN_ERR_ASSERT(shim_callbacks->fetch_props_func != NULL);
   SVN_ERR_ASSERT(shim_callbacks->fetch_base_func != NULL);
 
-  if (!base_relpath)
-    base_relpath = "";
-  else if (base_relpath[0] == '/')
-    base_relpath += 1;
-
-  SVN_ERR(editor_from_delta(&editor, &exb, &unlock_func, &unlock_baton,
+  SVN_ERR(svn_delta__editor_from_delta(&editor, &exb,
+                            &unlock_func, &unlock_baton,
                             deditor_in, dedit_baton_in,
                             found_abs_paths, repos_root, base_relpath,
                             NULL, NULL,
@@ -2164,7 +2150,7 @@ svn_editor__insert_shims(const svn_delta
                             shim_callbacks->fetch_props_func,
                             shim_callbacks->fetch_baton,
                             result_pool, scratch_pool));
-  SVN_ERR(delta_from_editor(deditor_out, dedit_baton_out, editor,
+  SVN_ERR(svn_delta__delta_from_editor(deditor_out, dedit_baton_out, editor,
                             unlock_func, unlock_baton,
                             found_abs_paths,
                             repos_root, base_relpath,

Modified: subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_delta/editor.c Wed Apr 25 22:04:36 2012
@@ -221,6 +221,13 @@ svn_editor_create(svn_editor_t **editor,
 }
 
 
+void *
+svn_editor_get_baton(const svn_editor_t *editor)
+{
+  return editor->baton;
+}
+
+
 svn_error_t *
 svn_editor_setcb_add_directory(svn_editor_t *editor,
                                svn_editor_cb_add_directory_t callback,

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs/fs-loader.c Wed Apr 25 22:04:36 2012
@@ -199,14 +199,27 @@ svn_fs_type(const char **fs_type, const 
   apr_size_t len;
 
   /* Read the fsap-name file to get the FSAP name, or assume the (old)
-     default. */
+     default.  For old repositories I suppose we could check some
+     other file, DB_CONFIG or strings say, but for now just check the
+     directory exists. */
   filename = svn_dirent_join(path, FS_TYPE_FILENAME, pool);
   err = svn_io_file_open(&file, filename, APR_READ|APR_BUFFERED, 0, pool);
   if (err && APR_STATUS_IS_ENOENT(err->apr_err))
     {
-      svn_error_clear(err);
-      *fs_type = apr_pstrdup(pool, SVN_FS_TYPE_BDB);
-      return SVN_NO_ERROR;
+      svn_node_kind_t kind;
+      svn_error_t *err2 = svn_io_check_path(path, &kind, pool);
+      if (err2)
+        {
+          svn_error_clear(err2);
+          return err;
+        }
+      if (kind == svn_node_dir)
+        {
+          svn_error_clear(err);
+          *fs_type = SVN_FS_TYPE_BDB;
+          return SVN_NO_ERROR;
+        }
+      return err;
     }
   else if (err)
     return err;
@@ -632,6 +645,7 @@ svn_error_t *
 svn_fs_commit_txn(const char **conflict_p, svn_revnum_t *new_rev,
                   svn_fs_txn_t *txn, apr_pool_t *pool)
 {
+  svn_error_t *err;
 #ifdef PACK_AFTER_EVERY_COMMIT
   svn_fs_root_t *txn_root;
   svn_fs_t *fs;
@@ -643,11 +657,25 @@ svn_fs_commit_txn(const char **conflict_
   fs_path = svn_fs_path(fs, pool);
 #endif
 
-  SVN_ERR(txn->vtable->commit(conflict_p, new_rev, txn, pool));
+  err = txn->vtable->commit(conflict_p, new_rev, txn, pool);
+
+#ifdef SVN_DEBUG
+  /* Check postconditions. */
+  if (conflict_p)
+    {
+      SVN_ERR_ASSERT_E(! (SVN_IS_VALID_REVNUM(*new_rev) && *conflict_p != NULL),
+                       err);
+      SVN_ERR_ASSERT_E((*conflict_p != NULL)
+                       == (err && err->apr_err == SVN_ERR_FS_CONFLICT),
+                       err);
+    }
+#endif
+
+  SVN_ERR(err);
 
 #ifdef PACK_AFTER_EVERY_COMMIT
   {
-    svn_error_t *err = svn_fs_pack(fs_path, NULL, NULL, NULL, NULL, pool);
+    err = svn_fs_pack(fs_path, NULL, NULL, NULL, NULL, pool);
     if (err && err->apr_err == SVN_ERR_UNSUPPORTED_FEATURE)
       /* Pre-1.6 filesystem. */
       svn_error_clear(err);

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_base/tree.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_base/tree.c Wed Apr 25 22:04:36 2012
@@ -3828,16 +3828,8 @@ base_apply_textdelta(svn_txdelta_window_
   tb->root = root;
   tb->path = path;
   tb->pool = pool;
-
-  if (base_checksum)
-    tb->base_checksum = svn_checksum_dup(base_checksum, pool);
-  else
-    tb->base_checksum = NULL;
-
-  if (result_checksum)
-    tb->result_checksum = svn_checksum_dup(result_checksum, pool);
-  else
-    tb->result_checksum = NULL;
+  tb->base_checksum = svn_checksum_dup(base_checksum, pool);
+  tb->result_checksum = svn_checksum_dup(result_checksum, pool);
 
   SVN_ERR(svn_fs_base__retry_txn(root->fs, txn_body_apply_textdelta, tb,
                                  FALSE, pool));
@@ -3978,11 +3970,7 @@ base_apply_text(svn_stream_t **contents_
   tb->root = root;
   tb->path = path;
   tb->pool = pool;
-
-  if (result_checksum)
-    tb->result_checksum = svn_checksum_dup(result_checksum, pool);
-  else
-    tb->result_checksum = NULL;
+  tb->result_checksum = svn_checksum_dup(result_checksum, pool);
 
   SVN_ERR(svn_fs_base__retry_txn(root->fs, txn_body_apply_text, tb,
                                  FALSE, pool));

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_base/util/fs_skels.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_base/util/fs_skels.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_base/util/fs_skels.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_base/util/fs_skels.c Wed Apr 25 22:04:36 2012
@@ -32,6 +32,7 @@
 
 #include "private/svn_skel.h"
 #include "private/svn_dep_compat.h"
+#include "private/svn_subr_private.h"
 
 #include "svn_checksum.h"
 #include "fs_skels.h"
@@ -511,18 +512,18 @@ svn_fs_base__parse_representation_skel(r
     {
       svn_skel_t *checksum_skel = header_skel->children->next->next;
       rep->md5_checksum =
-        svn_checksum__from_digest((const unsigned char *)
-                                  (checksum_skel->children->next->data),
-                                  svn_checksum_md5, pool);
+        svn_checksum__from_digest_md5((const unsigned char *)
+                                      (checksum_skel->children->next->data),
+                                      pool);
 
       /* SHA1 */
       if (header_skel->children->next->next->next)
         {
           checksum_skel = header_skel->children->next->next->next;
           rep->sha1_checksum =
-            svn_checksum__from_digest((const unsigned char *)
-                                      (checksum_skel->children->next->data),
-                                      svn_checksum_sha1, pool);
+            svn_checksum__from_digest_sha1(
+              (const unsigned char *)(checksum_skel->children->next->data),
+              pool);
         }
     }
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/dag.c Wed Apr 25 22:04:36 2012
@@ -1146,7 +1146,7 @@ svn_fs_fs__dag_open(dag_node_t **child_p
   const svn_fs_id_t *node_id;
 
   /* Ensure that NAME exists in PARENT's entry list. */
-  SVN_ERR(dir_entry_id_from_node(&node_id, parent, name, 
+  SVN_ERR(dir_entry_id_from_node(&node_id, parent, name,
                                  scratch_pool, scratch_pool));
   if (! node_id)
     return svn_error_createf

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs.h Wed Apr 25 22:04:36 2012
@@ -255,11 +255,11 @@ typedef struct fs_fs_data_t
   /* Access object to the revprop "generation". Will be NULL until
      the first access. */
   svn_named_atomic__t *revprop_generation;
-  
+
   /* Access object to the revprop update timeout. Will be NULL until
      the first access. */
   svn_named_atomic__t *revprop_timeout;
-  
+
   /* Revision property cache.  Maps from (rev,generation) to apr_hash_t. */
   svn_cache__t *revprop_cache;
 

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/fs_fs.c Wed Apr 25 22:04:36 2012
@@ -99,9 +99,9 @@
 
 /* The following are names of atomics that will be used to communicate
  * revprop updates across all processes on this machine. */
-#define ATOMIC_REVPROP_GENERATION "RevPropGeneration"
-#define ATOMIC_REVPROP_TIMEOUT    "RevPropTimeout"
-#define ATOMIC_REVPROP_NAMESPACE  "RevPropAtomics"
+#define ATOMIC_REVPROP_GENERATION "rev-prop-generation"
+#define ATOMIC_REVPROP_TIMEOUT    "rev-prop-timeout"
+#define ATOMIC_REVPROP_NAMESPACE  "rev-prop-atomics"
 
 /* Following are defines that specify the textual elements of the
    native filesystem directories and revision files. */
@@ -2808,10 +2808,9 @@ ensure_revprop_namespace(svn_fs_t *fs)
 
   return ffd->revprop_namespace == NULL
     ? svn_atomic_namespace__create(&ffd->revprop_namespace,
-                                   apr_pstrcat(fs->pool,
-                                               fs->path,
-                                               ATOMIC_REVPROP_NAMESPACE,
-                                               (char *)NULL),
+                                   svn_dirent_join(fs->path,
+                                                   ATOMIC_REVPROP_NAMESPACE,
+                                                   fs->pool),
                                    fs->pool)
     : SVN_NO_ERROR;
 }
@@ -2836,7 +2835,7 @@ static svn_error_t *
 ensure_revprop_timeout(svn_fs_t *fs)
 {
   fs_fs_data_t *ffd = fs->fsap_data;
-  
+
   SVN_ERR(ensure_revprop_namespace(fs));
   return ffd->revprop_timeout == NULL
     ? svn_named_atomic__get(&ffd->revprop_timeout,
@@ -2892,7 +2891,7 @@ read_revprop_generation(apr_int64_t *gen
 {
   apr_int64_t current = 0;
   fs_fs_data_t *ffd = fs->fsap_data;
-  
+
   /* read the current revprop generation number */
   SVN_ERR(ensure_revprop_generation(fs));
   SVN_ERR(svn_named_atomic__read(&current, ffd->revprop_generation));
@@ -2935,7 +2934,7 @@ begin_revprop_change(svn_fs_t *fs)
 {
   apr_int64_t current;
   fs_fs_data_t *ffd = fs->fsap_data;
-  
+
   /* set the timeout for the write operation */
   SVN_ERR(ensure_revprop_timeout(fs));
   SVN_ERR(svn_named_atomic__write(NULL,
@@ -2966,7 +2965,7 @@ end_revprop_change(svn_fs_t *fs)
 {
   apr_int64_t current = 1;
   fs_fs_data_t *ffd = fs->fsap_data;
-  
+
   /* set the revprop generation to an even value to indicate
    * that a write has been completed
    */

Modified: subversion/branches/inheritable-props/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/libsvn_fs_fs/temp_serializer.c?rev=1330583&r1=1330582&r2=1330583&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/inheritable-props/subversion/libsvn_fs_fs/temp_serializer.c Wed Apr 25 22:04:36 2012
@@ -594,7 +594,7 @@ serialize_cstring_array(svn_temp_seriali
 {
   apr_size_t i;
   const char **entries = *strings;
-  
+
   /* serialize COUNT entries pointers (the array) */
   svn_temp_serializer__push(context,
                             (const void * const *)strings,
@@ -615,7 +615,7 @@ serialize_svn_string_array(svn_temp_seri
 {
   apr_size_t i;
   const svn_string_t **entries = *strings;
-  
+
   /* serialize COUNT entries pointers (the array) */
   svn_temp_serializer__push(context,
                             (const void * const *)strings,
@@ -645,14 +645,14 @@ svn_fs_fs__serialize_properties(void **d
   properties.count = apr_hash_count(hash);
   properties.keys = apr_palloc(pool, sizeof(const char*) * (properties.count + 1));
   properties.values = apr_palloc(pool, sizeof(const char*) * properties.count);
-  
+
   /* populate it with the hash entries */
   for (hi = apr_hash_first(pool, hash), i=0; hi; hi = apr_hash_next(hi), ++i)
     {
       properties.keys[i] = svn__apr_hash_index_key(hi);
       properties.values[i] = svn__apr_hash_index_val(hi);
     }
-  
+
   /* serialize it */
   context = svn_temp_serializer__init(&properties,
                                       sizeof(properties),
@@ -685,19 +685,19 @@ svn_fs_fs__deserialize_properties(void *
   /* de-serialize our auxilliary data structure */
   svn_temp_deserializer__resolve(properties, (void**)&properties->keys);
   svn_temp_deserializer__resolve(properties, (void**)&properties->values);
-  
+
   /* de-serialize each entry and put it into the hash */
   for (i = 0; i < properties->count; ++i)
     {
       apr_size_t len = properties->keys[i+1] - properties->keys[i] - 1;
-      svn_temp_deserializer__resolve((void*)properties->keys, 
+      svn_temp_deserializer__resolve((void*)properties->keys,
                                      (void**)&properties->keys[i]);
-      
-      deserialize_svn_string((void*)properties->values, 
+
+      deserialize_svn_string((void*)properties->values,
                              (svn_string_t **)&properties->values[i]);
-      
-      apr_hash_set(hash, 
-                   properties->keys[i], len, 
+
+      apr_hash_set(hash,
+                   properties->keys[i], len,
                    properties->values[i]);
     }