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/05/09 02:23:36 UTC

svn commit: r942484 - in /subversion/trunk/subversion/libsvn_wc: adm_crawler.c adm_ops.c merge.c props.c update_editor.c workqueue.c workqueue.h

Author: gstein
Date: Sun May  9 00:23:35 2010
New Revision: 942484

URL: http://svn.apache.org/viewvc?rev=942484&view=rev
Log:
Remove const from the return work items. They're allocated in the
RESULT_POOL, and avalable for callers to mess around with. In particular,
we want non-const in order to link work items together.

* subversion/libsvn_wc/workqueue.h:
  (svn_wc__wq_build_file_install, svn_wc__wq_build_file_remove,
      svn_wc__wq_build_sync_file_flags, svn_wc__wq_build_prej_install,
      svn_wc__wq_build_write_old_props): remove const from WORK_ITEM

* subversion/libsvn_wc/workqueue.c:
  (svn_wc__wq_build_file_install, svn_wc__wq_build_file_remove,
      svn_wc__wq_build_sync_file_flags, svn_wc__wq_build_prej_install,
      svn_wc__wq_build_write_old_props): remove const from WORK_ITEM
    parameter, and directly build the work item into the parameter.

* subversion/libsvn_wc/adm_crawler.c:
  (restore_file): remove const from WORK_ITEM

* subversion/libsvn_wc/adm_ops.c:
  (process_committed_leaf): remove const from WORK_ITEM

* subversion/libsvn_wc/merge.c:
  (eval_conflict_func_result, merge_text_file, merge_binary_file,
      svn_wc__internal_merge): remove const from WORK_ITEM

* subversion/libsvn_wc/props.c:
  (svn_wc__install_props, immediate_install_props, svn_wc__merge_props):
    remove const from WORK_ITEM

* subversion/libsvn_wc/update_editor.c:
  (build_write_base_props, build_write_actual_props): remove const from
    the WORK_ITEM param
  (close_directory, merge_file, close_file, svn_wc_add_repos_file4):
    remove const from work item variables.

Modified:
    subversion/trunk/subversion/libsvn_wc/adm_crawler.c
    subversion/trunk/subversion/libsvn_wc/adm_ops.c
    subversion/trunk/subversion/libsvn_wc/merge.c
    subversion/trunk/subversion/libsvn_wc/props.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/workqueue.c
    subversion/trunk/subversion/libsvn_wc/workqueue.h

Modified: subversion/trunk/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_crawler.c?rev=942484&r1=942483&r2=942484&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_crawler.c Sun May  9 00:23:35 2010
@@ -69,7 +69,7 @@ restore_file(svn_wc__db_t *db,
              svn_boolean_t use_commit_times,
              apr_pool_t *scratch_pool)
 {
-  const svn_skel_t *work_item;
+  svn_skel_t *work_item;
 
   SVN_ERR(svn_wc__wq_build_file_install(&work_item,
                                         db, local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=942484&r1=942483&r2=942484&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Sun May  9 00:23:35 2010
@@ -384,7 +384,7 @@ process_committed_leaf(svn_wc__db_t *db,
   /* ### this goes away once props are fully in the database  */
   {
     const char *revert_props_abspath;
-    const svn_skel_t *work_item;
+    svn_skel_t *work_item;
 
     /* ### this breaks the abstraction of svn_wc__props_delete, but
        ### screw it. this is transitional code.  */
@@ -406,7 +406,7 @@ process_committed_leaf(svn_wc__db_t *db,
       /* Queue a removal any "revert" text base now.  */
       {
         const char *revert_abspath;
-        const svn_skel_t *work_item;
+        svn_skel_t *work_item;
 
         SVN_ERR(svn_wc__text_revert_path(&revert_abspath, db, local_abspath,
                                          scratch_pool));

Modified: subversion/trunk/subversion/libsvn_wc/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/merge.c?rev=942484&r1=942483&r2=942484&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/merge.c (original)
+++ subversion/trunk/subversion/libsvn_wc/merge.c Sun May  9 00:23:35 2010
@@ -564,7 +564,7 @@ eval_conflict_func_result(enum svn_wc_me
   SVN_ERR_ASSERT(install_from != NULL);
 
   {
-    const svn_skel_t *work_item;
+    svn_skel_t *work_item;
 
     SVN_ERR(svn_wc__wq_build_file_install(&work_item,
                                           db, target_abspath,
@@ -976,7 +976,7 @@ merge_text_file(enum svn_wc_merge_outcom
 
   if (*merge_outcome != svn_wc_merge_unchanged && ! dry_run)
     {
-      const svn_skel_t *work_item;
+      svn_skel_t *work_item;
 
       /* replace TARGET_ABSPATH with the new merged file, expanding. */
       SVN_ERR(svn_wc__wq_build_file_install(&work_item,
@@ -1094,7 +1094,7 @@ merge_binary_file(enum svn_wc_merge_outc
 
       if (install_from != NULL)
         {
-          const svn_skel_t *work_item;
+          svn_skel_t *work_item;
 
           SVN_ERR(svn_wc__wq_build_file_install(&work_item,
                                                 db, target_abspath,
@@ -1305,7 +1305,7 @@ svn_wc__internal_merge(enum svn_wc_merge
      possibly make it read-only. */
   if (! dry_run)
     {
-      const svn_skel_t *work_item;
+      svn_skel_t *work_item;
 
       SVN_ERR(svn_wc__wq_build_sync_file_flags(&work_item, db,
                                                target_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=942484&r1=942483&r2=942484&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Sun May  9 00:23:35 2010
@@ -343,7 +343,7 @@ svn_wc__install_props(svn_wc__db_t *db,
 {
   apr_array_header_t *prop_diffs;
   const char *prop_abspath;
-  const svn_skel_t *work_item;
+  svn_skel_t *work_item;
 
   SVN_ERR_ASSERT(pristine_props != NULL);
 
@@ -401,7 +401,7 @@ immediate_install_props(svn_wc__db_t *db
   apr_hash_t *base_props;
   const char *propfile_abspath;
   apr_array_header_t *prop_diffs;
-  const svn_skel_t *work_item;
+  svn_skel_t *work_item;
 
   /* ### no pristines should be okay.  */
   SVN_ERR_W(load_pristine_props(&base_props, db, local_abspath,
@@ -1830,7 +1830,7 @@ svn_wc__merge_props(svn_wc_notify_state_
 
       /* Once the prejfile is recorded, then install the file.  */
       {
-        const svn_skel_t *work_item;
+        svn_skel_t *work_item;
 
         /* ### careful. CONFLICT_SKEL is NOT dup'd into the provided
            ### result_pool at the moment. we'll get that fixed soon-ish.

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=942484&r1=942483&r2=942484&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Sun May  9 00:23:35 2010
@@ -2876,7 +2876,7 @@ prop_hash_from_array(const apr_array_hea
    ### breaks the props encapsulation by using svn_wc__prop_path, but this
    ### function will only last until we move props into the database.  */
 static svn_error_t *
-build_write_base_props(const svn_skel_t **work_item,
+build_write_base_props(svn_skel_t **work_item,
                        const char *local_abspath,
                        svn_wc__db_kind_t kind,
                        apr_hash_t *base_props,
@@ -2900,7 +2900,7 @@ build_write_base_props(const svn_skel_t 
    ### breaks the props encapsulation by using svn_wc__prop_path, but this
    ### function will only last until we move props into the database.  */
 static svn_error_t *
-build_write_actual_props(const svn_skel_t **work_item,
+build_write_actual_props(svn_skel_t **work_item,
                          const char *local_abspath,
                          svn_wc__db_kind_t kind,
                          apr_hash_t *actual_props,
@@ -3098,7 +3098,7 @@ close_directory(void *dir_baton,
       apr_time_t changed_date;
       const char *changed_author;
       apr_hash_t *props;
-      const svn_skel_t *work_items;
+      svn_skel_t *work_items;
 
       /* ### we know a base node already exists. it was created in
          ### open_directory or add_directory.  let's just preserve the
@@ -4476,7 +4476,7 @@ merge_file(svn_boolean_t *install_pristi
               const char *merge_left;
               svn_boolean_t delete_left = FALSE;
               const char *path_ext = "";
-              const svn_skel_t *work_item;
+              svn_skel_t *work_item;
 
               /* If we have any file extensions we're supposed to
                  preserve in generated conflict file names, then find
@@ -4703,7 +4703,7 @@ close_file(void *file_baton,
   const char *install_from;
   apr_hash_t *current_base_props = NULL;
   apr_hash_t *current_actual_props = NULL;
-  const svn_skel_t *work_items;
+  svn_skel_t *work_items;
 
   if (fb->skip_this)
     {
@@ -5047,7 +5047,7 @@ close_file(void *file_baton,
   if (install_pristine)
     {
       svn_boolean_t record_fileinfo;
-      const svn_skel_t *work_item;
+      svn_skel_t *work_item;
 
       /* If we are installing from the pristine contents, then go ahead and
          record the fileinfo. That will be the "proper" values. Installing
@@ -5073,7 +5073,7 @@ close_file(void *file_baton,
   if (new_text_base_abspath == NULL
       && lock_state == svn_wc_notify_lock_state_unlocked)
     {
-      const svn_skel_t *work_item;
+      svn_skel_t *work_item;
 
       /* If a lock was removed and we didn't update the text contents, we
          might need to set the file read-only.
@@ -5100,7 +5100,7 @@ close_file(void *file_baton,
                                        fb->local_abspath, pool));
       if (strcmp(install_from, revert_base_abspath) != 0)
         {
-          const svn_skel_t *work_item;
+          svn_skel_t *work_item;
 
           SVN_ERR(svn_wc__wq_build_file_remove(&work_item, eb->db,
                                                install_from,
@@ -5112,7 +5112,7 @@ close_file(void *file_baton,
 
   if (fb->copied_text_base_abspath)
     {
-      const svn_skel_t *work_item;
+      svn_skel_t *work_item;
 
       SVN_ERR(svn_wc__wq_build_file_remove(&work_item, eb->db,
                                            fb->copied_text_base_abspath,
@@ -6067,7 +6067,7 @@ svn_wc_add_repos_file4(svn_wc_context_t 
     source_abspath = tmp_text_base_abspath;
 
   {
-    const svn_skel_t *work_item;
+    svn_skel_t *work_item;
     svn_boolean_t record_fileinfo;
 
     /* If new contents were provided, then we do NOT want to record the

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=942484&r1=942483&r2=942484&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Sun May  9 00:23:35 2010
@@ -322,7 +322,7 @@ run_revert(svn_wc__db_t *db,
       if (reinstall_working)
         {
           svn_boolean_t use_commit_times;
-          const svn_skel_t *wi_file_install;
+          svn_skel_t *wi_file_install;
 
           use_commit_times = svn_skel__parse_int(arg1->next->next->next,
                                                  scratch_pool) != 0;
@@ -1940,7 +1940,7 @@ run_file_install(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc__wq_build_file_install(const svn_skel_t **work_item,
+svn_wc__wq_build_file_install(svn_skel_t **work_item,
                               svn_wc__db_t *db,
                               const char *local_abspath,
                               const char *source_abspath,
@@ -1949,22 +1949,19 @@ svn_wc__wq_build_file_install(const svn_
                               apr_pool_t *result_pool,
                               apr_pool_t *scratch_pool)
 {
-  svn_skel_t *build_item = svn_skel__make_empty_list(result_pool);
+  *work_item = svn_skel__make_empty_list(result_pool);
 
   /* If a SOURCE_ABSPATH was provided, then put it into the skel. If this
      value is not provided, then the file's pristine contents will be used.  */
   if (source_abspath != NULL)
     svn_skel__prepend_str(apr_pstrdup(result_pool, source_abspath),
-                          build_item, result_pool);
+                          *work_item, result_pool);
 
-  svn_skel__prepend_int(record_fileinfo, build_item, result_pool);
-  svn_skel__prepend_int(use_commit_times, build_item, result_pool);
+  svn_skel__prepend_int(record_fileinfo, *work_item, result_pool);
+  svn_skel__prepend_int(use_commit_times, *work_item, result_pool);
   svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
-                        build_item, result_pool);
-  svn_skel__prepend_str(OP_FILE_INSTALL, build_item, result_pool);
-
-  /* Done. Assign to the const-ful WORK_ITEM.  */
-  *work_item = build_item;
+                        *work_item, result_pool);
+  svn_skel__prepend_str(OP_FILE_INSTALL, *work_item, result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -1996,20 +1993,17 @@ run_file_remove(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc__wq_build_file_remove(const svn_skel_t **work_item,
+svn_wc__wq_build_file_remove(svn_skel_t **work_item,
                              svn_wc__db_t *db,
                              const char *local_abspath,
                              apr_pool_t *result_pool,
                              apr_pool_t *scratch_pool)
 {
-  svn_skel_t *build_item = svn_skel__make_empty_list(result_pool);
+  *work_item = svn_skel__make_empty_list(result_pool);
 
   svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
-                        build_item, result_pool);
-  svn_skel__prepend_str(OP_FILE_REMOVE, build_item, result_pool);
-
-  /* Done. Assign to the const-ful WORK_ITEM.  */
-  *work_item = build_item;
+                        *work_item, result_pool);
+  svn_skel__prepend_str(OP_FILE_REMOVE, *work_item, result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -2020,7 +2014,7 @@ svn_wc__wq_build_file_remove(const svn_s
 /* OP_SYNC_FILE_FLAGS  */
 
 /* Process the OP_SYNC_FILE_FLAGS work item WORK_ITEM.
- * See svn_wc__wq_build_file_remove() which generates this work item.
+ * See svn_wc__wq_build_sync_file_flags() which generates this work item.
  * Implements (struct work_item_dispatch).func. */
 static svn_error_t *
 run_sync_file_flags(svn_wc__db_t *db,
@@ -2039,20 +2033,17 @@ run_sync_file_flags(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc__wq_build_sync_file_flags(const svn_skel_t **work_item,
+svn_wc__wq_build_sync_file_flags(svn_skel_t **work_item,
                                  svn_wc__db_t *db,
                                  const char *local_abspath,
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool)
 {
-  svn_skel_t *build_item = svn_skel__make_empty_list(result_pool);
+  *work_item = svn_skel__make_empty_list(result_pool);
 
   svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
-                        build_item, result_pool);
-  svn_skel__prepend_str(OP_SYNC_FILE_FLAGS, build_item, result_pool);
-
-  /* Done. Assign to the const-ful WORK_ITEM.  */
-  *work_item = build_item;
+                        *work_item, result_pool);
+  svn_skel__prepend_str(OP_SYNC_FILE_FLAGS, *work_item, result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -2102,27 +2093,24 @@ run_prej_install(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc__wq_build_prej_install(const svn_skel_t **work_item,
+svn_wc__wq_build_prej_install(svn_skel_t **work_item,
                               svn_wc__db_t *db,
                               const char *local_abspath,
                               const svn_skel_t *conflict_skel,
                               apr_pool_t *result_pool,
                               apr_pool_t *scratch_pool)
 {
-  svn_skel_t *build_item = svn_skel__make_empty_list(result_pool);
+  *work_item = svn_skel__make_empty_list(result_pool);
 
   /* ### gotta have this, today  */
   SVN_ERR_ASSERT(conflict_skel != NULL);
 
   if (conflict_skel != NULL)
     /* ### woah! this needs to dup the skel into RESULT_POOL  */
-    svn_skel__prepend((svn_skel_t *)conflict_skel, build_item);
+    svn_skel__prepend((svn_skel_t *)conflict_skel, *work_item);
   svn_skel__prepend_str(apr_pstrdup(result_pool, local_abspath),
-                        build_item, result_pool);
-  svn_skel__prepend_str(OP_PREJ_INSTALL, build_item, result_pool);
-
-  /* Done. Assign to the const-ful WORK_ITEM.  */
-  *work_item = build_item;
+                        *work_item, result_pool);
+  svn_skel__prepend_str(OP_PREJ_INSTALL, *work_item, result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -2177,12 +2165,12 @@ run_write_old_props(svn_wc__db_t *db,
 
 
 svn_error_t *
-svn_wc__wq_build_write_old_props(const svn_skel_t **work_item,
+svn_wc__wq_build_write_old_props(svn_skel_t **work_item,
                                  const char *props_abspath,
                                  apr_hash_t *props,
                                  apr_pool_t *result_pool)
 {
-  svn_skel_t *build_item = svn_skel__make_empty_list(result_pool);
+  *work_item = svn_skel__make_empty_list(result_pool);
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(props_abspath));
 
@@ -2191,14 +2179,11 @@ svn_wc__wq_build_write_old_props(const s
       svn_skel_t *props_skel;
 
       SVN_ERR(svn_skel__unparse_proplist(&props_skel, props, result_pool));
-      svn_skel__prepend(props_skel, build_item);
+      svn_skel__prepend(props_skel, *work_item);
     }
   svn_skel__prepend_str(apr_pstrdup(result_pool, props_abspath),
-                        build_item, result_pool);
-  svn_skel__prepend_str(OP_WRITE_OLD_PROPS, build_item, result_pool);
-
-  /* Done. Assign to the const-ful WORK_ITEM.  */
-  *work_item = build_item;
+                        *work_item, result_pool);
+  svn_skel__prepend_str(OP_WRITE_OLD_PROPS, *work_item, result_pool);
 
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.h?rev=942484&r1=942483&r2=942484&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.h (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.h Sun May  9 00:23:35 2010
@@ -103,7 +103,7 @@ svn_wc__wq_run(svn_wc__db_t *db,
    temporary file, and an OP_FILE_REMOVE will be queued to later remove it.
 */
 svn_error_t *
-svn_wc__wq_build_file_install(const svn_skel_t **work_item,
+svn_wc__wq_build_file_install(svn_skel_t **work_item,
                               svn_wc__db_t *db,
                               const char *local_abspath,
                               const char *source_abspath,
@@ -116,7 +116,7 @@ svn_wc__wq_build_file_install(const svn_
 /* Build a work item (returned in *WORK_ITEM) that will remove a single
    file.  */
 svn_error_t *
-svn_wc__wq_build_file_remove(const svn_skel_t **work_item,
+svn_wc__wq_build_file_remove(svn_skel_t **work_item,
                              svn_wc__db_t *db,
                              const char *local_abspath,
                              apr_pool_t *result_pool,
@@ -127,7 +127,7 @@ svn_wc__wq_build_file_remove(const svn_s
    target node's readonly and executable flags with the values defined
    by its properties and lock status.  */
 svn_error_t *
-svn_wc__wq_build_sync_file_flags(const svn_skel_t **work_item,
+svn_wc__wq_build_sync_file_flags(svn_skel_t **work_item,
                                  svn_wc__db_t *db,
                                  const char *local_abspath,
                                  apr_pool_t *result_pool,
@@ -139,7 +139,7 @@ svn_wc__wq_build_sync_file_flags(const s
    be taken from CONFLICT_SKEL, or if NULL, then from wc_db for the
    given DB/LOCAL_ABSPATH.  */
 svn_error_t *
-svn_wc__wq_build_prej_install(const svn_skel_t **work_item,
+svn_wc__wq_build_prej_install(svn_skel_t **work_item,
                               svn_wc__db_t *db,
                               const char *local_abspath,
                               const svn_skel_t *conflict_skel,
@@ -152,7 +152,7 @@ svn_wc__wq_build_prej_install(const svn_
 
    ### this will go away when we fully move to in-db properties.  */
 svn_error_t *
-svn_wc__wq_build_write_old_props(const svn_skel_t **work_item,
+svn_wc__wq_build_write_old_props(svn_skel_t **work_item,
                                  const char *props_abspath,
                                  apr_hash_t *props,
                                  apr_pool_t *result_pool);