Index: subversion/include/svn_config.h
===================================================================
--- subversion/include/svn_config.h	(revision 15516)
+++ subversion/include/svn_config.h	(working copy)
@@ -202,9 +202,12 @@
                           const char *section, const char *option,
                           svn_boolean_t value);
 
-/** A callback function used in enumerating config sections.
+/** Similar to @c svn_config_section_enumerator_t2, but is not
+ * provided with a memory pool argument.
  *
  * See svn_config_enumerate_sections() for the details of this type.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.2 API.
  */
 typedef svn_boolean_t (*svn_config_section_enumerator_t)
        (const char *name, void *baton);
@@ -218,10 +221,19 @@
                                    svn_config_section_enumerator_t callback,
                                    void *baton);
 
-/** Enumerate the sections, passing @a baton and the current section's name to
- * @a callback.  Continue the enumeration if @a callback returns @c TRUE.
- * Return the number of times @a callback was called.
+/** A callback function used in enumerating config sections.
  *
+ * See svn_config_enumerate_sections2() for the details of this type.
+ *
+ * @since New in 1.3.
+ */
+typedef svn_boolean_t (*svn_config_section_enumerator_t2)
+       (const char *name, void *baton, apr_pool_t *pool);
+
+/** Enumerate the sections, passing @a baton and the current section's name
+ * to @a callback.  Continue the enumeration if @a callback returns @c TRUE.
+ * Return the number of times @a callback was called. 
+ *
  * ### See kff's comment to svn_config_enumerate2().  It applies to this
  * function, too. ###
  *
@@ -231,12 +243,14 @@
  * @since New in 1.3.
  */
 int svn_config_enumerate_sections2 (svn_config_t *cfg, 
-                                    svn_config_section_enumerator_t callback,
+                                    svn_config_section_enumerator_t2 callback,
                                     void *baton, apr_pool_t *pool);
 
-/** A callback function used in enumerating config options.
+/** Similar to @c svn_config_enumerator_t2, but is not
+ * provided with a memory pool argument.
+ * See svn_config_enumerate() for the details of this type.
  *
- * See svn_config_enumerate() for the details of this type.
+ * @deprecated Provided for backwards compatibility with the 1.2 API. 
  */
 typedef svn_boolean_t (*svn_config_enumerator_t)
        (const char *name, const char *value, void *baton);
@@ -250,6 +264,15 @@
                           svn_config_enumerator_t callback, void *baton);
 
 
+/** A callback function used in enumerating config options.
+ *
+ * See svn_config_enumerate2() for the details of this type.
+ *
+ * @since New in 1.3.
+ */
+typedef svn_boolean_t (*svn_config_enumerator_t2)
+       (const char *name, const char *value, void *baton, apr_pool_t *pool);
+
 /** Enumerate the options in @a section, passing @a baton and the current
  * option's name and value to @a callback.  Continue the enumeration if
  * @a callback returns @c TRUE.  Return the number of times @a callback 
@@ -269,7 +292,7 @@
  * @since New in 1.3.
  */
 int svn_config_enumerate2 (svn_config_t *cfg, const char *section,
-                           svn_config_enumerator_t callback, void *baton,
+                           svn_config_enumerator_t2 callback, void *baton,
                            apr_pool_t *pool);
 
 
Index: subversion/libsvn_subr/config.c
===================================================================
--- subversion/libsvn_subr/config.c	(revision 15516)
+++ subversion/libsvn_subr/config.c	(working copy)
@@ -662,22 +662,39 @@
                                svn_config_section_enumerator_t callback,
                                void *baton)
 {
-  apr_pool_t *tmp_pool = svn_pool_create (cfg->x_pool);
-  int retval = svn_config_enumerate_sections2 (cfg, callback, baton, tmp_pool);
-  svn_pool_destroy (tmp_pool);
+  apr_hash_index_t *sec_ndx;
+  int count = 0;
+  apr_pool_t *subpool = svn_pool_create (cfg->x_pool);
 
-  return retval;
+  for (sec_ndx = apr_hash_first (subpool, cfg->sections);
+       sec_ndx != NULL;
+       sec_ndx = apr_hash_next (sec_ndx))
+    {
+      void *sec_ptr;
+      cfg_section_t *sec;
+
+      apr_hash_this (sec_ndx, NULL, NULL, &sec_ptr);
+      sec = sec_ptr;
+      ++count;
+      if (!callback (sec->name, baton))
+        break;
+    }
+
+  svn_pool_destroy (subpool);
+  return count;
 }
 
 
 int
 svn_config_enumerate_sections2 (svn_config_t *cfg,
-                                svn_config_section_enumerator_t callback,
+                                svn_config_section_enumerator_t2 callback,
                                 void *baton, apr_pool_t *pool)
 {
   apr_hash_index_t *sec_ndx;
+  apr_pool_t *iteration_pool;
   int count = 0;
 
+  iteration_pool = svn_pool_create (pool);
   for (sec_ndx = apr_hash_first (pool, cfg->sections);
        sec_ndx != NULL;
        sec_ndx = apr_hash_next (sec_ndx))
@@ -688,9 +705,11 @@
       apr_hash_this (sec_ndx, NULL, NULL, &sec_ptr);
       sec = sec_ptr;
       ++count;
-      if (!callback (sec->name, baton))
+      svn_pool_clear (iteration_pool);
+      if (!callback (sec->name, baton, iteration_pool))
         break;
     }
+  svn_pool_destroy (iteration_pool);
 
   return count;
 }
@@ -698,20 +717,21 @@
 
 
 int
-svn_config_enumerate2 (svn_config_t *cfg, const char *section,
-                       svn_config_enumerator_t callback, void *baton,
-                       apr_pool_t *pool)
+svn_config_enumerate (svn_config_t *cfg, const char *section,
+                      svn_config_enumerator_t callback, void *baton)
 {
   cfg_section_t *sec;
   apr_hash_index_t *opt_ndx;
   int count;
+  apr_pool_t *subpool;
 
   find_option (cfg, section, NULL, &sec);
   if (sec == NULL)
     return 0;
 
+  subpool = svn_pool_create (cfg->x_pool);
   count = 0;
-  for (opt_ndx = apr_hash_first (pool, sec->options);
+  for (opt_ndx = apr_hash_first (subpool, sec->options);
        opt_ndx != NULL;
        opt_ndx = apr_hash_next (opt_ndx))
     {
@@ -728,19 +748,47 @@
         break;
     }
 
+  svn_pool_destroy (subpool);
   return count;
 }
 
 
 int
-svn_config_enumerate (svn_config_t *cfg, const char *section,
-                      svn_config_enumerator_t callback, void *baton)
+svn_config_enumerate2 (svn_config_t *cfg, const char *section,
+                       svn_config_enumerator_t2 callback, void *baton,
+                       apr_pool_t *pool)
 {
-  apr_pool_t *tmp_pool = svn_pool_create (cfg->x_pool);
-  int retval = svn_config_enumerate2 (cfg, section, callback, baton, tmp_pool);
-  svn_pool_destroy (tmp_pool);
+  cfg_section_t *sec;
+  apr_hash_index_t *opt_ndx;
+  apr_pool_t *iteration_pool;
+  int count;
 
-  return retval;
+  find_option (cfg, section, NULL, &sec);
+  if (sec == NULL)
+    return 0;
+
+  iteration_pool = svn_pool_create (pool);
+  count = 0;
+  for (opt_ndx = apr_hash_first (pool, sec->options);
+       opt_ndx != NULL;
+       opt_ndx = apr_hash_next (opt_ndx))
+    {
+      void *opt_ptr;
+      cfg_option_t *opt;
+      const char *temp_value;
+
+      apr_hash_this (opt_ndx, NULL, NULL, &opt_ptr);
+      opt = opt_ptr;
+
+      ++count;
+      make_string_from_option (&temp_value, cfg, sec, opt, NULL);
+      svn_pool_clear (iteration_pool);
+      if (!callback (opt->name, temp_value, baton, iteration_pool))
+        break;
+    }
+  svn_pool_destroy (iteration_pool);
+
+  return count;
 }
 
 
@@ -759,16 +807,17 @@
  */
 static svn_boolean_t search_groups (const char *name,
                                     const char *value,
-                                    void *baton)
+                                    void *baton,
+                                    apr_pool_t *pool)
 {
   struct search_groups_baton *b = baton;
   apr_array_header_t *list;
 
-  list = svn_cstring_split (value, ",", TRUE, b->pool);
+  list = svn_cstring_split (value, ",", TRUE, pool);
   if (svn_cstring_match_glob_list (b->key, list))
     {
       /* Fill in the match and return false, to stop enumerating. */
-      b->match = apr_pstrdup (b->pool, name);
+      b->match = apr_pstrdup (pool, name);
       return FALSE;
     }
   else
Index: subversion/libsvn_client/add.c
===================================================================
--- subversion/libsvn_client/add.c	(revision 15516)
+++ subversion/libsvn_client/add.c	(working copy)
@@ -86,7 +86,8 @@
 static svn_boolean_t
 auto_props_enumerator (const char *name,
                        const char *value,
-                       void *baton)
+                       void *baton,
+                       apr_pool_t *pool)
 {
   auto_props_baton_t *autoprops = baton;
   char *property;
Index: subversion/libsvn_repos/authz.c
===================================================================
--- subversion/libsvn_repos/authz.c	(revision 15516)
+++ subversion/libsvn_repos/authz.c	(working copy)
@@ -30,8 +30,6 @@
 /* Information for the config enumerators called during authz
    lookup. */
 struct authz_lookup_baton {
-  apr_pool_t *pool;
-
   /* The authz configuration. */
   svn_config_t *config;
 
@@ -164,7 +162,8 @@
  * authz_baton accordingly.
  */
 static svn_boolean_t
-authz_parse_line (const char *name, const char *value, void *baton)
+authz_parse_line (const char *name, const char *value, 
+                  void *baton, apr_pool_t *pool)
 {
   struct authz_lookup_baton *b = baton;
 
@@ -179,7 +178,7 @@
       if (*name == '@')
         {
           if (!authz_group_contains_user (b->config, &name[1],
-                                          b->user, b->pool))
+                                          b->user, pool))
             return TRUE;
         }
 
@@ -208,7 +207,7 @@
  * section denies access to the subtree the baton describes.
  */
 static svn_boolean_t
-authz_parse_section (const char *section_name, void *baton)
+authz_parse_section (const char *section_name, void *baton, apr_pool_t *pool)
 {
   struct authz_lookup_baton *b = baton;
   svn_boolean_t conclusive;
@@ -223,7 +222,7 @@
   /* Work out what this section grants. */
   b->allow = b->deny = 0;
   svn_config_enumerate2 (b->config, section_name,
-                         authz_parse_line, b, b->pool);
+                         authz_parse_line, b, pool);
 
   /* Has the section explicitely determined an access? */
   conclusive = authz_access_is_determined (b->allow, b->deny,
@@ -259,7 +258,6 @@
   const char *qualified_path;
   struct authz_lookup_baton baton = { 0 };
 
-  baton.pool = pool;
   baton.config = cfg;
   baton.user = user;
 
@@ -303,7 +301,6 @@
 {
   struct authz_lookup_baton baton = { 0 };
 
-  baton.pool = pool;
   baton.config = cfg;
   baton.user = user;
   baton.required_access = required_access;
@@ -387,7 +384,8 @@
    errors.  Use BATON for context and error reporting. */
 static svn_boolean_t authz_validate_rule (const char *group,
                                           const char *value,
-                                          void *baton)
+                                          void *baton,
+                                          apr_pool_t *pool)
 {
   const char *val;
   struct authz_validate_baton *b = baton;
@@ -418,12 +416,12 @@
    BATON for context and error reporting. */
 static svn_boolean_t authz_validate_group (const char *group,
                                            const char *value,
-                                           void *baton)
+                                           void *baton,
+                                           apr_pool_t *pool)
 {
   struct authz_validate_baton *b = baton;
 
-  b->err = authz_group_walk (b->config, group, apr_hash_make (b->pool),
-                             b->pool);
+  b->err = authz_group_walk (b->config, group, apr_hash_make (pool), pool);
   if (b->err)
     return FALSE;
 
@@ -435,7 +433,8 @@
 /* Callback to check the contents of the configuration section given
    by NAME.  Use BATON for context and error reporting. */
 static svn_boolean_t authz_validate_section (const char *name,
-                                             void *baton)
+                                             void *baton,
+                                             apr_pool_t *pool)
 {
   struct authz_validate_baton *b = baton;
 
@@ -443,10 +442,10 @@
      callback. Otherwise, use the rule checking callback. */
   if (strncmp (name, "groups", 6) == 0)
     svn_config_enumerate2 (b->config, name, authz_validate_group,
-                           baton, b->pool);
+                           baton, pool);
   else
     svn_config_enumerate2 (b->config, name, authz_validate_rule,
-                           baton, b->pool);
+                           baton, pool);
 
   if (b->err)
     return FALSE;
@@ -463,7 +462,6 @@
   svn_authz_t *authz = apr_palloc (pool, sizeof(*authz));
   struct authz_validate_baton baton = { 0 };
 
-  baton.pool = pool;
   baton.err = SVN_NO_ERROR;
 
   /* Load the rule file. */


