[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: John Calcote <jcalcote_at_novell.com>
Date: 2006-08-01 22:10:11 CEST


I apologize profusely - I stated that I was using the 'Revision:' tag -
I'm not using the 'Revision:' tag in my recursive search - I'm using the
'Last Changed Rev:' tag, which gives me the last revision number in
which a given file or directory entry was modified. I scan this field
looking for the highest field in a given subdirectory of our repository.
This allows me to have multiple components in the same repository -
which is a quite common occurrence - without being required to rebuild
each component with every build.

The highest revision number in a given subtree that is associated with
any file in that subtree becomes the revision number of the project for
that build (assuming it needs to be built again).


>>> "Reedick, Andrew" <Andrew.Reedick@BellSouth.com> 8/1/2006 12:53 PM
> -----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
> 'svn info --non-interative -R' on the repository url and
> (not a work area), and then just scanning for the highest value in
> repository for that subtree.

a) You scare my inner CM child. The repository revision number(s)
the code/workspace revision number(s) are not guaranteed to be the
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
                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,
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
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
mixed revision workspace. It also assumes that the workspace is


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 22:12:02 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.