On 2/1/2011 10:16 PM, Waseem Bokhari wrote:
>
> _Here is a Post-Commit.bat for generating email on every-commit._
>
> *@echo off*
>
> **
>
> *:::::::::::::::::::::::::::::::::::::::::::::::::::::*
>
> *::: ARGUMENTS :::::::::::::::::::::::::::::::::::::::*
>
> **
>
> *SET REPOS=%1*
>
> *SET REV=%2*
>
> **
>
> *:::::::::::::::::::::::::::::::::::::::::::::::::::::*
>
> *::: GENERAL INFO ::::::::::::::::::::::::::::::::::::*
>
> *SET DIR=E:\Repositories\WSBokhari\hooks*
>
> *SET MESSAGE_FILE=%DIR%/message.txt*
>
> **
>
> *:::::::::::::::::::::::::::::::::::::::::::::::::::::*
>
> *::: SVN INFO ::::::::::::::::::::::::::::::::::::::::*
>
> *SET DIR=E:\Repositories\WSBokhari\hooks*
>
> *SET REPO_PATH=file:///E:/Repositories/WSBokhari*
>
> **
>
> *::: Get the author ::::::::::::::::::::::::::::::::::*
>
> *For /F "Tokens=*" %%I in ('svnlook author %REPOS% -r %REV%') Do Set
> author=%%I*
>
> **
>
> *::: Get the log messsage ::::::::::::::::::::::::::::::::::*
>
> *For /F "Tokens=*" %%I in ('svnlook log %REPOS% -r %REV%') Do Set log=%%I*
>
> **
>
> *::: Set the message body ::::::::::::::::::::::::::::::::::*
>
> *ECHO Commit - rev %REV% (#%author%): '%log%' - %REPOS% > %MESSAGE_FILE%*
>
> **
>
> *:::::::::::::::::::::::::::::::::::::::::::::::::::::*
>
> *::: EMAIL INFO ::::::::::::::::::::::::::::::::::::::*
>
> **
>
> *set to=-to ntpk.scm_at_netsolpk.com*
>
> **
>
> *set subj=-s "SVN Commit (Revision %REV%)"*
>
> **
>
> *set server=-server mail.netsolpk.com*
>
> **
>
> *set auth=-u waseem.bokhari_at_netsolpk.com --pw 123 *
>
> **
>
> *set from=-f waseem.bokhari_at_netsolpk.com*
>
> **
>
> *:::::::::::::::::::::::::::::::::::::::::::::::::::::*
>
> *::: SEND THE EMAIL ::::::::::::::::::::::::::::::::::*
>
> **
>
> *E:/Repositories/WSBokhari/%MESSAGE_FILE% %server% %to% %from% %subj%
> %auth%***
>
> **
>
> **
>
> *_Error Message:_*
>
> **
>
> *post-commit hook failed (exit code 1) with output:*
>
> *The filename, directory name, or volume label syntax is incorrect.*
>
> **
>
> **
>
> *_PS:_*
>
> Even file *message.txt***is being creating in my Hooks Folder
> according to this::**
>
> **
>
> *SET MESSAGE_FILE=%DIR%/message.txt*
>
>
> **
>
> //
>
This line looks wrong. Try using a backslash ('\') instead of a forward
slash ('/'). Although many Windows programs tolerate forward slashes in
file names, the Windows batch processor is not one of them. It uses
forward slashes to mark parameters (as is shown in the "For /F" lines)
so it is trying to interpret "/message.txt" as a parameter, not part of
your message file name.
If you're going to be creating or editing Windows batch files, I
strongly encourage you to buy a book on how to create them. It's been
so long that I can't recommend one to you, unfortunately.
--
David Chapman dcchapman_at_acm.org
Chapman Consulting -- San Jose, CA
Received on 2011-02-02 07:48:44 CET