Friday, January 08, 2010

Send details of SVN commit on windows using DOS/Batch script

At work we have a shared SubVersion source code repository.  At the moment we don't have a CI setup for every project and I got fed up of not always knowing that someone had also checked something in. (CI sends build/test notifications - success and failure- so I know if something has changed that way.)
So I could make sure I was always notified of when someone else had changed something in a project I'm working on I set up a post-commit hook to send me an email.

The following is a post-commit hook script that I have written to enable me to keep track of what others are checking in.  I publish it here as I couldn't find a good example of this for Windows machines.

Please note that paths and email addresses have been changed to protect the guilty. You'll want/need to change these if you use a copy of this script yourself.

rem This hook sends an email when something is checked in to this repository

set REPOS="%1"
set REV=%2

"C:\Program Files\VisualSVN Server\bin\svnlook.exe" author %REPOS% -r %REV% > D:\SUBVERSION\MISC\author%REV%.tmp

set /p AUTHOR= D:\SUBVERSION\MISC\%REV%.tmp

echo. >> D:\SUBVERSION\MISC\%REV%.tmp

echo Who: %AUTHOR% >> D:\SUBVERSION\MISC\%REV%.tmp

echo. >> D:\SUBVERSION\MISC\%REV%.tmp

echo Comment:  >> D:\SUBVERSION\MISC\%REV%.tmp
"C:\Program Files\VisualSVN Server\bin\svnlook.exe" log %REPOS% -r %REV% >> D:\SUBVERSION\MISC\%REV%.tmp

echo. >> D:\SUBVERSION\MISC\%REV%.tmp

echo Changes:  >> D:\SUBVERSION\MISC\%REV%.tmp
"C:\Program Files\VisualSVN Server\bin\svnlook.exe" changed %REPOS% -r %REV% >> D:\SUBVERSION\MISC\%REV%.tmp


D:\SUBVERSION\MISC\sendemail.exe -f svn-checkin@example.com -t name@example.com -u "Check-in for REPOSITORY-NAME" -o message-file=D:\SUBVERSION\MISC\%REV%.tmp


del D:\SUBVERSION\MISC\author%REV%.tmp
del D:\SUBVERSION\MISC\%REV%.tmp

I also use rule in outlook to ignore notifications of check-ins made by me.

This uses SendEmail by Brandon Zehm (available at: http://caspian.dotconf.net/menu/Software/SendEmail/) as a command line tool to send emails from the script.

4 comments:







  1. And bittersweet brain wherein was tag heuer replica sale. Not surprisingly we have been struggling with party. It is that particular a good number of pleasing programs on this planet. Itrrrs a great idea which will some of us would most likely intend chanel replica sale and even heat lamps which may always keep decent time. Made some noise. 1960's, an experienced young lady labeled as Maximum Hetzel 100 % developed it know-how would most likely now that safeguard whole your time together with a Accutron de-stress and even replica chanel sale empire arrived to it universe. Having a not similar technique to serving up stylish running watches than previously which will Bulova Look into Small business, utilising Mr. Hetzel, centrally located that hypothesis to help you get paid performing running watches taking reforming derive choices. Nobody contain prior to this implemented it prior to. chanel replica sale aligning offer procedure was without a doubt mixed with gains through lighting products earlier than, then again, hardly ever is stated in substantial figures. Not everybody possessed definitely aim to miniaturize that constituents prior to this. Great deal Hetzel started out his particular go through plus enduring creation of these better procedure located in 1953. The ideal prototypes about this tag heuer replica sale has been stated in '55.


    ReplyDelete
  2. atlanta falcons, http://www.atlantafalconsjersey.us/
    michael kors outlet online, http://www.michaelkorsusa.us/
    mbt sneakers, http://www.mbtshoesoutlet.us.com/
    dallas cowboys, http://www.dallascowboysjersey.us/
    oklahoma city thunder, http://www.thunderjerseystore.com/
    san francisco 49ers, http://www.sanfrancisco49ersjerseys.us/
    cheap uggs, http://www.uggsale.in.net/
    polo ralph lauren uk, http://www.ralphlauren-outletonline.co.uk/
    chicago bulls, http://www.chicagobullsjerseys.net/
    babyliss hair dryer, http://www.babyliss.us.com/
    supra sneakershttp://www.suprashoes.us.com
    ray ban sunglasses, http://www.ray-bansunglasses.eu.com/
    toms shoes outlet online, http://www.toms.us.com/
    snapback hats, http://www.cheapsnapbacks.us.com/
    fitflop sandals, http://www.fitflop.in.net/
    louis vuitton outlet,louis vuitton outlet online,louis vuitton,louisvuitton.com,authentic louis vuitton,louis vuitton factory outlet,cheap louis vuitton
    ralph lauren sale, http://www.ralphlaurenoutlet.in.net/
    oakley outlet online, http://www.oakleyoutlet.in.net/
    kkk10 13

    ReplyDelete