Author: rhuijben
Date: Fri Mar 6 00:18:33 2015
New Revision: 1664531
URL: http://svn.apache.org/r1664531
Log:
Make the entries dump tool used by our test tool use a newer wc api to
see if a directory has a working copy lock to avoid opening and closing
wc.db an extra time per directory, while we have an existing connection
(and transaction) open.
On Windows this resolves a 14 second delay in the testsuite on the new
upgrade_tests.py test with a read only wc.db.
It appears that Sqlite tries to open sqlite databases writable for some
time before giving up on Windows.
* subversion/tests/cmdline/entries-dump.c
(entries_dump): Create wc context to allow using the svn_wc_locked2
api, which can access the db directly.
Modified:
subversion/trunk/subversion/tests/cmdline/entries-dump.c
Modified: subversion/trunk/subversion/tests/cmdline/entries-dump.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/entries-dump.c?rev=1664531&r1=1664530&r2=1664531&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/entries-dump.c (original)
+++ subversion/trunk/subversion/tests/cmdline/entries-dump.c Fri Mar 6
00:18:33 2015
@@ -74,12 +74,19 @@ entries_dump(const char *dir_path, svn_w
apr_hash_index_t *hi;
svn_boolean_t locked;
svn_error_t *err;
+ svn_wc_context_t *wc_ctx = NULL;
+ const char *dir_abspath;
err = svn_wc_adm_open3(&adm_access, related, dir_path, FALSE, 0,
NULL, NULL, pool);
if (!err)
{
- SVN_ERR(svn_wc_locked(&locked, dir_path, pool));
+ SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL,
+ svn_wc__adm_get_db(adm_access),
+ pool));
+ SVN_ERR(svn_dirent_get_absolute(&dir_abspath, dir_path, pool));
+
+ SVN_ERR(svn_wc_locked2(NULL, &locked, wc_ctx, dir_abspath, pool));
SVN_ERR(svn_wc_entries_read(&entries, adm_access, TRUE, pool));
}
else if (err && err->apr_err == SVN_ERR_WC_LOCKED
@@ -88,7 +95,13 @@ entries_dump(const char *dir_path, svn_w
{
/* Common caller error: Can't open a baton when there is one. */
svn_error_clear(err);
- SVN_ERR(svn_wc_locked(&locked, dir_path, pool));
+
+ SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL,
+ svn_wc__adm_get_db(related),
+ pool));
+ SVN_ERR(svn_dirent_get_absolute(&dir_abspath, dir_path, pool));
+
+ SVN_ERR(svn_wc_locked2(NULL, &locked, wc_ctx, dir_abspath, pool));
SVN_ERR(svn_wc_entries_read(&entries, related, TRUE, pool));
}
else
@@ -161,6 +174,9 @@ entries_dump(const char *dir_path, svn_w
printf("entries['%s'] = e\n", (const char *)key);
}
+ if (wc_ctx)
+ SVN_ERR(svn_wc_context_destroy(wc_ctx));
+
if (adm_access)
SVN_ERR(svn_wc_adm_close2(adm_access, pool));