Is there some svn
or svnadmin
command that will display the revision of a local repo? I'd like to be able to have a Windows batch or PowerShell script that would let me zip up the repo and name it with the rev to email.
The best I can figure out is just to find the highest file in [reporoot]\db\revs\0
, but it seems kind of clunky and I don't know if it is reliable.
function Get-SvnRevision($dir)
{
([xml](svn info $dir --xml)).info.entry.revision
}
PowerShell, Subversion One Liner
(Edit) svnversion
is not so good because it relates to the working copy, not to the repository.
svn info
also relates to the working copy.
=> svnlook youngest REPOS_PATH
should do it. See also svn redbook.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With