You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/03/29 19:57:35 UTC
svn commit: r928849 - in /subversion/trunk/subversion/libsvn_wc: log.c log.h
props.c props.h update_editor.c
Author: gstein
Date: Mon Mar 29 17:57:35 2010
New Revision: 928849
URL: http://svn.apache.org/viewvc?rev=928849&view=rev
Log:
Convert all loggy_remove calls to the OP_FILE_REMOVE work item. The work
items constructed by svn_wc__merge_props() are installed immediately
rather than stashed into an accumulator for later installation.
* subversion/libsvn_wc/update_editor.c:
(close_directory): no need to pass LOG_ACCUM to svn_wc__merge_props().
this eliminates the need for the LOG_ACCUM localvar.
(merge_file): shift the FLUSH upwards to just after internal_merge,
which may place items into LOG_ACCUM. convert the three loggy_remove
calls into OP_FILE_REMOVE work item constructions.
(close_file): no need to pass DELAYED_LOG_ACCUM to svn_wc__merge_props
* subversion/libsvn_wc/props.h:
(svn_wc__merge_props): remove ENTRY_ACCUM parameter
* subversion/libsvn_wc/props.c:
(svn_wc_merge_props3): remove LOG_ACCUM handling and passing to the
svn_wc__merge_props function.
(svn_wc__merge_props): remove LOG_ACCUM parameter, and a couple of the
FLUSH macro calls. convert the loggy_remove invocation to a direct
OP_FILE_REMOVE invocation/queueing. introduce a LOG_ACCUM localvar in
the one small block using it, and queue the results.
* subversion/libsvn_wc/log.h:
(svn_wc__loggy_remove): remove (haha!)
* subversion/libsvn_wc/log.c:
(SVN_WC__LOG_RM): remove. no longer used.
(SVN_WC__LOG_ATTR_REVISION, SVN_WC__LOG_ATTR_PROPNAME,
SVN_WC__LOG_ATTR_PROPVAL, SVN_WC__LOG_ATTR_FORMAT): remove. these
became unused at some point in the recent past.
(log_do_rm): remove. no longer used.
(start_handler): remove detection of SVN_WC__LOG_RM
(svn_wc__loggy_remove): removed. no longer used.
Modified:
subversion/trunk/subversion/libsvn_wc/log.c
subversion/trunk/subversion/libsvn_wc/log.h
subversion/trunk/subversion/libsvn_wc/props.c
subversion/trunk/subversion/libsvn_wc/props.h
subversion/trunk/subversion/libsvn_wc/update_editor.c
Modified: subversion/trunk/subversion/libsvn_wc/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.c?rev=928849&r1=928848&r2=928849&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.c (original)
+++ subversion/trunk/subversion/libsvn_wc/log.c Mon Mar 29 17:57:35 2010
@@ -88,9 +88,6 @@
the DEST. */
#define SVN_WC__LOG_CP_AND_TRANSLATE "cp-and-translate"
-/* Remove file SVN_WC__LOG_ATTR_NAME. */
-#define SVN_WC__LOG_RM "rm"
-
/* Append file from SVN_WC__LOG_ATTR_NAME to SVN_WC__LOG_ATTR_DEST. */
#define SVN_WC__LOG_APPEND "append"
@@ -119,11 +116,7 @@
#define SVN_WC__LOG_ATTR_NAME "name"
#define SVN_WC__LOG_ATTR_DEST "dest"
-#define SVN_WC__LOG_ATTR_REVISION "revision"
#define SVN_WC__LOG_ATTR_TIMESTAMP "timestamp"
-#define SVN_WC__LOG_ATTR_PROPNAME "propname"
-#define SVN_WC__LOG_ATTR_PROPVAL "propval"
-#define SVN_WC__LOG_ATTR_FORMAT "format"
#define SVN_WC__LOG_ATTR_FORCE "force"
#define SVN_WC__LOG_ATTR_DATA "data"
@@ -388,18 +381,6 @@ log_do_file_timestamp(struct log_runner
}
-/* Remove file NAME in log's CWD. */
-static svn_error_t *
-log_do_rm(struct log_runner *loggy, const char *name)
-{
- const char *local_abspath
- = svn_dirent_join(loggy->adm_abspath, name, loggy->pool);
-
- return svn_error_return(
- svn_io_remove_file2(local_abspath, TRUE, loggy->pool));
-}
-
-
/* */
static svn_error_t *
log_do_modify_entry(struct log_runner *loggy,
@@ -670,9 +651,6 @@ start_handler(void *userData, const char
else if (strcmp(eltname, SVN_WC__LOG_DELETE_ENTRY) == 0) {
err = log_do_delete_entry(loggy, name);
}
- else if (strcmp(eltname, SVN_WC__LOG_RM) == 0) {
- err = log_do_rm(loggy, name);
- }
else if (strcmp(eltname, SVN_WC__LOG_MV) == 0) {
err = log_do_file_xfer(loggy, name, svn_wc__xfer_mv, atts);
}
@@ -1215,27 +1193,6 @@ svn_wc__loggy_set_timestamp(svn_stringbu
return SVN_NO_ERROR;
}
-svn_error_t *
-svn_wc__loggy_remove(svn_stringbuf_t **log_accum,
- const char *adm_abspath,
- const char *path,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- const char *loggy_path1;
-
- SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
- /* No need to check whether BASE_NAME exists: ENOENT is ignored
- by the log-runner */
- svn_xml_make_open_tag(log_accum, result_pool,
- svn_xml_self_closing,
- SVN_WC__LOG_RM,
- SVN_WC__LOG_ATTR_NAME,
- loggy_path1,
- NULL);
-
- return SVN_NO_ERROR;
-}
svn_error_t *
svn_wc__loggy_add_tree_conflict(svn_stringbuf_t **log_accum,
Modified: subversion/trunk/subversion/libsvn_wc/log.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.h?rev=928849&r1=928848&r2=928849&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.h (original)
+++ subversion/trunk/subversion/libsvn_wc/log.h Mon Mar 29 17:57:35 2010
@@ -289,20 +289,6 @@ svn_wc__loggy_set_timestamp(svn_stringbu
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Extend **LOG_ACCUM with log instructions to remove the file
- PATH, if it exists.
- ADM_ABSPATH is the absolute path for the admin directory for PATH.
-
- Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
- temporary allocations.
-*/
-svn_error_t *
-svn_wc__loggy_remove(svn_stringbuf_t **log_accum,
- const char *adm_abspath,
- const char *path,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
/* TODO ###
Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=928849&r1=928848&r2=928849&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Mon Mar 29 17:57:35 2010
@@ -657,7 +657,6 @@ svn_wc_merge_props3(svn_wc_notify_state_
apr_pool_t *pool /* scratch_pool */)
{
svn_boolean_t hidden;
- svn_stringbuf_t *log_accum;
apr_hash_t *new_base_props;
apr_hash_t *new_actual_props;
@@ -672,14 +671,9 @@ svn_wc_merge_props3(svn_wc_notify_state_
_("The node '%s' was not found."),
svn_dirent_local_style(local_abspath, pool));
- if (! dry_run)
- log_accum = svn_stringbuf_create("", pool);
- else
- log_accum = NULL; /* Provide NULL to __merge_props */
-
/* Note that while this routine does the "real" work, it's only
prepping tempfiles and writing log commands. */
- SVN_ERR(svn_wc__merge_props(&log_accum, state,
+ SVN_ERR(svn_wc__merge_props(state,
&new_base_props, &new_actual_props,
wc_ctx->db, local_abspath,
left_version, right_version,
@@ -710,10 +704,6 @@ svn_wc_merge_props3(svn_wc_notify_state_
/* ### add_loggy takes a DIR, but wq_run is a simple WRI_ABSPATH */
- if (! svn_stringbuf_isempty(log_accum))
- SVN_ERR(svn_wc__wq_add_loggy(wc_ctx->db, dir_abspath, log_accum,
- pool));
-
SVN_ERR(svn_wc__wq_run(wc_ctx->db, local_abspath,
cancel_func, cancel_baton,
pool));
@@ -1532,8 +1522,7 @@ apply_single_prop_change(svn_wc_notify_s
svn_error_t *
-svn_wc__merge_props(svn_stringbuf_t **log_accum,
- svn_wc_notify_state_t *state,
+svn_wc__merge_props(svn_wc_notify_state_t *state,
apr_hash_t **new_base_props,
apr_hash_t **new_actual_props,
svn_wc__db_t *db,
@@ -1757,26 +1746,33 @@ svn_wc__merge_props(svn_stringbuf_t **lo
/* We've now guaranteed that some kind of .prej file exists
above the .svn/ dir. We write log entries to append our
conflicts to it. */
- SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, *log_accum, scratch_pool);
SVN_ERR(svn_wc__loggy_append(db, adm_abspath, reject_tmp_path,
- reject_path, result_pool));
+ reject_path, scratch_pool));
/* And of course, delete the temporary reject file. */
- SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, *log_accum, scratch_pool);
- SVN_ERR(svn_wc__loggy_remove(log_accum, adm_abspath,
- reject_tmp_path, result_pool,
- scratch_pool));
+ {
+ const svn_skel_t *work_item;
+
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
+ db, reject_tmp_path,
+ scratch_pool, scratch_pool));
+ /* ### we should pass WORK_ITEM to some wc_db api that records
+ ### the property conflicts. */
+ SVN_ERR(svn_wc__db_wq_add(db, adm_abspath, work_item, scratch_pool));
+ }
/* Mark entry as "conflicted" with a particular .prej file. */
{
+ svn_stringbuf_t *log_accum = NULL;
svn_wc_entry_t entry;
entry.prejfile = svn_dirent_is_child(adm_abspath, reject_path, NULL);
- SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, *log_accum, scratch_pool);
- SVN_ERR(svn_wc__loggy_entry_modify(log_accum, adm_abspath,
+ SVN_ERR(svn_wc__loggy_entry_modify(&log_accum, adm_abspath,
local_abspath, &entry,
SVN_WC__ENTRY_MODIFY_PREJFILE,
- result_pool, scratch_pool));
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__wq_add_loggy(db, adm_abspath, log_accum,
+ scratch_pool));
}
} /* if (reject_tmp_fp) */
Modified: subversion/trunk/subversion/libsvn_wc/props.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.h?rev=928849&r1=928848&r2=928849&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.h (original)
+++ subversion/trunk/subversion/libsvn_wc/props.h Mon Mar 29 17:57:35 2010
@@ -115,8 +115,7 @@ svn_wc__internal_propset(svn_wc__db_t *d
If STATE is non-null, set *STATE to the state of the local properties
after the merge. */
svn_error_t *
-svn_wc__merge_props(svn_stringbuf_t **entry_accum,
- svn_wc_notify_state_t *state,
+svn_wc__merge_props(svn_wc_notify_state_t *state,
apr_hash_t **new_base_props,
apr_hash_t **new_actual_props,
svn_wc__db_t *db,
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=928849&r1=928848&r2=928849&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Mon Mar 29 17:57:35 2010
@@ -2971,9 +2971,6 @@ close_directory(void *dir_baton,
to deal with them. */
if (regular_props->nelts || entry_props->nelts || wc_props->nelts)
{
- /* Make a temporary log accumulator for dirprop changes.*/
- svn_stringbuf_t *log_accum = svn_stringbuf_create("", pool);
-
if (regular_props->nelts)
{
/* If recording traversal info, then see if the
@@ -3013,8 +3010,7 @@ close_directory(void *dir_baton,
/* Merge pending properties into temporary files (ignoring
conflicts). */
- SVN_ERR_W(svn_wc__merge_props(&log_accum,
- &prop_state,
+ SVN_ERR_W(svn_wc__merge_props(&prop_state,
&new_base_props,
&new_actual_props,
eb->db,
@@ -3047,10 +3043,6 @@ close_directory(void *dir_baton,
pool),
pool));
}
-
- /* Add the dirprop loggy entries to the baton's log
- accumulator. */
- svn_stringbuf_appendstr(db->log_accum, log_accum);
}
/* Queue some items to install the properties. */
@@ -3059,7 +3051,7 @@ close_directory(void *dir_baton,
new_base_props, new_actual_props,
TRUE /* write_base_props */, TRUE, pool));
- /* Flush and run the log. */
+ /* Flush the log. */
SVN_ERR(flush_log(db, pool));
if (last_change)
@@ -4493,6 +4485,7 @@ merge_file(svn_stringbuf_t **log_accum,
const char *merge_left;
svn_boolean_t delete_left = FALSE;
const char *path_ext = "";
+ const svn_skel_t *work_item;
/* If we have any file extensions we're supposed to
preserve in generated conflict file names, then find
@@ -4562,21 +4555,29 @@ merge_file(svn_stringbuf_t **log_accum,
eb->conflict_func, eb->conflict_baton,
eb->cancel_func, eb->cancel_baton,
pool));
+ SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum,
+ pool);
/* If we created a temporary left merge file, get rid of it. */
if (delete_left)
- SVN_ERR(svn_wc__loggy_remove(
- log_accum, pb->local_abspath,
- merge_left, pool, pool));
+ {
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
+ eb->db, merge_left,
+ pool, pool));
+ SVN_ERR(svn_wc__db_wq_add(eb->db, pb->local_abspath,
+ work_item, pool));
+ }
/* And clean up add-with-history-related temp file too. */
if (fb->copied_working_text)
- SVN_ERR(svn_wc__loggy_remove(
- log_accum, pb->local_abspath,
- fb->copied_working_text, pool, pool));
-
- SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum,
- pool);
+ {
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
+ eb->db,
+ fb->copied_working_text,
+ pool, pool));
+ SVN_ERR(svn_wc__db_wq_add(eb->db, pb->local_abspath,
+ work_item, pool));
+ }
} /* end: working file exists and has mods */
} /* end: working file has mods */
} /* end: "textual" merging process */
@@ -4681,9 +4682,12 @@ merge_file(svn_stringbuf_t **log_accum,
/* Clean up add-with-history temp file. */
if (fb->copied_text_base)
{
- SVN_ERR(svn_wc__loggy_remove(log_accum, pb->local_abspath,
- fb->copied_text_base, pool, pool));
- SVN_WC__FLUSH_LOG_ACCUM(eb->db, pb->local_abspath, *log_accum, pool);
+ const svn_skel_t *work_item;
+
+ SVN_ERR(svn_wc__wq_build_file_remove(&work_item,
+ eb->db, fb->copied_text_base,
+ pool, pool));
+ SVN_ERR(svn_wc__db_wq_add(eb->db, pb->local_abspath, work_item, pool));
}
/* Set the returned content state. */
@@ -4930,8 +4934,7 @@ close_file(void *file_baton,
/* This will merge the old and new props into a new prop db, and
write <cp> commands to the logfile to install the merged
props. */
- SVN_ERR(svn_wc__merge_props(&delayed_log_accum,
- &prop_state,
+ SVN_ERR(svn_wc__merge_props(&prop_state,
&new_base_props,
&new_actual_props,
eb->db,