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/11 03:29:44 UTC
svn commit: r921667 - /subversion/trunk/subversion/libsvn_wc/update_editor.c
Author: gstein
Date: Thu Mar 11 02:29:44 2010
New Revision: 921667
URL: http://svn.apache.org/viewvc?rev=921667&view=rev
Log:
Simplify some entry-modification code.
* subversion/libsvn_wc/update_editor.c:
(loggy_tweak_working_node): removed. inlined into ...
(svn_wc_add_repos_file4): ... here, and the flags handling was
simplified, and we already have DIR_ABSPATH. remove a later FLAGS
localvar and just inline the value into the call.
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=921667&r1=921666&r2=921667&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Mar 11 02:29:44 2010
@@ -6068,40 +6068,6 @@ install_added_props(struct last_change_i
return SVN_NO_ERROR;
}
-/* Append, to LOG_ACCUM, log commands to update the entry for LOCAL_ABSPATH
- with a NEW_REVISION and a NEW_URL (if non-NULL), making sure
- the entry refers to a file and has no absent or deleted state.
- Use POOL for temporary allocations. */
-static svn_error_t *
-loggy_tweak_working_node(svn_stringbuf_t *log_accum,
- const char *local_abspath,
- apr_pool_t *pool)
-{
- /* Write log entry which will bump the revision number. Also, just
- in case we're overwriting an existing phantom 'deleted' or
- 'absent' entry, be sure to remove the hiddenness. */
- svn_wc_entry_t tmp_entry;
- apr_uint64_t modify_flags = SVN_WC__ENTRY_MODIFY_KIND
- | SVN_WC__ENTRY_MODIFY_TEXT_TIME
- | SVN_WC__ENTRY_MODIFY_WORKING_SIZE;
-
- tmp_entry.kind = svn_node_file;
- /* Indicate the file was locally modified and we didn't get to
- calculate the true value, but we can't set it to UNKNOWN (-1),
- because that would indicate absense of this value.
- If it isn't locally modified,
- we'll overwrite with the actual value later. */
- tmp_entry.working_size = SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN;
- /* The same is true for the TEXT_TIME field, except that that doesn't
- have an explicid 'changed' value, so we set the value to 'undefined'. */
- tmp_entry.text_time = 0;
-
- return svn_error_return(
- svn_wc__loggy_entry_modify(&log_accum,
- svn_dirent_dirname(local_abspath, pool),
- local_abspath, &tmp_entry, modify_flags,
- pool, pool));
-}
/* ### Note that this function is completely different from the rest of the
update editor in what it updates. The update editor changes only BASE
@@ -6256,7 +6222,28 @@ svn_wc_add_repos_file4(svn_wc_context_t
}
/* ### Clear working node status in preparation for writing a new node. */
- SVN_ERR(loggy_tweak_working_node(pre_props_accum, local_abspath, pool));
+ {
+ svn_wc_entry_t tmp_entry;
+
+ tmp_entry.kind = svn_node_file;
+ /* Indicate the file was locally modified and we didn't get to
+ calculate the true value, but we can't set it to UNKNOWN (-1),
+ because that would indicate absense of this value.
+ If it isn't locally modified,
+ we'll overwrite with the actual value later. */
+ tmp_entry.working_size = SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN;
+ /* The same is true for the TEXT_TIME field, except that that doesn't
+ have an explicid 'changed' value, so we set the value to 'undefined'. */
+ tmp_entry.text_time = 0;
+
+ SVN_ERR(svn_wc__loggy_entry_modify(&pre_props_accum, dir_abspath,
+ local_abspath, &tmp_entry,
+ SVN_WC__ENTRY_MODIFY_KIND
+ | SVN_WC__ENTRY_MODIFY_TEXT_TIME
+ | SVN_WC__ENTRY_MODIFY_WORKING_SIZE,
+ pool, pool));
+
+ }
post_props_accum = svn_stringbuf_create("", pool);
@@ -6318,7 +6305,6 @@ svn_wc_add_repos_file4(svn_wc_context_t
{
const char *tmp_text_base_abspath;
svn_wc_entry_t tmp_entry;
- apr_uint64_t flags = 0;
SVN_ERR(svn_dirent_get_absolute(&tmp_text_base_abspath, tmp_text_base_path,
pool));
@@ -6328,11 +6314,11 @@ svn_wc_add_repos_file4(svn_wc_context_t
tmp_text_base_abspath, text_base_path,
pool, pool));
tmp_entry.checksum = svn_checksum_to_cstring(base_checksum, pool);
- flags |= SVN_WC__ENTRY_MODIFY_CHECKSUM;
SVN_ERR(svn_wc__loggy_entry_modify(&post_props_accum, dir_abspath,
local_abspath, &tmp_entry,
- flags, pool, pool));
+ SVN_WC__ENTRY_MODIFY_CHECKSUM,
+ pool, pool));
}
/* Write our accumulation of log entries into a log file */
@@ -6353,6 +6339,5 @@ svn_wc_add_repos_file4(svn_wc_context_t
/* ### /HACK */
SVN_ERR(svn_wc__wq_add_loggy(db, dir_abspath, post_props_accum, pool));
-
return svn_error_return(svn_wc__run_log2(db, dir_abspath, pool));
}