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

Re: Windows Shell Kung-Fu

From: si <sshnug.si_at_gmail.com>
Date: 2006-10-08 04:16:35 CEST

> When HookStart is called, it ignores the environment variables. It spawns a
> new process, so, we can't call a batch file from it.

I did include the source code.

Here's the documentation for the Process class
http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.aspx

It looks like the ProcessStartInfo and Environment classes will help
http://msdn2.microsoft.com/en-us/library/system.diagnostics.processstartinfo.environmentvariables.aspx
http://msdn2.microsoft.com/en-us/library/system.environment.aspx

Subnant doesn't assume environment variables will be set, since on
non-windows operating systems, e.g. running via Mono on Linux,
they're not set when a hook is called, so I don't worry about them.

Whilst the environment variables are available for hooks on Windows,
I wouldn't rely on them, as it's not documented and the inconsistent
behaviour (from other operating systems) might change in future
releases of Subversion.

It would be nice if these issues were documented, perhaps in the FAQ?

Something like:

"Hook differences between Windows and non-Windows operating systems"

1. On Windows, it is currently not known how to easily enable
post-commit hooks to return the process to the client. This means
that if you are sending email or other time consuming tasks,
the client will be left waiting.

2. On Windows, environment paths are available in hooks.

I just re-read through the FAQ and couldn't see anything,
although it looks like it needs a small update, as of 1.4.0
this link probably isn't needed
http://subversion.tigris.org/faq.html#svnserve-win-service

And I believe this is incorrect in regards to the %PATH%
http://subversion.tigris.org/faq.html#hook-debugging

It's easy to test, just echo %PATH% to a file from a hook.

@echo off
echo %PATH% > c:\temp\path.txt

peace
si

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Oct 8 04:17:11 2006

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.