[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Require comments/messages on commit

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2005-05-07 03:00:45 CEST

On May 6, 2005, at 5:09 PM, Gregory Piņero wrote:

> I'm sorry, that did work. I just tested it by having it write a file
> instead. I guess I just can't see the console it launches?
>
> Ok, but now I'm stuck, Here's the actual code in my .bat file so far
>
> SVNLOOK log -t "$TXN" "$REPOS" | C:\SVN_SANDBOX\hooks\CheckLength.py
>
> Here are the questions I have:
> 1. Does anyone know how I feed TXN and REPOS to SVNLOOK in windows?

Again, you should google about win32 batch language. I think
incoming script arguments are expressed as %1%, %2%, or something
like that.

> 2. Is my piping right?

No idea.

> 3. Can I avoid this whole .bat thing and just have the python script
> called? (I read a .py extension wouldn't work)

Even if that's true, then just make your batch file run 'C:\bin
\python myscript.py %1% %2%'. Then you don't have to learn batch
language at all.

> 4. How do I get a message to the user as the error, such as "A comment
> of 20 chars is required" ?
>

Print to stderr. This text comes from the pre-commit template file:

# If the hook program exits with success, the txn is committed; but
# if it exits with failure (non-zero), the txn is aborted, no commit
# takes place, and STDERR is returned to the client.
  
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat May 7 03:02:39 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.