You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Kenneth Porter <sh...@sewingwitch.com> on 2007/12/18 01:12:33 UTC
Extracting URL from WC
I want to report for a given application build what Subversion repo URL
(eg. trunk or which branch) the source was drawn from. I expect I could
parse it out of "svn info" output, but I'm wondering if there's a shortcut
for this. Or perhaps a script or utility that extracts this information.
(Of course this won't work from an exported copy.)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Andy Levy <an...@gmail.com>.
On Dec 17, 2007 9:05 PM, Eric Hanchrow <of...@blarg.net> wrote:
> >>>>> "Kenneth" == Kenneth Porter <sh...@sewingwitch.com> writes:
>
> Kenneth> I want to report for a given application build what
> Kenneth> Subversion repo URL (eg. trunk or which branch) the
> Kenneth> source was drawn from. I expect I could parse it out of
> Kenneth> "svn info" output, but I'm wondering if there's a
> Kenneth> shortcut for this.
>
> I doubt there's a shortcut, but keep in mind that "svn info", like
> most svn commands, has an --xml option, which, not surprisingly,
> causes it to emit XML. In theory, XML is easy to parse :-)
I think --xml may have been added to info in 1.4.
The output of svn info, whether it be XML or plain text, is pretty
easy to parse.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Eric Hanchrow <of...@blarg.net>.
>>>>> "Kenneth" == Kenneth Porter <sh...@sewingwitch.com> writes:
Kenneth> I want to report for a given application build what
Kenneth> Subversion repo URL (eg. trunk or which branch) the
Kenneth> source was drawn from. I expect I could parse it out of
Kenneth> "svn info" output, but I'm wondering if there's a
Kenneth> shortcut for this.
I doubt there's a shortcut, but keep in mind that "svn info", like
most svn commands, has an --xml option, which, not surprisingly,
causes it to emit XML. In theory, XML is easy to parse :-)
--
Software is largely a service industry operating under the
persistent but unfounded delusion that it is a manufacturing
industry.
-- Eric Raymond
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Re: Extracting URL from WC
Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: Kenneth Porter [mailto:shiva@sewingwitch.com]
> Sent: Tuesday, December 18, 2007 1:07 AM
> To: users@subversion.tigris.org
> Subject: Re: Extracting URL from WC
>
> --On Monday, December 17, 2007 10:26 PM -0700 Mark Reibert
> <sv...@reibert.com> wrote:
>
> > I can't think of anything much shorter than:
> >
> > svn info | awk '/^URL:/ { print $2 }'
>
> Yeah, I was thinking of adding Active State Perl as a build
requirement
> on
> all (WinXP) development systems.
>
> And I'm thinking the desirable string is actually the difference
> between
> the URL and the repository root (ie. the path within the repo), and
> that
> should be easy to compute.
svn info | perl -ne "print qq($1\n) if m|^URL: svn://[^/]*/(.*)|"
On a related side note, last time I tested with AS Perl, parsing the
text output of 'svn log' was literally ten times faster than parsing
'svn log --xml'.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: Re: Extracting URL from WC
Posted by "Thompson, Graeme (GE Infra, Aviation)" <Gr...@ge.com>.
Or even:
http://gnuwin32.sourceforge.net/packages/gawk.htm
Graeme
-----Original Message-----
From: Geoffrey [mailto:lists@serioustechnology.com]
Sent: 18 December 2007 13:39
To: users@subversion.tigris.org
Subject: Re: Extracting URL from WC
Mark Reibert wrote:
> On Mon, 2007-12-17 at 22:06 -0800, Kenneth Porter wrote:
>> --On Monday, December 17, 2007 10:26 PM -0700 Mark Reibert
>> <sv...@reibert.com> wrote:
>>
>>> I can't think of anything much shorter than:
>>>
>>> svn info | awk '/^URL:/ { print $2 }'
>> Yeah, I was thinking of adding Active State Perl as a build
>> requirement on all (WinXP) development systems.
>
> Ahh, you are on Windows ... didn't realize that.
Unix tools for Windows, free:
http://www.research.att.com/sw/tools/uwin/
http://www.research.att.com/~gsf/man/man1/
--
Until later, Geoffrey
Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
- Benjamin Franklin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
______________________________________________________________________
CAUTION: This message was sent via the Public Internet and its
authenticity cannot be guaranteed.
______________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn:ignore pattern syntax
Posted by Matthieu Moy <Ma...@imag.fr>.
Geoffrey Hoffman <gh...@emomem.com> writes:
> Google search suggested that * and/or ? are wildcards in the
> svn:status pattern matching algorthm...
svn:ignore, I suppose.
The ignore pattern is applied to _untracked_ files, to know whether
SVN should warn you with a "? foo" line or not.
svn:ignore is just here to tell subversion "these files can be in my
working tree, they're not versionned, don't worry about them".
> jetfire:/Volumes/WORKGROUP\;WEBSERVER/www/my_wc ghoffman$ svn status
> M Scripts
> ! Scripts/._AC_RunActiveContent.js
I suppose ._AC_RunActiveContent.js used to be versionned, and you
deleted it from your local copy. svn:ignore does nothing about that.
--
Matthieu
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn:ignore pattern syntax
Posted by Andy Levy <an...@gmail.com>.
On Dec 18, 2007 12:03 PM, Geoffrey Hoffman <gh...@emomem.com> wrote:
> Google search suggested that * and/or ? are wildcards in the
> svn:status pattern matching algorthm...
> but (Mac OS X Terminal):
>
>
> jetfire:/Volumes/WORKGROUP\;WEBSERVER/www/my_wc ghoffman$ svn status
> M Scripts
> ! Scripts/._AC_RunActiveContent.js
> M site/dsp_nav.php
> M site/circuit.xml.php
>
> jetfire:/Volumes/WORKGROUP\;WEBSERVER/www/my_wc ghoffman$ svn propset
> svn:ignore ._* Scripts
> property 'svn:ignore' set on 'Scripts'
>
> jetfire:/Volumes/WORKGROUP\;WEBSERVER/www/my_wc ghoffman$ svn status
> M Scripts
> ! Scripts/._AC_RunActiveContent.js
> M site/dsp_nav.php
> M site/circuit.xml.php
>
>
> I was expecting to not see this on the second svn status...
>
> ! Scripts/._AC_RunActiveContent.js
>
> Am I doing something wrong? What pattern syntax does svn:ignore use?
> I put an
> svn:ignore .* .
>
> but that doesn't seem to work either.
You can't svn:ignore items which are already versioned AFAIK.
Scripts/._AC_RunActiveContent.js is versioned, but has been deleted or
renamed by non-svn methods (thus the ! status)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
svn:ignore pattern syntax
Posted by Geoffrey Hoffman <gh...@emomem.com>.
Google search suggested that * and/or ? are wildcards in the
svn:status pattern matching algorthm...
but (Mac OS X Terminal):
jetfire:/Volumes/WORKGROUP\;WEBSERVER/www/my_wc ghoffman$ svn status
M Scripts
! Scripts/._AC_RunActiveContent.js
M site/dsp_nav.php
M site/circuit.xml.php
jetfire:/Volumes/WORKGROUP\;WEBSERVER/www/my_wc ghoffman$ svn propset
svn:ignore ._* Scripts
property 'svn:ignore' set on 'Scripts'
jetfire:/Volumes/WORKGROUP\;WEBSERVER/www/my_wc ghoffman$ svn status
M Scripts
! Scripts/._AC_RunActiveContent.js
M site/dsp_nav.php
M site/circuit.xml.php
I was expecting to not see this on the second svn status...
! Scripts/._AC_RunActiveContent.js
Am I doing something wrong? What pattern syntax does svn:ignore use?
I put an
svn:ignore .* .
but that doesn't seem to work either.
TIA,
Geoffrey Hoffman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Lorenz <lo...@yahoo.com>.
Mark Reibert wrote:
>On Tue, 2007-12-18 at 08:39 -0500, Geoffrey wrote:
>> Mark Reibert wrote:
>> > Ahh, you are on Windows ... didn't realize that.
>>
>> Unix tools for Windows, free:
>>
>> http://www.research.att.com/sw/tools/uwin/
>> http://www.research.att.com/~gsf/man/man1/
>
>Also http://www.cygwin.com
And http://gnuwin32.sourceforge.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Mark Reibert <sv...@reibert.com>.
On Tue, 2007-12-18 at 08:39 -0500, Geoffrey wrote:
> Mark Reibert wrote:
> > Ahh, you are on Windows ... didn't realize that.
>
> Unix tools for Windows, free:
>
> http://www.research.att.com/sw/tools/uwin/
> http://www.research.att.com/~gsf/man/man1/
Also http://www.cygwin.com
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Geoffrey <li...@serioustechnology.com>.
Mark Reibert wrote:
> On Mon, 2007-12-17 at 22:06 -0800, Kenneth Porter wrote:
>> --On Monday, December 17, 2007 10:26 PM -0700 Mark Reibert
>> <sv...@reibert.com> wrote:
>>
>>> I can't think of anything much shorter than:
>>>
>>> svn info | awk '/^URL:/ { print $2 }'
>> Yeah, I was thinking of adding Active State Perl as a build requirement on
>> all (WinXP) development systems.
>
> Ahh, you are on Windows ... didn't realize that.
Unix tools for Windows, free:
http://www.research.att.com/sw/tools/uwin/
http://www.research.att.com/~gsf/man/man1/
--
Until later, Geoffrey
Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
- Benjamin Franklin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Mark Reibert <sv...@reibert.com>.
On Mon, 2007-12-17 at 22:06 -0800, Kenneth Porter wrote:
> --On Monday, December 17, 2007 10:26 PM -0700 Mark Reibert
> <sv...@reibert.com> wrote:
>
> > I can't think of anything much shorter than:
> >
> > svn info | awk '/^URL:/ { print $2 }'
>
> Yeah, I was thinking of adding Active State Perl as a build requirement on
> all (WinXP) development systems.
Ahh, you are on Windows ... didn't realize that.
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Kenneth Porter <sh...@sewingwitch.com>.
--On Monday, December 17, 2007 10:26 PM -0700 Mark Reibert
<sv...@reibert.com> wrote:
> I can't think of anything much shorter than:
>
> svn info | awk '/^URL:/ { print $2 }'
Yeah, I was thinking of adding Active State Perl as a build requirement on
all (WinXP) development systems.
And I'm thinking the desirable string is actually the difference between
the URL and the repository root (ie. the path within the repo), and that
should be easy to compute.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Mark Reibert <sv...@reibert.com>.
On Tue, 2007-12-18 at 13:16 +0100, marc gonzalez-carnicer wrote:
> hi,
>
> 2007/12/18, Mark Reibert <sv...@reibert.com>:
> >
> > I can't think of anything much shorter than:
> >
> > svn info | awk '/^URL:/ { print $2 }'
>
> now that i see your post, i recall there is something i never dared
> to ask. i wonder if it would be a good idea to provide the svn status
> command with an option (or a set of options) that allow searching
> or modified files, conflicted files, added files, etc, in order to ease
> scripting. something that would be equivalent to type commands like:
>
> svn status | awk '/^M/ { print $2 }'
>
> this would not work for files whose properties have been modified
> (awk '^ M'), etc. i did something like that for a script that helps
> the user to solve conflicts, that starts in that case with
>
> FITXERS=`svn status | grep "^C" | cut -c 8-`
>
> and performs moreless the same way as svn update for
> version 1.5 when there are conflicts. this scripts is for
> an old machine that uses solaris 8 and launches filemerge
> (kdiff3 is not easily installable). i tried to find the spec on the
> roadmap for svn 1.5.0 but i failed, don't know if it has been
> moved).
>
> doing this kind of scripts / hacks is always tricky and tedious.
> don't you think it would be useful to have these set of options
> for svn status?
I am not a fan of adding functionality to commands that can be
accomplished with existing tools. The problem is, once you start down
that path you invariably leave out some feature. How many times has a
Window application popped up a dialog that does not give you the option
you need? And you can't do anything about it!
The UNIX philosophy has always been a collection of small tools that do
very specific things well, with stdin/stdout and a pipe to glue it all
together. Thus there is almost no limit to what can be accomplished. It
is the reason UNIX is still viable after nearly 40 years.
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by marc gonzalez-carnicer <ca...@gmail.com>.
hi,
2007/12/18, Mark Reibert <sv...@reibert.com>:
>
> I can't think of anything much shorter than:
>
> svn info | awk '/^URL:/ { print $2 }'
now that i see your post, i recall there is something i never dared
to ask. i wonder if it would be a good idea to provide the svn status
command with an option (or a set of options) that allow searching
or modified files, conflicted files, added files, etc, in order to ease
scripting. something that would be equivalent to type commands like:
svn status | awk '/^M/ { print $2 }'
this would not work for files whose properties have been modified
(awk '^ M'), etc. i did something like that for a script that helps
the user to solve conflicts, that starts in that case with
FITXERS=`svn status | grep "^C" | cut -c 8-`
and performs moreless the same way as svn update for
version 1.5 when there are conflicts. this scripts is for
an old machine that uses solaris 8 and launches filemerge
(kdiff3 is not easily installable). i tried to find the spec on the
roadmap for svn 1.5.0 but i failed, don't know if it has been
moved).
doing this kind of scripts / hacks is always tricky and tedious.
don't you think it would be useful to have these set of options
for svn status?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Extracting URL from WC
Posted by Mark Reibert <sv...@reibert.com>.
On Mon, 2007-12-17 at 17:12 -0800, Kenneth Porter wrote:
> I want to report for a given application build what Subversion repo URL
> (eg. trunk or which branch) the source was drawn from. I expect I could
> parse it out of "svn info" output, but I'm wondering if there's a shortcut
> for this. Or perhaps a script or utility that extracts this information.
I can't think of anything much shorter than:
svn info | awk '/^URL:/ { print $2 }'
--
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org