[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: Ryan Schmidt <subversion-2006d_at_ryandesign.com>
Date: 2006-10-06 22:46:38 CEST

On Oct 6, 2006, at 10:35, Rob Hubbard wrote:

> (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.

Just the revision(s) is(are) obtainable with the svnversion command.

The rest is quite easy with standard shell parsing tools.

$ svn info | grep '^Repository Root:'
Repository Root: http://example/svn

Or you can parse it with any XML tool of your choice.

$ svn info --xml

> (2) URL and Path fragments
> When writing svn or svnlook-based scripts, I have often had to hard
> code information about where the location of the repository ends
> and the path within the repository begins.
> [And perhaps there is a simple method that I have overlooked.]
> Thus some mechanism for splitting such paths would be useful. For
> example, options such as:
> --url-to-repository
> --path-within-repository
> and perhaps also
> --scheme
> --directory
> --filename
> The minimum, I suppose, would be a method of obtaining the URL to
> the repository (from svn info) or the path to the repository (from
> svnlook info).

svn info provides you with the full URL and the repository URL. From
this you can deduce the path within the repository. Certainly finding
the scheme is easy. I'm not sure how your hypothetical --path-within-
repository differs from --directory (is --directory just `basename
$PATH_WITHIN_REPOSITORY`?) As for --filename, if you call svn info on
a file, you get a line that lists the name. So I think svn info
already provides all the info you want.

$ svn info http://example/svn/vendor/pma/current/index.php
Path: index.php
Name: index.php
URL: http://example/svn/vendor/pma/current/index.php
Repository Root: http://example/svn
Repository UUID: [snip]
Revision: 214
Node Kind: file
Last Changed Author: rschmidt
Last Changed Rev: 206
Last Changed Date: 2006-09-28 21:27:44 -0500 (Thu, 28 Sep 2006)

$ svn --version | head -n 1
svn, version 1.4.0 (r21228)

The above all applies to the svn command when working with a working
copy or a repository URL. Not sure how this would apply to svnlook.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Oct 6 22:58:14 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.