Author: julianfoad
Date: Wed Jul  7 12:59:43 2010
New Revision: 961362

URL: http://svn.apache.org/viewvc?rev=961362&view=rev
Log:
Fix some 1.6-compatibility code.

* subversion/include/svn_wc.h
  (svn_wc_is_wc_root2, svn_wc_is_wc_root): In the doc strings, fix the
    parameter names and move the note about an empty path to the deprecated
    function as it is not relevant to the new function.

* subversion/libsvn_wc/deprecated.c
  (svn_wc_is_wc_root): Return TRUE in cases where v1.6 did.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_wc/deprecated.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=961362&r1=961361&r2=961362&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Wed Jul  7 12:59:43 2010
@@ -5235,19 +5235,16 @@ svn_wc_crawl_revisions(const char *path,
 
 /* Updates. */
 
-/** Set @a *wc_root to @c TRUE if @a path represents a "working copy root",
- * @c FALSE otherwise. Here, @a path is a "working copy root" if its parent
- * directory is not a WC or if its parent directory's repository URL is not
- * the parent of its own repository URL. Thus, a switched subtree is
+/** Set @a *wc_root to @c TRUE if @a local_abspath represents a "working copy
+ * root", @c FALSE otherwise. Here, @a local_abspath is a "working copy root"
+ * if its parent directory is not a WC or if its parent directory's repository
+ * URL is not the parent of its own repository URL. Thus, a switched subtree is
  * considered to be a working copy root. Also, a deleted tree-conflict
  * victim is considered a "working copy root" because it has no URL.
  *
- * If @a path is not found, return the error #SVN_ERR_ENTRY_NOT_FOUND.
+ * If @a local_abspath is not found, return the error #SVN_ERR_ENTRY_NOT_FOUND.
  *
- * Use @a pool for any intermediate allocations.
- *
- * @note Due to the way in which "WC-root-ness" is calculated, passing
- * a @a path of `.' to this function will always return @c TRUE.
+ * Use @a scratch_pool for any temporary allocations.
  *
  * @since New in 1.7.
  */
@@ -5261,6 +5258,8 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
  * Similar to svn_wc_is_wc_root2(), but with an access baton and relative
  * path.
  *
+ * @note If @a path is '', this function will always return @c TRUE.
+ *
  * @deprecated Provided for backward compatibility with the 1.6 API.
  */
 SVN_DEPRECATED

Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=961362&r1=961361&r2=961362&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Wed Jul  7 12:59:43 2010
@@ -2850,6 +2850,13 @@ svn_wc_is_wc_root(svn_boolean_t *wc_root
   const char *local_abspath;
   svn_error_t *err;
 
+  /* Subversion <= 1.6 said that '.' or a drive root is a WC root. */
+  if (svn_path_is_empty(path) || svn_dirent_is_root(path, strlen(path)))
+    {
+      *wc_root = TRUE;
+      return SVN_NO_ERROR;
+    }
+
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
   SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL /* config */,
                                          svn_wc__adm_get_db(adm_access),
@@ -2861,9 +2868,9 @@ svn_wc_is_wc_root(svn_boolean_t *wc_root
       && (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY
           || err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND))
     {
-      /* Subversion <= 1.6 just said that a not versioned path is not a root */
+      /* Subversion <= 1.6 said that an unversioned path is a WC root. */
       svn_error_clear(err);
-      *wc_root = FALSE;
+      *wc_root = TRUE;
     }
   else
     SVN_ERR(err);


Reply via email to