> -----Original Message-----
> From: John Calcote [mailto:firstname.lastname@example.org]
> 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
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
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
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
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: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Tue Aug 1 20:55:31 2006