You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Luca Bonora <bo...@gmail.com> on 2008/10/15 09:02:54 UTC

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

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?

Thank you very much!
Greetings,

Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Luca Bonora <bo...@gmail.com>.
Sorry, I'll remember it .
So what can I do? Is there a simple guide that I can study to solve the 
problem?


Ryan Schmidt ha scritto:
> 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@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
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@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ryan Schmidt <su...@ryandesign.com>.
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?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Luca Bonora <bo...@gmail.com>.
I tried what you said but it doesn't work. It really seems there's not a 
simple and fast way to know at first time how many files I'm going to 
download with checkout.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: update --dry-run (again) [Was: Know before downloading trunk how many files I'm going to download.]

Posted by Rob Hubbard <ro...@softel.co.uk>.
> I realize it's a workaround, not a solution, but doesn't
> 
>     "svn merge -r BASE:HEAD --dry-run . ."
> 
> do approximately what you would want 'svn up --dry-run' to do?
> 
> Daniel

Yes, excellent.

This is probably exactly what "svn update --dry-run [.]" should mean.

Similarly for "svn switch --dry-run ..." as mentioned elsewhere on this 
mailing list. Again that can be emulated by a dry-run merge.

Er, and another thing... :-)
	$ svn st -u
does not help when wishing to explore the possibility of 
updating/"downdating" to a revision other than the HEAD.

In that case,
	$ svn update -r[N] --dry-run [.]
should probably mean
	$ svn merge -r BASE:[N] --dry-run . .

Thanks,
Rob.

> 
> 
> Rob Hubbard wrote on Fri, 17 Oct 2008 at 14:57 +0100:
> >  
> > 
> > > I may be missing something obvious, but what would svn update 
> > > --dry-run provide which svn status -u would not? svn st -u shows 
> > > what's changed locally and what's changed in the 
> repository, so one 
> > > could see where conflicts might arise upon
> > > updating, no?
> > > 
> > 
> > 
> > Well, as you said, and as I commented in 
> > <http://svn.haxx.se/users/archive-2006-10/0465.shtml>,
> > 	$ svn st -u
> > shows where conflicts *might* occur.
> > 
> > On the other hand,
> > 	$ svn up --dry-run
> > would show where they *will* occur.
> > 
> > Given that SVN already provides --dry-run for merge, I'm surprised 
> > that there is so much resistance to introducing this option for the 
> > update command.
> > 
> > My impression is also that other users would find this 
> option useful 
> > for other reasons.
> > 
> > I'd *also* quite like to see the remote changes without my local 
> > changes, that is, show what files will be updated to my 
> working copy 
> > irrespective of my local changes. That's a slightly separate issue.
> > 
> > 
> > Thanks,
> > Rob.

_______________________________________________
This email has been scanned for Softel by Star.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


RE: update --dry-run (again) [Was: Know before downloading trunk how many files I'm going to download.]

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
I realize it's a workaround, not a solution, but doesn't

    "svn merge -r BASE:HEAD --dry-run . ."

do approximately what you would want 'svn up --dry-run' to do?

Daniel


Rob Hubbard wrote on Fri, 17 Oct 2008 at 14:57 +0100:
>  
> 
> > I may be missing something obvious, but what would svn update 
> > --dry-run provide which svn status -u would not? svn st -u 
> > shows what's changed locally and what's changed in the 
> > repository, so one could see where conflicts might arise upon 
>                                                ^^^^^ 
> > updating, no?
> > 
> 
> 
> Well, as you said, and as I commented in
> <http://svn.haxx.se/users/archive-2006-10/0465.shtml>,
> 	$ svn st -u
> shows where conflicts *might* occur.
> 
> On the other hand,
> 	$ svn up --dry-run
> would show where they *will* occur.
> 
> Given that SVN already provides --dry-run for merge,
> I'm surprised that there is so much resistance to introducing this
> option for the update command.
> 
> My impression is also that other users would find this option useful
> for other reasons.
> 
> I'd *also* quite like to see the remote changes without my local
> changes,
> that is, show what files will be updated to my working copy
> irrespective of my local changes. That's a slightly separate issue.
> 
> 
> Thanks,
> Rob.
> 
> _______________________________________________
> This email has been scanned for Softel by Star.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: update --dry-run (again) [Was: Know before downloading trunk how many files I'm going to download.]

Posted by Rob Hubbard <ro...@softel.co.uk>.
 

> I may be missing something obvious, but what would svn update 
> --dry-run provide which svn status -u would not? svn st -u 
> shows what's changed locally and what's changed in the 
> repository, so one could see where conflicts might arise upon 
                                               ^^^^^ 
> updating, no?
> 


Well, as you said, and as I commented in
<http://svn.haxx.se/users/archive-2006-10/0465.shtml>,
	$ svn st -u
shows where conflicts *might* occur.

On the other hand,
	$ svn up --dry-run
would show where they *will* occur.

Given that SVN already provides --dry-run for merge,
I'm surprised that there is so much resistance to introducing this
option for the update command.

My impression is also that other users would find this option useful
for other reasons.

I'd *also* quite like to see the remote changes without my local
changes,
that is, show what files will be updated to my working copy
irrespective of my local changes. That's a slightly separate issue.


Thanks,
Rob.

_______________________________________________
This email has been scanned for Softel by Star.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: update --dry-run (again) [Was: Know before downloading trunk how many files I'm going to download.]

Posted by Andy Levy <an...@gmail.com>.
On Fri, Oct 17, 2008 at 04:53, Rob Hubbard <ro...@softel.co.uk> wrote:
>> > You can also try the --dry-run flag:
>> >
>> >    $  svn --dry-run update
>> >
>>
>>     % svn up --dry-run
>>     Subcommand 'update' doesn't accept option '--dry-run'
>>     Type 'svn help update' for usage.
>>
>
> That's been suggested, requested, hinted at, or discussed before.
> See e.g. the following SVN User threads...
>
>        Re: svn status proposal
>        <http://svn.haxx.se/dev/archive-2001-09/0409.shtml>
>
>        --dry-run
>        <http://svn.haxx.se/users/archive-2004-04/0624.shtml>
>
>        option equivalent to cvs's -n
>        <http://svn.haxx.se/users/archive-2004-05/0020.shtml>
>
>        How to do a "dry run" of svn update
>        <http://svn.haxx.se/users/archive-2004-05/1177.shtml>
>
>        svn update --dry-run?
>        <http://svn.haxx.se/users/archive-2004-12/0110.shtml>
>
>        --dry-run switch for svn update
>        <http://svn.haxx.se/users/archive-2005-02/1000.shtml>
>
>        Missing --dry-run?
>        <http://svn.haxx.se/users/archive-2006-02/0373.shtml>
>
>        request for "pretend" option
>        <http://svn.haxx.se/users/archive-2006-03/1240.shtml>
>
>        Feature suggestion: --dry-run on update
>        <http://svn.haxx.se/users/archive-2006-10/0465.shtml>
>        (that was me!)
>
>        how to find what would be updated: status --show-updates not
> enough
>        <http://svn.haxx.se/users/archive-2006-10/0615.shtml>
>
>        update working copy to old revision --dry-run
>        <http://svn.haxx.se/users/archive-2006-10/1511.shtml>
>
>        Import of hidden files/dirs - no 'dry-run' ?
>        <http://svn.haxx.se/users/archive-2007-04/0889.shtml>
>
>        switch bug?
>        <http://svn.haxx.se/users/archive-2007-08/0186.shtml>
>
>        update without updating?
>        <http://svn.haxx.se/users/archive-2007-09/0831.shtml>
>
> This seems to indicate the frequency of the surprise that
>        $ svn update --dry-run
> is not available.
>
> One reason for expect that this should be available is that an
> update is somewhat like a merge.
>
> Perhaps the only argument against is that an update is normally
> mandatory, whereas a branch merge is an option. However, a dry-run
> option on update might help plan *when* to update, if now whether to.
>
> On an update, a --dry-run, might give you prior warning
> of clashes with pre-existing files.
>
>
> I still (2 years later) think --dry-run should be more-widely
> available on svn commands.

I may be missing something obvious, but what would svn update
--dry-run provide which svn status -u would not? svn st -u shows
what's changed locally and what's changed in the repository, so one
could see where conflicts might arise upon updating, no?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

update --dry-run (again) [Was: Know before downloading trunk how many files I'm going to download.]

Posted by Rob Hubbard <ro...@softel.co.uk>.
> > You can also try the --dry-run flag:
> > 
> >    $  svn --dry-run update
> > 
> 
>     % svn up --dry-run
>     Subcommand 'update' doesn't accept option '--dry-run'
>     Type 'svn help update' for usage.
> 

That's been suggested, requested, hinted at, or discussed before.
See e.g. the following SVN User threads...

	Re: svn status proposal
	<http://svn.haxx.se/dev/archive-2001-09/0409.shtml>

	--dry-run
	<http://svn.haxx.se/users/archive-2004-04/0624.shtml>

	option equivalent to cvs's -n
	<http://svn.haxx.se/users/archive-2004-05/0020.shtml>

	How to do a "dry run" of svn update
	<http://svn.haxx.se/users/archive-2004-05/1177.shtml>

	svn update --dry-run?
	<http://svn.haxx.se/users/archive-2004-12/0110.shtml>

	--dry-run switch for svn update
	<http://svn.haxx.se/users/archive-2005-02/1000.shtml>

	Missing --dry-run?
	<http://svn.haxx.se/users/archive-2006-02/0373.shtml>

	request for "pretend" option
	<http://svn.haxx.se/users/archive-2006-03/1240.shtml>

	Feature suggestion: --dry-run on update
	<http://svn.haxx.se/users/archive-2006-10/0465.shtml>
	(that was me!)

	how to find what would be updated: status --show-updates not
enough
	<http://svn.haxx.se/users/archive-2006-10/0615.shtml>

	update working copy to old revision --dry-run
	<http://svn.haxx.se/users/archive-2006-10/1511.shtml>

	Import of hidden files/dirs - no 'dry-run' ?
	<http://svn.haxx.se/users/archive-2007-04/0889.shtml>

	switch bug?
	<http://svn.haxx.se/users/archive-2007-08/0186.shtml>

	update without updating?
	<http://svn.haxx.se/users/archive-2007-09/0831.shtml>

This seems to indicate the frequency of the surprise that
	$ svn update --dry-run
is not available.

One reason for expect that this should be available is that an
update is somewhat like a merge.

Perhaps the only argument against is that an update is normally
mandatory, whereas a branch merge is an option. However, a dry-run
option on update might help plan *when* to update, if now whether to.

On an update, a --dry-run, might give you prior warning
of clashes with pre-existing files.


I still (2 years later) think --dry-run should be more-widely
available on svn commands.


Thanks,
Rob.

Rob Hubbard.

_______________________________________________
This email has been scanned for Softel by Star.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


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

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
David Weintraub wrote on Thu, 16 Oct 2008 at 12:50 -0400:
> How about something like this:
> 
> svn diff -r<prevBuildRev>:HEAD <repositoryURL> | grep "^Index:" | wc -l
> 

Just

    svn diff --summarize

> 
> You can also try the --dry-run flag:
> 
>    $  svn --dry-run update
> 

    % svn up --dry-run
    Subcommand 'update' doesn't accept option '--dry-run'
    Type 'svn help update' for usage.

> See if that works.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by David Weintraub <qa...@gmail.com>.
How about something like this:

svn diff -r<prevBuildRev>:HEAD <repositoryURL> | grep "^Index:" | wc -l

Where:
    <prevBuildRev> was the Subversion revision of the last build.
    <repositoryURL> is the URL of the repository

That will give you the number of files that were changed between the
last build and the current one.

You can also try the --dry-run flag:

   $  svn --dry-run update

See if that works.

--
David Weintraub
qazwart@gmail.com



On Wed, Oct 15, 2008 at 5:02 AM, Luca Bonora <bo...@gmail.com> 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?
>
> Thank you very much!
> Greetings,
>
> Luca
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org