subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r932692 - in /subversion/trunk/subversion/libsvn_wc: log.c log.h merge.c props.c update_editor.c
Date Sat, 10 Apr 2010 11:11:37 GMT
Author: gstein
Date: Sat Apr 10 11:11:36 2010
New Revision: 932692

URL: http://svn.apache.org/viewvc?rev=932692&view=rev
Log:
Convert loggy_entry_modify() to direct queueing, rather than using an
accumulator.

* subversion/libsvn_wc/log.h:
  (svn_wc__loggy_entry_modify): adjust params

* subversion/libsvn_wc/log.c:
  (svn_wc__loggy_entry_modify): take a DB, and lose the LOG_ACCUM and
    RESULT_POOL. adjust logic to directly queue the resulting ops.

* subversion/libsvn_wc/merge.c:
  (save_merge_result): unrelated varname consistency changes
  (preserve_pre_merge_files): adjust logic for calling loggy_entry_modify
  (merge_binary_file): change params to loggy_entry_modify, and no need to
    flush LOG_ACCUM afterwards.

* subversion/libsvn_wc/props.c:
  (svn_wc__merge_props): adjust logic for calling loggy_entry_modify

* subversion/libsvn_wc/update_editor.c:
  (do_entry_deletion, svn_wc_add_repos_file4): adjust logic for calling
    loggy_entry_modify.

Modified:
    subversion/trunk/subversion/libsvn_wc/log.c
    subversion/trunk/subversion/libsvn_wc/log.h
    subversion/trunk/subversion/libsvn_wc/merge.c
    subversion/trunk/subversion/libsvn_wc/props.c
    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=932692&r1=932691&r2=932692&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.c (original)
+++ subversion/trunk/subversion/libsvn_wc/log.c Sat Apr 10 11:11:36 2010
@@ -793,14 +793,14 @@ svn_wc__loggy_delete_lock(svn_wc__db_t *
 
 
 svn_error_t *
-svn_wc__loggy_entry_modify(svn_stringbuf_t **log_accum,
+svn_wc__loggy_entry_modify(svn_wc__db_t *db,
                            const char *adm_abspath,
                            const char *path,
                            const svn_wc_entry_t *entry,
                            apr_uint64_t modify_flags,
-                           apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool)
 {
+  svn_stringbuf_t *log_accum = NULL;
   const char *loggy_path1;
   apr_hash_t *prop_hash = apr_hash_make(scratch_pool);
   static const char *kind_str[] =
@@ -910,12 +910,12 @@ svn_wc__loggy_entry_modify(svn_stringbuf
   apr_hash_set(prop_hash, SVN_WC__LOG_ATTR_NAME,
                APR_HASH_KEY_STRING, loggy_path1);
 
-  svn_xml_make_open_tag_hash(log_accum, result_pool,
+  svn_xml_make_open_tag_hash(&log_accum, scratch_pool,
                              svn_xml_self_closing,
                              SVN_WC__LOG_MODIFY_ENTRY,
                              prop_hash);
-
-  return SVN_NO_ERROR;
+  return svn_error_return(svn_wc__wq_add_loggy(db, adm_abspath, log_accum,
+                                               scratch_pool));
 }
 
 

Modified: subversion/trunk/subversion/libsvn_wc/log.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/log.h?rev=932692&r1=932691&r2=932692&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/log.h (original)
+++ subversion/trunk/subversion/libsvn_wc/log.h Sat Apr 10 11:11:36 2010
@@ -121,24 +121,23 @@ svn_wc__loggy_delete_lock(svn_wc__db_t *
                           apr_pool_t *scratch_pool);
 
 
-/* Extend **LOG_ACCUM with commands to modify the entry associated with PATH
+/* Queue operations to modify the entry associated with PATH
    in ADM_ABSPATH according to the flags specified in MODIFY_FLAGS, based on
    the values supplied in *ENTRY.
+
    ADM_ABSPATH is the absolute path for the admin directory for PATH.
 
    The flags in MODIFY_FLAGS are to be taken from the svn_wc__entry_modify()
    parameter by the same name.
 
-   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
-   temporary allocations.
+   Use SCRATCH_POOL for temporary allocations.
 */
 svn_error_t *
-svn_wc__loggy_entry_modify(svn_stringbuf_t **log_accum,
+svn_wc__loggy_entry_modify(svn_wc__db_t *db,
                            const char *adm_abspath,
                            const char *path,
                            const svn_wc_entry_t *entry,
                            apr_uint64_t modify_flags,
-                           apr_pool_t *result_pool,
                            apr_pool_t *scratch_pool);
 
 

Modified: subversion/trunk/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=932692&r1=932691&r2=932692&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/merge.c (original)
+++ subversion/trunk/subversion/libsvn_wc/merge.c Sat Apr 10 11:11:36 2010
@@ -402,22 +402,23 @@ save_merge_result(svn_wc__db_t *db,
                   const char *result_target,
                   apr_pool_t *pool)
 {
-  const char *edited_copy;
-  const char *merge_dirpath;
+  const char *edited_copy_abspath;
+  const char *dir_abspath;
   const char *merge_filename;
 
-  svn_dirent_split(target_abspath, &merge_dirpath, &merge_filename, pool);
+  svn_dirent_split(target_abspath, &dir_abspath, &merge_filename, pool);
 
   /* ### Should use preserved-conflict-file-exts. */
+  /* Create the .edited file within this file's DIR_ABSPATH  */
   SVN_ERR(svn_io_open_uniquely_named(NULL,
-                                     &edited_copy,
-                                     merge_dirpath,
+                                     &edited_copy_abspath,
+                                     dir_abspath,
                                      merge_filename,
                                      ".edited",
                                      svn_io_file_del_none,
                                      pool, pool));
-  SVN_ERR(svn_wc__loggy_translated_file(db, merge_dirpath,
-                                        edited_copy,
+  SVN_ERR(svn_wc__loggy_translated_file(db, dir_abspath,
+                                        edited_copy_abspath,
                                         result_target,
                                         target_abspath,
                                         pool));
@@ -593,7 +594,6 @@ preserve_pre_merge_files(svn_wc__db_t *d
   const char *dir_abspath, *target_name;
   const char *temp_dir;
   svn_wc_entry_t tmp_entry;
-  svn_stringbuf_t *log_accum = NULL;
 
   svn_dirent_split(target_abspath, &dir_abspath, &target_name, pool);
   SVN_ERR(svn_wc__db_temp_wcroot_tempdir(&temp_dir, db, target_abspath,
@@ -697,13 +697,12 @@ preserve_pre_merge_files(svn_wc__db_t *d
 
   /* Mark TARGET_ABSPATH's entry as "Conflicted", and start tracking
      the backup files in the entry as well. */
-  SVN_ERR(svn_wc__loggy_entry_modify(&log_accum, dir_abspath,
+  SVN_ERR(svn_wc__loggy_entry_modify(db, dir_abspath,
                                      target_abspath, &tmp_entry,
                                      SVN_WC__ENTRY_MODIFY_CONFLICT_OLD
                                        | SVN_WC__ENTRY_MODIFY_CONFLICT_NEW
                                        | SVN_WC__ENTRY_MODIFY_CONFLICT_WRK,
-                                     pool, pool));
-  SVN_ERR(svn_wc__wq_add_loggy(db, dir_abspath, log_accum, pool));
+                                     pool));
 
   return SVN_NO_ERROR;
 }
@@ -1192,14 +1191,12 @@ merge_binary_file(svn_stringbuf_t **log_
   tmp_entry.conflict_old = left_base;
   tmp_entry.conflict_new = right_base;
   SVN_ERR(svn_wc__loggy_entry_modify(
-            log_accum,
-            merge_dirpath, target_abspath,
+            db, merge_dirpath, target_abspath,
             &tmp_entry,
             SVN_WC__ENTRY_MODIFY_CONFLICT_OLD
               | SVN_WC__ENTRY_MODIFY_CONFLICT_NEW
               | SVN_WC__ENTRY_MODIFY_CONFLICT_WRK,
-            pool, pool));
-  SVN_WC__FLUSH_LOG_ACCUM(db, merge_dirpath, *log_accum, pool);
+            pool));
 
   *merge_outcome = svn_wc_merge_conflict; /* a conflict happened */
 

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=932692&r1=932691&r2=932692&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Sat Apr 10 11:11:36 2010
@@ -1745,16 +1745,13 @@ svn_wc__merge_props(svn_wc_notify_state_
 
       /* 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_ERR(svn_wc__loggy_entry_modify(&log_accum, adm_abspath,
+        SVN_ERR(svn_wc__loggy_entry_modify(db, adm_abspath,
                                            local_abspath, &entry,
                                            SVN_WC__ENTRY_MODIFY_PREJFILE,
-                                           scratch_pool, scratch_pool));
-        SVN_ERR(svn_wc__wq_add_loggy(db, adm_abspath, log_accum,
-                                     scratch_pool));
+                                           scratch_pool));
       }
 
     } /* if (reject_tmp_fp) */

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=932692&r1=932691&r2=932692&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sat Apr 10 11:11:36 2010
@@ -2166,7 +2166,6 @@ do_entry_deletion(struct edit_baton *eb,
   if (strcmp(local_abspath, eb->target_abspath) == 0)
     {
       svn_wc_entry_t tmp_entry;
-      svn_stringbuf_t *log_accum = NULL;
 
       tmp_entry.revision = *(eb->target_revision);
       /* ### Why not URL as well? This might be a switch. ... */
@@ -2178,14 +2177,13 @@ do_entry_deletion(struct edit_baton *eb,
 
       tmp_entry.deleted = TRUE;
 
-      SVN_ERR(svn_wc__loggy_entry_modify(&log_accum,
+      SVN_ERR(svn_wc__loggy_entry_modify(eb->db,
                                dir_abspath, local_abspath,
                                &tmp_entry,
                                SVN_WC__ENTRY_MODIFY_REVISION
                                | SVN_WC__ENTRY_MODIFY_KIND
                                | SVN_WC__ENTRY_MODIFY_DELETED,
-                               pool, pool));
-      SVN_ERR(svn_wc__wq_add_loggy(eb->db, dir_abspath, log_accum, pool));
+                               pool));
 
       eb->target_deleted = TRUE;
     }
@@ -5689,7 +5687,7 @@ svn_wc_add_repos_file4(svn_wc_context_t 
   svn_stream_t *tmp_base_contents;
   const char *text_base_abspath;
   const char *temp_dir_abspath;
-  svn_stringbuf_t *log_accum;
+  svn_stringbuf_t *log_accum = NULL;
   struct last_change_info *last_change = NULL;
   svn_error_t *err;
   const char *source_abspath = NULL;
@@ -5723,10 +5721,6 @@ svn_wc_add_repos_file4(svn_wc_context_t 
                                  copyfrom_url, repos_root);
   }
 
-  /* Accumulate log commands in this buffer until we're ready to close
-     and run the log.  */
-  log_accum = svn_stringbuf_create("", pool);
-
   /* If we're replacing the file then we need to save the destination file's
      original text base and prop base before replacing it. This allows us to
      revert the entire change.
@@ -5811,10 +5805,9 @@ svn_wc_add_repos_file4(svn_wc_context_t 
           | SVN_WC__ENTRY_MODIFY_COPIED;
       }
 
-    SVN_ERR(svn_wc__loggy_entry_modify(&log_accum, dir_abspath,
+    SVN_ERR(svn_wc__loggy_entry_modify(db, dir_abspath,
                                        local_abspath, &tmp_entry,
-                                       modify_flags, pool, pool));
-    SVN_WC__FLUSH_LOG_ACCUM(db, dir_abspath, log_accum, pool);
+                                       modify_flags, pool));
   }
 
   /* ### Clear working node status in preparation for writing a new node. */
@@ -5832,13 +5825,12 @@ svn_wc_add_repos_file4(svn_wc_context_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(&log_accum, dir_abspath,
+    SVN_ERR(svn_wc__loggy_entry_modify(db, 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));
-    SVN_WC__FLUSH_LOG_ACCUM(db, dir_abspath, log_accum, pool);
+                                       pool));
   }
 
   /* Categorize the base properties. */
@@ -5910,11 +5902,10 @@ svn_wc_add_repos_file4(svn_wc_context_t 
 
     tmp_entry.checksum = svn_checksum_to_cstring(base_checksum, pool);
 
-    SVN_ERR(svn_wc__loggy_entry_modify(&log_accum, dir_abspath,
+    SVN_ERR(svn_wc__loggy_entry_modify(db, dir_abspath,
                                        local_abspath, &tmp_entry,
                                        SVN_WC__ENTRY_MODIFY_CHECKSUM,
-                                       pool, pool));
-    SVN_WC__FLUSH_LOG_ACCUM(db, dir_abspath, log_accum, pool);
+                                       pool));
   }
 
   /* ### HACK: The following code should be performed in the same transaction as the install
*/



Mime
View raw message