You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/11/22 19:53:58 UTC

svn commit: r1412638 - in /subversion/trunk/subversion/libsvn_wc: update_editor.c wc.h

Author: rhuijben
Date: Thu Nov 22 18:53:57 2012
New Revision: 1412638

URL: http://svn.apache.org/viewvc?rev=1412638&view=rev
Log:
Revert a behavior change of svn_wc_is_wc_root2() that was merged in from the
inherited properties branch in r1395109.

The inherited properties code liked the changed behavior more than the
original behavior, but that code uses the internal api now.
(And we shouldn't change the behavior of public apis...)

* subversion/libsvn_wc/update_editor.c
  (svn_wc__internal_is_wc_root): Integrate into...
  (svn_wc_is_wc_root2): ... this, and document why there is no internal version.
    Revert the behavior to the behavior before r1395109.

* subversion/libsvn_wc/wc.h
  (svn_wc__internal_is_wc_root): Remove function.

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

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1412638&r1=1412637&r2=1412638&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Nov 22 18:53:57 2012
@@ -5004,11 +5004,14 @@ svn_wc__check_wc_root(svn_boolean_t *wc_
                                    scratch_pool));
 }
 
+/* This function has no internal variant as its behavior on switched
+   non-directories is not what you would expect. But this happens to
+   be the legacy behavior of this function. */
 svn_error_t *
-svn_wc__internal_is_wc_root(svn_boolean_t *wc_root,
-                            svn_wc__db_t *db,
-                            const char *local_abspath,
-                            apr_pool_t *scratch_pool)
+svn_wc_is_wc_root2(svn_boolean_t *wc_root,
+                   svn_wc_context_t *wc_ctx,
+                   const char *local_abspath,
+                   apr_pool_t *scratch_pool)
 {
   svn_boolean_t is_root;
   svn_boolean_t is_switched;
@@ -5017,7 +5020,7 @@ svn_wc__internal_is_wc_root(svn_boolean_
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
   err = svn_wc__check_wc_root(&is_root, &kind, &is_switched,
-                              db, local_abspath, scratch_pool);
+                              wc_ctx->db, local_abspath, scratch_pool);
 
   if (err)
     {
@@ -5028,22 +5031,11 @@ svn_wc__internal_is_wc_root(svn_boolean_
       return svn_error_create(SVN_ERR_ENTRY_NOT_FOUND, err, err->message);
     }
 
-  *wc_root = is_root || is_switched;
+  *wc_root = is_root || (kind == svn_kind_dir && is_switched);
 
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_wc_is_wc_root2(svn_boolean_t *wc_root,
-                   svn_wc_context_t *wc_ctx,
-                   const char *local_abspath,
-                   apr_pool_t *scratch_pool)
-{
-  return svn_error_trace(svn_wc__internal_is_wc_root(wc_root, wc_ctx->db,
-                                                     local_abspath,
-                                                     scratch_pool));
-}
-
 svn_error_t*
 svn_wc__strictly_is_wc_root(svn_boolean_t *wc_root,
                             svn_wc_context_t *wc_ctx,

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1412638&r1=1412637&r2=1412638&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Thu Nov 22 18:53:57 2012
@@ -616,14 +616,6 @@ svn_wc__internal_get_iprops(apr_array_he
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool);
 
-/* Internal version of svn_wc_is_wc_root2() */
-svn_error_t *
-svn_wc__internal_is_wc_root(svn_boolean_t *wc_root,
-                            svn_wc__db_t *db,
-                            const char *local_abspath,
-                            apr_pool_t *scratch_pool);
-
-
 /* Upgrade the wc sqlite database given in SDB for the wc located at
    WCROOT_ABSPATH. It's current/starting format is given by START_FORMAT.
    After the upgrade is complete (to as far as the automatic upgrade will