Index: subversion/include/private/svn_wc_private.h
===================================================================
--- subversion/include/private/svn_wc_private.h	(revision 0)
+++ subversion/include/private/svn_wc_private.h	(revision 0)
@@ -0,0 +1,72 @@
+/**
+ * @copyright
+ * ====================================================================
+ * Copyright (c) 2007 CollabNet.  All rights reserved.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at http://subversion.tigris.org/license-1.html.
+ * If newer versions of this license are posted there, you may use a
+ * newer version instead, at your option.
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals.  For exact contribution history, see the revision
+ * history and logs, available at http://subversion.tigris.org/.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file svn_wc_private.h
+ * @brief The Subversion Working Copy Library - Internal routines
+ *
+ * Requires:  
+ *            - A working copy
+ * 
+ * Provides: 
+ *            - Ability to manipulate working copy's versioned data.
+ *            - Ability to manipulate working copy's administrative files.
+ *
+ * Used By:   
+ *            - Clients.
+ */
+
+#ifndef SVN_WC_PRIVATE_H
+#define SVN_WC_PRIVATE_H
+
+#include "svn_wc.h"
+
+/** Internal function used by the svn_wc_entry_versioned() macro.
+ *
+ * @since New in 1.5.
+ */
+svn_error_t *
+svn_wc__entry_versioned_internal(const svn_wc_entry_t **entry,
+                                 const char *path,
+                                 svn_wc_adm_access_t *adm_access,
+                                 svn_boolean_t show_hidden,
+                                 const char *caller_filename,
+                                 int caller_lineno,
+                                 apr_pool_t *pool);
+
+
+/** Same as svn_wc_entry() except that the entry returned
+ * is a non @c NULL entry.
+ *
+ * Returns an error when svn_wc_entry() would have returned a @c NULL entry.
+ *
+ * @since New in 1.5.
+ */
+
+#ifdef SVN_DEBUG
+#define svn_wc__entry_versioned(entry, path, adm_access, show_hidden, pool) \
+  svn_wc__entry_versioned_internal((entry), (path), (adm_access), \
+                                   (show_hidden), __FILE__, __LINE__, (pool))
+#else
+#define svn_wc__entry_versioned(entry, path, adm_access, show_hidden, pool) \
+  svn_wc__entry_versioned_internal((entry), (path), (adm_access), \
+                                   (show_hidden), NULL, 0, (pool))
+#endif
+
+
+
+
+#endif /* SVN_WC_PRIVATE_H */
Index: subversion/libsvn_wc/entries.c
===================================================================
--- subversion/libsvn_wc/entries.c	(revision 23911)
+++ subversion/libsvn_wc/entries.c	(working copy)
@@ -37,6 +37,7 @@
 #include "lock.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /** Overview **/
@@ -1225,6 +1226,33 @@
 }
 
 
+svn_error_t *
+svn_wc__entry_versioned_internal(const svn_wc_entry_t **entry,
+                                 const char *path,
+                                 svn_wc_adm_access_t *adm_access,
+                                 svn_boolean_t show_hidden,
+                                 const char *caller_filename,
+                                 int caller_lineno,
+                                 apr_pool_t *pool)
+{
+  SVN_ERR(svn_wc_entry(entry, path, adm_access, show_hidden, pool));
+
+  if (! *entry)
+    {
+      svn_error_t *err
+        = svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
+                            _("'%s' is not under version control"),
+                            svn_path_local_style(path, pool));
+
+      err->file = caller_filename;
+      err->line = caller_lineno;
+      return err;
+    }
+
+  return SVN_NO_ERROR;
+}
+
+
 #if 0
 /* This is #if 0'd out until I decide where to use it. --cmpilato */
 
Index: subversion/libsvn_wc/copy.c
===================================================================
--- subversion/libsvn_wc/copy.c	(revision 23911)
+++ subversion/libsvn_wc/copy.c	(working copy)
@@ -2,7 +2,7 @@
  * copy.c:  wc 'copy' functionality.
  *
  * ====================================================================
- * Copyright (c) 2000-2006 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -23,7 +23,6 @@
 /*** Includes. ***/
 
 #include <string.h>
-#include "svn_wc.h"
 #include "svn_pools.h"
 #include "svn_error.h"
 #include "svn_path.h"
@@ -35,6 +34,7 @@
 #include "translate.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -288,25 +288,19 @@
         {
           SVN_ERR(svn_wc_adm_retrieve(&parent_access, src_access,
                                       parent_path, pool));
-          SVN_ERR(svn_wc_entry(&entry, parent_path, parent_access,
-                               FALSE, pool));
+          SVN_ERR(svn_wc__entry_versioned(&entry, parent_path, parent_access,
+                                         FALSE, pool));
         }
       else /* ...get access for parent_path instead. */
         {
           SVN_ERR(svn_wc_adm_probe_open3(&parent_access, NULL,
                                          parent_path, FALSE, -1,
                                          NULL, NULL, pool));
-          SVN_ERR(svn_wc_entry(&entry, parent_path, parent_access,
-                               FALSE, pool));
+          SVN_ERR(svn_wc__entry_versioned(&entry, parent_path, parent_access,
+                                         FALSE, pool));
           SVN_ERR(svn_wc_adm_close(parent_access));
         }
 
-      if (! entry)
-        return svn_error_createf
-          (SVN_ERR_ENTRY_NOT_FOUND, NULL,
-           _("'%s' is not under version control"),
-             svn_path_local_style(parent_path, pool));
-
       if (entry->copyfrom_url)
         {
           *copyfrom_url = svn_path_join(entry->copyfrom_url, rest,
@@ -377,12 +371,8 @@
 
   /* Sanity check 1: You cannot make a copy of something that's not
      under version control. */
-  SVN_ERR(svn_wc_entry(&src_entry, src_path, src_access, FALSE, pool));
-  if (! src_entry)
-    return svn_error_createf 
-      (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-       _("Cannot copy or move '%s': it's not under version control"),
-       svn_path_local_style(src_path, pool));
+  SVN_ERR(svn_wc__entry_versioned(&src_entry, src_path, src_access, FALSE,
+                                 pool));
 
   /* Sanity check 2: You cannot make a copy of something that's not
      in the repository unless it's a copy of an uncommitted copy. */
@@ -656,12 +646,8 @@
 
   /* Sanity check 1: You cannot make a copy of something that's not
      under version control. */
-  SVN_ERR(svn_wc_entry(&src_entry, src_path, src_access, FALSE, pool));
-  if (! src_entry)
-    return svn_error_createf
-      (SVN_ERR_ENTRY_NOT_FOUND, NULL, 
-       _("'%s' is not under version control"),
-       svn_path_local_style(src_path, pool));
+  SVN_ERR(svn_wc__entry_versioned(&src_entry, src_path, src_access, FALSE,
+                                 pool));
 
   /* Sanity check 2: You cannot make a copy of something that's not
      in the repository unless it's a copy of an uncommitted copy. */
@@ -778,20 +764,11 @@
                                  cancel_func, cancel_baton, pool));
 
   dst_path =  svn_wc_adm_access_path(dst_parent);
-  SVN_ERR(svn_wc_entry(&dst_entry, dst_path, dst_parent, FALSE, pool));
-  if (! dst_entry)
-    return svn_error_createf
-      (SVN_ERR_ENTRY_NOT_FOUND, NULL,
-       _("'%s' is not under version control"),
-       svn_path_local_style(dst_path, pool));
+  SVN_ERR(svn_wc__entry_versioned(&dst_entry, dst_path, dst_parent, FALSE,
+                                 pool));
+  SVN_ERR(svn_wc__entry_versioned(&src_entry, src_path, adm_access, FALSE,
+                                 pool));
 
-  SVN_ERR(svn_wc_entry(&src_entry, src_path, adm_access, FALSE, pool));
-  if (! src_entry)
-    return svn_error_createf
-      (SVN_ERR_ENTRY_NOT_FOUND, NULL,
-       _("'%s' is not under version control"),
-       svn_path_local_style(src_path, pool));
-
   if ((src_entry->repos != NULL && dst_entry->repos != NULL) &&
       strcmp(src_entry->repos, dst_entry->repos) != 0)
     return svn_error_createf
Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c	(revision 23911)
+++ subversion/libsvn_wc/adm_ops.c	(working copy)
@@ -53,6 +53,7 @@
 #include "translate.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Finishing updates and commits. ***/
@@ -1357,11 +1358,7 @@
 {
   const svn_wc_entry_t *ent;
 
-  SVN_ERR(svn_wc_entry(&ent, path, adm_access, FALSE, pool));
-  if (! ent)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"),
-                             svn_path_local_style(path, pool));
+  SVN_ERR(svn_wc__entry_versioned(&ent, path, adm_access, FALSE, pool));
 
   if (url)
     *url = apr_pstrdup(pool, ent->url);
@@ -1948,12 +1945,8 @@
   SVN_ERR(svn_wc_adm_probe_retrieve(&dir_access, parent_access, path, pool));
 
   /* Safeguard 1:  is this a versioned resource? */
-  SVN_ERR(svn_wc_entry(&entry, path, dir_access, FALSE, pool));
-  if (! entry)
-    return svn_error_createf 
-      (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-       _("Cannot revert: '%s' is not under version control"),
-       svn_path_local_style(path, pool));
+  SVN_ERR_W(svn_wc__entry_versioned(&entry, path, dir_access, FALSE, pool),
+            "Cannot revert.");
 
   /* Safeguard 1.5: is this a missing versioned directory? */
   if (entry->kind == svn_node_dir)
@@ -2652,11 +2645,7 @@
   if (! recurse)
     {
       const svn_wc_entry_t *entry;
-      SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
-      if (! entry)
-        return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
-                                 _("'%s' is not under version control"),
-                                 svn_path_local_style(path, pool));
+      SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool));
 
       SVN_ERR(resolve_found_entry_callback(path, entry, baton, pool));
     }
@@ -2677,11 +2666,8 @@
   const svn_wc_entry_t *entry;
   svn_wc_entry_t newentry;
 
-  SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool));
 
-  if (! entry)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"), path);
 
   newentry.lock_token = lock->token;
   newentry.lock_owner = lock->owner;
@@ -2713,12 +2699,8 @@
   const svn_wc_entry_t *entry;
   svn_wc_entry_t newentry;
 
-  SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool));
 
-  if (! entry)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"), path);
-
   newentry.lock_token = newentry.lock_owner = newentry.lock_comment = NULL;
   newentry.lock_creation_date = 0;
   SVN_ERR(svn_wc__entry_modify(adm_access, entry->name, &newentry,
Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c	(revision 23911)
+++ subversion/libsvn_wc/status.c	(working copy)
@@ -2,7 +2,7 @@
  * status.c: construct a status structure from an entry structure
  *
  * ====================================================================
- * Copyright (c) 2000-2006 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -30,7 +30,6 @@
 #include "svn_error.h"
 #include "svn_path.h"
 #include "svn_io.h"
-#include "svn_wc.h"
 #include "svn_config.h"
 #include "svn_time.h"
 #include "svn_private_config.h"
@@ -40,6 +39,7 @@
 #include "props.h"
 #include "translate.h"
 
+#include "private/svn_wc_private.h"
 
 
 /*** Editor batons ***/
@@ -720,15 +720,10 @@
          as a *directory* on disk), we don't want to reach down into
          that subdir to try to flesh out a "complete entry".  */
       const svn_wc_entry_t *full_entry = entry;
-          
+
       if (entry->kind == kind)
-        {
-          SVN_ERR(svn_wc_entry(&full_entry, path, adm_access, FALSE, pool));
-          if (! full_entry)
-            return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                                     _("'%s' is not under version control"),
-                                     svn_path_local_style(path, pool));
-        }
+        SVN_ERR(svn_wc__entry_versioned(&full_entry, path, adm_access, FALSE,
+                                       pool));
 
       /* Descend only if the subdirectory is a working copy directory
          (and DESCEND is non-zero ofcourse)  */
Index: subversion/libsvn_wc/adm_files.c
===================================================================
--- subversion/libsvn_wc/adm_files.c	(revision 23911)
+++ subversion/libsvn_wc/adm_files.c	(working copy)
@@ -6,7 +6,7 @@
  *              information is kept.  
  *
  * ====================================================================
- * Copyright (c) 2000-2006 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -32,7 +32,6 @@
 #include "svn_error.h"
 #include "svn_io.h"
 #include "svn_path.h"
-#include "svn_wc.h"
 
 #include "wc.h"
 #include "adm_files.h"
@@ -40,6 +39,7 @@
 #include "lock.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** File names in the adm area. ***/
@@ -1028,12 +1028,8 @@
 
       SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, path, FALSE, 0,
                                NULL, NULL, pool));
-      SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
+      SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool));
       SVN_ERR(svn_wc_adm_close(adm_access));
-      if (!entry)
-        return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
-                                 _("No entry for '%s'"),
-                                 svn_path_local_style(path, pool));
 
       /* When the directory exists and is scheduled for deletion do not
        * check the revision or the URL.  The revision can be any 
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c	(revision 23911)
+++ subversion/libsvn_wc/update_editor.c	(working copy)
@@ -38,7 +38,6 @@
 #include "svn_error.h"
 #include "svn_io.h"
 #include "svn_md5.h"
-#include "svn_wc.h"
 #include "svn_private_config.h"
 #include "svn_time.h"
 
@@ -52,6 +51,8 @@
 #include "props.h"
 #include "translate.h"
 
+#include "private/svn_wc_private.h"
+
 
 /*** batons ***/
 
@@ -3125,11 +3126,7 @@
   /* Fabricate the anticipated new URL of the target and check the
      copyfrom URL to be in the same repository. */
   {
-    SVN_ERR(svn_wc_entry(&ent, dir_name, adm_access, FALSE, pool));
-    if (! ent)
-      return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                               _("'%s' is not under version control"),
-                               svn_path_local_style(dir_name, pool));
+    SVN_ERR(svn_wc__entry_versioned(&ent, dir_name, adm_access, FALSE, pool));
 
     new_URL = svn_path_url_add_component(ent->url, base_name, pool);
 
Index: subversion/libsvn_wc/questions.c
===================================================================
--- subversion/libsvn_wc/questions.c	(revision 23911)
+++ subversion/libsvn_wc/questions.c	(working copy)
@@ -29,7 +29,6 @@
 #include "svn_error.h"
 #include "svn_path.h"
 #include "svn_time.h"
-#include "svn_wc.h"
 #include "svn_io.h"
 #include "svn_props.h"
 
@@ -43,6 +42,7 @@
 #include <apr_md5.h>
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /* ### todo: make this compare repository too?  Or do so in parallel
@@ -179,15 +179,8 @@
   const svn_wc_entry_t *entry;
 
   /* Get the timestamp from the entries file */
-  SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool));
 
-  /* Can't compare timestamps for an unversioned file. */
-  if (entry == NULL)
-    return svn_error_createf
-      (SVN_ERR_ENTRY_NOT_FOUND, NULL,
-       _("'%s' is not under version control"),
-       svn_path_local_style(path, pool));
-
   /* Get the timestamp from the working file and the entry */
   if (timestamp_kind == svn_wc__text_time)
     {
@@ -294,13 +287,8 @@
         {
           /* Need checksum verification, so read checksum from entries file
            * and setup checksummed stream for base file. */
-          SVN_ERR(svn_wc_entry(&entry, versioned_file, adm_access, TRUE,
-                               pool));
-          if (! entry)
-            return svn_error_createf
-              (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                _("'%s' is not under version control"),
-                svn_path_local_style(versioned_file, pool));
+          SVN_ERR(svn_wc__entry_versioned(&entry, versioned_file, adm_access,
+                                         TRUE, pool));
 
           if (entry->checksum)
             b_stream = svn_stream_checksummed(b_stream, &digest, NULL, TRUE,
Index: subversion/libsvn_wc/translate.c
===================================================================
--- subversion/libsvn_wc/translate.c	(revision 23911)
+++ subversion/libsvn_wc/translate.c	(working copy)
@@ -2,7 +2,7 @@
  * translate.c :  wc-specific eol/keyword substitution
  *
  * ====================================================================
- * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -32,7 +32,6 @@
 #include "svn_subst.h"
 #include "svn_io.h"
 #include "svn_props.h"
-#include "svn_wc.h"
 
 #include "wc.h"
 #include "adm_files.h"
@@ -40,6 +39,7 @@
 #include "props.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 
@@ -263,11 +263,7 @@
       return SVN_NO_ERROR;
     }
 
-  SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
-  if (! entry)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"),
-                             svn_path_local_style(path, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool));
 
   SVN_ERR(svn_subst_build_keywords2(keywords,
                                     list,
Index: subversion/libsvn_client/switch.c
===================================================================
--- subversion/libsvn_client/switch.c	(revision 23911)
+++ subversion/libsvn_client/switch.c	(working copy)
@@ -2,7 +2,7 @@
  * switch.c:  implement 'switch' feature via WC & RA interfaces.
  *
  * ====================================================================
- * Copyright (c) 2000-2006 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -24,7 +24,6 @@
 
 #include <assert.h>
 
-#include "svn_wc.h"
 #include "svn_client.h"
 #include "svn_error.h"
 #include "svn_time.h"
@@ -33,6 +32,7 @@
 #include "client.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -101,11 +101,7 @@
                                  ctx->cancel_baton, pool));
   anchor = svn_wc_adm_access_path(adm_access);
 
-  SVN_ERR(svn_wc_entry(&entry, anchor, adm_access, FALSE, pool));
-  if (! entry)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL, 
-                             _("'%s' is not under version control"),
-                             svn_path_local_style(anchor, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, anchor, adm_access, FALSE, pool));
   if (! entry->url)
     return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
                              _("Directory '%s' has no URL"),
Index: subversion/libsvn_client/export.c
===================================================================
--- subversion/libsvn_client/export.c	(revision 23911)
+++ subversion/libsvn_client/export.c	(working copy)
@@ -2,7 +2,7 @@
  * export.c:  export a tree.
  *
  * ====================================================================
- * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -25,7 +25,6 @@
 #include <apr_file_io.h>
 #include <apr_md5.h>
 #include "svn_types.h"
-#include "svn_wc.h"
 #include "svn_client.h"
 #include "svn_string.h"
 #include "svn_error.h"
@@ -38,6 +37,7 @@
 #include "client.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -230,19 +230,8 @@
                                  0, ctx->cancel_func, ctx->cancel_baton,
                                  pool));
 
-  SVN_ERR(svn_wc_entry(&entry, from, adm_access, FALSE, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, from, adm_access, FALSE, pool));
 
-  /* Bail if we're trying to export something that doesn't exist,
-     or isn't under version control. */
-  if (! entry)
-    {
-      SVN_ERR(svn_wc_adm_close(adm_access));
-      return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                               _("'%s' is not under version control "
-                                 "or doesn't exist"),
-                               svn_path_local_style(from, pool));
-    }
-
   /* Only export 'added' files when the revision is WORKING.
      Otherwise, skip the 'added' files, since they didn't exist
      in the BASE revision and don't have an associated text-base.
Index: subversion/libsvn_client/revisions.c
===================================================================
--- subversion/libsvn_client/revisions.c	(revision 23911)
+++ subversion/libsvn_client/revisions.c	(working copy)
@@ -22,11 +22,11 @@
 
 #include "svn_error.h"
 #include "svn_ra.h"
-#include "svn_wc.h"
 #include "svn_path.h"
 #include "client.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 
@@ -80,15 +80,9 @@
 
       SVN_ERR(svn_wc_adm_probe_open3(&adm_access, NULL, path, FALSE,
                                      0, NULL, NULL, pool));
-      SVN_ERR(svn_wc_entry(&ent, path, adm_access, FALSE, pool));
+      SVN_ERR(svn_wc__entry_versioned(&ent, path, adm_access, FALSE, pool));
       SVN_ERR(svn_wc_adm_close(adm_access));
 
-      if (! ent)
-        return svn_error_createf
-        (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-	 _("'%s' is not under version control"),
-         svn_path_local_style(path, pool));
-      
       if ((revision->kind == svn_opt_revision_base)
           || (revision->kind == svn_opt_revision_working))
         *revnum = ent->revision;
Index: subversion/libsvn_client/status.c
===================================================================
--- subversion/libsvn_client/status.c	(revision 23911)
+++ subversion/libsvn_client/status.c	(working copy)
@@ -2,7 +2,7 @@
  * status.c:  return the status of a working copy dirent
  *
  * ====================================================================
- * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -28,13 +28,13 @@
 #include "svn_pools.h"
 #include "client.h"
 
-#include "svn_wc.h"
 #include "svn_path.h"
 #include "svn_delta.h"
 #include "svn_client.h"
 #include "svn_error.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Getting update information ***/
@@ -249,12 +249,8 @@
       svn_node_kind_t kind;
 
       /* Get full URL from the ANCHOR. */
-      SVN_ERR(svn_wc_entry(&entry, anchor, anchor_access, FALSE, pool));
-      if (! entry)
-        return svn_error_createf
-          (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-           _("'%s' is not under version control"),
-           svn_path_local_style(anchor, pool));
+      SVN_ERR(svn_wc__entry_versioned(&entry, anchor, anchor_access, FALSE,
+                                     pool));
       if (! entry->url)
         return svn_error_createf
           (SVN_ERR_ENTRY_MISSING_URL, NULL,
Index: subversion/libsvn_client/info.c
===================================================================
--- subversion/libsvn_client/info.c	(revision 23911)
+++ subversion/libsvn_client/info.c	(working copy)
@@ -2,7 +2,7 @@
  * info.c:  return system-generated metadata about paths or URLs.
  *
  * ====================================================================
- * Copyright (c) 2000-2006 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -22,11 +22,11 @@
 
 #include "client.h"
 #include "svn_client.h"
-#include "svn_wc.h"
 #include "svn_pools.h"
 #include "svn_path.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /* Helper: build an svn_info_t *INFO struct from svn_dirent_t DIRENT
@@ -237,12 +237,7 @@
                                  recurse ? -1 : 0,
                                  ctx->cancel_func, ctx->cancel_baton,
                                  pool));
-  SVN_ERR(svn_wc_entry(&entry, wcpath, adm_access, FALSE, pool));
-  if (! entry)
-    {
-      return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                               _("Cannot read entry for '%s'"), wcpath);
-    }
+  SVN_ERR(svn_wc__entry_versioned(&entry, wcpath, adm_access, FALSE, pool));
 
   SVN_ERR(build_info_from_entry(&info, entry, pool));
   fe_baton.receiver = receiver;
Index: subversion/libsvn_client/prop_commands.c
===================================================================
--- subversion/libsvn_client/prop_commands.c	(revision 23911)
+++ subversion/libsvn_client/prop_commands.c	(working copy)
@@ -32,6 +32,7 @@
 #include "svn_props.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -351,11 +352,7 @@
   SVN_ERR(svn_wc_adm_probe_open3(&adm_access, NULL, target, TRUE,
                                  recurse ? -1 : 0, ctx->cancel_func,
                                  ctx->cancel_baton, pool));
-  SVN_ERR(svn_wc_entry(&node, target, adm_access, FALSE, pool));
-  if (!node)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"), 
-                             svn_path_local_style(target, pool));
+  SVN_ERR(svn_wc__entry_versioned(&node, target, adm_access, FALSE, pool));
 
   if (recurse && node->kind == svn_node_dir)
     {
@@ -605,11 +602,8 @@
       
       SVN_ERR(svn_wc_adm_open3(&adm_access, NULL, pdir, FALSE,
                                0, NULL, NULL, pool));
-      SVN_ERR(svn_wc_entry(&entry, target, adm_access, FALSE, pool));
-      if (! entry)
-        return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                                 _("'%s' is not under version control"), 
-                                 svn_path_local_style(target, pool));
+      SVN_ERR(svn_wc__entry_versioned(&entry, target, adm_access, FALSE, pool));
+
       *new_target = entry->url;
     }
   else
@@ -768,13 +762,8 @@
                                      FALSE, recurse ? -1 : 0,
                                      ctx->cancel_func, ctx->cancel_baton,
                                      pool));
-      SVN_ERR(svn_wc_entry(&node, target, adm_access, FALSE, pool));
-      if (! node)
-        return svn_error_createf 
-          (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-           _("'%s' is not under version control"),
-           svn_path_local_style(target, pool));
-      
+      SVN_ERR(svn_wc__entry_versioned(&node, target, adm_access, FALSE, pool));
+
       SVN_ERR(svn_client__get_revision_number
               (&revnum, NULL, revision, target, pool));
 
@@ -1104,13 +1093,8 @@
                                      FALSE, recurse ? -1 : 0,
                                      ctx->cancel_func, ctx->cancel_baton,
                                      pool));
-      SVN_ERR(svn_wc_entry(&node, target, adm_access, FALSE, pool));
-      if (! node)
-        return svn_error_createf 
-          (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-           _("'%s' is not under version control"),
-           svn_path_local_style(target, pool));
-      
+      SVN_ERR(svn_wc__entry_versioned(&node, target, adm_access, FALSE, pool));
+
       SVN_ERR(svn_client__get_revision_number
               (&revnum, NULL, revision, target, pool));
 
Index: subversion/libsvn_client/ra.c
===================================================================
--- subversion/libsvn_client/ra.c	(revision 23911)
+++ subversion/libsvn_client/ra.c	(working copy)
@@ -26,14 +26,15 @@
 #include "svn_string.h"
 #include "svn_sorts.h"
 #include "svn_ra.h"
-#include "svn_wc.h"
 #include "svn_client.h"
 #include "svn_path.h"
 #include "svn_props.h"
 #include "client.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
+
 
 static svn_error_t *
 open_admin_tmp_file(apr_file_t **fp,
@@ -175,11 +176,8 @@
   const svn_wc_entry_t *entry;
   const char *full_path = svn_path_join(cb->base_dir, path, pool);
 
-  SVN_ERR(svn_wc_entry(&entry, full_path, cb->base_access, FALSE, pool));
-  if (! entry)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"),
-                             svn_path_local_style(full_path, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, full_path, cb->base_access, FALSE,
+                                 pool));
 
   SVN_ERR(svn_wc_adm_retrieve(&adm_access, cb->base_access,
                               (entry->kind == svn_node_dir
@@ -351,14 +349,9 @@
 {
   const svn_wc_entry_t *entry;
 
-  SVN_ERR(svn_wc_entry(&entry, path, adm_access,
-                       TRUE,  /* show deleted */ pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access,
+                                 TRUE,  /* show deleted */ pool));
 
-  if (! entry)
-    return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
-                             _("Can't find entry for '%s'"),
-                             svn_path_local_style(path, pool));
-
   if (entry->uuid)
     {
       *uuid = entry->uuid;
Index: subversion/libsvn_client/cat.c
===================================================================
--- subversion/libsvn_client/cat.c	(revision 23911)
+++ subversion/libsvn_client/cat.c	(working copy)
@@ -2,7 +2,7 @@
  * cat.c:  implementation of the 'cat' command
  *
  * ====================================================================
- * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -34,6 +34,7 @@
 #include "client.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -66,14 +67,8 @@
          revision->kind == svn_opt_revision_committed ||
          revision->kind == svn_opt_revision_unspecified);
 
-  SVN_ERR(svn_wc_entry(&entry, path, adm_access, FALSE, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, FALSE, pool));
 
-  if (! entry)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control "
-                               "or doesn't exist"),
-                             svn_path_local_style(path, pool));
-
   if (entry->kind != svn_node_file)
     return svn_error_createf(SVN_ERR_CLIENT_IS_DIRECTORY, NULL,
                              _("'%s' refers to a directory"),
Index: subversion/libsvn_client/locking_commands.c
===================================================================
--- subversion/libsvn_client/locking_commands.c	(revision 23911)
+++ subversion/libsvn_client/locking_commands.c	(working copy)
@@ -29,6 +29,7 @@
 #include "svn_pools.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -251,13 +252,9 @@
           abs_path = svn_path_join
             (svn_wc_adm_access_path(*parent_adm_access_p), target, subpool);
 
-          SVN_ERR(svn_wc_entry(&entry, abs_path, *parent_adm_access_p, FALSE,
-                               subpool));
+          SVN_ERR(svn_wc__entry_versioned(&entry, abs_path,
+                                         *parent_adm_access_p, FALSE, subpool));
 
-          if (! entry)
-            return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                                     _("'%s' is not under version control"), 
-                                     svn_path_local_style(target, pool));
           if (! entry->url)
             return svn_error_createf(SVN_ERR_ENTRY_MISSING_URL, NULL,
                                      _("'%s' has no URL"),
Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c	(revision 23911)
+++ subversion/libsvn_client/diff.c	(working copy)
@@ -25,7 +25,6 @@
 #include <apr_strings.h>
 #include <apr_pools.h>
 #include <apr_hash.h>
-#include "svn_wc.h"
 #include "svn_delta.h"
 #include "svn_diff.h"
 #include "svn_client.h"
@@ -42,6 +41,7 @@
 #include <assert.h>
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 /*
  * Constant separator strings
@@ -2787,11 +2787,8 @@
                                  ctx->cancel_func, ctx->cancel_baton,
                                  pool));
 
-  SVN_ERR(svn_wc_entry(&entry, target_wcpath, adm_access, FALSE, pool));
-  if (entry == NULL)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"), 
-                             svn_path_local_style(target_wcpath, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, target_wcpath, adm_access, FALSE,
+                                 pool));
 
   merge_cmd_baton.force = force;
   merge_cmd_baton.dry_run = dry_run;
@@ -2915,11 +2912,8 @@
                                  ctx->cancel_func, ctx->cancel_baton,
                                  pool));
 
-  SVN_ERR(svn_wc_entry(&entry, target_wcpath, adm_access, FALSE, pool));
-  if (entry == NULL)
-    return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                             _("'%s' is not under version control"), 
-                             svn_path_local_style(target_wcpath, pool));
+  SVN_ERR(svn_wc__entry_versioned(&entry, target_wcpath, adm_access, FALSE,
+                                 pool));
 
   merge_cmd_baton.force = force;
   merge_cmd_baton.dry_run = dry_run;
Index: subversion/libsvn_client/copy.c
===================================================================
--- subversion/libsvn_client/copy.c	(revision 23911)
+++ subversion/libsvn_client/copy.c	(working copy)
@@ -24,7 +24,6 @@
 
 #include <string.h>
 #include <assert.h>
-#include "svn_wc.h"
 #include "svn_client.h"
 #include "svn_error.h"
 #include "svn_path.h"
@@ -35,6 +34,7 @@
 #include "client.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Code. ***/
@@ -1484,17 +1484,10 @@
                                                  ctx->cancel_func,
                                                  ctx->cancel_baton, 
                                                  iterpool));
-                  SVN_ERR(svn_wc_entry(&entry, pair->src, adm_access,
-                                       FALSE,
-                                       iterpool));
+                  SVN_ERR(svn_wc__entry_versioned(&entry, pair->src, adm_access,
+                                                 FALSE, iterpool));
                   SVN_ERR(svn_wc_adm_close(adm_access));
 
-                  if (! entry)
-                    return svn_error_createf
-                      (SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                       _("'%s' is not under version control"),
-                       svn_path_local_style(pair->src, pool));
-
                   if (! entry->url)
                     return svn_error_createf
                       (SVN_ERR_ENTRY_MISSING_URL, NULL,
Index: subversion/libsvn_client/log.c
===================================================================
--- subversion/libsvn_client/log.c	(revision 23911)
+++ subversion/libsvn_client/log.c	(working copy)
@@ -35,6 +35,7 @@
 #include "svn_path.h"
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 
 /*** Getting update information ***/
@@ -127,12 +128,9 @@
           SVN_ERR(svn_wc_adm_probe_open3(&adm_access, NULL, target,
                                          FALSE, 0, ctx->cancel_func,
                                          ctx->cancel_baton, pool));
-          SVN_ERR(svn_wc_entry(&entry, target, adm_access, FALSE, pool));
-          if (! entry)
-            return svn_error_createf(SVN_ERR_UNVERSIONED_RESOURCE, NULL,
-                                     _("'%s' is not under version control"),
-                                     svn_path_local_style(target, pool));
-          
+          SVN_ERR(svn_wc__entry_versioned(&entry, target, adm_access, FALSE,
+                                         pool));
+
           if (! entry->url)
             return svn_error_createf
               (SVN_ERR_ENTRY_MISSING_URL, NULL,
Index: subversion/libsvn_client/commit_util.c
===================================================================
--- subversion/libsvn_client/commit_util.c	(revision 23911)
+++ subversion/libsvn_client/commit_util.c	(working copy)
@@ -28,7 +28,6 @@
 #include "svn_path.h"
 #include "svn_types.h"
 #include "svn_pools.h"
-#include "svn_wc.h"
 #include "svn_props.h"
 #include "svn_md5.h"
 
@@ -36,6 +35,7 @@
 #include <stdlib.h>  /* for qsort() */
 
 #include "svn_private_config.h"
+#include "private/svn_wc_private.h"
 
 /*** Uncomment this to turn on commit driver debugging. ***/
 /*
@@ -702,11 +702,8 @@
       /* No entry?  This TARGET isn't even under version control! */
       SVN_ERR(svn_wc_adm_probe_retrieve(&adm_access, parent_dir,
                                         target, subpool));
-      SVN_ERR(svn_wc_entry(&entry, target, adm_access, FALSE, subpool));
-      if (! entry)
-        return svn_error_createf
-          (SVN_ERR_ENTRY_NOT_FOUND, NULL,
-           _("'%s' is not under version control"), target);
+      SVN_ERR(svn_wc__entry_versioned(&entry, target, adm_access, FALSE,
+                                     subpool));
       if (! entry->url)
         return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL, 
                                  _("Entry for '%s' has no URL"),
@@ -844,13 +841,9 @@
       svn_pool_clear(iterpool);
 
       /* Read the entry for this SRC. */
-      SVN_ERR(svn_wc_entry(&entry, pair->src, adm_access, FALSE, iterpool));
-      if (! entry)
-        return svn_error_createf
-          (SVN_ERR_ENTRY_NOT_FOUND, NULL,
-           _("'%s' is not under version control"),
-           svn_path_local_style(pair->src, iterpool));
-      
+      SVN_ERR(svn_wc__entry_versioned(&entry, pair->src, adm_access, FALSE,
+                                     iterpool));
+
       /* Get the right access baton for this SRC. */
       if (entry->kind == svn_node_dir)
         SVN_ERR(svn_wc_adm_retrieve(&dir_access, adm_access, pair->src,
Index: subversion/tests/cmdline/cat_tests.py
===================================================================
--- subversion/tests/cmdline/cat_tests.py	(revision 23911)
+++ subversion/tests/cmdline/cat_tests.py	(working copy)
@@ -106,7 +106,7 @@
     item_to_cat = os.path.join(dir_path, file)
     if item_to_cat == new_file_path:
       expected_err = ["svn: warning: '" + item_to_cat + "'" + \
-                     " is not under version control or doesn't exist\n"]
+                     " is not under version control\n"]
       svntest.actions.run_and_verify_svn(None, None, expected_err,
                                          'cat', item_to_cat)
     elif os.path.isdir(item_to_cat):
@@ -129,7 +129,7 @@
                                      'cat', rho_path, G_path)
 
   expected_err2 = ["svn: warning: '" + new_file_path + "'"
-                   + " is not under version control or doesn't exist\n"]
+                   + " is not under version control\n"]
   svntest.actions.run_and_verify_svn(None, expected_out, expected_err2,
                                      'cat', rho_path, new_file_path)
 
Index: subversion/tests/cmdline/lock_tests.py
===================================================================
--- subversion/tests/cmdline/lock_tests.py	(revision 23911)
+++ subversion/tests/cmdline/lock_tests.py	(working copy)
@@ -739,7 +739,7 @@
                                        '--password', svntest.main.wc_passwd,
                                        '-m', '', file_path)
 
-  error_msg = "'foo' is not under version control"
+  error_msg = "foo' is not under version control"
   for line in error:
     if line.find(error_msg) != -1:
       break
