I’m trying to write a batch file in which I need the HEAD revision of the project I am working on.
Is there a command to get this from the command line?
I am on a Windows XP Machine.
EDIT
I ended up using a mix between Shambulator, mizipzor, and Stefan’s answers. I ended up with this:
for /f "tokens=5" %%i in ('SubWCRev WorkingCopyPath^|find "Last committed at revision"') do set version=%%i
echo %version%
Thanks for all your help guys
Added this answer to the list below as well.
It’s awkward without the text-processing capabilities of *nix, but this batch file does it:
Substitute your svn repository for my
svn://localhost.svn infogets the repository info, then pipes it tofind, which strips out everything except the line containing the revision number. Theforcommand gives you the second “token” on that line (the first one isRevision:).EDIT: As others have mentioned already, you’ll need a command-line version of Subversion installed, and have
svn.exeon yourPATH.