[[
Use result_pool/scratch_pool paradigm in libsvn_wc.

* subversion/libsvn_wc/log.h
  subversion/libsvn_wc/log.c
  renamed all pool parameters to result_pool or scratch_pool, or split
  them into result_pool and scratch pool depending on a functions pool
  usage.

* subversion/libsvn_wc/adm_ops.c
  subversion/libsvn_wc/merge.c
  subversion/libsvn_wc/props.c
  subversion/libsvn_wc/update_editor.c
  adjusted all calls to log.h to use two pool parameters.
]]
Index: subversion/libsvn_wc/props.c
===================================================================
--- subversion/libsvn_wc/props.c	(revision 39256)
+++ subversion/libsvn_wc/props.c	(working copy)
@@ -351,11 +351,11 @@
   SVN_ERR(svn_wc__loggy_move(log_accum, svn_wc__adm_access_abspath(adm_access),
                              propfile_tmp_path,
                              propfile_path,
-                             pool));
+                             pool, pool));
 
   /* Make the props file read-only */
   return svn_wc__loggy_set_readonly(log_accum, adm_access,
-                                    propfile_path, pool);
+                                    propfile_path, pool, pool);
 }
 
 svn_error_t *
@@ -393,7 +393,7 @@
                                 kind, svn_wc__props_working, pool));
 
       SVN_ERR(svn_wc__loggy_remove(log_accum, adm_access,
-                                   working_propfile_path, pool));
+                                   working_propfile_path, pool, pool));
     }
 
   /* Repeat the above steps for the base properties if required. */
@@ -412,7 +412,7 @@
                                     kind, svn_wc__props_base, pool));
 
           SVN_ERR(svn_wc__loggy_remove(log_accum, adm_access,
-                                       base_propfile_path, pool));
+                                       base_propfile_path, pool, pool));
         }
     }
 
@@ -505,7 +505,7 @@
 
   SVN_ERR(svn_wc__entry_versioned(&entry, path, adm_access, TRUE, pool));
   SVN_ERR(svn_wc__prop_path(&props_file, path, entry->kind, props_kind, pool));
-  SVN_ERR(svn_wc__loggy_remove(log_accum, adm_access, props_file, pool));
+  SVN_ERR(svn_wc__loggy_remove(log_accum, adm_access, props_file, pool, pool));
 
   return SVN_NO_ERROR;
 }
@@ -573,13 +573,13 @@
       if (destroy_baseprops)
         SVN_ERR(svn_wc__loggy_move(log_accum,
                                    svn_wc__adm_access_abspath(adm_access),
-                                   dst_bprop, dst_rprop, pool));
+                                   dst_bprop, dst_rprop, pool, pool));
       else
         {
           SVN_ERR(svn_io_copy_file(dst_bprop, tmp_rprop, TRUE, pool));
           SVN_ERR(svn_wc__loggy_move(log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
-                                     tmp_rprop, dst_rprop, pool));
+                                     tmp_rprop, dst_rprop, pool, pool));
         }
     }
   else if (kind == svn_node_none)
@@ -595,7 +595,7 @@
 
       SVN_ERR(svn_wc__loggy_move(log_accum,
                                  svn_wc__adm_access_abspath(adm_access),
-                                 dst_bprop, dst_rprop, pool));
+                                 dst_bprop, dst_rprop, pool, pool));
     }
 
   return SVN_NO_ERROR;
@@ -620,7 +620,7 @@
                             svn_wc__props_revert, pool));
 
   return svn_wc__loggy_move(log_accum, svn_wc__adm_access_abspath(adm_access),
-                            revert_file, base_file, pool);
+                            revert_file, base_file, pool, pool);
 }
 
 
@@ -1712,7 +1712,7 @@
 
       /* And of course, delete the temporary reject file. */
       SVN_ERR(svn_wc__loggy_remove(entry_accum, adm_access,
-                                   reject_tmp_path, pool));
+                                   reject_tmp_path, pool, pool));
 
       /* Mark entry as "conflicted" with a particular .prej file. */
       {
@@ -1724,7 +1724,7 @@
                                       svn_wc__adm_access_abspath(adm_access),
                                       path, &entry,
                                       SVN_WC__ENTRY_MODIFY_PREJFILE,
-                                      pool));
+                                      pool, pool));
       }
 
     } /* if (reject_tmp_fp) */
Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c	(revision 39256)
+++ subversion/libsvn_wc/adm_ops.c	(working copy)
@@ -249,7 +249,8 @@
 
   SVN_ERR(svn_io_check_path(revert_file, &kind, pool));
   if (kind == svn_node_file)
-    SVN_ERR(svn_wc__loggy_remove(logtags, adm_access, revert_file, pool));
+    SVN_ERR(svn_wc__loggy_remove(logtags, adm_access, revert_file,
+                                 pool, pool));
 
   return svn_wc__loggy_props_delete(logtags, path, svn_wc__props_revert,
                                     adm_access, pool);
@@ -470,24 +471,25 @@
   if (modify_flags)
     SVN_ERR(svn_wc__loggy_entry_modify(&logtags,
                                        svn_wc__adm_access_abspath(adm_access),
-                                       path, &tmp_entry, modify_flags, pool));
+                                       path, &tmp_entry, modify_flags,
+                                       pool, pool));
 
   if (remove_lock)
     SVN_ERR(svn_wc__loggy_delete_lock(&logtags,
                                       svn_wc__adm_access_abspath(adm_access),
-                                      path, pool));
+                                      path, pool, pool));
 
   if (remove_changelist)
     SVN_ERR(svn_wc__loggy_delete_changelist(&logtags,
                                       svn_wc__adm_access_abspath(adm_access),
-                                      path, pool));
+                                      path, pool, pool));
 
   /* Regardless of whether it's a file or dir, the "main" logfile
      contains a command to bump the revision attribute (and
      timestamp). */
   SVN_ERR(svn_wc__loggy_committed(&logtags,
                                   svn_wc__adm_access_abspath(adm_access),
-                                  path, new_revnum, pool));
+                                  path, new_revnum, pool, pool));
 
 
   /* Do wcprops in the same log txn as revision, etc. */
@@ -503,7 +505,7 @@
                                        svn_wc__adm_access_abspath(adm_access),
                                        path, prop->name,
                                        prop->value ? prop->value->data : NULL,
-                                       pool));
+                                       pool, pool));
         }
     }
 
@@ -1296,7 +1298,7 @@
                                          svn_wc__adm_access_abspath(adm_access),
                                          path, &tmp_entry,
                                          SVN_WC__ENTRY_MODIFY_SCHEDULE,
-                                         pool));
+                                         pool, pool));
 
       /* is it a replacement with history? */
       if (was_schedule == svn_wc_schedule_replace && was_copied)
@@ -1314,7 +1316,7 @@
             SVN_ERR(svn_wc__loggy_move(&log_accum,
                                        svn_wc__adm_access_abspath(adm_access),
                                        text_revert, text_base,
-                                       pool));
+                                       pool, pool));
 
           SVN_ERR(svn_wc__loggy_revert_props_restore(&log_accum,
                                                      path, adm_access, pool));
@@ -1607,7 +1609,7 @@
 
           SVN_ERR(svn_wc__loggy_move(&log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
-                                     text_base, text_revert, pool));
+                                     text_base, text_revert, pool, pool));
         }
       SVN_ERR(svn_wc__loggy_revert_props_create(&log_accum, path,
                                                 adm_access, TRUE, pool));
@@ -1942,11 +1944,11 @@
           SVN_ERR(svn_wc__loggy_copy(&log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
                                      text_revert, fullpath,
-                                     pool));
+                                     pool, pool));
           SVN_ERR(svn_wc__loggy_move(&log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
                                      text_revert, text_base,
-                                     pool));
+                                     pool, pool));
           *reverted = TRUE;
         }
       else
@@ -1965,7 +1967,7 @@
               SVN_ERR(svn_wc__loggy_copy(&log_accum,
                                       svn_wc__adm_access_abspath(adm_access),
                                       text_base, fullpath,
-                                      pool));
+                                      pool, pool));
               *reverted = TRUE;
             }
         }
@@ -1980,12 +1982,12 @@
             SVN_ERR(svn_wc__loggy_set_timestamp
                     (&log_accum, adm_access, fullpath,
                      svn_time_to_cstring(entry->cmt_date, pool),
-                     pool));
+                     pool, pool));
 
           SVN_ERR(svn_wc__loggy_set_entry_timestamp_from_wc
-                  (&log_accum, adm_access, fullpath, pool));
+                  (&log_accum, adm_access, fullpath, pool, pool));
           SVN_ERR(svn_wc__loggy_set_entry_working_size_from_wc
-                  (&log_accum, adm_access, fullpath, pool));
+                  (&log_accum, adm_access, fullpath, pool, pool));
         }
     }
 
@@ -1998,7 +2000,7 @@
       SVN_ERR(svn_wc__loggy_remove
               (&log_accum, adm_access,
                svn_dirent_join(svn_wc_adm_access_path(adm_access),
-                               entry->conflict_old, pool), pool));
+                               entry->conflict_old, pool), pool, pool));
     }
   if (entry->conflict_new)
     {
@@ -2007,7 +2009,7 @@
       SVN_ERR(svn_wc__loggy_remove
               (&log_accum, adm_access,
                svn_dirent_join(svn_wc_adm_access_path(adm_access),
-                               entry->conflict_new, pool), pool));
+                               entry->conflict_new, pool), pool, pool));
     }
   if (entry->conflict_wrk)
     {
@@ -2016,7 +2018,7 @@
       SVN_ERR(svn_wc__loggy_remove
               (&log_accum, adm_access,
                svn_dirent_join(svn_wc_adm_access_path(adm_access),
-                               entry->conflict_wrk, pool), pool));
+                               entry->conflict_wrk, pool), pool, pool));
     }
 
   /* Remove the property conflict file if the entry lists one (and it
@@ -2028,7 +2030,7 @@
       SVN_ERR(svn_wc__loggy_remove
               (&log_accum, adm_access,
                svn_dirent_join(svn_wc_adm_access_path(adm_access),
-                               entry->prejfile, pool), pool));
+                               entry->prejfile, pool), pool, pool));
     }
 
   /* Clean up the copied state if this is a replacement. */
@@ -2070,7 +2072,8 @@
   /* Modify the entry, loggily. */
   SVN_ERR(svn_wc__loggy_entry_modify(&log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
-                                     fullpath, &tmp_entry, flags, pool));
+                                     fullpath, &tmp_entry, flags,
+                                     pool, pool));
 
   /* Don't run log if nothing to change. */
   if (! svn_stringbuf_isempty(log_accum))
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c	(revision 39256)
+++ subversion/libsvn_wc/update_editor.c	(working copy)
@@ -1205,7 +1205,7 @@
         {
           SVN_ERR(svn_wc__loggy_delete_lock(&log_accum,
                                    svn_wc__adm_access_abspath(adm_access),
-                                   path, pool));
+                                   path, pool, pool));
 
           if (lock_state)
             *lock_state = svn_wc_notify_lock_state_unlocked;
@@ -1245,7 +1245,7 @@
   if (flags)
     SVN_ERR(svn_wc__loggy_entry_modify(&log_accum,
                                        svn_wc__adm_access_abspath(adm_access),
-                                       path, &tmp_entry, flags, pool));
+                                       path, &tmp_entry, flags, pool, pool));
 
   return SVN_NO_ERROR;
 }
@@ -2138,7 +2138,7 @@
    * unversioned. */
   SVN_ERR(svn_wc__loggy_delete_entry(&log_item,
                              svn_wc__adm_access_abspath(parent_adm_access),
-                             full_path, pool));
+                             full_path, pool, pool));
 
   /* If the thing being deleted is the *target* of this update, then
      we need to recreate a 'deleted' entry, so that the parent can give
@@ -2159,7 +2159,7 @@
                                SVN_WC__ENTRY_MODIFY_REVISION
                                | SVN_WC__ENTRY_MODIFY_KIND
                                | SVN_WC__ENTRY_MODIFY_DELETED,
-                               pool));
+                               pool, pool));
 
       eb->target_deleted = TRUE;
     }
@@ -4165,7 +4165,7 @@
   return svn_wc__loggy_entry_modify(&log_accum,
                                     svn_wc__adm_access_abspath(adm_access),
                                     path, &tmp_entry, modify_flags,
-                                    pool);
+                                    pool, pool);
 }
 
 
@@ -4359,7 +4359,7 @@
             SVN_ERR(svn_wc__loggy_copy(&log_accum,
                                        svn_wc__adm_access_abspath(adm_access),
                                        new_text_base_path,
-                                       fb->path, pool));
+                                       fb->path, pool, pool));
         }
       else   /* working file or obstruction is locally modified... */
         {
@@ -4373,7 +4373,7 @@
               SVN_ERR(svn_wc__loggy_copy(&log_accum,
                                          svn_wc__adm_access_abspath(adm_access),
                                          new_text_base_path,
-                                         fb->path, pool));
+                                         fb->path, pool, pool));
             }
           else if (! fb->existed)
             /* Working file exists and has local mods
@@ -4453,12 +4453,13 @@
               /* If we created a temporary left merge file, get rid of it. */
               if (delete_left)
                 SVN_ERR(svn_wc__loggy_remove(&log_accum, adm_access,
-                                             merge_left, pool));
+                                             merge_left, pool, pool));
 
               /* And clean up add-with-history-related temp file too. */
               if (fb->copied_working_text)
                 SVN_ERR(svn_wc__loggy_remove(&log_accum, adm_access,
-                                             fb->copied_working_text, pool));
+                                             fb->copied_working_text,
+                                             pool, pool));
 
             } /* end: working file exists and has mods */
         } /* end: working file has mods */
@@ -4495,7 +4496,7 @@
              retranslation is actually done according to the new props. */
           SVN_ERR(svn_wc__loggy_copy(&log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
-                                     tmptext, fb->path, pool));
+                                     tmptext, fb->path, pool, pool));
         }
 
       if (*lock_state == svn_wc_notify_lock_state_unlocked)
@@ -4503,7 +4504,7 @@
            might need to set the file read-only. */
         SVN_ERR(svn_wc__loggy_maybe_set_readonly(&log_accum,
                                     svn_wc__adm_access_abspath(adm_access),
-                                    fb->path, pool));
+                                    fb->path, pool, pool));
     }
 
   /* Deal with installation of the new textbase, if appropriate. */
@@ -4512,9 +4513,9 @@
       SVN_ERR(svn_wc__loggy_move(&log_accum,
                                  svn_wc__adm_access_abspath(adm_access),
                                  new_text_base_path,
-                                 fb->text_base_path, pool));
+                                 fb->text_base_path, pool, pool));
       SVN_ERR(svn_wc__loggy_set_readonly(&log_accum, adm_access,
-                                         fb->text_base_path, pool));
+                                         fb->text_base_path, pool, pool));
       tmp_entry.checksum = svn_checksum_to_cstring(actual_checksum, pool);
       flags |= SVN_WC__ENTRY_MODIFY_CHECKSUM;
     }
@@ -4530,7 +4531,8 @@
   /* Do the entry modifications we've accumulated. */
   SVN_ERR(svn_wc__loggy_entry_modify(&log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
-                                     fb->path, &tmp_entry, flags, pool));
+                                     fb->path, &tmp_entry, flags,
+                                     pool, pool));
 
   /* Log commands to handle text-timestamp and working-size,
      if the file is - or will be - unmodified and schedule-normal */
@@ -4542,7 +4544,7 @@
       if (fb->last_changed_date && !fb->existed)
         SVN_ERR(svn_wc__loggy_set_timestamp(&log_accum, adm_access,
                                             fb->path, fb->last_changed_date,
-                                            pool));
+                                            pool, pool));
 
       if ((new_text_base_path || magic_props_changed)
           && !fb->deleted)
@@ -4550,18 +4552,20 @@
           /* Adjust entries file to match working file */
           SVN_ERR(svn_wc__loggy_set_entry_timestamp_from_wc(&log_accum,
                                                             adm_access,
-                                                            fb->path, pool));
+                                                            fb->path,
+                                                            pool, pool));
         }
       SVN_ERR(svn_wc__loggy_set_entry_working_size_from_wc(&log_accum,
                                                            adm_access,
-                                                           fb->path, pool));
+                                                           fb->path,
+                                                           pool, pool));
     }
 
   /* Clean up add-with-history temp file. */
   if (fb->copied_text_base)
     SVN_ERR(svn_wc__loggy_remove(&log_accum, adm_access,
                                  fb->copied_text_base,
-                                 pool));
+                                 pool, pool));
 
 
   /* Set the returned content state. */
@@ -5493,7 +5497,7 @@
 
       SVN_ERR(svn_wc__loggy_move(&log_accum,
                                  svn_wc__adm_access_abspath(adm_access),
-                                 dst_txtb, dst_rtext, pool));
+                                 dst_txtb, dst_rtext, pool, pool));
       SVN_ERR(svn_wc__loggy_revert_props_create(&log_accum,
                                                 dst_path, adm_access,
                                                 TRUE, pool));
@@ -5525,7 +5529,7 @@
     SVN_ERR(svn_wc__loggy_entry_modify(&log_accum,
                                        svn_wc__adm_access_abspath(adm_access),
                                        dst_path, &tmp_entry,
-                                       modify_flags, pool));
+                                       modify_flags, pool, pool));
   }
 
   /* Set the new revision number and URL in the entry and clean up some other
@@ -5573,12 +5577,12 @@
       SVN_ERR(svn_wc__loggy_copy(&log_accum,
                                  svn_wc__adm_access_abspath(adm_access),
                                  tmp_text_path, dst_path,
-                                 pool));
+                                 pool, pool));
 
       /* After copying to the working directory, lose the temp file. */
       SVN_ERR(svn_wc__loggy_remove(&log_accum, adm_access,
                                    tmp_text_path,
-                                   pool));
+                                   pool, pool));
     }
   else
     {
@@ -5587,13 +5591,15 @@
       SVN_ERR(svn_wc__loggy_copy(&log_accum,
                                  svn_wc__adm_access_abspath(adm_access),
                                  tmp_text_base_path, dst_path,
-                                 pool));
+                                 pool, pool));
       SVN_ERR(svn_wc__loggy_set_entry_timestamp_from_wc(&log_accum,
                                                         adm_access,
-                                                        dst_path, pool));
+                                                        dst_path,
+                                                        pool, pool));
       SVN_ERR(svn_wc__loggy_set_entry_working_size_from_wc(&log_accum,
                                                            adm_access,
-                                                           dst_path, pool));
+                                                           dst_path,
+                                                           pool, pool));
     }
 
   /* Install new text base. */
@@ -5604,16 +5610,17 @@
        checksum. */
     SVN_ERR(svn_wc__loggy_move(&log_accum,
                                svn_wc__adm_access_abspath(adm_access),
-                               tmp_text_base_path, text_base_path, pool));
+                               tmp_text_base_path, text_base_path,
+                               pool, pool));
     SVN_ERR(svn_wc__loggy_set_readonly(&log_accum, adm_access,
-                                       text_base_path, pool));
+                                       text_base_path, pool, pool));
 
     tmp_entry.checksum = svn_checksum_to_cstring(base_checksum, pool);
     SVN_ERR(svn_wc__loggy_entry_modify(&log_accum,
                                        svn_wc__adm_access_abspath(adm_access),
                                        dst_path, &tmp_entry,
                                        SVN_WC__ENTRY_MODIFY_CHECKSUM,
-                                       pool));
+                                       pool, pool));
   }
 
   /* Write our accumulation of log entries into a log file */
Index: subversion/libsvn_wc/merge.c
===================================================================
--- subversion/libsvn_wc/merge.c	(revision 39256)
+++ subversion/libsvn_wc/merge.c	(working copy)
@@ -412,7 +412,7 @@
                                      svn_io_file_del_none,
                                      pool, pool));
   SVN_ERR(svn_wc__loggy_copy(log_accum, adm_abspath,
-                             result_target, edited_copy, pool));
+                             result_target, edited_copy, pool, pool));
   return SVN_NO_ERROR;
 }
 
@@ -446,14 +446,14 @@
       case svn_wc_conflict_choose_base:
         {
           SVN_ERR(svn_wc__loggy_copy(log_accum, adm_abspath,
-                                     left, merge_target, pool));
+                                     left, merge_target, pool, pool));
           *merge_outcome = svn_wc_merge_merged;
           return SVN_NO_ERROR;
         }
       case svn_wc_conflict_choose_theirs_full:
         {
           SVN_ERR(svn_wc__loggy_copy(log_accum, adm_abspath,
-                                     right, merge_target, pool));
+                                     right, merge_target, pool, pool));
           *merge_outcome = svn_wc_merge_merged;
           return SVN_NO_ERROR;
         }
@@ -496,7 +496,7 @@
                                               pool));
           SVN_ERR(svn_stream_close(chosen_stream));
           SVN_ERR(svn_wc__loggy_copy(log_accum, adm_abspath,
-                                     chosen_path, merge_target, pool));
+                                     chosen_path, merge_target, pool, pool));
           *merge_outcome = svn_wc_merge_merged;
           return SVN_NO_ERROR;
         }
@@ -516,7 +516,7 @@
                                        ? result->merged_file
                                        : result_target,
                                      merge_target,
-                                     pool));
+                                     pool, pool));
           *merge_outcome = svn_wc_merge_merged;
           return SVN_NO_ERROR;
         }
@@ -529,7 +529,8 @@
           if (copyfrom_text)
             {
               SVN_ERR(svn_wc__loggy_copy(log_accum, adm_abspath,
-                                     copyfrom_text, merge_target, pool));
+                                     copyfrom_text, merge_target,
+                                     pool, pool));
             }
 
           /* Assume conflict remains. */
@@ -638,11 +639,11 @@
   SVN_ERR(svn_wc__loggy_translated_file(log_accum,
                                         svn_wc__adm_access_abspath(adm_access),
                                         left_copy, tmp_left,
-                                        merge_target, pool));
+                                        merge_target, pool, pool));
   SVN_ERR(svn_wc__loggy_translated_file(log_accum,
                                         svn_wc__adm_access_abspath(adm_access),
                                         right_copy, tmp_right,
-                                        merge_target, pool));
+                                        merge_target, pool, pool));
 
   /* Back up MERGE_TARGET through detranslation/retranslation:
      the new translation properties may not match the current ones */
@@ -653,7 +654,7 @@
   SVN_ERR(svn_wc__loggy_translated_file(log_accum,
                                         svn_wc__adm_access_abspath(adm_access),
                                         target_copy, detranslated_target_copy,
-                                        merge_target, pool));
+                                        merge_target, pool, pool));
 
   tmp_entry.conflict_old = svn_dirent_is_child(adm_path, left_copy, pool);
   tmp_entry.conflict_new = svn_dirent_is_child(adm_path, right_copy, pool);
@@ -667,7 +668,7 @@
             SVN_WC__ENTRY_MODIFY_CONFLICT_OLD
               | SVN_WC__ENTRY_MODIFY_CONFLICT_NEW
               | SVN_WC__ENTRY_MODIFY_CONFLICT_WRK,
-            pool));
+            pool, pool));
 
   return SVN_NO_ERROR;
 }
@@ -939,7 +940,7 @@
     /* replace MERGE_TARGET with the new merged file, expanding. */
     SVN_ERR(svn_wc__loggy_copy(log_accum,
                                svn_wc__adm_access_abspath(adm_access),
-                               result_target, merge_target, pool));
+                               result_target, merge_target, pool, pool));
   return SVN_NO_ERROR;
 }
 
@@ -1002,7 +1003,7 @@
             {
               SVN_ERR(svn_wc__loggy_copy(log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
-                                     left, merge_target, pool));
+                                     left, merge_target, pool, pool));
               *merge_outcome = svn_wc_merge_merged;
               return SVN_NO_ERROR;
             }
@@ -1010,7 +1011,7 @@
             {
               SVN_ERR(svn_wc__loggy_copy(log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
-                                     right, merge_target, pool));
+                                     right, merge_target, pool, pool));
               *merge_outcome = svn_wc_merge_merged;
               return SVN_NO_ERROR;
             }
@@ -1039,7 +1040,7 @@
                   SVN_ERR(svn_wc__loggy_copy(log_accum,
                                      svn_wc__adm_access_abspath(adm_access),
                                      result->merged_file, merge_target,
-                                     pool));
+                                     pool, pool));
                   *merge_outcome = svn_wc_merge_merged;
                   return SVN_NO_ERROR;
                 }
@@ -1090,7 +1091,7 @@
                                  svn_wc__adm_access_abspath(adm_access),
                                  detranslated_target_abspath,
                                  mine_copy,
-                                 pool));
+                                 pool, pool));
       mine_copy = svn_dirent_is_child(svn_wc_adm_access_path(adm_access),
                                       mine_copy, pool);
       tmp_entry.conflict_wrk = mine_copy;
@@ -1113,7 +1114,7 @@
             SVN_WC__ENTRY_MODIFY_CONFLICT_OLD
               | SVN_WC__ENTRY_MODIFY_CONFLICT_NEW
               | SVN_WC__ENTRY_MODIFY_CONFLICT_WRK,
-            pool));
+            pool, pool));
 
   *merge_outcome = svn_wc_merge_conflict; /* a conflict happened */
 
@@ -1244,10 +1245,10 @@
     {
       SVN_ERR(svn_wc__loggy_maybe_set_executable(log_accum,
                                       svn_wc__adm_access_abspath(adm_access),
-                                      merge_target, pool));
+                                      merge_target, pool, pool));
       SVN_ERR(svn_wc__loggy_maybe_set_readonly(log_accum,
                                       svn_wc__adm_access_abspath(adm_access),
-                                      merge_target, pool));
+                                      merge_target, pool, pool));
     }
 
   return SVN_NO_ERROR;
Index: subversion/libsvn_wc/log.c
===================================================================
--- subversion/libsvn_wc/log.c	(revision 39256)
+++ subversion/libsvn_wc/log.c	(working copy)
@@ -204,24 +204,26 @@
                      const char *versioned,
                      enum svn_wc__xfer_action action,
                      svn_boolean_t rerun,
-                     apr_pool_t *pool)
+                     apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
   const char *full_from_path, *full_dest_path, *full_versioned_path;
   const char *dest_abspath;
 
-  full_from_path = svn_dirent_join(adm_abspath, name, pool);
-  full_dest_path = svn_dirent_join(adm_abspath, dest, pool);
-  SVN_ERR(svn_dirent_get_absolute(&dest_abspath, full_dest_path, pool));
+  full_from_path = svn_dirent_join(adm_abspath, name, scratch_pool);
+  full_dest_path = svn_dirent_join(adm_abspath, dest, scratch_pool);
+  SVN_ERR(svn_dirent_get_absolute(&dest_abspath, full_dest_path,
+                                  scratch_pool));
   if (versioned)
-    full_versioned_path = svn_dirent_join(adm_abspath, versioned, pool);
+    full_versioned_path = svn_dirent_join(adm_abspath, versioned,
+                                          scratch_pool);
   else
     full_versioned_path = NULL; /* Silence GCC uninitialised warning */
 
   switch (action)
     {
     case svn_wc__xfer_append:
-      err = svn_io_append_file(full_from_path, full_dest_path, pool);
+      err = svn_io_append_file(full_from_path, full_dest_path, scratch_pool);
       if (err)
         {
           if (! rerun || ! APR_STATUS_IS_ENOENT(err->apr_err))
@@ -242,16 +244,17 @@
           full_versioned_path = full_dest_path;
 
         err = svn_dirent_get_absolute(&versioned_abspath, full_versioned_path,
-                                      pool);
+                                      scratch_pool);
 
         if (! err)
           err = svn_wc__get_eol_style(&style, &eol, db, versioned_abspath,
-                                      pool, pool);
+                                      scratch_pool, scratch_pool);
         if (! err)
           err = svn_wc__get_keywords(&keywords, db, versioned_abspath, NULL,
-                                     pool, pool);
+                                     scratch_pool, scratch_pool);
         if (! err)
-          err = svn_wc__get_special(&special, db, versioned_abspath, pool);
+          err = svn_wc__get_special(&special, db, versioned_abspath,
+                                    scratch_pool);
 
         if (! err)
           err = svn_subst_copy_and_translate3
@@ -259,7 +262,7 @@
                  eol, TRUE,
                  keywords, TRUE,
                  special,
-                 pool);
+                 scratch_pool);
 
         if (err)
           {
@@ -268,15 +271,17 @@
             svn_error_clear(err);
           }
 
-        SVN_ERR(svn_wc__maybe_set_read_only(NULL, db, dest_abspath, pool));
+        SVN_ERR(svn_wc__maybe_set_read_only(NULL, db, dest_abspath,
+                                            scratch_pool));
 
         return svn_error_return(svn_wc__maybe_set_executable(
-                                              NULL, db, dest_abspath, pool));
+                                              NULL, db, dest_abspath,
+                                              scratch_pool));
       }
 
     case svn_wc__xfer_mv:
       err = svn_io_file_rename(full_from_path,
-                               full_dest_path, pool);
+                               full_dest_path, scratch_pool);
 
       /* If we got an ENOENT, that's ok;  the move has probably
          already completed in an earlier run of this log.  */
@@ -310,7 +315,7 @@
  * then set OVERWROTE_WORKING to TRUE.  If the working file isn't
  * touched at all, then set to FALSE.
  *
- * Use POOL for any temporary allocation.
+ * Use SCRATCH_POOL for any temporary allocation.
  */
 static svn_error_t *
 install_committed_file(svn_boolean_t *overwrote_working,
@@ -319,7 +324,7 @@
                        const char *name,
                        svn_boolean_t remove_executable,
                        svn_boolean_t remove_read_only,
-                       apr_pool_t *pool)
+                       apr_pool_t *scratch_pool)
 {
   const char *tmp_text_base;
   svn_node_kind_t kind;
@@ -331,7 +336,7 @@
   /* start off assuming that the working file isn't touched. */
   *overwrote_working = FALSE;
 
-  file_abspath = svn_dirent_join(adm_abspath, name, pool);
+  file_abspath = svn_dirent_join(adm_abspath, name, scratch_pool);
 
   /* In the commit, newlines and keywords may have been
    * canonicalized and/or contracted... Or they may not have
@@ -352,8 +357,8 @@
 
   /* Is there a tmp_text_base that needs to be installed?  */
   SVN_ERR(svn_wc__text_base_path(&tmp_text_base, db, file_abspath, TRUE,
-                                 pool));
-  SVN_ERR(svn_io_check_path(tmp_text_base, &kind, pool));
+                                 scratch_pool));
+  SVN_ERR(svn_io_check_path(tmp_text_base, &kind, scratch_pool));
 
   {
     const char *tmp = (kind == svn_node_file) ? tmp_text_base : file_abspath;
@@ -361,7 +366,7 @@
     SVN_ERR(svn_wc__internal_translated_file(&tmp_wfile, tmp, db,
                                              file_abspath,
                                              SVN_WC_TRANSLATE_FROM_NF,
-                                             pool, pool));
+                                             scratch_pool, scratch_pool));
 
     /* If the translation is a no-op, the text base and the working copy
      * file contain the same content, because we use the same props here
@@ -371,17 +376,17 @@
      * it has the right executable and read_write attributes set.
      */
 
-    SVN_ERR(svn_wc__get_special(&special, db, file_abspath, pool));
+    SVN_ERR(svn_wc__get_special(&special, db, file_abspath, scratch_pool));
     if (! special && tmp != tmp_wfile)
       SVN_ERR(svn_io_files_contents_same_p(&same, tmp_wfile,
-                                           file_abspath, pool));
+                                           file_abspath, scratch_pool));
     else
       same = TRUE;
   }
 
   if (! same)
     {
-      SVN_ERR(svn_io_file_rename(tmp_wfile, file_abspath, pool));
+      SVN_ERR(svn_io_file_rename(tmp_wfile, file_abspath, scratch_pool));
       *overwrote_working = TRUE;
     }
 
@@ -391,13 +396,14 @@
       if (same)
         SVN_ERR(svn_io_set_file_executable(file_abspath,
                                            FALSE, /* chmod -x */
-                                           FALSE, pool));
+                                           FALSE, scratch_pool));
       *overwrote_working = TRUE; /* entry needs wc-file's timestamp  */
     }
   else
     {
       /* Set the working file's execute bit if props dictate. */
-      SVN_ERR(svn_wc__maybe_set_executable(&did_set, db, file_abspath, pool));
+      SVN_ERR(svn_wc__maybe_set_executable(&did_set, db, file_abspath,
+                                           scratch_pool));
       if (did_set)
         /* okay, so we didn't -overwrite- the working file, but we changed
            its timestamp, which is the point of returning this flag. :-) */
@@ -408,12 +414,14 @@
     {
       /* No need to make a new file read_write: new files already are. */
       if (same)
-        SVN_ERR(svn_io_set_file_read_write(file_abspath, FALSE, pool));
+        SVN_ERR(svn_io_set_file_read_write(file_abspath, FALSE,
+                                           scratch_pool));
       *overwrote_working = TRUE; /* entry needs wc-file's timestamp  */
     }
   else
     {
-      SVN_ERR(svn_wc__maybe_set_read_only(&did_set, db, file_abspath, pool));
+      SVN_ERR(svn_wc__maybe_set_read_only(&did_set, db, file_abspath,
+                                          scratch_pool));
       if (did_set)
         /* okay, so we didn't -overwrite- the working file, but we changed
            its timestamp, which is the point of returning this flag. :-) */
@@ -422,7 +430,7 @@
 
   /* Install the new text base if one is waiting. */
   if (kind == svn_node_file)  /* tmp_text_base exists */
-    SVN_ERR(svn_wc__sync_text_base(file_abspath, pool));
+    SVN_ERR(svn_wc__sync_text_base(file_abspath, scratch_pool));
 
   return SVN_NO_ERROR;
 }
@@ -1477,14 +1485,14 @@
               svn_boolean_t adm_only,
               svn_cancel_func_t cancel_func,
               void *cancel_baton,
-              apr_pool_t *pool)
+              apr_pool_t *scratch_pool)
 {
   const svn_wc_entry_t *thisdir_entry, *parent_entry;
   svn_wc_entry_t tmp_entry;
   svn_error_t *err;
   SVN_ERR(svn_wc_entry(&thisdir_entry,
                        svn_wc_adm_access_path(adm_access), adm_access,
-                       FALSE, pool));
+                       FALSE, scratch_pool));
 
   /* Blow away the administrative directories, and possibly the working
      copy tree too. */
@@ -1493,7 +1501,7 @@
                                             !adm_only, /* destroy */
                                             FALSE, /* no instant err */
                                             cancel_func, cancel_baton,
-                                            pool);
+                                            scratch_pool);
   if (err && err->apr_err != SVN_ERR_WC_LEFT_LOCAL_MOD)
     return err;
   svn_error_clear(err);
@@ -1505,9 +1513,11 @@
     svn_wc_adm_access_t *parent_access;
 
     svn_dirent_split(svn_wc_adm_access_path(adm_access), &parent, &bname,
-                     pool);
-    SVN_ERR(svn_wc_adm_retrieve(&parent_access, adm_access, parent, pool));
-    SVN_ERR(svn_wc_entry(&parent_entry, parent, parent_access, FALSE, pool));
+                     scratch_pool);
+    SVN_ERR(svn_wc_adm_retrieve(&parent_access, adm_access, parent,
+                                scratch_pool));
+    SVN_ERR(svn_wc_entry(&parent_entry, parent, parent_access, FALSE,
+                         scratch_pool));
 
     if (thisdir_entry->revision > parent_entry->revision)
       {
@@ -1518,7 +1528,7 @@
                                      SVN_WC__ENTRY_MODIFY_REVISION
                                      | SVN_WC__ENTRY_MODIFY_KIND
                                      | SVN_WC__ENTRY_MODIFY_DELETED,
-                                     pool));
+                                     scratch_pool));
       }
   }
   return SVN_NO_ERROR;
@@ -1535,11 +1545,11 @@
    number appended to SVN_WC__ADM_LOG so that they look like "log.1",
    "log.2", etc. */
 static const char *
-compute_logfile_path(int log_number, apr_pool_t *pool)
+compute_logfile_path(int log_number, apr_pool_t *result_pool)
 {
   if (log_number == 0)
     return SVN_WC__ADM_LOG;
-  return apr_psprintf(pool, SVN_WC__ADM_LOG ".%d", log_number);
+  return apr_psprintf(result_pool, SVN_WC__ADM_LOG ".%d", log_number);
 }
 
 
@@ -1547,30 +1557,31 @@
 static svn_error_t *
 run_log(svn_wc_adm_access_t *adm_access,
         svn_boolean_t rerun,
-        apr_pool_t *pool)
+        apr_pool_t *scratch_pool)
 {
   const char *dir_abspath = svn_wc__adm_access_abspath(adm_access);
   svn_xml_parser_t *parser;
   struct log_runner *loggy;
-  char *buf = apr_palloc(pool, SVN__STREAM_CHUNK_SIZE);
+  char *buf = apr_palloc(scratch_pool, SVN__STREAM_CHUNK_SIZE);
   const char *logfile_path;
   int log_number;
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_boolean_t killme, kill_adm_only;
 
-  loggy = apr_pcalloc(pool, sizeof(*loggy));
+  loggy = apr_pcalloc(scratch_pool, sizeof(*loggy));
 
-  parser = svn_xml_make_parser(loggy, start_handler, NULL, NULL, pool);
+  parser = svn_xml_make_parser(loggy, start_handler, NULL, NULL,
+                               scratch_pool);
 
   loggy->db = svn_wc__adm_get_db(adm_access);
   loggy->adm_abspath = svn_wc__adm_access_abspath(adm_access);
   loggy->adm_access = adm_access;
-  loggy->pool = svn_pool_create(pool);
-  loggy->result_pool = svn_pool_create(pool);
+  loggy->pool = svn_pool_create(scratch_pool);
+  loggy->result_pool = svn_pool_create(scratch_pool);
   loggy->parser = parser;
   loggy->rerun = rerun;
   loggy->count = 0;
-  loggy->tree_conflicts = apr_hash_make(pool);
+  loggy->tree_conflicts = apr_hash_make(scratch_pool);
 
   /* Expat wants everything wrapped in a top-level form, so start with
      a ghost open tag. */
@@ -1620,7 +1631,7 @@
     {
       apr_hash_index_t *hi;
 
-      for (hi = apr_hash_first(pool, loggy->tree_conflicts); hi;
+      for (hi = apr_hash_first(scratch_pool, loggy->tree_conflicts); hi;
             hi = apr_hash_next(hi))
         {
           svn_error_t *err;
@@ -1639,10 +1650,12 @@
     }
 
   /* Check for a 'killme' file in the administrative area. */
-  SVN_ERR(svn_wc__check_killme(adm_access, &killme, &kill_adm_only, pool));
+  SVN_ERR(svn_wc__check_killme(adm_access, &killme, &kill_adm_only,
+                               scratch_pool));
   if (killme)
     {
-      SVN_ERR(handle_killme(adm_access, kill_adm_only, NULL, NULL, pool));
+      SVN_ERR(handle_killme(adm_access, kill_adm_only, NULL, NULL,
+                            scratch_pool));
     }
   else
     {
@@ -1665,9 +1678,9 @@
 
 svn_error_t *
 svn_wc__run_log(svn_wc_adm_access_t *adm_access,
-                apr_pool_t *pool)
+                apr_pool_t *scratch_pool)
 {
-  return run_log(adm_access, FALSE, pool);
+  return run_log(adm_access, FALSE, scratch_pool);
 }
 
 
@@ -1684,17 +1697,19 @@
                          svn_boolean_t is_move,
                          const char *adm_abspath,
                          const char *src_path, const char *dst_path,
-                         apr_pool_t *pool)
+                         apr_pool_t *result_pool,
+                         apr_pool_t *scratch_pool)
 {
   svn_node_kind_t kind;
-  const char *src_abspath = svn_dirent_join(adm_abspath, src_path, pool);
+  const char *src_abspath = svn_dirent_join(adm_abspath, src_path,
+                                            scratch_pool);
 
-  SVN_ERR(svn_io_check_path(src_abspath, &kind, pool));
+  SVN_ERR(svn_io_check_path(src_abspath, &kind, scratch_pool));
 
   /* Does this file exist? */
   if (kind != svn_node_none)
     {
-      svn_xml_make_open_tag(log_accum, pool,
+      svn_xml_make_open_tag(log_accum, result_pool,
                             svn_xml_self_closing,
                             is_move
                               ? SVN_WC__LOG_MV
@@ -1719,11 +1734,11 @@
 loggy_path(const char **logy_path,
            const char *path,
            const char *adm_abspath,
-           apr_pool_t *pool)
+           apr_pool_t *scratch_pool)
 {
   const char *abspath;
 
-  SVN_ERR(svn_dirent_get_absolute(&abspath, path, pool));
+  SVN_ERR(svn_dirent_get_absolute(&abspath, path, scratch_pool));
   *logy_path = svn_dirent_is_child(adm_abspath, abspath, NULL);
 
   if (! (*logy_path) && strcmp(abspath, adm_abspath) == 0)
@@ -1760,18 +1775,19 @@
                         const char *adm_abspath,
                         const char *path,
                         svn_revnum_t revnum,
-                        apr_pool_t *pool)
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(adm_abspath));
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
-  svn_xml_make_open_tag(log_accum, pool, svn_xml_self_closing,
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
+  svn_xml_make_open_tag(log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_COMMITTED,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
                         SVN_WC__LOG_ATTR_REVISION,
-                        apr_psprintf(pool, "%ld", revnum),
+                        apr_psprintf(scratch_pool, "%ld", revnum),
                         NULL);
 
   return SVN_NO_ERROR;
@@ -1781,15 +1797,17 @@
 svn_wc__loggy_copy(svn_stringbuf_t **log_accum,
                    const char *adm_abspath,
                    const char *src_path, const char *dst_path,
-                   apr_pool_t *pool)
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
   const char *loggy_path2;
 
-  SVN_ERR(loggy_path(&loggy_path1, src_path, adm_abspath, pool));
-  SVN_ERR(loggy_path(&loggy_path2, dst_path, adm_abspath, pool));
+  SVN_ERR(loggy_path(&loggy_path1, src_path, adm_abspath, scratch_pool));
+  SVN_ERR(loggy_path(&loggy_path2, dst_path, adm_abspath, scratch_pool));
   return loggy_move_copy_internal(log_accum, FALSE, adm_abspath,
-                                  loggy_path1, loggy_path2, pool);
+                                  loggy_path1, loggy_path2,
+                                  result_pool, scratch_pool);
 }
 
 svn_error_t *
@@ -1798,17 +1816,18 @@
                               const char *dst,
                               const char *src,
                               const char *versioned,
-                              apr_pool_t *pool)
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
   const char *loggy_path2;
   const char *loggy_path3;
 
-  SVN_ERR(loggy_path(&loggy_path1, src, adm_abspath, pool));
-  SVN_ERR(loggy_path(&loggy_path2, dst, adm_abspath, pool));
-  SVN_ERR(loggy_path(&loggy_path3, versioned, adm_abspath, pool));
+  SVN_ERR(loggy_path(&loggy_path1, src, adm_abspath, scratch_pool));
+  SVN_ERR(loggy_path(&loggy_path2, dst, adm_abspath, scratch_pool));
+  SVN_ERR(loggy_path(&loggy_path3, versioned, adm_abspath, scratch_pool));
   svn_xml_make_open_tag
-    (log_accum, pool, svn_xml_self_closing,
+    (log_accum, result_pool, svn_xml_self_closing,
      SVN_WC__LOG_CP_AND_TRANSLATE,
      SVN_WC__LOG_ATTR_NAME, loggy_path1,
      SVN_WC__LOG_ATTR_DEST, loggy_path2,
@@ -1822,12 +1841,13 @@
 svn_wc__loggy_delete_entry(svn_stringbuf_t **log_accum,
                            const char *adm_abspath,
                            const char *path,
-                           apr_pool_t *pool)
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
-  svn_xml_make_open_tag(log_accum, pool, svn_xml_self_closing,
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
+  svn_xml_make_open_tag(log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_DELETE_ENTRY,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
                         NULL);
@@ -1839,12 +1859,13 @@
 svn_wc__loggy_delete_lock(svn_stringbuf_t **log_accum,
                           const char *adm_abspath,
                           const char *path,
-                          apr_pool_t *pool)
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
-  svn_xml_make_open_tag(log_accum, pool, svn_xml_self_closing,
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
+  svn_xml_make_open_tag(log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_DELETE_LOCK,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
                         NULL);
@@ -1856,12 +1877,13 @@
 svn_wc__loggy_delete_changelist(svn_stringbuf_t **log_accum,
                                 const char *adm_abspath,
                                 const char *path,
-                                apr_pool_t *pool)
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
-  svn_xml_make_open_tag(log_accum, pool, svn_xml_self_closing,
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
+  svn_xml_make_open_tag(log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_DELETE_CHANGELIST,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
                         NULL);
@@ -1875,10 +1897,11 @@
                            const char *path,
                            const svn_wc_entry_t *entry,
                            apr_uint64_t modify_flags,
-                           apr_pool_t *pool)
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
-  apr_hash_t *prop_hash = apr_hash_make(pool);
+  apr_hash_t *prop_hash = apr_hash_make(scratch_pool);
   static const char *kind_str[] =
     { "none",
       SVN_WC__ENTRIES_ATTR_FILE_STR,
@@ -1903,7 +1926,7 @@
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_REVISION,
                  SVN_WC__ENTRY_ATTR_REVISION,
-                 apr_psprintf(pool, "%ld", entry->revision));
+                 apr_psprintf(scratch_pool, "%ld", entry->revision));
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_URL,
                  SVN_WC__ENTRY_ATTR_URL,
@@ -1947,7 +1970,7 @@
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_COPYFROM_REV,
                  SVN_WC__ENTRY_ATTR_COPYFROM_REV,
-                 apr_psprintf(pool, "%ld", entry->copyfrom_rev));
+                 apr_psprintf(scratch_pool, "%ld", entry->copyfrom_rev));
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CONFLICT_OLD,
                  SVN_WC__ENTRY_ATTR_CONFLICT_OLD,
@@ -1967,7 +1990,7 @@
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_TEXT_TIME,
                  SVN_WC__ENTRY_ATTR_TEXT_TIME,
-                 svn_time_to_cstring(entry->text_time, pool));
+                 svn_time_to_cstring(entry->text_time, scratch_pool));
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CHECKSUM,
                  SVN_WC__ENTRY_ATTR_CHECKSUM,
@@ -1975,11 +1998,11 @@
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CMT_REV,
                  SVN_WC__ENTRY_ATTR_CMT_REV,
-                 apr_psprintf(pool, "%ld", entry->cmt_rev));
+                 apr_psprintf(scratch_pool, "%ld", entry->cmt_rev));
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CMT_DATE,
                  SVN_WC__ENTRY_ATTR_CMT_DATE,
-                 svn_time_to_cstring(entry->cmt_date, pool));
+                 svn_time_to_cstring(entry->cmt_date, scratch_pool));
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_CMT_AUTHOR,
                  SVN_WC__ENTRY_ATTR_CMT_AUTHOR,
@@ -1992,7 +2015,7 @@
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_WORKING_SIZE,
                  SVN_WC__ENTRY_ATTR_WORKING_SIZE,
-                 apr_psprintf(pool, "%" APR_OFF_T_FMT,
+                 apr_psprintf(scratch_pool, "%" APR_OFF_T_FMT,
                               entry->working_size));
 
   ADD_ENTRY_ATTR(SVN_WC__ENTRY_MODIFY_FORCE,
@@ -2008,11 +2031,11 @@
   if (apr_hash_count(prop_hash) == 0)
     return SVN_NO_ERROR;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
   apr_hash_set(prop_hash, SVN_WC__LOG_ATTR_NAME,
                APR_HASH_KEY_STRING, loggy_path1);
 
-  svn_xml_make_open_tag_hash(log_accum, pool,
+  svn_xml_make_open_tag_hash(log_accum, result_pool,
                              svn_xml_self_closing,
                              SVN_WC__LOG_MODIFY_ENTRY,
                              prop_hash);
@@ -2027,12 +2050,13 @@
                             const char *path,
                             const char *propname,
                             const char *propval,
-                            apr_pool_t *pool)
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
-  svn_xml_make_open_tag(log_accum, pool, svn_xml_self_closing,
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
+  svn_xml_make_open_tag(log_accum, result_pool, svn_xml_self_closing,
                         SVN_WC__LOG_MODIFY_WCPROP,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
                         SVN_WC__LOG_ATTR_PROPNAME, propname,
@@ -2046,28 +2070,31 @@
 svn_wc__loggy_move(svn_stringbuf_t **log_accum,
                    const char *adm_abspath,
                    const char *src_path, const char *dst_path,
-                   apr_pool_t *pool)
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
   const char *loggy_path2;
 
-  SVN_ERR(loggy_path(&loggy_path1, src_path, adm_abspath, pool));
-  SVN_ERR(loggy_path(&loggy_path2, dst_path, adm_abspath, pool));
+  SVN_ERR(loggy_path(&loggy_path1, src_path, adm_abspath, scratch_pool));
+  SVN_ERR(loggy_path(&loggy_path2, dst_path, adm_abspath, scratch_pool));
   return loggy_move_copy_internal(log_accum, TRUE, adm_abspath,
-                                  loggy_path1, loggy_path2, pool);
+                                  loggy_path1, loggy_path2,
+                                  result_pool, scratch_pool);
 }
 
 svn_error_t *
 svn_wc__loggy_maybe_set_executable(svn_stringbuf_t **log_accum,
                                    const char *adm_abspath,
                                    const char *path,
-                                   apr_pool_t *pool)
+                                   apr_pool_t *result_pool,
+                                   apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
   svn_xml_make_open_tag(log_accum,
-                        pool,
+                        result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_MAYBE_EXECUTABLE,
                         SVN_WC__LOG_ATTR_NAME, loggy_path1,
@@ -2080,13 +2107,14 @@
 svn_wc__loggy_maybe_set_readonly(svn_stringbuf_t **log_accum,
                                  const char *adm_abspath,
                                  const char *path,
-                                 apr_pool_t *pool)
+                                 apr_pool_t *result_pool,
+                                 apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
-  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, pool));
+  SVN_ERR(loggy_path(&loggy_path1, path, adm_abspath, scratch_pool));
   svn_xml_make_open_tag(log_accum,
-                        pool,
+                        result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_MAYBE_READONLY,
                         SVN_WC__LOG_ATTR_NAME,
@@ -2100,14 +2128,15 @@
 svn_wc__loggy_set_entry_timestamp_from_wc(svn_stringbuf_t **log_accum,
                                           svn_wc_adm_access_t *adm_access,
                                           const char *path,
-                                          apr_pool_t *pool)
+                                          apr_pool_t *result_pool,
+                                          apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
   SVN_ERR(loggy_path(&loggy_path1, path,
-                     svn_wc__adm_access_abspath(adm_access), pool));
+                     svn_wc__adm_access_abspath(adm_access), scratch_pool));
   svn_xml_make_open_tag(log_accum,
-                        pool,
+                        result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_MODIFY_ENTRY,
                         SVN_WC__LOG_ATTR_NAME,
@@ -2123,14 +2152,15 @@
 svn_wc__loggy_set_entry_working_size_from_wc(svn_stringbuf_t **log_accum,
                                                 svn_wc_adm_access_t *adm_access,
                                                 const char *path,
-                                                apr_pool_t *pool)
+                                                apr_pool_t *result_pool,
+                                                apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
   SVN_ERR(loggy_path(&loggy_path1, path,
-                     svn_wc__adm_access_abspath(adm_access), pool));
+                     svn_wc__adm_access_abspath(adm_access), scratch_pool));
   svn_xml_make_open_tag(log_accum,
-                        pool,
+                        result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_MODIFY_ENTRY,
                         SVN_WC__LOG_ATTR_NAME,
@@ -2146,14 +2176,15 @@
 svn_wc__loggy_set_readonly(svn_stringbuf_t **log_accum,
                            svn_wc_adm_access_t *adm_access,
                            const char *path,
-                           apr_pool_t *pool)
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
   SVN_ERR(loggy_path(&loggy_path1, path,
-                     svn_wc__adm_access_abspath(adm_access), pool));
+                     svn_wc__adm_access_abspath(adm_access), scratch_pool));
   svn_xml_make_open_tag(log_accum,
-                        pool,
+                        result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_READONLY,
                         SVN_WC__LOG_ATTR_NAME,
@@ -2168,14 +2199,15 @@
                             svn_wc_adm_access_t *adm_access,
                             const char *path,
                             const char *timestr,
-                            apr_pool_t *pool)
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
   SVN_ERR(loggy_path(&loggy_path1, path,
-                     svn_wc__adm_access_abspath(adm_access), pool));
+                     svn_wc__adm_access_abspath(adm_access), scratch_pool));
   svn_xml_make_open_tag(log_accum,
-                        pool,
+                        result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_SET_TIMESTAMP,
                         SVN_WC__LOG_ATTR_NAME,
@@ -2191,15 +2223,16 @@
 svn_wc__loggy_remove(svn_stringbuf_t **log_accum,
                      svn_wc_adm_access_t *adm_access,
                      const char *path,
-                     apr_pool_t *pool)
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool)
 {
   const char *loggy_path1;
 
   SVN_ERR(loggy_path(&loggy_path1, path,
-                     svn_wc__adm_access_abspath(adm_access), pool));
+                     svn_wc__adm_access_abspath(adm_access), scratch_pool));
   /* No need to check whether BASE_NAME exists: ENOENT is ignored
      by the log-runner */
-  svn_xml_make_open_tag(log_accum, pool,
+  svn_xml_make_open_tag(log_accum, result_pool,
                         svn_xml_self_closing,
                         SVN_WC__LOG_RM,
                         SVN_WC__LOG_ATTR_NAME,
@@ -2243,23 +2276,24 @@
 svn_error_t *
 svn_wc__write_log(svn_wc_adm_access_t *adm_access,
                   int log_number, svn_stringbuf_t *log_content,
-                  apr_pool_t *pool)
+                  apr_pool_t *scratch_pool)
 {
   svn_stream_t *stream;
   const char *temp_file_path;
-  const char *logfile_name = compute_logfile_path(log_number, pool);
+  const char *logfile_name = compute_logfile_path(log_number, scratch_pool);
   const char *adm_path = svn_wc_adm_access_path(adm_access);
   apr_size_t len = log_content->len;
 
   SVN_ERR(svn_wc__open_adm_writable(&stream, &temp_file_path,
-                                    adm_path, logfile_name, pool, pool));
+                                    adm_path, logfile_name,
+                                    scratch_pool, scratch_pool));
 
   SVN_ERR_W(svn_stream_write(stream, log_content->data, &len),
-            apr_psprintf(pool, _("Error writing log for '%s'"),
-                         svn_dirent_local_style(logfile_name, pool)));
+            apr_psprintf(scratch_pool, _("Error writing log for '%s'"),
+                         svn_dirent_local_style(logfile_name, scratch_pool)));
 
   return svn_wc__close_adm_stream(stream, temp_file_path, adm_path,
-                                  logfile_name, pool);
+                                  logfile_name, scratch_pool);
 }
 
 
Index: subversion/libsvn_wc/log.h
===================================================================
--- subversion/libsvn_wc/log.h	(revision 39256)
+++ subversion/libsvn_wc/log.h	(working copy)
@@ -42,8 +42,8 @@
  * NOTES
  *
  *  * When a doc string says "Extend **LOG_ACCUM", it means: "if *LOG_ACCUM is
- *    NULL then set *LOG_ACCUM to a new stringbuf allocated in POOL, else
- *    append to the existing stringbuf there."
+ *    NULL then set *LOG_ACCUM to a new stringbuf allocated in RESULT_POOL,
+ *    else append to the existing stringbuf there."
  */
 
 /* Each path argument to the svn_wc__loggy_* functions in this section can
@@ -71,12 +71,16 @@
 /* Extend **LOG_ACCUM with log instructions to mark PATH as committed
    with revision REVNUM.
    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_committed(svn_stringbuf_t **log_accum,
                         const char *adm_abspath,
                         const char *path, svn_revnum_t revnum,
-                        apr_pool_t *pool);
+                        apr_pool_t *result_pool,
+                        apr_pool_t *scratch_pool);
 
 
 /* Extend **LOG_ACCUM with log instructions to copy (and translate!) the
@@ -86,17 +90,24 @@
    The test for existence is made during this call, not at log running time.
 
    SRC_PATH and DST_PATH are relative to ADM_ABSPATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_copy(svn_stringbuf_t **log_accum,
                    const char *adm_abspath,
                    const char *src_path, const char *dst_path,
-                   apr_pool_t *pool);
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool);
 
 
 /* Extend **LOG_ACCUM with log instructions to generate a translated
    file from SRC to DST with translation settings from VERSIONED.
    DST and SRC and VERSIONED are relative to ADM_ABSPATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_translated_file(svn_stringbuf_t **log_accum,
@@ -104,38 +115,51 @@
                               const char *dst,
                               const char *src,
                               const char *versioned,
-                              apr_pool_t *pool);
+                              apr_pool_t *result_pool,
+                              apr_pool_t *scratch_pool);
 
 /* Extend **LOG_ACCUM with log instructions to delete the entry
    associated with PATH from the entries file.
    ADM_ABSPATH is the absolute path for the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_delete_entry(svn_stringbuf_t **log_accum,
                            const char *adm_abspath,
                            const char *path,
-                           apr_pool_t *pool);
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool);
 
 
 /* Extend **LOG_ACCUM with log instructions to delete lock related
    fields from the entry belonging to PATH.
    ADM_ABSPATH is the absolute path for the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_delete_lock(svn_stringbuf_t **log_accum,
                           const char *adm_abspath,
                           const char *path,
-                          apr_pool_t *pool);
+                          apr_pool_t *result_pool,
+                          apr_pool_t *scratch_pool);
 
 /* Extend **LOG_ACCUM with log instructions to delete changelist
    from the entry belonging to PATH.
    ADM_ABSPATH is the absolute path for the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_delete_changelist(svn_stringbuf_t **log_accum,
                                 const char *adm_abspath,
                                 const char *path,
-                                apr_pool_t *pool);
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool);
 
 /* Extend **LOG_ACCUM with commands to modify the entry associated with PATH
    in ADM_ABSPATH according to the flags specified in MODIFY_FLAGS, based on
@@ -143,6 +167,9 @@
 
    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.
 */
 svn_error_t *
 svn_wc__loggy_entry_modify(svn_stringbuf_t **log_accum,
@@ -150,11 +177,15 @@
                            const char *path,
                            const svn_wc_entry_t *entry,
                            apr_uint64_t modify_flags,
-                           apr_pool_t *pool);
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool);
 
 /* Extend **LOG_ACCUM with log instructions to modify wcprop PROPNAME
    for PATH, setting it to PROPVAL (which may be NULL to delete the property).
    ADM_ABSPATH is the absolute path for the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_modify_wcprop(svn_stringbuf_t **log_accum,
@@ -162,7 +193,8 @@
                             const char *path,
                             const char *propname,
                             const char *propval,
-                            apr_pool_t *pool);
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool);
 
 
 /* Extend **LOG_ACCUM with log instructions to move the file SRC_PATH to
@@ -176,35 +208,47 @@
    Set *DST_MODIFIED (if DST_MODIFIED isn't NULL) to indicate whether the
    destination path will have been modified after running the log: if either
    the move or the remove will have been carried out.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_move(svn_stringbuf_t **log_accum,
                    const char *adm_abspath,
                    const char *src_path, const char *dst_path,
-                   apr_pool_t *pool);
+                   apr_pool_t *result_pool,
+                   apr_pool_t *scratch_pool);
 
 
 
 /* Extend **LOG_ACCUM with log instructions to set permissions of PATH
    to 'executable' if it has the 'executable' property set.
    The property is tested at log run time, within this log instruction.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_maybe_set_executable(svn_stringbuf_t **log_accum,
                                    const char *adm_abspath,
                                    const char *path,
-                                   apr_pool_t *pool);
+                                   apr_pool_t *result_pool,
+                                   apr_pool_t *scratch_pool);
 
 /* Extend **LOG_ACCUM with log instructions to set permissions of PATH
    to 'readonly' if it has the 'needs-lock' property set and there is
    no lock for the file in the working copy.
    The tests are made at log run time, within this log instruction.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_maybe_set_readonly(svn_stringbuf_t **log_accum,
                                  const char *adm_abspath,
                                  const char *path,
-                                 apr_pool_t *pool);
+                                 apr_pool_t *result_pool,
+                                 apr_pool_t *scratch_pool);
 
 
 /* Extend **LOG_ACCUM with log instructions to set the timestamp of PATH
@@ -212,63 +256,85 @@
 
    Use one of the SVN_WC__ENTRY_ATTR_* values for TIME_PROP.
    ADM_ACCESS is the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_set_entry_timestamp_from_wc(svn_stringbuf_t **log_accum,
                                           svn_wc_adm_access_t *adm_access,
                                           const char *path,
-                                          apr_pool_t *pool);
+                                          apr_pool_t *result_pool,
+                                          apr_pool_t *scratch_pool);
 
 
 /* Extend **LOG_ACCUM with log instructions to set the file size of PATH
    in the entries' WORKING_SIZE field.
    ADM_ACCESS is the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_set_entry_working_size_from_wc(svn_stringbuf_t **log_accum,
                                              svn_wc_adm_access_t *adm_access,
                                              const char *path,
-                                             apr_pool_t *pool);
+                                             apr_pool_t *result_pool,
+                                             apr_pool_t *scratch_pool);
 
 
 /* Extend **LOG_ACCUM with log instructions to set permissions of PATH
    to 'readonly'.
    ADM_ACCESS is the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_set_readonly(svn_stringbuf_t **log_accum,
                            svn_wc_adm_access_t *adm_access,
                            const char *path,
-                           apr_pool_t *pool);
+                           apr_pool_t *result_pool,
+                           apr_pool_t *scratch_pool);
 
 /* Extend **LOG_ACCUM with log instructions to set the timestamp of PATH to
    the time TIMESTR.
    ADM_ACCESS is the access baton for PATH.
+
+   Allocate *LOG_ACCUM in RESULT_POOL if it is NULL. Use SCRATCH_POOL for
+   temporary allocations.
 */
 svn_error_t *
 svn_wc__loggy_set_timestamp(svn_stringbuf_t **log_accum,
                             svn_wc_adm_access_t *adm_access,
                             const char *path,
                             const char *timestr,
-                            apr_pool_t *pool);
+                            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_ACCESS is the access baton 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,
                      svn_wc_adm_access_t *adm_access,
                      const char *path,
-                     apr_pool_t *pool);
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool);
 
 /* Create a log file with LOG_NUMBER. Write LOG_CONTENT to it and close-
    and-sync afterwards. ADM_ACCESS must point to a locked working copy.
+
+   Use SCRATCH_POOL for temporary allocations.
 */
 svn_error_t *
 svn_wc__write_log(svn_wc_adm_access_t *adm_access,
                   int log_number, svn_stringbuf_t *log_content,
-                  apr_pool_t *pool);
+                  apr_pool_t *scratch_pool);
 
 
 /* Set PRESENT if there is a log file present for the working copy directory
@@ -285,9 +351,12 @@
 
    If the log fails on its first command, return the error
    SVN_ERR_WC_BAD_ADM_LOG_START.  If it fails on some subsequent
-   command, return SVN_ERR_WC_BAD_ADM_LOG. */
+   command, return SVN_ERR_WC_BAD_ADM_LOG
+
+   Use SCRATCH_POOL for temporary allocations.
+ */
 svn_error_t *svn_wc__run_log(svn_wc_adm_access_t *adm_access,
-                             apr_pool_t *pool);
+                             apr_pool_t *scratch_pool);
 
 
 #ifdef __cplusplus

