subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1654698 - /subversion/trunk/subversion/libsvn_wc/wc_db.c
Date Sun, 25 Jan 2015 20:12:48 GMT
Author: rhuijben
Date: Sun Jan 25 20:12:48 2015
New Revision: 1654698

URL: http://svn.apache.org/r1654698
Log:
Following up on r1652157, stop setting the WCROOT for each and every child
directory to the new ancestor as there are cases where this breaks things.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_init): Clear the cached wcroot for descendants instead of
    overwriting them. Set the node itself last to avoid clearing it.

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

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1654698&r1=1654697&r2=1654698&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Sun Jan 25 20:12:48 2015
@@ -1591,19 +1591,32 @@ svn_wc__db_init(svn_wc__db_t *db,
                         FALSE /* auto-upgrade */,
                         db->state_pool, scratch_pool));
 
-  /* The WCROOT is complete. Stash it into DB.  */
-  svn_hash_sets(db->dir_data, wcroot->abspath, wcroot);
+  /* Any previously cached children may now have a new WCROOT, most likely that
+     of the new WCROOT, but there might be descendant directories that are their
+     own working copy, in which case setting WCROOT to our new WCROOT might
+     actually break things for those.
+
+     Clearing is the safest thing we can do in this case, as a test would lead
+     to unnecessary probing, while the standard code probes later anyway. So we
+     only lose a bit of memory
 
-  /* Any previously cached children now have a new WCROOT. */
+     ### Perhaps we could check wcroot->abspath to detect which case we have
+         where, but currently it is already very hard to trigger this from
+         the short living 'svn' client. (GUI clients like TortoiseSVN are far
+         more likely to get in these cases)
+     */
   for (hi = apr_hash_first(scratch_pool, db->dir_data);
        hi;
        hi = apr_hash_next(hi))
     {
       const char *abspath = apr_hash_this_key(hi);
       if (svn_dirent_is_ancestor(wcroot->abspath, abspath))
-        svn_hash_sets(db->dir_data, abspath, wcroot);
+        svn_hash_sets(db->dir_data, abspath, NULL);
     }
 
+  /* The WCROOT is complete. Stash it into DB.  */
+  svn_hash_sets(db->dir_data, wcroot->abspath, wcroot);
+
   return SVN_NO_ERROR;
 }
 



Mime
View raw message