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

Re: Java Libraries: Dumbo Question about svn_client.h

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2001-07-16 19:03:40 CEST

(Hope you don't mind my keeping this on the public list... others may
learn from this discussion.)

Alexander Mueller <alex@littleblue.de> writes:

[...]
>
> This is all fine with me, but I found code like:
>
> file trace-update.c
> ----> snip
> static svn_error_t *
> replace_directory (svn_stringbuf_t *name,
> void *parent_baton,
> svn_revnum_t base_revision,
> void **child_baton)
> {
> struct dir_baton *parent_d = parent_baton;
> struct dir_baton *child_d
> = apr_pcalloc (parent_d->edit_baton->pool, sizeof (*child_d));
>
> child_d->edit_baton = parent_d->edit_baton;
> child_d->parent_dir_baton = parent_d;
> child_d->path = svn_stringbuf_dup (parent_d->path, child_d->edit_baton->pool);
> svn_path_add_component (child_d->path, name, svn_path_local_style);
>
> *child_baton = child_d;
>
> /* Don't print anything for a directory replace -- this event is
> implied by printing events beneath it. */
>
> return SVN_NO_ERROR;
> }
> <---- snap
>
> Ok. If all of this action is optional (not necessary for function).
> Why is it used, then?

This is part of a very specific "after" editor that exists in the
command-line client code. It is passed to svn_client_update(). This
way, whenever the command-line client receives a patch to a file, it
can print a "U" to stdout, and so on.

But does a GUI client want to do this? Probably not. Maybe you want
little animated bullets to appear next to a tree diagram. Maybe you
want to append text to an update-window. Either way, you'll want to
write your own "after" editor to graphically indicate the status of an
update-in-progress.

> > The svn_cl__* code is the command-line client. You should definitely
> > look at it as an example of "how to use svn_client.h"... but you
> > shouldn't write JNI wrappers around them! Wrap svn_client.h and the
> > headers it immediately depends on.
>
> I am unsure if there is essential code implemented in snv_cl_.
> You know, can I use the svn_client.h API without duplication logic thats
> include in the command line code? If there is redundant code maybe I should
> use the functions that implement this functionality.

There shouldn't be any "essential" code in svn_cl__*. We've tried
very hard to draw a distinct line between routines that *all* clients
need and ones that are absolutely specific to a the needs of a
command-line client.

So if you find any code in subversion/client/cmdline/ that you suspect
everybody will need, please let us know. It would be a bug in our
design! :-)

---------------------------------------------------------------------
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:33 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.