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

RE: Querying revision properties

From: Campbell, Matthew A <Matthew.Campbell_at_Relizon.com>
Date: 2004-07-22 00:21:35 CEST

Do you have access to the server? If so, your script could run there more
efficiently using svnlook.

As far as running it client-side, you could help a LOT by eliminating the
revisions in which the project didn't exist or wasn't modified:

for rev in `svn log -q | grep -v ^- | cut -d\| -f1 | cut -c2-` ; do
    version=`svn --revprop -r $rev propget rs:version`
    if [ ! -z $version ]; then
        echo $version
    fi
done

(Note I swapped your variable names so they made more sense to me.)

The list of revisions is generated in reverse sort order since it comes from
svn log. If that matters, you could add a pipe through 'tac' at the end (If
you have it handy - it should be on all GNU based systems. It's 'gtac' here
at work - we're running Solaris).

Incidentally, this approach doesn't break when there are local modifications
since they don't affect revision properties.

HTH,
Matt

> -----Original Message-----
> From: Andrew Kappen [mailto:akappen@yahoo.com]
> Sent: Wednesday, July 21, 2004 6:00 PM
> To: users@subversion.tigris.org
> Subject: Querying revision properties
>
>
> I have a repository with a revision property called
> 'rs:version' stamped on a small subset of all
> revisions. I am looking for a quick way to find all
> revisions for which this property exists and
> print them out along with the property value. I have a
> script that will do this, but it is very
> inefficient due to many server hits (the script follows).
> Anybody have a better way to query this
> type of revision property?
>
> ====== begin ======
> #!/bin/sh
>
> # This script is brittle and requires the local copy to be fully up
> # to date with no local modifications. If you see errors like:
> # 119M: integer expression expected
> # or
> # 118:119: integer expression expected
> # then your local copy is not in sync with the repository.
>
> UPPER_LIMIT=`svnversion .`
> i=1
>
> while [ "$i" -le $UPPER_LIMIT ]
> do
> rev=`svn --revprop -r $i propget rs:version`
> if [ -n "$rev" ]
> then
> echo $rev $i
> fi
> let "i+=1"
> done
>
> exit 0
> ======= end =======
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Vote for the stars of Yahoo!'s next ad campaign!
> http://advision.webevents.yahoo.com/yahoo/votelifeengine/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jul 22 00:27:28 2004

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.