You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jake Stone <ja...@gmail.com> on 2009/09/05 10:01:45 UTC

Commit Hook Error

Hello all! I am working on some simple commit hooks for my repository, 
and I ran into a slight issue.

I am using some easy batch commands to grab information from the svnlook 
tool so I can send emails about the commit, but "svnlook author" is 
being stubborn. Running from the command line, svnlook author gives the 
correct committer's username, yet this code:

FOR /F "tokens=*" %%i in ('%SVNDIR%\svnlook author -r "%REV%" 
"%REPOS%"') do SET TOOLOUTPUT=%%i
SET AUTHOR=%TOOLOUTPUT%

FOR /F "tokens=*" %%i in ('%SVNDIR%\svnlook date -r "%REV%" "%REPOS%"') 
do SET TOOLOUTPUT=%%i
SET DATE=%TOOLOUTPUT%

SET SUBJECT="%REPOSNAME% updated by %AUTHOR% on %DATE%"

Will produce a subject of "Repository updated by  on Sat 09/05/2009"
This is obviously rather frustrating, since the exact same command works 
on date but not author. I could just tell the commands to append their 
information to a file, but then it'd be harder to make email subject 
lines, etc like the one above.

Any ideas?

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2391264

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Commit Hook Error

Posted by Andrey Repin <an...@freemail.ru>.
Greetings, Jake Stone!

> Hello all! I am working on some simple commit hooks for my repository, 
> and I ran into a slight issue.

> I am using some easy batch commands to grab information from the svnlook 
> tool so I can send emails about the commit, but "svnlook author" is 
> being stubborn. Running from the command line, svnlook author gives the 
> correct committer's username, yet this code:

> FOR /F "tokens=*" %%i in ('%SVNDIR%\svnlook author -r "%REV%" 
> "%REPOS%"') do SET TOOLOUTPUT=%%i
> SET AUTHOR=%TOOLOUTPUT%

> FOR /F "tokens=*" %%i in ('%SVNDIR%\svnlook date -r "%REV%" "%REPOS%"') 
> do SET TOOLOUTPUT=%%i
> SET DATE=%TOOLOUTPUT%

> SET SUBJECT="%REPOSNAME% updated by %AUTHOR% on %DATE%"

> Will produce a subject of "Repository updated by  on Sat 09/05/2009"
> This is obviously rather frustrating, since the exact same command works 
> on date but not author. I could just tell the commands to append their 
> information to a file, but then it'd be harder to make email subject 
> lines, etc like the one above.

> Any ideas?

Yes. RTFM "SET /?". Your code is wrong. Also RTFM "FOR /?" as your FOR line is
wrong too.
I know this can be done in cmd, but the way to have it function properly just
too frustrating... you better choose different tools.


--
WBR,
 Andrey Repin (anrdaemon@freemail.ru) 05.09.2009, <15:20>

Sorry for my terrible english...

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2391271

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].