[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: Gregory Piņero <gregpinero_at_gmail.com>
Date: 2005-05-07 04:22:04 CEST

Thanks Ben,

I'm taking your advice and having the batch file just launch the python script.

However I'm having issues getting python to get results from svnlook.
Here's what I have so far:

os.system("svnlook") #works but doesn't give me the output from
svnlook, just the status

commands.gettegetstatusoutput("svnlook") only works in unix?

Here's my final code which really <should> work:

pipe=os.popen("svnlook log \arms") #works from console
text=pipe.read()
print text

>> I get blank

However this works fine and gives me many lines of output:
pipe=os.popen("dir")
text=pipe.read()
print text

Any ideas?

Thanks,

Greg

On 5/6/05, Ben Collins-Sussman <sussman@collab.net> wrote:
>
> 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 04:24:13 2005

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