Author: hwright
Date: Fri Jan 13 14:06:03 2012
New Revision: 1231076
URL: http://svn.apache.org/viewvc?rev=1231076&view=rev
Log:
Ev2 shims: Fix the rest of the lock test failures.
This is a hack upon a hack. The way we say "unlock" to a working copy is
by sending a prop delete on a non-existant property. But since that property
doesn't exist in the first place, we weren't registering the delete correctly.
To "fix" the problem, we inject a false lock token when running update, and
then see if it's been deleted.
This is quite inefficient, and hopefully won't live too long (this is supposed
to be compatibility code, after all), but given Ev2's design, I'm not really
sure what the long term solution is.
Current number of failing Ev2 tests: 86
* subversion/libsvn_wc/update_editor.c
(fetch_props_func): New.
(make_editor): Use the file-private function to fetch props.
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1231076&r1=1231075&r2=1231076&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Fri Jan 13 14:06:03
2012
@@ -4716,6 +4716,46 @@ close_edit(void *edit_baton,
}
+static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+ void *baton,
+ const char *path,
+ svn_revnum_t base_revision,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ struct svn_wc__shim_fetch_baton_t *sfb = baton;
+ const char *local_abspath = svn_dirent_join(sfb->base_abspath, path,
+ scratch_pool);
+ svn_error_t *err;
+
+ if (sfb->fetch_base)
+ err = svn_wc__db_base_get_props(props, sfb->db, local_abspath, result_pool,
+ scratch_pool);
+ else
+ err = svn_wc__db_read_props(props, sfb->db, local_abspath,
+ result_pool, scratch_pool);
+
+ /* If the path doesn't exist, just return an empty set of props. */
+ if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+ {
+ svn_error_clear(err);
+ *props = apr_hash_make(result_pool);
+ }
+ else if (err)
+ return svn_error_trace(err);
+
+ /* Add a bogus LOCK_TOKEN if we don't already have one, so as to catch
+ any deletions thereto. */
+ if (!apr_hash_get(*props, SVN_PROP_ENTRY_LOCK_TOKEN, APR_HASH_KEY_STRING))
+ {
+ apr_hash_set(*props, SVN_PROP_ENTRY_LOCK_TOKEN, APR_HASH_KEY_STRING,
+ svn_string_create("This is completely bogus", result_pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
/*** Returning editors. ***/
@@ -4992,7 +5032,7 @@ make_editor(svn_revnum_t *target_revisio
sfb->fetch_base = TRUE;
shim_callbacks->fetch_kind_func = svn_wc__fetch_kind_func;
- shim_callbacks->fetch_props_func = svn_wc__fetch_props_func;
+ shim_callbacks->fetch_props_func = fetch_props_func;
shim_callbacks->fetch_base_func = svn_wc__fetch_base_func;
shim_callbacks->fetch_baton = sfb;