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

RE: Getting the high revision number

From: Reedick, Andrew <Andrew.Reedick_at_BellSouth.com>
Date: 2006-08-01 20:53:31 CEST

> -----Original Message-----
> From: John Calcote [mailto:jcalcote@novell.com]
>
> 2. Is there a good way to GET the high SVN revision number for a
> sub-directory of a project? Right now, I'm using a php script to call
> 'svn info --non-interative -R' on the repository url and sub-directory
> (not a work area), and then just scanning for the highest value in the
> repository for that subtree.

a) You scare my inner CM child. The repository revision number(s) and
the code/workspace revision number(s) are not guaranteed to be the same,
so your build number is random. <evil_eye>Tell your CM person that I
said to beat you.</evil_eye>

b) IMHO, what you should do is:
        First, get the HEAD revision number of the project root using
"svn info url/project_root".
                Grep out the "Revision:" to get the revision number.
                There is no need to scan the sub-tree for the highest
rev number.
                You will probably want an option to specify the build
number and url manually.
        Checkout/export using the revision number. (svn co -r 123
url/project_root)
                You should delete or fail if the workspace/export area
already exists.
                You will probably want to make the build area readonly
to everyone but the build owner.
        Check the exit code of the checkout/export command.
        Build in the nice clean workspace/export area.

        The build number should be: url + rev_num. A revision number
by itself is useless if you have multiple projects, releases, branches,
etc. in a repository. You need the revision number (the time) and the
url (the place.)
        Using url + rev_num precludes the need to scan the sub-tree for
the highest rev number.
        If you only ever build from trunk, then you do not need the url.
However, the odds of only ever building on trunk approach zero as time
goes on.

        If you are building from a workset, then you can use 'svn info
root_dir_of_workspace' to get the revision number. However, this
assumes that the entire workspace is on the same rev number and isn't a
mixed revision workspace. It also assumes that the workspace is
'clean'.

*****

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 1 20: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.