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

Asked

Viewed 409 times

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 being executed it is necessary that the developer in charge of it provides details about the progress of the process. The problem in my opinion is that this ends up generating a certain redundancy in the process carried out by the developer, since when doing the commits in SVN it already writes in the log the process that was carried out with that working copy.

Keeping this in mind my goal would be to make sure that when writing the log on the SVN commit screen, that log text is already inserted into my database linked to that respective task in our task control system. From what I researched it is practically consensus that this process should be performed by script in the SVN post-commit event.

One problem with this fact is that the treatments of this event, from what I saw, should be done in Shell-Script, but however I do not understand Shell Script and use Linux (Because we developed with Delphi). Has anyone working with Delphi ever managed to achieve this kind of integration? If it were possible I could get the task data in the name of the branch using Regex, but I have no ideas where to start, I would appreciate suggestions.

1 answer

5


For what I found in some links the hook of post-commit SVN in a Windows environment can easily be directed to an archive batch (.bat).

The repository and the identifier of the commit 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 the svnlook. I found an example that even supports comments with line breaks at 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 its database.

  • I will review your reply right now and check if it is indeed what I need. Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.