| Paste number 88988: | flush log accum |
| Pasted by: | hwright |
| When: | 2 years, 7 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+1WNW |
| Channel: | #svn-dev |
| Paste contents: |
Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c (revision 40126)
+++ subversion/libsvn_wc/adm_ops.c (working copy)
@@ -470,6 +470,7 @@ process_committed_leaf(svn_wc__db_t *db,
}
}
+ SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool);
/* Append a log command to set (overwrite) the 'committed-rev',
'committed-date', 'last-author', and possibly 'checksum'
@@ -506,10 +507,12 @@ process_committed_leaf(svn_wc__db_t *db,
SVN_ERR(svn_wc__loggy_entry_modify(&log_accum, adm_abspath,
path, &tmp_entry, modify_flags,
scratch_pool, scratch_pool));
+ SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool);
if (remove_lock)
SVN_ERR(svn_wc__loggy_delete_lock(&log_accum, adm_abspath,
path, scratch_pool, scratch_pool));
+ SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool);
/* ### messed up right now. we need to pass this boolean. */
if (remove_changelist && !using_ng)
@@ -522,12 +525,14 @@ process_committed_leaf(svn_wc__db_t *db,
SVN_ERR(svn_wc__loggy_committed(&log_accum, adm_abspath,
path, new_revnum,
scratch_pool, scratch_pool));
+ SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool);
/* ### the NG code doesn't set these values. do it now. */
if (modify_flags && using_ng)
SVN_ERR(svn_wc__loggy_entry_modify(&log_accum, adm_abspath,
path, &tmp_entry, modify_flags,
scratch_pool, scratch_pool));
+ SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool);
/* Do wcprops in the same log txn as revision, etc. */
if (wcprop_changes && (wcprop_changes->nelts > 0))
@@ -545,6 +550,7 @@ process_committed_leaf(svn_wc__db_t *db,
? prop->value->data
: NULL,
scratch_pool, scratch_pool));
+ SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool);
}
}
Index: subversion/libsvn_wc/log.h
===================================================================
--- subversion/libsvn_wc/log.h (revision 40126)
+++ subversion/libsvn_wc/log.h (working copy)
@@ -52,6 +52,19 @@ extern "C" {
be either absolute or relative to the adm_abspath.
*/
+
+/* A macro to flush LOG_ACCUM using DB and ADM_ABSPATH. This writes all
+ current items in LOG_ACCUM to the work queue, and then reinitializes
+ LOG_ACCUM to an empty buffer. */
+#define SVN_WC__FLUSH_LOG_ACCUM(db, adm_abspath, log_accum, scratch_pool) \
+ if ((log_accum)->len > 0) \
+ { \
+ SVN_ERR(svn_wc__wq_add_loggy((db), (adm_abspath), (log_accum), \
+ (scratch_pool))); \
+ (log_accum) = svn_stringbuf_create("", (scratch_pool)); \
+ }
+
+
/* Extend **LOG_ACCUM with log instructions to append the contents
of SRC to DST.
SRC and DST are relative to ADM_ABSPATH.
This paste has no annotations.