=== subversion/include/svn_config.h
==================================================================
--- subversion/include/svn_config.h	(revision 15404)
+++ subversion/include/svn_config.h	(local)
@@ -212,16 +212,33 @@
  * @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_enumerate().  It applies to this
+ * ### See kff's comment to svn_config_enumerate2().  It applies to this
  * function, too. ###
  *
  * @a callback's @a name and @a name parameters are only valid for the
  * duration of the call.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.2 API.
+ *   Use svn_config_enumerate_sections2() instead.
  */
 int svn_config_enumerate_sections (svn_config_t *cfg, 
                                    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.
+ *
+ * ### See kff's comment to @c svn_config_enumerate2.  It applies to this
+ * function, too. ###
+ *
+ * @a callback's @a name and @a name parameters are only valid for the
+ * duration of the call.
+ */
+int svn_config_enumerate_sections2 (svn_config_t *cfg, 
+                                    svn_config_section_enumerator_t callback,
+                                    void *baton, apr_pool_t *pool);
+
 /** A callback function used in enumerating config options.
  *
  * See svn_config_enumerate() for the details of this type.
@@ -234,6 +251,24 @@
  * @a callback returns @c TRUE.  Return the number of times @a callback 
  * was called.
  *
+ * ### See kff's comment to @c svn_config_enumerate2.  It applies to this
+ * function, too. ###
+ *
+ * @a callback's @a name and @a value parameters are only valid for the
+ * duration of the call.
+ *
+ * @deprecated Provided for backwards compatibility with the 1.2 API. 
+ *   Use svn_config_enumerate2() instead.
+ */
+int svn_config_enumerate (svn_config_t *cfg, const char *section,
+                          svn_config_enumerator_t callback, void *baton);
+
+
+/** 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 
+ * was called.
+ *
  * ### kff asks: A more usual interface is to continue enumerating
  *     while @a callback does not return error, and if @a callback does
  *     return error, to return the same error (or a wrapping of it)
@@ -245,8 +280,9 @@
  * @a callback's @a name and @a value parameters are only valid for the
  * duration of the call.
  */
-int svn_config_enumerate (svn_config_t *cfg, const char *section,
-                          svn_config_enumerator_t callback, void *baton);
+int svn_config_enumerate2 (svn_config_t *cfg, const char *section,
+                           svn_config_enumerator_t callback, void *baton,
+                           apr_pool_t *pool);
 
 
 /** Enumerate the group @a master_section in @a cfg.  Each variable
=== subversion/libsvn_subr/config.c
==================================================================
--- subversion/libsvn_subr/config.c	(revision 15404)
+++ subversion/libsvn_subr/config.c	(local)
@@ -662,11 +662,23 @@
                                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);
+
+  return retval;
+}
+
+
+int
+svn_config_enumerate_sections2 (svn_config_t *cfg,
+                                svn_config_section_enumerator_t callback,
+                                void *baton, apr_pool_t *pool)
+{
   apr_hash_index_t *sec_ndx;
   int count = 0;
-  apr_pool_t *subpool = svn_pool_create (cfg->x_pool);
 
-  for (sec_ndx = apr_hash_first (subpool, cfg->sections);
+  for (sec_ndx = apr_hash_first (pool, cfg->sections);
        sec_ndx != NULL;
        sec_ndx = apr_hash_next (sec_ndx))
     {
@@ -680,27 +692,26 @@
         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_t callback, void *baton,
+                       apr_pool_t *pool)
 {
   cfg_section_t *sec;
   apr_hash_index_t *opt_ndx;
   int count;
-  apr_pool_t *subpool = svn_pool_create (cfg->x_pool);
 
   find_option (cfg, section, NULL, &sec);
   if (sec == NULL)
     return 0;
 
   count = 0;
-  for (opt_ndx = apr_hash_first (subpool, sec->options);
+  for (opt_ndx = apr_hash_first (pool, sec->options);
        opt_ndx != NULL;
        opt_ndx = apr_hash_next (opt_ndx))
     {
@@ -717,11 +728,22 @@
         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)
+{
+  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);
+
+  return retval;
+}
+
+
 
 /* Baton for search_groups() */
 struct search_groups_baton
@@ -763,7 +785,7 @@
   gb.key = key;
   gb.match = NULL;
   gb.pool = pool;
-  svn_config_enumerate (cfg, master_section, search_groups, &gb);
+  svn_config_enumerate2 (cfg, master_section, search_groups, &gb, pool);
   return gb.match;
 }
 

