You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2015/01/15 17:11:57 UTC
svn commit: r1652157 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c
tests/cmdline/externals_tests.py
Author: philip
Date: Thu Jan 15 16:11:57 2015
New Revision: 1652157
URL: http://svn.apache.org/r1652157
Log:
Fix issue 4550, failed to run workqueue item due to earlier use of
wrong wcroot.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_init): Update wcroot cache.
* subversion/tests/cmdline/externals_tests.py
(replace_tree_with_foreign_external): Remove XFAIL.
Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/cmdline/externals_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1652157&r1=1652156&r2=1652157&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jan 15 16:11:57 2015
@@ -1561,6 +1561,7 @@ svn_wc__db_init(svn_wc__db_t *db,
svn_wc__db_wcroot_t *wcroot;
svn_boolean_t sqlite_exclusive = FALSE;
apr_int32_t sqlite_timeout = 0; /* default timeout */
+ apr_hash_index_t *hi;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
SVN_ERR_ASSERT(repos_relpath != NULL);
@@ -1593,6 +1594,16 @@ svn_wc__db_init(svn_wc__db_t *db,
/* The WCROOT is complete. Stash it into DB. */
svn_hash_sets(db->dir_data, wcroot->abspath, wcroot);
+ /* Any previously cached children now have a new WCROOT. */
+ 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);
+ }
+
return SVN_NO_ERROR;
}
Modified: subversion/trunk/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/externals_tests.py?rev=1652157&r1=1652156&r2=1652157&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/externals_tests.py Thu Jan 15 16:11:57 2015
@@ -3506,7 +3506,6 @@ def copy_file_external_to_repo(sbox):
expected_output, expected_disk, None)
@Issue(4550)
-@XFail()
def replace_tree_with_foreign_external(sbox):
"replace tree with foreign external"
Re: svn commit: r1652157 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/cmdline/externals_tests.py
Posted by Philip Martin <ph...@codematters.co.uk>.
Philip Martin <ph...@wandisco.com> writes:
>> + /* Any previously cached children now have a new WCROOT. */
>> + 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);
>> + }
>> +
>> return SVN_NO_ERROR;
>> }
>
> This fixes the issue but I'm wondering if I should remove the entries
> rather than update them. Is it wrong for db->dir_cache to have entries
> for paths that are not directories and do not exist?
It is always possible for the disk tree to change outside of Subversion
so that entries in db->dir_cache refer to paths that are no longer
directories or no longer exist. I suppose that means there should be no
bad effects updating these child entries rather than removing them.
--
Philip
Re: svn commit: r1652157 - in /subversion/trunk/subversion: libsvn_wc/wc_db.c tests/cmdline/externals_tests.py
Posted by Philip Martin <ph...@wandisco.com>.
philip@apache.org writes:
> Author: philip
> Date: Thu Jan 15 16:11:57 2015
> New Revision: 1652157
>
> URL: http://svn.apache.org/r1652157
> Log:
> Fix issue 4550, failed to run workqueue item due to earlier use of
> wrong wcroot.
>
> * subversion/libsvn_wc/wc_db.c
> (svn_wc__db_init): Update wcroot cache.
>
> @@ -1593,6 +1594,16 @@ svn_wc__db_init(svn_wc__db_t *db,
> /* The WCROOT is complete. Stash it into DB. */
> svn_hash_sets(db->dir_data, wcroot->abspath, wcroot);
>
> + /* Any previously cached children now have a new WCROOT. */
> + 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);
> + }
> +
> return SVN_NO_ERROR;
> }
This fixes the issue but I'm wondering if I should remove the entries
rather than update them. Is it wrong for db->dir_cache to have entries
for paths that are not directories and do not exist?
--
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*