-
Notifications
You must be signed in to change notification settings - Fork 2
/
post-commit.bat
29 lines (26 loc) · 1.34 KB
/
post-commit.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@ECHO OFF
REM *************************************************************
REM * Edit the following lines to suit your environment *
REM *************************************************************
REM Set full path to svnlook.exe
SET SVNLOOK="C:\Program Files\VisualSVN Server\bin\svnlook.exe"
REM Set full path to python.exe
SET PYTHON="C:\Python27\python.exe"
REM Set full path to post.py
SET POSTPY="\path\to\Subversion-Integration-for-Mattermost\post.py"
REM *************************************************************
REM * This sets the arguments supplied by Subversion *
REM *************************************************************
SET REPOS=%1
SET TXN=%2
REM *************************************************************
REM * Get Author and comment *
REM *************************************************************
setlocal EnableDelayedExpansion
for /f "tokens=*" %%i in ('%SVNLOOK% log -r %TXN% %REPOS%') do set COMMENT=%%i
for /f "tokens=*" %%i in ('%SVNLOOK% author -r %TXN% %REPOS%') do set AUTHOR=%%i
REM *************************************************************
REM * Hand it to post.py *
REM *************************************************************
"%PYTHON%" "%POSTPY%" "%AUTHOR% committed revision %TXN% to %REPOS%: %COMMENT%"
exit 0