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

RE: [PATCH] svn url command

From: Barry Scott <barry.alan.scott_at_ntlworld.com>
Date: 2002-09-07 17:22:38 CEST

> well, we can't do that because we've decided not to allow subcommand
> specific flags (for good reason, it complicates the user interface, see
> the mailing list archives for details). off the top of my head, i
> can't think of a good way to design this interface without that...
> perhaps something like:
>
> $ svn info -x 'url revision last-change-author' FOO
>
> (perhaps -x is not correct... that's what we use to pass flags to diff
> though, and this is /sort of/ similar...)
>
> but then it just feels like we're /really/ trying to fake have
> subcommand specific flags...

O.k. I understand.

>
> anyway, i'd prefer not to get into a protracted discussion on this,
> since i don't personally have a huge need for this anyway. i know that
> some of the windows people had wanted this functionality, so i knocked
> a patch together since it was pretty simple. for my own personal use,
> i live in an operating system where i have tools to let me get this
> from 'svn info', so i'll be happy doing:
>
> $ svn info | grep ^[Url|Revision]

Well at least on Windows NT and later the tools are also available.
Not as nice as the Unix tools, but available. From the CMD prompt
see the help for SET, FOR and FINDSTR, you may be surprised at what's
hidden away in the CMD tools. (Shocked might be better then suprised
when you see the syntax!) I've not seen any docs accept the built in
help, so it hit or miss if someone find the features they have need.

The NT equivalent of your command is:

svn info | findstr "^Url ^Revision"

Maybe the solution is a FAQ entry.

Q: How do I get the URL from svn info for use in a windows batch file?

A1: svn info | findstr "^Url:"

A2: The commands will place the Url: value into the variable URL

-------------- url.cmd -----------------
@for /f "usebackq tokens=1, 2*" %%i in (`svn info`) do @if "%%i" == "Url:" @set URL=%%j
@echo The URL is %URL%
----------------------------------------

        BArry

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Sep 7 17:23:11 2002

This is an archived mail posted to the Subversion Dev mailing list.