Index: subversion/libsvn_client/patch.c
===================================================================
--- subversion/libsvn_client/patch.c	(revision 38779)
+++ subversion/libsvn_client/patch.c	(arbetskopia)
@@ -45,6 +45,7 @@
 
 #include "svn_private_config.h"
 #include "private/svn_diff_private.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -606,6 +607,7 @@
   svn_node_kind_t kind;
   const svn_wc_entry_t *entry;
   const char *child;
+  const char *local_abspath;
 
   /* Easy out:  if we have no adm_access for the parent directory,
      then this portion of the tree-delta "patch" must be inapplicable.
@@ -628,6 +630,9 @@
   child = svn_dirent_is_child(patch_b->target, path, subpool);
   assert(child != NULL);
 
+  /* libsvn_wc wants absolute paths. */
+  SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, subpool));
+
   SVN_ERR(svn_io_check_path(path, &kind, subpool));
   switch (kind)
     {
@@ -688,8 +693,14 @@
 
       if (state)
         {
-          SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, subpool));
 
+          SVN_ERR(svn_wc__get_entry_versioned(&entry, patch_b->ctx->wc_ctx,
+                                          local_abspath,
+                                          svn_node_unknown,
+                                          FALSE, FALSE,
+                                          subpool,
+                                          subpool));
+
           if (entry && dry_run_deleted_p(patch_b, path))
             /* ### TODO: Retain record of this dir being added to
                ### avoid problems from subsequent edits which try to
@@ -2016,10 +2027,26 @@
   if (! new_target->skipped)
     {
       const svn_wc_entry_t *entry;
+      svn_error_t *err;
 
       /* If the target is versioned, we should be able to get an entry. */
-      SVN_ERR(svn_wc_entry(&entry, new_target->abs_path, adm_access,
-                           TRUE /* show_hidden */, scratch_pool));
+      err = svn_wc__get_entry_versioned(&entry, ctx->wc_ctx,
+                                          new_target->abs_path,
+                                          svn_node_unknown,
+                                          TRUE, FALSE,
+                                          result_pool,
+                                          scratch_pool);
+
+      /* We catch the error since a NULL value is expected when the entry
+         was not versioned. */
+      if (err && err->apr_err == SVN_ERR_ENTRY_NOT_FOUND)
+        {
+          svn_error_clear(err);
+          entry = NULL;
+        }
+      else if (err)
+        return svn_error_return(err);
+
       if (entry && entry->schedule == svn_wc_schedule_delete)
         {
           /* The target is versioned and scheduled for deletion, so skip it. */
