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

Re: [PATCH] Fix svndiff-test and vdelta-test

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-02-15 22:53:02 CET

Daniel Berlin <dan@dberlin.org> writes:
> They need to create and pass pools, or else they crash.

Daniel,

This can be reviewed as-is, but can you PLEASE write a log message for
future patches you submit? Either you can spend the time, or someone
else can spend it (but it will take the other person longer, because
they didn't write the change like you did).

-K

P.S. Haven't reviewed the change, in other code right now.

> Index: ./vdelta-test.c
> ===================================================================
> --- ./vdelta-test.c
> +++ ./vdelta-test.c Fri Feb 15 16:20:11 2002
> @@ -127,13 +127,13 @@
> }
>
> apr_initialize();
> + wpool = svn_pool_create (NULL);
> svn_txdelta (&stream,
> - svn_stream_from_stdio (source_file, NULL),
> - svn_stream_from_stdio (target_file, NULL),
> - NULL);
> + svn_stream_from_stdio (source_file, wpool),
> + svn_stream_from_stdio (target_file, wpool),
> + wpool);
>
> /* ### urm. we should have a pool here! */
> - wpool = svn_pool_create (NULL);
> do {
> svn_txdelta_next_window (&window, stream, wpool);
> if (window != NULL)
> Index: ./svndiff-test.c
> ===================================================================
> --- ./svndiff-test.c
> +++ ./svndiff-test.c Fri Feb 15 16:16:58 2002
> @@ -21,6 +21,7 @@
> #include <apr_general.h>
> #include "svn_base64.h"
> #include "svn_quoprint.h"
> +#include "svn_pools.h"
> #include "svn_delta.h"
> #include "svn_error.h"
>
> @@ -34,28 +35,29 @@
> svn_txdelta_window_handler_t svndiff_handler;
> svn_stream_t *encoder;
> void *svndiff_baton;
> + apr_pool_t *pool = svn_pool_create (NULL);
>
> source_file = fopen (argv[1], "rb");
> target_file = fopen (argv[2], "rb");
>
> apr_initialize();
> - svn_txdelta (&txdelta_stream, svn_stream_from_stdio (source_file, NULL),
> - svn_stream_from_stdio (target_file, NULL), NULL);
> + svn_txdelta (&txdelta_stream, svn_stream_from_stdio (source_file, pool),
> + svn_stream_from_stdio (target_file, pool), pool);
>
> #ifdef QUOPRINT_SVNDIFFS
> - encoder = svn_quoprint_encode (svn_stream_from_stdio (stdout, NULL), NULL);
> + encoder = svn_quoprint_encode (svn_stream_from_stdio (stdout, pool), pool);
> #else
> - encoder = svn_base64_encode (svn_stream_from_stdio (stdout, NULL), NULL);
> + encoder = svn_base64_encode (svn_stream_from_stdio (stdout, pool), pool);
> #endif
> - svn_txdelta_to_svndiff (encoder, NULL, &svndiff_handler, &svndiff_baton);
> + svn_txdelta_to_svndiff (encoder, pool, &svndiff_handler, &svndiff_baton, 1);
> svn_txdelta_send_txstream (txdelta_stream,
> svndiff_handler,
> svndiff_baton,
> - NULL);
> + pool);
>
> fclose (source_file);
> fclose (target_file);
> -
> + svn_pool_destroy (pool);
> apr_terminate();
> exit (0);
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.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:37:08 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.