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

Re: svn commit: rev 1923 - trunk/subversion trunk/subversion/libsvn_ra_pipe

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-05-10 10:58:31 CEST

On Thu, May 09, 2002 at 10:03:58PM -0500, kevin@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_ra_pipe/ra_pipe.c Thu May 9 22:03:45 2002
> @@ -0,0 +1,501 @@
> +#include <svn_ra.h>
> +#include <svn_xml.h>
> +#include <svn_time.h>
> +#include <svn_io.h>

The file needs the standard summary, copyright, license blurb at the top.
For SVN includes, we place them in double quotes rather than angle brackets.

> +/** XML Stuff for this file (needs to go somewhere public, so libsvn_server
> + * can see it.) */
> +#define SVN_RA_PIPE__REQUEST_TAG "svn:pipe:request"

XML tags cannot contain colon characters. When using XML namespaces, you can
include a "prefix", separated from the tag name by a colon, but you would
also need to ensure the namespace/prefix is declared.

>...
> +/** Structures **/
> +typedef struct
> +{
> + apr_file_t *input;
> + apr_file_t *output;

ra_pipe is going to need more than this. You're going to need to make
requests to the "server" (the other end of the pipe) and get a response
back. But you can't just use stdin/stdout because stdout is still needed to
tell the user about the operation (e.g. update items).

>...
> + sess->pool = pool;
> + sess->url = svn_stringbuf_dup (repos_URL, pool);

You might want to consider just using 'const char *' rather than a full
stringbuf. i.e. sess->url = apr_pstrdup(pool, repos_URL->data);

>...
> + svn_xml_make_open_tag (&buf, sess->pool, svn_xml_normal,
> + SVN_RA_PIPE__GET_LOG_TAG,
> + SVN_RA_PIPE__ATT_STARTREV,
> + svn_stringbuf_create (apr_psprintf (sess->pool,
> + "%ld",
> + start),
> + sess->pool),

It is more efficient to use svn_stringbuf_createf(), rather than the pair of
create and apr_psprintf.

Cheers,
-g

-- 
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 Fri May 10 10:57:12 2002

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