[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: CVS update: MODIFIED: libsvn_wc ...

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-06-09 11:43:32 CEST

On Fri, Jun 08, 2001 at 09:31:23PM -0000, cmpilato@tigris.org wrote:
> User: cmpilato
> Date: 01/06/08 14:31:23
>
> Modified: subversion/tests/libsvn_wc commit-test.c
> Added: subversion/include svn_pools.h
> subversion/tests/libsvn_subr stream-test.c
> Log:
> Big Ol' Change: Moved pool-related function prototypes into new
> include file, svn_pools.h. This was done to solve some circular
> dependency issues related another change -- the addition of an
> svn_stream_t to the userdata of SVN pools. Dubbed the "feedback
> stream", this stream provides a way for any function with access to a
> Subversion pool to send bytes out to whoever may want them, and is
> scheduled to be used for non-fatal warnings and such.

Woah, woah, woah...

"send bytes" ... this design is predicated on sending an arbitrary set of
human-readable bytes, and expecting the stream to get them to the person.
Really... we can do better than this. How is the receiver supposed to deal
with these bytes? Is there a structure to them? Or should they just be
displayed? Should they display upon receipt? Or should they be buffered for
a while, and displayed at <this> point? Are the bytes in the appropriate
character set? etc etc

The stream concept for "feedback" is inappropriate for a library. It is just
another name for the library printing to stdout or stderr. Libraries
shouldn't do that because it is unknown what are connected to those, but in
a similar vein: the library can't know a number of output characteristics.

Please, please, please... do not depend on this stream thing. It creates a
serious inflexibility for the system(*). Provide *structured* feedback calls
for this kind of informatin.

Cheers,
-g

(*) what do you suppose mod_dav_svn is supposed to do with that information?
somehow get it sent over the wire? for which methods calls? what if the call
doesn't support a request body? where does it go? etc etc

> In the future, this mechanism may be replaced by a function v-table to
> optimize data transmission (why package up in a string protocol data
> that is just going to be unpackaged by in-process methods?)
>
> * subversion/include/svn_pools.h
>
> New header file for pool-related function prototypes.
>
> * subversion/tests/libsvn_subr/stream-test.c
>
> New file for stream-related tests. Current contains just the one
> test for the feedback stream, but your contributions and patches are
> welcome....
>
> * subversion/tests/libsvn_subr/.cvsignore
>
> Please ignore the generated stream-test binary.
>
> * build.conf
>
> (stream-test): New section for stream-test test.
>
> * subversion/include/svn_error.h
>
> Big change: Moved pool-related prototypes and related epic
> storytelling to new file, svn_pools.h.
>
> (SVN_ERR_WC_CORRUPT): New error type for corrupted working copies.
>
> * subversion/libsvn_subr/svn_error.c
>
> (SVN_ERROR_STREAM): New key into pool's userdata for the feedback
> stream.
>
> (svn_pool_get_feedback_stream): New function for retrieving the
> feedback stream from a pool.
>
> (svn_error_init_pool, svn_pool_create, svn_pool_clear): Keep the new
> feedback stream in mind when creating and destroying pools.
>
> * subversion/include/svn_io.h
> * subversion/libsvn_subr/io.c
>
> (svn_stream_dup): New function for duplicating streams.
>
> (svn_stream_set_baton): New accessor function for setting the baton
> associated with a stream (just in case you didn't have one handy at
> stream creation time).
>
> * subversion/clients/cmdline/main.c
> * subversion/clients/cmdline/trace-update.c
> * subversion/libsvn_client/add.c
> * subversion/libsvn_client/commit.c
> * subversion/libsvn_delta/svndiff.c
> * subversion/libsvn_delta/text_delta.c
> * subversion/libsvn_delta/xml_output.c
> * subversion/libsvn_delta/xml_parse.c
> * subversion/libsvn_fs/dag.c
> * subversion/libsvn_fs/fs.c
> * subversion/libsvn_fs/trail.c
> * subversion/libsvn_fs/tree.c
> * subversion/libsvn_fs/txn.c
> * subversion/libsvn_ra_dav/commit.c
> * subversion/libsvn_ra_local/checkout.c
> * subversion/libsvn_ra_local/ra_plugin.c
> * subversion/libsvn_ra_local/split_url.c
> * subversion/libsvn_repos/commit_editor.c
> * subversion/libsvn_repos/delta.c
> * subversion/libsvn_subr/base64.c
> * subversion/libsvn_subr/quoprint.c
> * subversion/libsvn_subr/target.c
> * subversion/libsvn_subr/xml.c
> * subversion/libsvn_wc/adm_crawler.c
> * subversion/libsvn_wc/adm_ops.c
> * subversion/libsvn_wc/get_editor.c
> * subversion/svnadmin/main.c
> * subversion/tests/fs-helpers.c
> * subversion/tests/svn_tests_main.c
> * subversion/tests/libsvn_delta/deltaparse-test.c
> * subversion/tests/libsvn_delta/random-test.c
> * subversion/tests/libsvn_delta/xml-output-test.c
> * subversion/tests/libsvn_fs/fs-test.c
> * subversion/tests/libsvn_fs/skel-test.c
> * subversion/tests/libsvn_repos/repos-test.c
> * subversion/tests/libsvn_wc/commit-test.c
>
> Now #include svn_pools.h
>
> Revision Changes Path
> 1.15 +8 -0 subversion/build.conf
>
> http://subversion.tigris.org/source/browse/subversion/build.conf.diff?r1=1.14&r2=1.15
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: build.conf
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/build.conf,v
> retrieving revision 1.14
> retrieving revision 1.15
> diff -u -b -r1.14 -r1.15
> --- build.conf 2001/06/08 20:27:32 1.14
> +++ build.conf 2001/06/08 21:31:20 1.15
> @@ -270,6 +270,14 @@
> group = programs
> libs = libsvn_test libsvn_delta libsvn_subr $(SVN_APR_LIBS) libexpat
>
> +[stream-test]
> +type = exe
> +path = subversion/tests/libsvn_subr
> +sources = stream-test.c
> +install = test
> +group = programs
> +libs = libsvn_test libsvn_delta libsvn_subr $(SVN_APR_LIBS) libexpat
> +
> [checkout-test]
> type = exe
> path = subversion/tests/libsvn_wc
>
>
>
> 1.2 +1 -0 subversion/subversion/clients/cmdline/main.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/clients/cmdline/main.c.diff?r1=1.1&r2=1.2
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: main.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/clients/cmdline/main.c,v
> retrieving revision 1.1
> retrieving revision 1.2
> diff -u -b -r1.1 -r1.2
> --- main.c 2001/06/05 14:52:21 1.1
> +++ main.c 2001/06/08 21:31:20 1.2
> @@ -25,6 +25,7 @@
> #include <apr_tables.h>
> #include <apr_general.h>
>
> +#include "svn_pools.h"
> #include "svn_wc.h"
> #include "svn_client.h"
> #include "svn_string.h"
>
>
>
> 1.3 +1 -0 subversion/subversion/clients/cmdline/trace-update.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/clients/cmdline/trace-update.c.diff?r1=1.2&r2=1.3
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: trace-update.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/clients/cmdline/trace-update.c,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -b -r1.2 -r1.3
> --- trace-update.c 2001/06/08 09:01:02 1.2
> +++ trace-update.c 2001/06/08 21:31:20 1.3
> @@ -19,6 +19,7 @@
>
> /*** Includes. ***/
> #include "svn_wc.h"
> +#include "svn_pools.h"
> #include "svn_path.h"
> #include "svn_string.h"
> #include "cl.h"
>
>
>
> 1.104 +4 -128 subversion/subversion/include/svn_error.h
>
> http://subversion.tigris.org/source/browse/subversion/subversion/include/svn_error.h.diff?r1=1.103&r2=1.104
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: svn_error.h
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/include/svn_error.h,v
> retrieving revision 1.103
> retrieving revision 1.104
> diff -u -b -r1.103 -r1.104
> --- svn_error.h 2001/06/08 00:56:48 1.103
> +++ svn_error.h 2001/06/08 21:31:20 1.104
> @@ -26,7 +26,6 @@
>
> #include <svn_types.h>
>
> -
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
> @@ -124,6 +123,9 @@
> /* If a working copy conflict is found (say, during a commit) */
> SVN_ERR_WC_FOUND_CONFLICT,
>
> + /* The working copy is in an invalid state */
> + SVN_ERR_WC_CORRUPT,
> +
> /* A general filesystem error. */
> SVN_ERR_FS_GENERAL,
>
> @@ -285,134 +287,7 @@
>
>
>
> -/*** Wrappers around APR pools, so we get error pools. ***/
> -
> -/* If you want pool usage debug info dumped to stderr (in environments
> - * that support that kind of thing), #define SVN_POOL_DEBUG here.
> - */
> -/*
> -#define SVN_POOL_DEBUG
> -*/
> -
> -
> -
> -/* THE ERROR POOL
> - *
> - * When SVN allocates an svn_error_t, it must do so from a pool. There is
> - * almost always a pool available for a function to provide to the error
> - * creation functions. However, that pool may have a shorter lifetime than
> - * is required for the error (in many cases, the error needs to bubble all
> - * the way to the top-most control function). Assuming that these shorter-
> - * lifetime pools are cleared or even destroyed as the error propagates,
> - * then we need a way to ensure that the error is allocated within the
> - * proper pool, to get the proper lifetime.
> - *
> - * We create a pool specifically for errors. This pool is then "hung from"
> - * the top-most pool that SVN will be using (whether this top-most pool is
> - * provided by an embeddor such as Apache, or whether an SVN tool creates
> - * the top-most pool itself). Since this error pool has a lifetime *at least*
> - * as long as the top-most pool, then any errors allocated within it will
> - * survive back to the top-most control function.
> - *
> - * We use a subpool rather than the top-most pool itself because we may want
> - * to occasionally clear the error pool (say, if we get an error, recover,
> - * and restart the operation).
> - *
> - * This subpool is called "the error pool". Using APR's "userdata" feature,
> - * we associate the error pool with every subpool that SVN creates. When
> - * the SVN error system allocates a new error, it first fetches the subpool
> - * from the pool..
> - */
> -
> -/* You may be wondering why is this is in svn_error, instead of
> - svn_pool or whatever. The reason is the needs of the SVN error
> - system are our only justification for wrapping APR's pool creation
> - funcs -- because errors have to live as long as the top-most pool
> - in a test program or a `request'. If you're not using SVN errors,
> - there's no reason not to use APR's native pool interface. But you
> - are using SVN errors, aren't you? */
> -
> -/* Initalize the given pool as SVN's top-most pool. This is needed when SVN
> - * is embedded in another application, and all of SVN's work will occur
> - * within a given pool.
> - *
> - * This function will construct the error pool (for all errors to live
> - * within), and hang it off of the given pool. When subpools are created
> - * with svn_pool_create(), they will pick up this pool.
> - *
> - * Note: we return an apr_status_t since a catch-22 means we cannot allocate
> - * an svn_error_t.
> - *
> - * WARNING: this is ONLY to be used for pools provided by an embeddor. Do not
> - * use it for pools returned by svn_pool_create().
> - */
> -apr_status_t svn_error_init_pool (apr_pool_t *top_pool);
> -
> -
> -#ifndef SVN_POOL_DEBUG
> -/* Return a new pool. If PARENT_POOL is non-null, then the new
> - * pool will be a subpool of it, and will inherit the containing
> - * pool's dedicated error subpool.
> - *
> - * If PARENT_POOL is NULL, then the returned pool will be a new "global"
> - * pool (with no parent), and an error pool will be created.
> - *
> - * If anything goes wrong with the pool creation, then an abort function
> - * will be called, which will exit the program. If future allocations from
> - * this pool cannot be fulfilled, then the abort function will be called,
> - * terminating the program.
> - */
> -apr_pool_t *svn_pool_create (apr_pool_t *parent_pool);
> -
> -#else /* SVN_POOL_DEBUG */
> -apr_pool_t *svn_pool_create_debug (apr_pool_t *parent_pool,
> - const char *file,
> - int line);
> -#define svn_pool_create(p) svn_pool_create_debug(p, __FILE__, __LINE__)
> -#endif /* SVN_POOL_DEBUG */
> -
> -
> -
> -#ifndef SVN_POOL_DEBUG
> -/* Clear the passed in pool.
> - *
> - * The reason we need this wrapper to apr_pool_clear, is because
> - * apr_pool_clear removes the association with the appropriate error
> - * pool. This wrapper calls apr_pool_clear, and then reattaches the
> - * error pool.
> - *
> - * If anything goes wrong, an abort function will be called.
> - */
> -void svn_pool_clear (apr_pool_t *p);
> -
> -#else /* SVN_POOL_DEBUG */
> -void svn_pool_clear_debug (apr_pool_t *p,
> - const char *file,
> - int line);
> -#define svn_pool_clear(p) svn_pool_clear_debug(p, __FILE__, __LINE__)
> -#endif /* SVN_POOL_DEBUG */
> -
> -
> -#ifndef SVN_POOL_DEBUG
> -
> -/* Destroy a POOL and all of its children.
> - *
> - * This wrapper to apr_pool_destroy exists for symmatry (the
> - * not-so-grand reason) and for the existence of a great memory usage
> - * debugging hook (the grand reason).
> - */
> -void svn_pool_destroy (apr_pool_t *p);
> -
> -#else /* SVN_POOL_DEBUG */
> -void svn_pool_destroy_debug (apr_pool_t *p,
> - const char *file,
> - int line);
> -#define svn_pool_destroy(p) svn_pool_destroy_debug(p, __FILE__, __LINE__)
> -#endif /* SVN_POOL_DEBUG */
> -
>
> -
> -
> /*** SVN error creation and destruction. ***/
>
> typedef struct svn_error
> @@ -424,6 +299,7 @@
> apr_pool_t *pool; /* The pool holding this error and any
> child errors it wraps */
> } svn_error_t;
> +
>
>
> /*
>
>
>
> 1.39 +4 -0 subversion/subversion/include/svn_io.h
>
> http://subversion.tigris.org/source/browse/subversion/subversion/include/svn_io.h.diff?r1=1.38&r2=1.39
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: svn_io.h
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/include/svn_io.h,v
> retrieving revision 1.38
> retrieving revision 1.39
> diff -u -b -r1.38 -r1.39
> --- svn_io.h 2001/06/08 09:01:02 1.38
> +++ svn_io.h 2001/06/08 21:31:20 1.39
> @@ -178,6 +178,10 @@
>
> svn_stream_t *svn_stream_create (void *baton, apr_pool_t *pool);
>
> +svn_stream_t *svn_stream_dup (svn_stream_t *stream, apr_pool_t *pool);
> +
> +void svn_stream_set_baton (svn_stream_t *stream, void *baton);
> +
> void svn_stream_set_read (svn_stream_t *stream, svn_read_fn_t read_fn);
>
> void svn_stream_set_write (svn_stream_t *stream, svn_write_fn_t write_fn);
>
>
>
> 1.1 subversion/subversion/include/svn_pools.h
>
> http://subversion.tigris.org/source/browse/subversion/subversion/include/svn_pools.h?rev=1.1&content-type=text/x-cvsweb-markup
>
> Index: svn_pools.h
> ===================================================================
> /* svn_pools.h: APR pool management for Subversion
> *
> * ====================================================================
> * Copyright (c) 2000-2001 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> * are also available at http://subversion.tigris.org/license-1.html.
> * If newer versions of this license are posted there, you may use a
> * newer version instead, at your option.
> * ====================================================================
> */
>
>
>
>
> #ifndef SVN_POOLS_H
> #define SVN_POOLS_H
>
> #include <apr.h>
> #include <apr_errno.h> /* APR's error system */
> #include <apr_pools.h>
>
> #define APR_WANT_STDIO
> #include <apr_want.h>
>
> #include <svn_types.h>
> #include "svn_io.h"
>
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
>
>
>
> /*** Wrappers around APR pools, so we get error pools. ***/
>
> /* If you want pool usage debug info dumped to stderr (in environments
> * that support that kind of thing), #define SVN_POOL_DEBUG here.
> */
> /*
> #define SVN_POOL_DEBUG
> */
>
>
>
> /* THE ERROR POOL
> *
> * When SVN allocates an svn_error_t, it must do so from a pool. There is
> * almost always a pool available for a function to provide to the error
> * creation functions. However, that pool may have a shorter lifetime than
> * is required for the error (in many cases, the error needs to bubble all
> * the way to the top-most control function). Assuming that these shorter-
> * lifetime pools are cleared or even destroyed as the error propagates,
> * then we need a way to ensure that the error is allocated within the
> * proper pool, to get the proper lifetime.
> *
> * We create a pool specifically for errors. This pool is then "hung from"
> * the top-most pool that SVN will be using (whether this top-most pool is
> * provided by an embeddor such as Apache, or whether an SVN tool creates
> * the top-most pool itself). Since this error pool has a lifetime *at least*
> * as long as the top-most pool, then any errors allocated within it will
> * survive back to the top-most control function.
> *
> * We use a subpool rather than the top-most pool itself because we may want
> * to occasionally clear the error pool (say, if we get an error, recover,
> * and restart the operation).
> *
> * This subpool is called "the error pool". Using APR's "userdata" feature,
> * we associate the error pool with every subpool that SVN creates. When
> * the SVN error system allocates a new error, it first fetches the subpool
> * from the pool..
> */
>
> /* You may be wondering why is this is in svn_error, instead of
> svn_pool or whatever. The reason is the needs of the SVN error
> system are our only justification for wrapping APR's pool creation
> funcs -- because errors have to live as long as the top-most pool
> in a test program or a `request'. If you're not using SVN errors,
> there's no reason not to use APR's native pool interface. But you
> are using SVN errors, aren't you? */
>
> /* Initalize the given pool as SVN's top-most pool. This is needed when SVN
> * is embedded in another application, and all of SVN's work will occur
> * within a given pool.
> *
> * This function will construct the error pool (for all errors to live
> * within), and hang it off of the given pool. It will also create a
> * feedback stream (for the transmission of messages in a
> * non-terminating fashion). When subpools are created with
> * svn_pool_create(), they will inherit these two things.
> *
> * Note: we return an apr_status_t since a catch-22 means we cannot allocate
> * an svn_error_t.
> *
> * WARNING: this is ONLY to be used for pools provided by an embeddor. Do not
> * use it for pools returned by svn_pool_create(). */
> apr_status_t svn_error_init_pool (apr_pool_t *top_pool);
>
>
> /* Return the feedback stream associated with pool P. This stream,
> like the error pool, exists at the top-level Subversion pool, and
> is referred to by all subpools of that top-level pool. A caller
> can set the i/o functions on this stream, as well as the baton,
> using the svn_stream_t functions in svn_io.h. This mechanism
> provides a way for real-time, non-terminative information (such as
> warnings) to be passed back to those who care.
>
> In the future, this mechanism may be replaced with the broader
> concept of function v-table (some of who functions could surely do
> the same thing that this stream's functions do). */
> svn_stream_t *svn_pool_get_feedback_stream (apr_pool_t *p);
>
>
> #ifndef SVN_POOL_DEBUG
> /* Return a new pool. If PARENT_POOL is non-null, then the new
> * pool will be a subpool of it, and will inherit the containing
> * pool's dedicated error subpool and feedback stream.
> *
> * If PARENT_POOL is NULL, then the returned pool will be a new
> * "global" pool (with no parent), and an error pool and feedback
> * stream will be created.
> *
> * If anything goes wrong with the pool creation, then an abort function
> * will be called, which will exit the program. If future allocations from
> * this pool cannot be fulfilled, then the abort function will be called,
> * terminating the program. */
> apr_pool_t *svn_pool_create (apr_pool_t *parent_pool);
>
> #else /* SVN_POOL_DEBUG */
> apr_pool_t *svn_pool_create_debug (apr_pool_t *parent_pool,
> const char *file,
> int line);
> #define svn_pool_create(p) svn_pool_create_debug(p, __FILE__, __LINE__)
> #endif /* SVN_POOL_DEBUG */
>
>
>
> #ifndef SVN_POOL_DEBUG
> /* Clear the passed in pool.
> *
> * The reason we need this wrapper to apr_pool_clear, is because
> * apr_pool_clear removes the association with the appropriate error
> * pool and feedback stream. This wrapper calls apr_pool_clear, and
> * then reattaches or recreates the error pool and feedback stream.
> *
> * If anything goes wrong, an abort function will be called. */
> void svn_pool_clear (apr_pool_t *p);
>
> #else /* SVN_POOL_DEBUG */
> void svn_pool_clear_debug (apr_pool_t *p,
> const char *file,
> int line);
> #define svn_pool_clear(p) svn_pool_clear_debug(p, __FILE__, __LINE__)
> #endif /* SVN_POOL_DEBUG */
>
>
> #ifndef SVN_POOL_DEBUG
>
> /* Destroy a POOL and all of its children.
> *
> * This wrapper to apr_pool_destroy exists for symmatry (the
> * not-so-grand reason) and for the existence of a great memory usage
> * debugging hook (the grand reason).
> */
> void svn_pool_destroy (apr_pool_t *p);
>
> #else /* SVN_POOL_DEBUG */
> void svn_pool_destroy_debug (apr_pool_t *p,
> const char *file,
> int line);
> #define svn_pool_destroy(p) svn_pool_destroy_debug(p, __FILE__, __LINE__)
> #endif /* SVN_POOL_DEBUG */
>
>
> #ifdef __cplusplus
> }
> #endif /* __cplusplus */
>
> #endif /* SVN_ERROR_H */
>
>
> /* ----------------------------------------------------------------
> * local variables:
> * eval: (load-file "../svn-dev.el")
> * end:
> */
>
>
>
> 1.16 +1 -0 subversion/subversion/libsvn_client/add.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_client/add.c.diff?r1=1.15&r2=1.16
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: add.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_client/add.c,v
> retrieving revision 1.15
> retrieving revision 1.16
> diff -u -b -r1.15 -r1.16
> --- add.c 2001/06/08 09:01:03 1.15
> +++ add.c 2001/06/08 21:31:20 1.16
> @@ -21,6 +21,7 @@
> #include "svn_wc.h"
> #include "svn_client.h"
> #include "svn_string.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_path.h"
> #include "client.h"
>
>
>
> 1.47 +1 -0 subversion/subversion/libsvn_client/commit.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_client/commit.c.diff?r1=1.46&r2=1.47
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: commit.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_client/commit.c,v
> retrieving revision 1.46
> retrieving revision 1.47
> diff -u -b -r1.46 -r1.47
> --- commit.c 2001/06/08 09:01:03 1.46
> +++ commit.c 2001/06/08 21:31:20 1.47
> @@ -25,6 +25,7 @@
> #include "svn_delta.h"
> #include "svn_client.h"
> #include "svn_string.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_path.h"
> #include "svn_test.h"
>
>
>
> 1.24 +1 -0 subversion/subversion/libsvn_delta/svndiff.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_delta/svndiff.c.diff?r1=1.23&r2=1.24
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: svndiff.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_delta/svndiff.c,v
> retrieving revision 1.23
> retrieving revision 1.24
> diff -u -b -r1.23 -r1.24
> --- svndiff.c 2001/06/08 09:01:03 1.23
> +++ svndiff.c 2001/06/08 21:31:21 1.24
> @@ -18,6 +18,7 @@
> #include "svn_delta.h"
> #include "svn_io.h"
> #include "delta.h"
> +#include "svn_pools.h"
>
> #define NORMAL_BITS 7
> #define LENGTH_BITS 5
>
>
>
> 1.34 +1 -1 subversion/subversion/libsvn_delta/text_delta.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_delta/text_delta.c.diff?r1=1.33&r2=1.34
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: text_delta.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_delta/text_delta.c,v
> retrieving revision 1.33
> retrieving revision 1.34
> diff -u -b -r1.33 -r1.34
> --- text_delta.c 2001/06/08 09:01:03 1.33
> +++ text_delta.c 2001/06/08 21:31:21 1.34
> @@ -20,8 +20,8 @@
>
> #include "svn_delta.h"
> #include "svn_io.h"
> +#include "svn_pools.h"
> #include "delta.h"
> -
>
>
> /* Text delta stream descriptor. */
>
>
>
> 1.39 +1 -1 subversion/subversion/libsvn_delta/xml_output.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_delta/xml_output.c.diff?r1=1.38&r2=1.39
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: xml_output.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_delta/xml_output.c,v
> retrieving revision 1.38
> retrieving revision 1.39
> diff -u -b -r1.38 -r1.39
> --- xml_output.c 2001/06/08 09:01:03 1.38
> +++ xml_output.c 2001/06/08 21:31:21 1.39
> @@ -23,7 +23,7 @@
> #include "svn_xml.h"
> #include "svn_base64.h"
> #include "svn_quoprint.h"
> -#include "apr_pools.h"
> +#include "svn_pools.h"
> #include "delta.h"
>
> /* TODO:
>
>
>
> 1.156 +1 -0 subversion/subversion/libsvn_delta/xml_parse.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_delta/xml_parse.c.diff?r1=1.155&r2=1.156
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: xml_parse.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_delta/xml_parse.c,v
> retrieving revision 1.155
> retrieving revision 1.156
> diff -u -b -r1.155 -r1.156
> --- xml_parse.c 2001/06/08 09:01:03 1.155
> +++ xml_parse.c 2001/06/08 21:31:21 1.156
> @@ -35,6 +35,7 @@
> #include <string.h>
> #include "svn_types.h"
> #include "svn_string.h"
> +#include "svn_pools.h"
> #include "svn_path.h"
> #include "svn_error.h"
> #include "svn_delta.h"
>
>
>
> 1.96 +1 -0 subversion/subversion/libsvn_fs/dag.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/dag.c.diff?r1=1.95&r2=1.96
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: dag.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/dag.c,v
> retrieving revision 1.95
> retrieving revision 1.96
> diff -u -b -r1.95 -r1.96
> --- dag.c 2001/06/08 09:01:04 1.95
> +++ dag.c 2001/06/08 21:31:21 1.96
> @@ -13,6 +13,7 @@
>
> #include <string.h>
> #include <assert.h>
> +#include "svn_pools.h"
> #include "svn_path.h"
> #include "svn_error.h"
> #include "svn_fs.h"
>
>
>
> 1.46 +1 -0 subversion/subversion/libsvn_fs/fs.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/fs.c.diff?r1=1.45&r2=1.46
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: fs.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/fs.c,v
> retrieving revision 1.45
> retrieving revision 1.46
> diff -u -b -r1.45 -r1.46
> --- fs.c 2001/06/08 08:34:32 1.45
> +++ fs.c 2001/06/08 21:31:21 1.46
> @@ -20,6 +20,7 @@
> #include "apr_pools.h"
> #include "apr_file_io.h"
>
> +#include "svn_pools.h"
> #include "db.h"
> #include "svn_fs.h"
> #include "fs.h"
>
>
>
> 1.11 +1 -0 subversion/subversion/libsvn_fs/trail.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/trail.c.diff?r1=1.10&r2=1.11
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: trail.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/trail.c,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -b -r1.10 -r1.11
> --- trail.c 2001/04/12 08:02:36 1.10
> +++ trail.c 2001/06/08 21:31:21 1.11
> @@ -13,6 +13,7 @@
>
> #include "db.h"
> #include "apr_pools.h"
> +#include "svn_pools.h"
> #include "svn_fs.h"
> #include "fs.h"
> #include "err.h"
>
>
>
> 1.75 +1 -0 subversion/subversion/libsvn_fs/tree.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/tree.c.diff?r1=1.74&r2=1.75
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: tree.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/tree.c,v
> retrieving revision 1.74
> retrieving revision 1.75
> diff -u -b -r1.74 -r1.75
> --- tree.c 2001/06/08 09:01:04 1.74
> +++ tree.c 2001/06/08 21:31:21 1.75
> @@ -29,6 +29,7 @@
> #include <stdlib.h>
> #include <string.h>
> #include <assert.h>
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_fs.h"
> #include "skel.h"
>
>
>
> 1.42 +1 -0 subversion/subversion/libsvn_fs/txn.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_fs/txn.c.diff?r1=1.41&r2=1.42
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: txn.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_fs/txn.c,v
> retrieving revision 1.41
> retrieving revision 1.42
> diff -u -b -r1.41 -r1.42
> --- txn.c 2001/05/09 21:11:53 1.41
> +++ txn.c 2001/06/08 21:31:21 1.42
> @@ -17,6 +17,7 @@
> #include "apr_tables.h"
> #include "apr_pools.h"
>
> +#include "svn_pools.h"
> #include "svn_fs.h"
>
> #include "fs.h"
>
>
>
> 1.53 +1 -0 subversion/subversion/libsvn_ra_dav/commit.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_ra_dav/commit.c.diff?r1=1.52&r2=1.53
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: commit.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_ra_dav/commit.c,v
> retrieving revision 1.52
> retrieving revision 1.53
> diff -u -b -r1.52 -r1.53
> --- commit.c 2001/06/08 09:01:04 1.52
> +++ commit.c 2001/06/08 21:31:21 1.53
> @@ -27,6 +27,7 @@
> #include <stdlib.h> /* for free() */
> #endif
>
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_delta.h"
> #include "svn_ra.h"
>
>
>
> 1.11 +1 -0 subversion/subversion/libsvn_ra_local/checkout.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_ra_local/checkout.c.diff?r1=1.10&r2=1.11
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: checkout.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_ra_local/checkout.c,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -b -r1.10 -r1.11
> --- checkout.c 2001/06/08 09:01:05 1.10
> +++ checkout.c 2001/06/08 21:31:21 1.11
> @@ -14,6 +14,7 @@
>
> #include "ra_local.h"
> #include <assert.h>
> +#include "svn_pools.h"
>
>
> /* Helper to read data out of a file at ROOT:PATH and push it to
>
>
>
> 1.33 +1 -0 subversion/subversion/libsvn_ra_local/ra_plugin.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_ra_local/ra_plugin.c.diff?r1=1.32&r2=1.33
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: ra_plugin.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_ra_local/ra_plugin.c,v
> retrieving revision 1.32
> retrieving revision 1.33
> diff -u -b -r1.32 -r1.33
> --- ra_plugin.c 2001/06/08 09:01:05 1.32
> +++ ra_plugin.c 2001/06/08 21:31:21 1.33
> @@ -15,6 +15,7 @@
> #include "ra_local.h"
> #include "svn_ra.h"
> #include "svn_repos.h"
> +#include "svn_pools.h"
>
> /*----------------------------------------------------------------*/
>
>
>
>
> 1.11 +1 -1 subversion/subversion/libsvn_ra_local/split_url.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_ra_local/split_url.c.diff?r1=1.10&r2=1.11
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: split_url.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_ra_local/split_url.c,v
> retrieving revision 1.10
> retrieving revision 1.11
> diff -u -b -r1.10 -r1.11
> --- split_url.c 2001/06/08 09:01:05 1.10
> +++ split_url.c 2001/06/08 21:31:21 1.11
> @@ -15,7 +15,7 @@
> #include "ra_local.h"
> #include <assert.h>
> #include <string.h>
> -
> +#include "svn_pools.h"
>
> svn_error_t *
> svn_ra_local__split_URL (svn_stringbuf_t **repos_path,
>
>
>
> 1.6 +1 -0 subversion/subversion/libsvn_repos/commit_editor.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_repos/commit_editor.c.diff?r1=1.5&r2=1.6
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: commit_editor.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_repos/commit_editor.c,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -b -r1.5 -r1.6
> --- commit_editor.c 2001/06/08 09:01:05 1.5
> +++ commit_editor.c 2001/06/08 21:31:21 1.6
> @@ -15,6 +15,7 @@
> #include "apr_pools.h"
> #include "apr_file_io.h"
>
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_path.h"
> #include "svn_delta.h"
>
>
>
> 1.49 +1 -0 subversion/subversion/libsvn_repos/delta.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_repos/delta.c.diff?r1=1.48&r2=1.49
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: delta.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_repos/delta.c,v
> retrieving revision 1.48
> retrieving revision 1.49
> diff -u -b -r1.48 -r1.49
> --- delta.c 2001/06/08 09:01:05 1.48
> +++ delta.c 2001/06/08 21:31:21 1.49
> @@ -19,6 +19,7 @@
> #include "svn_path.h"
> #include "apr_hash.h"
> #include "svn_repos.h"
> +#include "svn_pools.h"
>
>
>
>
>
>
> 1.19 +1 -0 subversion/subversion/libsvn_subr/base64.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_subr/base64.c.diff?r1=1.18&r2=1.19
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: base64.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_subr/base64.c,v
> retrieving revision 1.18
> retrieving revision 1.19
> diff -u -b -r1.18 -r1.19
> --- base64.c 2001/06/08 09:01:05 1.18
> +++ base64.c 2001/06/08 21:31:22 1.19
> @@ -20,6 +20,7 @@
> #include <apr_pools.h>
> #include <apr_general.h> /* for APR_INLINE */
>
> +#include "svn_pools.h"
> #include "svn_io.h"
> #include "svn_error.h"
> #include "svn_base64.h"
>
>
>
> 1.38 +21 -0 subversion/subversion/libsvn_subr/io.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_subr/io.c.diff?r1=1.37&r2=1.38
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: io.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_subr/io.c,v
> retrieving revision 1.37
> retrieving revision 1.38
> diff -u -b -r1.37 -r1.38
> --- io.c 2001/06/08 09:01:05 1.37
> +++ io.c 2001/06/08 21:31:22 1.38
> @@ -389,6 +389,27 @@
> }
>
>
> +svn_stream_t *
> +svn_stream_dup (svn_stream_t *stream, apr_pool_t *pool)
> +{
> + svn_stream_t *new_stream;
> +
> + new_stream = apr_palloc (pool, sizeof (*new_stream));
> + new_stream->baton = stream->baton;
> + new_stream->read_fn = stream->read_fn;
> + new_stream->write_fn = stream->write_fn;
> + new_stream->close_fn = stream->close_fn;
> + return stream;
> +}
> +
> +
> +void
> +svn_stream_set_baton (svn_stream_t *stream, void *baton)
> +{
> + stream->baton = baton;
> +}
> +
> +
> void
> svn_stream_set_read (svn_stream_t *stream, svn_read_fn_t read_fn)
> {
>
>
>
> 1.6 +1 -0 subversion/subversion/libsvn_subr/quoprint.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_subr/quoprint.c.diff?r1=1.5&r2=1.6
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: quoprint.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_subr/quoprint.c,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -b -r1.5 -r1.6
> --- quoprint.c 2001/06/08 09:01:05 1.5
> +++ quoprint.c 2001/06/08 21:31:22 1.6
> @@ -20,6 +20,7 @@
> #include <apr_pools.h>
> #include <apr_general.h> /* for APR_INLINE */
>
> +#include "svn_pools.h"
> #include "svn_io.h"
> #include "svn_error.h"
> #include "svn_quoprint.h"
>
>
>
> 1.63 +96 -25 subversion/subversion/libsvn_subr/svn_error.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_subr/svn_error.c.diff?r1=1.62&r2=1.63
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: svn_error.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_subr/svn_error.c,v
> retrieving revision 1.62
> retrieving revision 1.63
> diff -u -b -r1.62 -r1.63
> --- svn_error.c 2001/04/27 03:37:59 1.62
> +++ svn_error.c 2001/06/08 21:31:22 1.63
> @@ -19,7 +19,9 @@
> #include "apr_general.h"
> #include "apr_pools.h"
> #include "apr_strings.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> +#include "svn_io.h"
>
> /* Key for the error pool itself. */
> #define SVN_ERROR_POOL "svn-error-pool"
> @@ -28,6 +30,8 @@
> the pool whose prog_data we got it from. */
> #define SVN_ERROR_POOL_ROOTED_HERE "svn-error-pool-rooted-here"
>
> +/* Key for the svn_stream_t used for non-fatal feedback. */
> +#define SVN_ERROR_STREAM "svn-error-stream"
>
>
> /*** helpers for creating errors ***/
> @@ -92,8 +96,8 @@
> *error_pool = apr_pool_sub_make (parent, abort_on_pool_failure);
>
> /* Set the error pool on itself. */
> - apr_err = apr_pool_userdata_set (*error_pool, SVN_ERROR_POOL, apr_pool_cleanup_null,
> - *error_pool);
> + apr_err = apr_pool_userdata_set (*error_pool, SVN_ERROR_POOL,
> + apr_pool_cleanup_null, *error_pool);
>
> return apr_err;
> }
> @@ -172,23 +176,42 @@
> }
>
>
> +svn_stream_t *
> +svn_pool_get_feedback_stream (apr_pool_t *p)
> +{
> + svn_stream_t *feedback_stream;
> +
> + apr_pool_userdata_get ((void **)&feedback_stream, SVN_ERROR_STREAM, p);
> + return feedback_stream;
> +}
> +
> +
> apr_status_t
> svn_error_init_pool (apr_pool_t *top_pool)
> {
> - void *check_for_pool;
> + void *check;
> apr_pool_t *error_pool;
> + svn_stream_t *feedback_stream;
> apr_status_t apr_err;
>
> /* just return if an error pool already exists */
> - apr_pool_userdata_get (&check_for_pool, SVN_ERROR_POOL, top_pool);
> - if (check_for_pool != NULL)
> - return APR_SUCCESS;
> -
> + apr_pool_userdata_get (&check, SVN_ERROR_POOL, top_pool);
> + if (check == NULL)
> + {
> apr_err = svn_error__make_error_pool (top_pool, &error_pool);
> if (! APR_STATUS_IS_SUCCESS (apr_err))
> return apr_err;
>
> svn_error__set_error_pool (top_pool, error_pool, 1);
> + }
> +
> + apr_pool_userdata_get (&check, SVN_ERROR_STREAM, top_pool);
> + if (check == NULL)
> + {
> + feedback_stream = svn_stream_create (NULL, top_pool);
> + apr_pool_userdata_set (feedback_stream, SVN_ERROR_STREAM,
> + apr_pool_cleanup_null, top_pool);
> + }
>
> return APR_SUCCESS;
> }
> @@ -231,14 +254,19 @@
> /* If there is no parent, then initialize ret_pool as the "top". */
> if (parent_pool == NULL)
> {
> - apr_status_t apr_err;
> -
> - apr_err = svn_error_init_pool (ret_pool);
> + apr_status_t apr_err = svn_error_init_pool (ret_pool);
> if (apr_err)
> abort_on_pool_failure (apr_err);
> }
> else
> + {
> + /* Inherit the error pool and feedback stream from the parent. */
> + svn_stream_t *stream;
> svn_pool__inherit_error_pool (ret_pool);
> + apr_pool_userdata_get ((void **)&stream, SVN_ERROR_STREAM, parent_pool);
> + apr_pool_userdata_set (stream, SVN_ERROR_STREAM,
> + apr_pool_cleanup_null, ret_pool);
> + }
>
> #ifdef SVN_POOL_DEBUG
> {
> @@ -263,6 +291,8 @@
> {
> apr_pool_t *parent;
> apr_pool_t *error_pool;
> + apr_pool_t *tmp_pool;
> + svn_stream_t *stream, *stream_copy;
> svn_boolean_t subpool_of_p_p; /* That's "predicate" to you, bud. */
>
> #ifdef SVN_POOL_DEBUG
> @@ -278,27 +308,68 @@
>
> parent = apr_pool_get_parent (p);
> if (parent)
> + {
> + /* Get the error pool */
> svn_error__get_error_pool (parent, &error_pool, &subpool_of_p_p);
> + }
> else
> {
> error_pool = NULL; /* Paranoia. */
> subpool_of_p_p = 1; /* The only possibility. */
> }
>
> - apr_pool_clear (p);
> + /* Get the feedback stream */
> + apr_pool_userdata_get ((void **)&stream, SVN_ERROR_STREAM, p);
>
> - /* Clearing the pool invalidated all userdata attached to it,
> - so we must reattach its error pool. However, clearing a pool
> - also destroys all its subpools; if the error pool was a subpool
> - of p (meaning it was created for p, rather than inherited from
> - p's parent), then we must conjure up a new error pool here.
> - Otherwise, we should stick with the old one, no point creating a
> - new error pool when we have a perfectly good one at hand. */
> + if (subpool_of_p_p)
> + {
> + /* Here we have a problematic situation. We're getting ready to
> + clear this pool P, which will invalidate all its userdata.
> + The problem is that as far as we can tell, the error pool and
> + feedback stream on this pool are copies of the originals,
> + they *are* the originals. We need to be able to re-create
> + them in this pool after it has been cleared.
> +
> + For the error pool, this turn out to be not that big of a
> + deal. We don't actually need to keep *the* original error
> + pool -- we can just initialize a new error pool to stuff into
> + P here after it's been cleared.
> +
> + The feedback stream doesn't offer quite the luxury. We can't
> + really afford to just create a new feedback stream, since the
> + caller may have already set up the stream functions and baton
> + and such on this stream. The svn_stream_t structure is
> + opaque, else we could just copy the stream into a static
> + structure temporarily. So the only real course of action
> + here is to allocate a new global pool, dupe the stream in
> + this new global pool, then dup it back after we've cleared
> + P. */
> + apr_pool_create (&tmp_pool, NULL);
> +
> + /* Dupe the feedback stream in our temporary pool. */
> + stream_copy = svn_stream_dup (stream, tmp_pool);
> + }
>
> + /* Clear the pool. All userdata of this pool is now invalid. */
> + apr_pool_clear (p);
> +
> if (subpool_of_p_p)
> + {
> + /* Make new error pool. */
> svn_error__make_error_pool (p, &error_pool);
>
> + /* Dupe our squirreled-away stream back into P... */
> + stream = svn_stream_dup (stream_copy, p);
> +
> + /* ...and clean up our mess. */
> + apr_pool_destroy (tmp_pool);
> + }
> +
> + /* Now, reset the error pool and feedback stream on P. */
> svn_error__set_error_pool (p, error_pool, subpool_of_p_p);
> + apr_pool_userdata_set (stream, SVN_ERROR_STREAM,
> + apr_pool_cleanup_null, p);
> +
> }
>
>
>
>
>
> 1.10 +1 -0 subversion/subversion/libsvn_subr/target.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_subr/target.c.diff?r1=1.9&r2=1.10
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: target.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_subr/target.c,v
> retrieving revision 1.9
> retrieving revision 1.10
> diff -u -b -r1.9 -r1.10
> --- target.c 2001/06/08 09:01:05 1.9
> +++ target.c 2001/06/08 21:31:22 1.10
> @@ -20,6 +20,7 @@
> /*** Includes. ***/
>
> #include "svn_string.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_path.h"
> #include "apr_file_info.h"
>
>
>
> 1.39 +1 -1 subversion/subversion/libsvn_subr/xml.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_subr/xml.c.diff?r1=1.38&r2=1.39
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: xml.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_subr/xml.c,v
> retrieving revision 1.38
> retrieving revision 1.39
> diff -u -b -r1.38 -r1.39
> --- xml.c 2001/06/08 09:01:05 1.38
> +++ xml.c 2001/06/08 21:31:22 1.39
> @@ -16,7 +16,7 @@
>
> #include <string.h>
> #include <assert.h>
> -#include "apr_pools.h"
> +#include "svn_pools.h"
> #include "svn_xml.h"
>
>
>
>
>
> 1.111 +1 -0 subversion/subversion/libsvn_wc/adm_crawler.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_wc/adm_crawler.c.diff?r1=1.110&r2=1.111
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: adm_crawler.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_wc/adm_crawler.c,v
> retrieving revision 1.110
> retrieving revision 1.111
> diff -u -b -r1.110 -r1.111
> --- adm_crawler.c 2001/06/08 09:01:05 1.110
> +++ adm_crawler.c 2001/06/08 21:31:22 1.111
> @@ -20,6 +20,7 @@
> #include "apr_hash.h"
> #include "wc.h"
> #include "svn_types.h"
> +#include "svn_pools.h"
> #include "svn_wc.h"
> #include "svn_io.h"
> #include "svn_sorts.h"
>
>
>
> 1.71 +1 -0 subversion/subversion/libsvn_wc/adm_ops.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_wc/adm_ops.c.diff?r1=1.70&r2=1.71
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: adm_ops.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_wc/adm_ops.c,v
> retrieving revision 1.70
> retrieving revision 1.71
> diff -u -b -r1.70 -r1.71
> --- adm_ops.c 2001/06/08 09:01:06 1.70
> +++ adm_ops.c 2001/06/08 21:31:22 1.71
> @@ -24,6 +24,7 @@
> #include <apr_file_io.h>
> #include <apr_time.h>
> #include "svn_types.h"
> +#include "svn_pools.h"
> #include "svn_string.h"
> #include "svn_error.h"
> #include "svn_hash.h"
>
>
>
> 1.184 +1 -0 subversion/subversion/libsvn_wc/get_editor.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/libsvn_wc/get_editor.c.diff?r1=1.183&r2=1.184
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: get_editor.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/libsvn_wc/get_editor.c,v
> retrieving revision 1.183
> retrieving revision 1.184
> diff -u -b -r1.183 -r1.184
> --- get_editor.c 2001/06/08 09:01:06 1.183
> +++ get_editor.c 2001/06/08 21:31:22 1.184
> @@ -26,6 +26,7 @@
> #include <apr_thread_proc.h>
>
> #include "svn_types.h"
> +#include "svn_pools.h"
> #include "svn_delta.h"
> #include "svn_string.h"
> #include "svn_path.h"
>
>
>
> 1.12 +1 -0 subversion/subversion/svnadmin/main.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/svnadmin/main.c.diff?r1=1.11&r2=1.12
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: main.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/svnadmin/main.c,v
> retrieving revision 1.11
> retrieving revision 1.12
> diff -u -b -r1.11 -r1.12
> --- main.c 2001/05/09 08:43:14 1.11
> +++ main.c 2001/06/08 21:31:22 1.12
> @@ -20,6 +20,7 @@
> #include <apr_want.h>
>
> #include "svn_types.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_fs.h"
>
>
>
>
> 1.4 +1 -0 subversion/subversion/tests/fs-helpers.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/fs-helpers.c.diff?r1=1.3&r2=1.4
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: fs-helpers.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/fs-helpers.c,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -b -r1.3 -r1.4
> --- fs-helpers.c 2001/06/08 09:01:07 1.3
> +++ fs-helpers.c 2001/06/08 21:31:22 1.4
> @@ -14,6 +14,7 @@
> #include <stdlib.h>
> #include <string.h>
> #include <apr_pools.h>
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_fs.h"
> #include "svn_path.h"
>
>
>
> 1.23 +1 -0 subversion/subversion/tests/svn_tests_main.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/svn_tests_main.c.diff?r1=1.22&r2=1.23
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: svn_tests_main.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/svn_tests_main.c,v
> retrieving revision 1.22
> retrieving revision 1.23
> diff -u -b -r1.22 -r1.23
> --- svn_tests_main.c 2001/05/30 11:26:23 1.22
> +++ svn_tests_main.c 2001/06/08 21:31:22 1.23
> @@ -23,6 +23,7 @@
> #include <apr_general.h>
> #include <apr_lib.h>
>
> +#include "svn_pools.h"
> #include "svn_error.h"
>
>
>
>
>
> 1.71 +1 -0 subversion/subversion/tests/libsvn_delta/deltaparse-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_delta/deltaparse-test.c.diff?r1=1.70&r2=1.71
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: deltaparse-test.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_delta/deltaparse-test.c,v
> retrieving revision 1.70
> retrieving revision 1.71
> diff -u -b -r1.70 -r1.71
> --- deltaparse-test.c 2001/06/08 09:01:07 1.70
> +++ deltaparse-test.c 2001/06/08 21:31:22 1.71
> @@ -19,6 +19,7 @@
> #include <apr_general.h>
>
> #include "svn_types.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_path.h"
> #include "svn_delta.h"
>
>
>
> 1.24 +1 -0 subversion/subversion/tests/libsvn_delta/random-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_delta/random-test.c.diff?r1=1.23&r2=1.24
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: random-test.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_delta/random-test.c,v
> retrieving revision 1.23
> retrieving revision 1.24
> diff -u -b -r1.23 -r1.24
> --- random-test.c 2001/06/01 23:18:19 1.23
> +++ random-test.c 2001/06/08 21:31:22 1.24
> @@ -19,6 +19,7 @@
> #include "apr_general.h"
> #include "apr_getopt.h"
> #include "svn_delta.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
>
> #define DEFAULT_ITERATIONS 30
>
>
>
> 1.16 +1 -0 subversion/subversion/tests/libsvn_delta/xml-output-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_delta/xml-output-test.c.diff?r1=1.15&r2=1.16
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: xml-output-test.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_delta/xml-output-test.c,v
> retrieving revision 1.15
> retrieving revision 1.16
> diff -u -b -r1.15 -r1.16
> --- xml-output-test.c 2001/06/08 09:01:07 1.15
> +++ xml-output-test.c 2001/06/08 21:31:22 1.16
> @@ -18,6 +18,7 @@
> #include <apr_general.h>
>
> #include "svn_types.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_path.h"
> #include "svn_delta.h"
>
>
>
> 1.79 +1 -0 subversion/subversion/tests/libsvn_fs/fs-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_fs/fs-test.c.diff?r1=1.78&r2=1.79
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: fs-test.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_fs/fs-test.c,v
> retrieving revision 1.78
> retrieving revision 1.79
> diff -u -b -r1.78 -r1.79
> --- fs-test.c 2001/06/08 09:01:07 1.78
> +++ fs-test.c 2001/06/08 21:31:23 1.79
> @@ -14,6 +14,7 @@
> #include <stdlib.h>
> #include <string.h>
> #include <apr_pools.h>
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_fs.h"
> #include "svn_repos.h"
>
>
>
> 1.22 +1 -0 subversion/subversion/tests/libsvn_fs/skel-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_fs/skel-test.c.diff?r1=1.21&r2=1.22
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: skel-test.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_fs/skel-test.c,v
> retrieving revision 1.21
> retrieving revision 1.22
> diff -u -b -r1.21 -r1.22
> --- skel-test.c 2001/06/08 09:01:07 1.21
> +++ skel-test.c 2001/06/08 21:31:23 1.22
> @@ -16,6 +16,7 @@
> #include <string.h>
> #include <stdio.h>
> #include "apr.h"
> +#include "svn_pools.h"
> #include "svn_string.h"
> #include "../../libsvn_fs/fs.h"
> #include "../../libsvn_fs/skel.h"
>
>
>
> 1.3 +1 -0 subversion/subversion/tests/libsvn_repos/repos-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_repos/repos-test.c.diff?r1=1.2&r2=1.3
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: repos-test.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_repos/repos-test.c,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -b -r1.2 -r1.3
> --- repos-test.c 2001/04/23 14:43:32 1.2
> +++ repos-test.c 2001/06/08 21:31:23 1.3
> @@ -14,6 +14,7 @@
> #include <stdlib.h>
> #include <string.h>
> #include <apr_pools.h>
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_fs.h"
> #include "svn_repos.h"
>
>
>
> 1.10 +1 -0 subversion/subversion/tests/libsvn_subr/.cvsignore
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_subr/.cvsignore.diff?r1=1.9&r2=1.10
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: .cvsignore
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_subr/.cvsignore,v
> retrieving revision 1.9
> retrieving revision 1.10
> diff -u -b -r1.9 -r1.10
> --- .cvsignore 2001/06/04 07:41:50 1.9
> +++ .cvsignore 2001/06/08 21:31:23 1.10
> @@ -6,5 +6,6 @@
> hashdump2.out
> stringtest
> target-test
> +stream-test
> path-test
> z
>
>
>
> 1.1 subversion/subversion/tests/libsvn_subr/stream-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_subr/stream-test.c?rev=1.1&content-type=text/x-cvsweb-markup
>
> Index: stream-test.c
> ===================================================================
> /*
> * stream-test.c -- test the stream functions
> *
> * ====================================================================
> * Copyright (c) 2000-2001 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> * are also available at http://subversion.tigris.org/license-1.html.
> * If newer versions of this license are posted there, you may use a
> * newer version instead, at your option.
> * ====================================================================
> */
>
> #include <svn_pools.h>
> #include <svn_io.h>
> #include <stdio.h>
> #include <apr_general.h>
> #include "svn_test.h"
>
>
> typedef struct stream_baton_t
> {
> apr_pool_t *pool;
> svn_stringbuf_t *buffer;
> }
> stream_baton_t;
>
>
> static stream_baton_t *
> make_baton (apr_pool_t *pool)
> {
> stream_baton_t *new_baton = apr_palloc (pool, sizeof (*new_baton));
> new_baton->pool = pool;
> new_baton->buffer = svn_string_create ("", pool);
> return new_baton;
> }
>
>
> static svn_error_t *
> read_func (void *baton,
> char *buffer,
> apr_size_t *len)
> {
> stream_baton_t *sb = (stream_baton_t *)baton;
>
> if ((! buffer) || (! *len))
> return SVN_NO_ERROR;
>
> /* If asked for more than we have, give only what we have. */
> if (*len > sb->buffer->len)
> *len = sb->buffer->len;
>
> /* Copy the requested amount into the buffer. */
> memcpy (buffer, sb->buffer->data, *len);
>
> /* Now, lose the bytes that were read from the buffer. */
> memcpy (sb->buffer->data,
> sb->buffer->data + *len,
> sb->buffer->len - *len);
> sb->buffer->len -= *len;
>
> return SVN_NO_ERROR;
> }
>
>
> static svn_error_t *
> write_func (void *baton,
> const char *data,
> apr_size_t *len)
> {
> stream_baton_t *sb = (stream_baton_t *)baton;
> svn_string_appendbytes (sb->buffer, data, *len);
> return SVN_NO_ERROR;
> }
>
>
> static svn_error_t *
> close_func (void *baton)
> {
> return SVN_NO_ERROR;
> }
>
>
> /* Helper function for test_feedback_stream */
> static svn_error_t *
> binary_recurse (int depth,
> int limit,
> int *next_branch_number,
> apr_pool_t *pool)
> {
> /* Make a subpool */
> svn_stream_t *fb_stream;
> svn_stringbuf_t *output;
> apr_size_t len;
>
> /* Get the feedback stream from our subpool, and print our branch
> number. */
> fb_stream = svn_pool_get_feedback_stream (pool);
> output = svn_string_createf (pool, "%d\n", *next_branch_number);
> len = output->len;
> svn_stream_write (fb_stream, output->data, &len);
>
> /* Don't forget to increment the next branch number! The fate of
> the Universe depends on this one ultra-important step! */
> (*next_branch_number)++;
>
> /* If there's room to recurse...do it. */
> if (depth < limit)
> {
> apr_pool_t *subpool = svn_pool_create (pool);
> SVN_ERR (binary_recurse (depth + 1, limit, next_branch_number, subpool));
> svn_pool_clear (subpool);
> SVN_ERR (binary_recurse (depth + 1, limit, next_branch_number, subpool));
> svn_pool_destroy (subpool);
> }
>
> return SVN_NO_ERROR;
> }
>
>
> static svn_error_t *
> test_feedback_stream (const char **msg,
> apr_pool_t *pool)
> {
> svn_stream_t *fb_stream;
> stream_baton_t *baton;
> int next_branch_number = 1;
> int max_depth = 4;
> int i, last_branch;
> svn_stringbuf_t *expected_output, *read_output;
> *msg = "test global feedback stream";
>
> fb_stream = svn_pool_get_feedback_stream (pool);
>
> baton = make_baton (pool);
> svn_stream_set_baton (fb_stream, baton);
> svn_stream_set_read (fb_stream, &read_func);
> svn_stream_set_write (fb_stream, &write_func);
> svn_stream_set_close (fb_stream, &close_func);
>
> /* Call the binary recursion routine. This routine prints, to the
> global feedback stream, the value of NEXT_BRANCH_NUMBER + a
> newline. It then increments NEXT_BRANCH_NUMBER and forks into two
> recursive calls, until a given maximum depth is reached. The
> net result should be that the integers from 1 to ( 2^max_depth -
> 1) should be printed, one per line, to the feedback stream. */
> SVN_ERR (binary_recurse (0, max_depth - 1, &next_branch_number, pool));
>
> /* Cheap pow() call. */
> for (i = 0, last_branch = 1; i < max_depth; i++, last_branch *= 2)
> {;}
>
> /* Make a big ol' string with the same number list we expected to be
> created by the binary_recurse() function. */
> expected_output = svn_string_create ("", pool);
> for (i = 1; i < last_branch; i++)
> {
> svn_stringbuf_t *tmp = svn_string_createf (pool, "%d\n", i);
> svn_string_appendstr (expected_output, tmp);
> }
>
> /* Compare the expected output with what we really got. We're going
> to do so the easy way first, then the hard way. The easy way is
> just to compare the buffer in the stream baton with our expected
> output string. */
> if (! svn_string_compare (expected_output, baton->buffer))
> return svn_error_create (SVN_ERR_TEST_FAILED, 0, 0, pool,
> "Easy compare failed");
>
> /* The hard way is to actually use the stream's read() function to
> build up yet another comparison string. */
> fb_stream = svn_pool_get_feedback_stream (pool);
> read_output = svn_string_create ("", pool);
> while (1)
> {
> apr_size_t len;
> char tmpbuf[257];
>
> len = 256;
> SVN_ERR (svn_stream_read (fb_stream, tmpbuf, &len));
> svn_string_appendbytes (read_output, tmpbuf, len);
> if (len < 256)
> break;
> }
> if (! svn_string_compare (expected_output, read_output))
> return svn_error_create (SVN_ERR_TEST_FAILED, 0, 0, pool,
> "Hard compare failed");
>
> return SVN_NO_ERROR;
> }
>
>
>
>
> /* The test table. */
>
> svn_error_t * (*test_funcs[]) (const char **msg,
> apr_pool_t *pool) = {
> 0,
> test_feedback_stream,
> 0
> };
>
>
>
> /*
> * local variables:
> * eval: (load-file "../../svn-dev.el")
> * end:
> */
>
>
>
>
> 1.32 +1 -0 subversion/subversion/tests/libsvn_wc/commit-test.c
>
> http://subversion.tigris.org/source/browse/subversion/subversion/tests/libsvn_wc/commit-test.c.diff?r1=1.31&r2=1.32
>
> (In the diff below, changes in quantity of whitespace are not shown.)
>
> Index: commit-test.c
> ===================================================================
> RCS file: /usr/local/tigris/data/helm/cvs/repository/subversion/subversion/tests/libsvn_wc/commit-test.c,v
> retrieving revision 1.31
> retrieving revision 1.32
> diff -u -b -r1.31 -r1.32
> --- commit-test.c 2001/06/08 09:01:08 1.31
> +++ commit-test.c 2001/06/08 21:31:23 1.32
> @@ -21,6 +21,7 @@
> #include <apr_general.h>
>
> #include "svn_types.h"
> +#include "svn_pools.h"
> #include "svn_error.h"
> #include "svn_path.h"
> #include "svn_io.h"
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cvs-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: cvs-help@subversion.tigris.org

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:31 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.