Is it possible to integrate SVN with my task control tool?

12

I have a development environment with an SVN server running with VisualSVN and terminals with TortoiseSVN. In this same environment I have a task control system, done in Delphi, in which the tasks are assigned to the developers.

Once a task is running, the developer in charge must provide details about the progress of the process. The problem in my view is that this ends up generating some redundancy in the process performed by the developer, since when doing the commits in SVN the same already writes in the log the process that was done with that working copy. >

With this in mind my goal would be to make when writing the log in the SVN commit screen, that text of the log was already inserted in my database linked to that respective task in our task control system . From what I've researched it's pretty much a consensus that this process should be done by script in the SVN post-commit event.

A problem with this fact is that the treatments of this event, as I have seen, must be done in Shell-Script, but I do not understand Shell Script and I do not use Linux (as we have developed with Delphi). Does anyone working with Delphi already have this kind of integration? If it were possible I could get the task data in the branch's own name using Regex, but I'm not sure where to start, I'd appreciate suggestions.

    
asked by anonymous 24.01.2014 / 14:54

1 answer

5

From what I found in some links hook post-commit in> of SVN in a Windows environment can easily be directed to a batch ( .bat ) stack.

The repository and commit identifier are received by parameters in the script and can be accessed like this:

set REPOS=%1  
set TXN=%2   

The commit comment can be obtained by running svnlook . I found an example that supports comments with broken lines this link . See the code:

@ECHO OFF
setlocal enabledelayedexpansion
set LF=^


rem ** The two empty lines are NECESSARY

SET REPOS=%1
SET REV=%2

SET MSG=
FOR /F %%i in ('svnlook log -r %REV% %REPOS%') do (
    SET "VAR=!VAR!!LF!%%i"
    SET "PAR=!PAR!^^!LF!!LF!%%i"
)
ECHO !VAR!
myProgram.exe !par!

Note that at the end, the above code executes myProgram.exe . This could be replaced by an executable of yours that interprets the comment and inserts the necessary information into your database.

    
24.01.2014 / 15:15