You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/06/24 18:20:49 UTC

svn commit: r1496111 - /subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c

Author: stsp
Date: Mon Jun 24 16:20:49 2013
New Revision: 1496111

URL: http://svn.apache.org/r1496111
Log:
Follow-up to r1496007:

* subversion/libsvn_wc/wc_db_wcroot.c
  (svn_wc__db_wcroot_parse_local_abspath): If a WCROOT was discovered via a
    symlink, cache it only under the symlink path, not under both the symlink
    path and the symlink target path. This function is supposed to maintain
    a 1:1 mapping between WCROOT objects and paths.

Suggested by: rhuijben

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c?rev=1496111&r1=1496110&r2=1496111&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c Mon Jun 24 16:20:49 2013
@@ -757,6 +757,13 @@ try_symlink_as_dir:
     {
       const char *dir_relpath;
 
+      if (symlink_wcroot_abspath)
+        {
+          /* The WCROOT was found through a symlink pointing at the root of
+           * the WC. Cache the WCROOT under the symlink's path. */
+          local_dir_abspath = symlink_wcroot_abspath;
+        }
+
       /* The subdirectory's relpath is easily computed relative to the
          wcroot that we just found.  */
       dir_relpath = compute_relpath(*wcroot, local_dir_abspath, NULL);
@@ -837,15 +844,6 @@ try_symlink_as_dir:
                 apr_pstrdup(db->state_pool, local_dir_abspath),
                 *wcroot);
 
-  /* If the WCROOT was found through a symlink pointing at the root of
-   * the WC, its cache entry is now keyed on the link's target path.
-   * Cache the WCROOT under the symlink's path as well. Otherwise, future
-   * wcroot queries for the symlink path would construct a fresh wcroot. */
-  if (symlink_wcroot_abspath)
-    svn_hash_sets(db->dir_data,
-                  apr_pstrdup(db->state_pool, symlink_wcroot_abspath),
-                  *wcroot);
-
   /* Did we traverse up to parent directories?  */
   if (!moved_upwards)
     {