You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Edmund Horner <ej...@paradise.net.nz> on 2003/05/03 14:16:47 UTC
Using svn client to get information about repository
Hi all,
I have been working on a rudimentary ViewCVS-like script, which makes
use of the svn command-line client to query the repository.
Unfortunately, Windows process creation can be very expensive, so one of
my goals is for the number of calls to svn.exe to be constant-bounded
for any particular request to the script.
For example, when listing a directory, I can't afford to call svn for
every file in the directory to get the last revision and log message.
Instead, I run "svn log -v" on that directory and parse the
(increasingly large) results.
1. Are there any better ways of getting the last revision and log
message for a directory full of files?
One improvement I am making is caching the output of the script for a
given request. I only want the script to requery the repository if the
revision number has increased since last time.
2. How can I get the most recent revision number out of the repository
without having to parse large amounts of data?
I'm aware that two possible answers might be "Use the Subversion
libraries to work with the repository without svn.exe" and "Just just
ViewCVS"; but I have decided against those solutions for the time being.
Thanks for all forthcoming ideas,
Edmund Horner
ejrh@paradise.net.nz
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Using svn client to get information about repository
Posted by Edmund Horner <ed...@chrysophylax.cjb.net>.
Apologies for the change of e-mail address, I forgot to choose the right
one in Mozilla!
Edmund.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Using svn client to get information about repository
Posted by Ben Collins-Sussman <su...@collab.net>.
Chrysophylax <ch...@chrysophylax.cjb.net> writes:
> > You just want the last revision and log message? I'd use 'svn ls -v',
> > and then 'svn pget -r REV --revprop svn:log' for each of the revisions
> > that 'svn ls -v' revealed that I need.
>
> I guess I would also like to have time and author...
$ svn ls -v http://svn.collab.net/repos/svn/trunk/README
_ 5327 sussman 6910 Mar 14 08:35 README
Last changed rev, last author, filesize, and last changed time, all in
one ls.
> Is there any planned feature to get multiple properties in one go?
Ha! Try a http PROPFIND of depth 1. :-)
>
> Out of curiosity, how does ViewCVS get data?
Via svn_fs.h.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Using svn client to get information about repository
Posted by Chrysophylax <ch...@chrysophylax.cjb.net>.
> You just want the last revision and log message? I'd use 'svn ls -v',
> and then 'svn pget -r REV --revprop svn:log' for each of the revisions
> that 'svn ls -v' revealed that I need.
I guess I would also like to have time and author... Is there any
planned feature to get multiple properties in one go?
> Most recent revision ... of the whole repository?
>
> $ svn st -u
> [ignore some possible lines of local mods here]
> Head revision: 5790
Actually it seems that doing "svn ls -v" (from your first answer) on the
root of the repository, and looking for the highest rev number in the
list would do the trick too.
Out of curiosity, how does ViewCVS get data?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Using svn client to get information about repository
Posted by cm...@collab.net.
Edmund Horner <ej...@paradise.net.nz> writes:
> Hi all,
>
> I have been working on a rudimentary ViewCVS-like script, which makes
> use of the svn command-line client to query the repository.
>
> Unfortunately, Windows process creation can be very expensive, so one
> of my goals is for the number of calls to svn.exe to be
> constant-bounded for any particular request to the script.
>
> For example, when listing a directory, I can't afford to call svn for
> every file in the directory to get the last revision and log
> message. Instead, I run "svn log -v" on that directory and parse the
> (increasingly large) results.
>
> 1. Are there any better ways of getting the last revision and log
> message for a directory full of files?
You just want the last revision and log message? I'd use 'svn ls -v',
and then 'svn pget -r REV --revprop svn:log' for each of the revisions
that 'svn ls -v' revealed that I need.
> 2. How can I get the most recent revision number out of the repository
> without having to parse large amounts of data?
Most recent revision ... of the whole repository?
$ svn st -u
[ignore some possible lines of local mods here]
Head revision: 5790
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Using svn client to get information about repository - thanks
Posted by Edmund Horner <ed...@chrysophylax.cjb.net>.
> I forgot to give the URL:
>
> http://www.alternatecomputing.com/jsvn/index.php3
Thanks, I will check it out. There is no URL for my work (in PHP) yet,
but if it gets to a state in which it is useful for others I will
mention it on the list.
Thanks also to the other respondents. I think you've given me enough to
improve my scipt by an order of efficiency, while still using only svn.exe.
Oh, and I forgot to mention I really like Subversion!
Edmund Horner
ejrh@paradise.net.nz
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Using svn client to get information about repository
Posted by David Golpira <go...@alternatecomputing.com>.
I forgot to give the URL:
http://www.alternatecomputing.com/jsvn/index.php3
On Sun, 2003-05-04 at 07:39, David Golpira wrote:
> Edmund,
>
> I do a very similar thing in JSVN. The code is entirely in Java, but
> you can look at it for ideas (or just use the classes directly in your
> own project if you're using Java too.)
>
> If after looking at the JSVN code, you have any questions about it,
> please let me know.
>
> -Dave
>
> On Sat, 2003-05-03 at 10:16, Edmund Horner wrote:
> > Hi all,
> >
> > I have been working on a rudimentary ViewCVS-like script, which makes
> > use of the svn command-line client to query the repository.
> >
> > Unfortunately, Windows process creation can be very expensive, so one of
> > my goals is for the number of calls to svn.exe to be constant-bounded
> > for any particular request to the script.
> >
> > For example, when listing a directory, I can't afford to call svn for
> > every file in the directory to get the last revision and log message.
> > Instead, I run "svn log -v" on that directory and parse the
> > (increasingly large) results.
> >
> > 1. Are there any better ways of getting the last revision and log
> > message for a directory full of files?
> >
> > One improvement I am making is caching the output of the script for a
> > given request. I only want the script to requery the repository if the
> > revision number has increased since last time.
> >
> > 2. How can I get the most recent revision number out of the repository
> > without having to parse large amounts of data?
> >
> > I'm aware that two possible answers might be "Use the Subversion
> > libraries to work with the repository without svn.exe" and "Just just
> > ViewCVS"; but I have decided against those solutions for the time being.
> >
> > Thanks for all forthcoming ideas,
> > Edmund Horner
> > ejrh@paradise.net.nz
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> > For additional commands, e-mail: dev-help@subversion.tigris.org
> >
> >
--
David Golpira <go...@alternatecomputing.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Using svn client to get information about repository
Posted by David Golpira <go...@alternatecomputing.com>.
Edmund,
I do a very similar thing in JSVN. The code is entirely in Java, but
you can look at it for ideas (or just use the classes directly in your
own project if you're using Java too.)
If after looking at the JSVN code, you have any questions about it,
please let me know.
-Dave
On Sat, 2003-05-03 at 10:16, Edmund Horner wrote:
> Hi all,
>
> I have been working on a rudimentary ViewCVS-like script, which makes
> use of the svn command-line client to query the repository.
>
> Unfortunately, Windows process creation can be very expensive, so one of
> my goals is for the number of calls to svn.exe to be constant-bounded
> for any particular request to the script.
>
> For example, when listing a directory, I can't afford to call svn for
> every file in the directory to get the last revision and log message.
> Instead, I run "svn log -v" on that directory and parse the
> (increasingly large) results.
>
> 1. Are there any better ways of getting the last revision and log
> message for a directory full of files?
>
> One improvement I am making is caching the output of the script for a
> given request. I only want the script to requery the repository if the
> revision number has increased since last time.
>
> 2. How can I get the most recent revision number out of the repository
> without having to parse large amounts of data?
>
> I'm aware that two possible answers might be "Use the Subversion
> libraries to work with the repository without svn.exe" and "Just just
> ViewCVS"; but I have decided against those solutions for the time being.
>
> Thanks for all forthcoming ideas,
> Edmund Horner
> ejrh@paradise.net.nz
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>
--
David Golpira <go...@alternatecomputing.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org