Andrew,
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).
John
>>> "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
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 22:12:02 2006