I have a PHP script that automatically generates project release history by examining directories under SVN, specifically those matching the pattern ^/*/tags/*
.
e.g.
^/myproject/tags/v1-00
^/myproject/tags/v1-01
^/myproject/tags/v1-02
…and so forth.
Among other things, the script parses the output of svn info
:
[tomalak@cat ~]$ svn info https://localhost/svn/myproject/tags/v8-11/
Path: v8-11
URL: https://localhost/svn/myproject/tags/v8-11
Repository Root: https://localhost/svn
Repository UUID: ***
Revision: 15198
Node Kind: directory
Last Changed Author: ***
Last Changed Rev: 15192
Last Changed Date: 2013-06-17 12:31:52 +0100 (Mon, 17 Jun 2013)
in order to obtain the SVN revision and Date of the tag's creation.
This works really well… until somebody commits onto the tag. It happens. Newer versions of TortoiseSVN warn you, and you can create pre-commit hooks to try to physically prohibit committing onto tags1, but I want to handle this case regardless.
We're told the "Last Changed Rev
" and "Last Changed Date
"; can we, without too much more work (and ideally without a second svn
invocation), ask for the "First Changed Rev
" and "First Changed Date
" instead?
Related: "SVN: How to get the first revision of a file?" comes close, but I specifically want to do this with the single svn info
call if at all possible. ("How to get the earliest checkout-able revision info from subversion?" is also close, but ultimately useless.)
1 Actually, I've had trouble doing this without prohibiting initial tag creation, though that's a story for another day…