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

Re: [PATCH] progress output in svn up

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-04-25 15:52:54 CEST

"Gerald Richter" <richter@ecos.de> writes:

> I have made a little patch that outputs some progress informations during
> svn up.

Hi Gerald, good to hear from you again.

This indeed may be a very nice feature, but there are some problems
with the implementation.

> --- subversion/libsvn_ra_dav/fetch.c.orig Wed Apr 16 21:28:45 2003
> +++ subversion/libsvn_ra_dav/fetch.c Wed Apr 16 21:31:17 2003
> @@ -666,6 +666,14 @@
> }
> }
> +static void fetch_file_progress(void *userdata, off_t progress, off_t
> total)
> +{
> + printf ("%d/%d\r", progress, total) ;
> + fflush(stdout) ;
> +}

For example: printf() is strictly verboten in all libraries. Only
applications can do that. So for a feature like this, you'll need to
make use of our feedback system, and then add a proper callback within

The other problem here is UI -- I'm not so sure it's a good idea to
print download percentages on a series of new lines. The output of
'svn co/up' is very specific and very parseable -- one file per line.
I think the least invasive thing to do is have main.c's callback use
something like the curses library. It can repeatedly print progress
information on the same line. I'm not sure how portable curses is,
though. :-(

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Apr 25 15:54:34 2003

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.