Author: rhuijben
Date: Thu Jul 8 09:38:14 2010
New Revision: 961681
URL: http://svn.apache.org/viewvc?rev=961681&view=rev
Log:
When adding/replacing a base node in wc.db from the update editor, also
update its dav_cache properties in the same transaction.
* subversion/libsvn_wc/update_editor.c
(close_directory): Rename variable. Pass dav_props to
svn_wc__db_base_add_directory() instead of calling
svn_wc__db_base_set_dav_cache().
(close_file): Rename variable. Pass dav_props to
svn_wc__db_base_add_file() instead of calling
svn_wc__db_base_set_dav_cache().
* subversion/libsvn_wc/wc-queries.sql
(STMT_INSERT_BASE_NODE): Allow setting dav_cache instead of
only clearing its value.
* subversion/libsvn_wc/wc_db.c
(insert_base_baton_t): Name struct and add dav_cache.
(insert_base_node): If dav_cache is set bind its value.
(svn_wc__db_base_add_directory): Handle dav_cache argument.
(svn_wc__db_base_add_file): Handle dav_cache argument.
(svn_wc__db_base_add_symlink): Handle dav_cache argument.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_base_add_directory): Add dav_cache argument.
(svn_wc__db_base_add_file): Add dav_cache argument.
(svn_wc__db_base_add_symlink): Add dav_cache argument.
* subversion/tests/libsvn_wc/db-test.c
(test_inserting_nodes): Update caller.
Modified:
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/libsvn_wc/wc_db.h
subversion/trunk/subversion/tests/libsvn_wc/db-test.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=961681&r1=961680&r2=961681&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Jul 8 09:38:14
2010
@@ -2963,7 +2963,7 @@ close_directory(void *dir_baton,
struct dir_baton *db = dir_baton;
struct edit_baton *eb = db->edit_baton;
svn_wc_notify_state_t prop_state = svn_wc_notify_state_unknown;
- apr_array_header_t *entry_props, *wc_props, *regular_props;
+ apr_array_header_t *entry_props, *dav_props, *regular_props;
apr_hash_t *base_props;
apr_hash_t *actual_props;
apr_hash_t *new_base_props = NULL, *new_actual_props = NULL;
@@ -2986,7 +2986,7 @@ close_directory(void *dir_baton,
return SVN_NO_ERROR;
}
- SVN_ERR(svn_categorize_props(db->propchanges, &entry_props, &wc_props,
+ SVN_ERR(svn_categorize_props(db->propchanges, &entry_props, &dav_props,
®ular_props, pool));
/* Fetch the existing properties. */
@@ -3041,7 +3041,7 @@ close_directory(void *dir_baton,
/* If this directory has property changes stored up, now is the time
to deal with them. */
- if (regular_props->nelts || entry_props->nelts || wc_props->nelts)
+ if (regular_props->nelts || entry_props->nelts || dav_props->nelts)
{
if (regular_props->nelts)
{
@@ -3184,6 +3184,9 @@ close_directory(void *dir_baton,
changed_rev, changed_date, changed_author,
NULL /* children */,
depth,
+ (dav_props && dav_props->nelts > 0)
+ ? prop_hash_from_array(dav_props, pool)
+ : NULL,
NULL /* conflict */,
work_items,
pool));
@@ -3217,15 +3220,6 @@ close_directory(void *dir_baton,
work_items,
pool));
}
-
- /* Handle the wcprops. */
- if (wc_props && wc_props->nelts > 0)
- {
- SVN_ERR(svn_wc__db_base_set_dav_cache(eb->db, db->local_abspath,
- prop_hash_from_array(wc_props,
- pool),
- pool));
- }
}
/* Process all of the queued work items for this directory. */
@@ -4956,7 +4950,7 @@ close_file(void *file_baton,
apr_hash_t *new_base_props = NULL;
apr_hash_t *new_actual_props = NULL;
apr_array_header_t *entry_props;
- apr_array_header_t *wc_props;
+ apr_array_header_t *dav_props;
apr_array_header_t *regular_props;
svn_boolean_t install_pristine;
const char *install_from = NULL;
@@ -5026,7 +5020,7 @@ close_file(void *file_baton,
svn_dirent_local_style(fb->local_abspath, pool));
/* Gather the changes for each kind of property. */
- SVN_ERR(svn_categorize_props(fb->propchanges, &entry_props, &wc_props,
+ SVN_ERR(svn_categorize_props(fb->propchanges, &entry_props, &dav_props,
®ular_props, pool));
/* Extract the changed_* and lock state information. */
@@ -5389,16 +5383,13 @@ close_file(void *file_baton,
new_changed_author,
new_checksum,
SVN_INVALID_FILESIZE,
+ (dav_props && dav_props->nelts > 0)
+ ? prop_hash_from_array(dav_props, pool)
+ : NULL,
NULL /* conflict */,
all_work_items,
pool));
- /* This writes a whole bunch of log commands to install wcprops. */
- /* ### no it doesn't. this immediately modifies them. */
- SVN_ERR(svn_wc__db_base_set_dav_cache(eb->db, fb->local_abspath,
- prop_hash_from_array(wc_props, pool),
- pool));
-
/* ### ugh. deal with preserving the file external value in the database.
### there is no official API, so we do it this way. maybe we should
### have a temp API into wc_db. */
Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=961681&r1=961680&r2=961681&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Jul 8 09:38:14
2010
@@ -73,9 +73,9 @@ insert into repository (root, uuid) valu
insert or replace into base_node (
wc_id, local_relpath, repos_id, repos_relpath, parent_relpath, presence,
kind, revnum, properties, changed_rev, changed_date, changed_author,
- depth, checksum, translated_size, symlink_target)
+ depth, checksum, translated_size, symlink_target, dav_cache)
values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14,
- ?15, ?16);
+ ?15, ?16, ?17);
-- STMT_INSERT_BASE_NODE_INCOMPLETE
insert or ignore into base_node (
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=961681&r1=961680&r2=961681&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Jul 8 09:38:14 2010
@@ -126,7 +126,7 @@
#define LIKE_ESCAPE_CHAR "#"
-typedef struct {
+typedef struct insert_base_baton_t {
/* common to all insertions into BASE */
svn_wc__db_status_t status;
svn_wc__db_kind_t kind;
@@ -141,6 +141,7 @@ typedef struct {
svn_revnum_t changed_rev;
apr_time_t changed_date;
const char *changed_author;
+ apr_hash_t *dav_cache;
/* for inserting directories */
const apr_array_header_t *children;
@@ -673,6 +674,10 @@ insert_base_node(void *baton, svn_sqlite
SVN_ERR(svn_sqlite__bind_text(stmt, 16, pibb->target));
}
+ if (pibb->dav_cache)
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 17, pibb->dav_cache,
+ scratch_pool));
+
SVN_ERR(svn_sqlite__insert(NULL, stmt));
if (pibb->kind == svn_wc__db_kind_dir && pibb->children)
@@ -1353,6 +1358,7 @@ svn_wc__db_base_add_directory(svn_wc__db
const char *changed_author,
const apr_array_header_t *children,
svn_depth_t depth,
+ apr_hash_t *dav_cache,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool)
@@ -1399,6 +1405,7 @@ svn_wc__db_base_add_directory(svn_wc__db
ibb.children = children;
ibb.depth = depth;
+ ibb.dav_cache = dav_cache;
ibb.conflict = conflict;
ibb.work_items = work_items;
@@ -1429,6 +1436,7 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
const char *changed_author,
const svn_checksum_t *checksum,
svn_filesize_t translated_size,
+ apr_hash_t *dav_cache,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool)
@@ -1473,6 +1481,7 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
ibb.checksum = checksum;
ibb.translated_size = translated_size;
+ ibb.dav_cache = dav_cache;
ibb.conflict = conflict;
ibb.work_items = work_items;
@@ -1501,6 +1510,7 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
apr_time_t changed_date,
const char *changed_author,
const char *target,
+ apr_hash_t *dav_cache,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool)
@@ -1544,6 +1554,7 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
ibb.target = target;
+ ibb.dav_cache = dav_cache;
ibb.conflict = conflict;
ibb.work_items = work_items;
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=961681&r1=961680&r2=961681&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Thu Jul 8 09:38:14 2010
@@ -455,6 +455,9 @@ svn_wc__db_from_relpath(const char **loc
This subsystem does not use DEPTH, but it can be recorded here in
the BASE tree for higher-level code to use.
+ If DAV_CACHE is not NULL, sets LOCAL_ABSPATH's dav cache to the specified
+ data.
+
If CONFLICT is not NULL, then it describes a conflict for this node. The
node will be record as conflicted (in ACTUAL).
@@ -476,6 +479,7 @@ svn_wc__db_base_add_directory(svn_wc__db
const char *changed_author,
const apr_array_header_t *children,
svn_depth_t depth,
+ apr_hash_t *dav_cache,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -500,6 +504,9 @@ svn_wc__db_base_add_directory(svn_wc__db
by its properties) is known, then pass it as TRANSLATED_SIZE. Otherwise,
pass SVN_INVALID_FILESIZE.
+ If DAV_CACHE is not NULL, sets LOCAL_ABSPATH's dav cache to the specified
+ data.
+
If CONFLICT is not NULL, then it describes a conflict for this node. The
node will be record as conflicted (in ACTUAL).
@@ -521,6 +528,7 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
const char *changed_author,
const svn_checksum_t *checksum,
svn_filesize_t translated_size,
+ apr_hash_t *dav_cache,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
@@ -540,6 +548,9 @@ svn_wc__db_base_add_file(svn_wc__db_t *d
The target of the symlink is specified by TARGET.
+ If DAV_CACHE is not NULL, sets LOCAL_ABSPATH's dav cache to the specified
+ data.
+
If CONFLICT is not NULL, then it describes a conflict for this node. The
node will be record as conflicted (in ACTUAL).
@@ -588,6 +599,7 @@ svn_wc__db_base_add_symlink(svn_wc__db_t
apr_time_t changed_date,
const char *changed_author,
const char *target,
+ apr_hash_t *dav_cache,
const svn_skel_t *conflict,
const svn_skel_t *work_items,
apr_pool_t *scratch_pool);
Modified: subversion/trunk/subversion/tests/libsvn_wc/db-test.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/db-test.c?rev=961681&r1=961680&r2=961681&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/db-test.c Thu Jul 8 09:38:14
2010
@@ -681,7 +681,7 @@ test_inserting_nodes(apr_pool_t *pool)
props,
1, TIME_1a, AUTHOR_1,
children, svn_depth_infinity,
- NULL, NULL,
+ NULL, NULL, NULL,
pool));
/* Replace an incomplete node with a file node. */
@@ -692,7 +692,7 @@ test_inserting_nodes(apr_pool_t *pool)
props,
1, TIME_1a, AUTHOR_1,
checksum, 10,
- NULL, NULL,
+ NULL, NULL, NULL,
pool));
/* Create a new symlink node. */
@@ -703,7 +703,7 @@ test_inserting_nodes(apr_pool_t *pool)
props,
1, TIME_1a, AUTHOR_1,
"O-target",
- NULL, NULL,
+ NULL, NULL, NULL,
pool));
/* Replace an incomplete node with an absent file node. */