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

Re: Know before downloading trunk how many files I'm going to download.

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Thu, 16 Oct 2008 02:38:25 -0500

Please remember to Reply All so your reply goes to the list too, not
just to me.

On Oct 16, 2008, at 01:44, Luca Bonora wrote:

> Ryan Schmidt ha scritto:
>
>> On Oct 15, 2008, at 04:02, Luca Bonora wrote:
>>
>>> Hi all. I have a question for you. I'm creating a collection of
>>> scripts that use zenity and I need to know how many files I'm
>>> going to download with checkout before I effectively do the
>>> checkout. For now, I found a little hack that use svn list , like
>>> this:
>>> svn list -v -R [URL] | wc -l
>>> But it's quite slow.
>>> Is there any command I can use instead of that hack?
>>
>> I don't think so.
>> Why do you need to know beforehand?
>
> Because zenity needs a number in stdin to show it as progress
> percentage, and to calculate the number I need the number of files
> I'm going to download. This is an example of the command I use in
> scripts:
>
> svn co URL | awk -v num=$num_files '{printf ("%.2f\n" , NR / num *
> 100 ); fflush();}' | zenity --progress --text="Download In
> Progress.." --title="$title" --auto-close
>
> Where $num_files is the number of files, passed to awk as num. I
> use awk to calculate the percentage of download and then redirect
> it to zenity to see it graphically.

I see. Well unfortunately Subversion does not provide an easy way to
list the number of files that will be downloaded, at least not in the
command line client. Perhaps writing something using the Subversion
language bindings would make it easier. Note also that there might be
externals definitions, which are loaded after the primary working
copy is loaded.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-16 09:38:54 CEST

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

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