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

RE: Feature Request: more svn info

From: Reedick, Andrew <Andrew.Reedick_at_BellSouth.com>
Date: 2006-10-06 19:53:49 CEST

> -----Original Message-----
> From: Rob Hubbard [mailto:Rob.Hubbard@celoxica.com]
> Sent: Friday, October 06, 2006 11:36 AM
> To: Subversion Mailing List (E-mail)
> Subject: Feature Request: more svn info
> Hello,
> The information fed back by svn info is very useful for use
> in scripts.
> (1) Single info replies
> I would really like to be able to have svn info be capable of
> replying with just a single piece of information. I'm not
> sure what the syntax should be, but perhaps something like
> svn info . --just "Revision"
> This would be very useful in, for example, simple bash
> scripts, or even just on the command line, within `back-ticks`.
> I suppose this could be done in, for example, a Python
> wrapper script or bash function, but it would be better if
> svn could do this directly.

Actually I do miss that kind of functionality from my ClearCase days.
ClearCase has a -fmt switch that would allow you to print only the data
you wanted and in a particular format. Made up example:
        svn info -fmt "%n,%r\n"
which would tell svn to print the filename (%n), a comma, the revision
(%r), and a newline. This was great for getting formatted data without
having to drop to an API.

On a related note, since you're digging for data, it's inefficient to
make multiple 'svn' command line calls. A spiffy feature of the
clearcase command line was that you could pipe commands into
'cleartool'. This spawned a single process, instead of one per command.
        find -name *.java | xargs -n 1 echo info -fmt '%n,%r\n' | svn
One svn process would read from STDIN and process each line as a
command, which is much more efficent than
        find -name *.java | xargs -n 1 svn info -fmt '%n,%r\n'
which spawns one svn process per file.

I know that the log and info commands support --target, but creating a
temp file on the fly for small operations is awkward.

Yes, you can use the bindings to do the same, but the command line is
available everywhere, whereas the bindings may not be available. Plus
the command line is faster and more user-friendly to use than whipping
up a quick perl or python script. Reading commands from STDIN or
--target makes bulk operations efficient enough to not need the


The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA624

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Oct 6 19:55:31 2006

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.