You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Saku Ytti <sa...@ytti.fi> on 2006/05/17 09:15:50 UTC

checkout to stdout (cvs -p)?

I'm considering moving cvs based system to svn, however one of my scripts
heavily relies on being able to checkout to stdout.

My SVN alternative seems to be 'ls' the directory then 'cat' each
file, but calling svn binary this many times will most probably
make my application perform worse than cvs.
I looked into SVN::Client, however it doesn't allow checking out
to an array, only to a filesystem. It also does not allow catting
to an array, only to a filehandle. It might have been acceptable
to do ls in perl and then cat in foreach loop.

Is there canonical solution to this?
-- 
  ++ytti

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


Re: checkout to stdout (cvs -p)?

Posted by Saku Ytti <sa...@ytti.fi>.
On (2006-05-18 14:02 +0200), Giovanni Bajo wrote:

> > Yes, thats what I want. However I can happily 'cat' every file with
> > SVN binary itself in a lets say for loop generated from 'ls'.
> > Only difference in perl bindings would be, that I don't have to start
> > svn binary at all. But I would have to call the perl script inside
> > another script, so that I could get the data in perl array. While
> > what I'd like to do, is to directly either a) in perl put the data
> > in array or b) make svn binary output to stdout each file in
> > directory.
> 
> Can't you have one per script which does *only* the equivalent of cvs -p
> through the Perl bindings, and then you run it in pipe with the other one
> which processes the output? Composition of small components through pipes is
> how this kind of scripts is always designed.

Yes I could, now I'm calling CVS binary from perl, once. With
this method I'm calling perl/python script inside perl, once. The
program speed is currently bound by cvs checkout speed, so I guess
even though I'd replace CVS binary calling to perl/python script
it might still be faster. 
But to be honest, it's seems more attractive to me to write
the whole shebang in single python program, as it appears
python binding supports catting to an array.

-- 
  ++ytti

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


Re: checkout to stdout (cvs -p)?

Posted by Giovanni Bajo <ra...@develer.com>.
Saku Ytti wrote:

>>> I looked into SVN::Client, however it doesn't allow checking out
>>> to an array, only to a filesystem. It also does not allow catting
>>> to an array, only to a filehandle. It might have been acceptable
>>> to do ls in perl and then cat in foreach loop.
>>
>> I'm confused. stdout *is* a filehandle. Didn't you want to cat to
>> the standard output?
>
> Yes, thats what I want. However I can happily 'cat' every file with
> SVN binary itself in a lets say for loop generated from 'ls'.
> Only difference in perl bindings would be, that I don't have to start
> svn binary at all. But I would have to call the perl script inside
> another script, so that I could get the data in perl array. While
> what I'd like to do, is to directly either a) in perl put the data
> in array or b) make svn binary output to stdout each file in
> directory.

Can't you have one per script which does *only* the equivalent of cvs -p
through the Perl bindings, and then you run it in pipe with the other one
which processes the output? Composition of small components through pipes is
how this kind of scripts is always designed.
-- 
Giovanni Bajo

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

Re: checkout to stdout (cvs -p)?

Posted by Saku Ytti <sa...@ytti.fi>.
On (2006-05-18 10:56 +0200), Giovanni Bajo wrote:

> > I looked into SVN::Client, however it doesn't allow checking out
> > to an array, only to a filesystem. It also does not allow catting
> > to an array, only to a filehandle. It might have been acceptable
> > to do ls in perl and then cat in foreach loop.
> 
> I'm confused. stdout *is* a filehandle. Didn't you want to cat to the standard
> output?

Yes, thats what I want. However I can happily 'cat' every file with SVN
binary itself in a lets say for loop generated from 'ls'.
Only difference in perl bindings would be, that I don't have to start
svn binary at all. But I would have to call the perl script inside
another script, so that I could get the data in perl array. While
what I'd like to do, is to directly either a) in perl put the data
in array or b) make svn binary output to stdout each file in directory.

Today what I do is call cvs binary in perl script to push 
it to perl array.


> Giovanni Bajo
> 

-- 
  ++ytti

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


Re: checkout to stdout (cvs -p)?

Posted by Giovanni Bajo <ra...@develer.com>.
Saku Ytti <sa...@ytti.fi> wrote:

> I looked into SVN::Client, however it doesn't allow checking out
> to an array, only to a filesystem. It also does not allow catting
> to an array, only to a filehandle. It might have been acceptable
> to do ls in perl and then cat in foreach loop.

I'm confused. stdout *is* a filehandle. Didn't you want to cat to the standard
output?

Giovanni Bajo

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

Re: checkout to stdout (cvs -p)?

Posted by Saku Ytti <sa...@ytti.fi>.
On (2006-05-17 10:23 -0400), Nico Kadel-Garcia wrote:

> >In my original post I mentioned that I've tried SVN::Client, which
> >is perl binding, and as far as I see, it's not possible to get
> >checkout or cat to an array there.
> >Quick scan of pysvn suggests same problem is there. Perl
> >(unfortunately) is vastly preferred as applications are already
> >written in perl, although it wouldn't be impossible idea to port them
> >to python. 
> 
> How about a plain old wget, using the WebDAV based access?

Thats definitely best solution for the problem at the moment. Would
prefer not to do it, but it would work. 
Further ideas are appreciated.

Thanks Nico,

-- 
  ++ytti

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

Re: checkout to stdout (cvs -p)?

Posted by Nico Kadel-Garcia <nk...@comcast.net>.
Saku Ytti wrote:
> On (2006-05-17 15:30 +0200), Ryan Schmidt wrote:
> 
>> Well, I don't think there's anything like that. There are, however,
>> language bindings available for many languages, including Python,
>> Perl, Java, Ruby, C++, C# and PHP. You could probably write a script
>> in one of these languages which would do what you want, and due to
>> the language bindings it should be considerably faster than
>> repeatedly calling the svn command line client.
> 
> In my original post I mentioned that I've tried SVN::Client, which
> is perl binding, and as far as I see, it's not possible to get
> checkout or cat to an array there.
> Quick scan of pysvn suggests same problem is there. Perl
> (unfortunately) is vastly preferred as applications are already
> written in perl, although it wouldn't be impossible idea to port them
> to python. 

How about a plain old wget, using the WebDAV based access?

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

Re: checkout to stdout (cvs -p)?

Posted by Saku Ytti <sa...@ytti.fi>.
On (2006-05-17 15:30 +0200), Ryan Schmidt wrote:
 
> Well, I don't think there's anything like that. There are, however,  
> language bindings available for many languages, including Python,  
> Perl, Java, Ruby, C++, C# and PHP. You could probably write a script  
> in one of these languages which would do what you want, and due to  
> the language bindings it should be considerably faster than  
> repeatedly calling the svn command line client.

In my original post I mentioned that I've tried SVN::Client, which
is perl binding, and as far as I see, it's not possible to get
checkout or cat to an array there.
Quick scan of pysvn suggests same problem is there. Perl (unfortunately)
is vastly preferred as applications are already written in perl,
although it wouldn't be impossible idea to port them to python.

> http://subversion.tigris.org/links.html#bindings
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 

-- 
  ++ytti

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


Re: checkout to stdout (cvs -p)?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 17, 2006, at 13:03, Saku Ytti wrote:

>>> My SVN alternative seems to be 'ls' the directory then 'cat' each
>>
>> I'm not familiar with CVS. You want to send multiple files from the
>> repository directly to stdout, all concatenated together? I don't
>> think Subversion does that. I only know "svn cat" which will output
>> one file to stdout.
>
>  Yes, cat method is the one I explained, but it's quite suboptimal
> due to need of run svn instance for each file, quite expensive.
>  But indeed that is what I want, concatane multiple files to stdout
> or just checkout to stdout (which will give extra stuff that I don't
> need, but can workaround easily).
>
>  'svn cat file:///foo/bar/*' would be optimal.

Well, I don't think there's anything like that. There are, however,  
language bindings available for many languages, including Python,  
Perl, Java, Ruby, C++, C# and PHP. You could probably write a script  
in one of these languages which would do what you want, and due to  
the language bindings it should be considerably faster than  
repeatedly calling the svn command line client.

http://subversion.tigris.org/links.html#bindings



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

Re: checkout to stdout (cvs -p)?

Posted by Saku Ytti <sa...@ytti.fi>.
On (2006-05-17 12:17 +0200), Ryan Schmidt wrote:

> >My SVN alternative seems to be 'ls' the directory then 'cat' each
> 
> I'm not familiar with CVS. You want to send multiple files from the  
> repository directly to stdout, all concatenated together? I don't  
> think Subversion does that. I only know "svn cat" which will output  
> one file to stdout.

 Yes, cat method is the one I explained, but it's quite suboptimal
due to need of run svn instance for each file, quite expensive.
 But indeed that is what I want, concatane multiple files to stdout
or just checkout to stdout (which will give extra stuff that I don't
need, but can workaround easily).

 'svn cat file:///foo/bar/*' would be optimal. 

-- 
  ++ytti

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

Re: checkout to stdout (cvs -p)?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 17, 2006, at 11:15, Saku Ytti wrote:

> I'm considering moving cvs based system to svn, however one of my  
> scripts
> heavily relies on being able to checkout to stdout.
>
> My SVN alternative seems to be 'ls' the directory then 'cat' each
> file, but calling svn binary this many times will most probably
> make my application perform worse than cvs.
> I looked into SVN::Client, however it doesn't allow checking out
> to an array, only to a filesystem. It also does not allow catting
> to an array, only to a filehandle. It might have been acceptable
> to do ls in perl and then cat in foreach loop.
>
> Is there canonical solution to this?

I'm not familiar with CVS. You want to send multiple files from the  
repository directly to stdout, all concatenated together? I don't  
think Subversion does that. I only know "svn cat" which will output  
one file to stdout.



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