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

Re: RE: Linux prefered for running Subversion : call for testimonials

From: Duncan Booth <duncan.booth_at_suttoncourtenay.org.uk>
Date: 2007-11-15 12:39:19 CET

"Andy Levy" <andy.levy@gmail.com> wrote:

>> So, even if I have a file extension associated with an EXE, such as
>> .pl with 'Perl.exe', it won't run unless I explicitly specify
>> 'perl.exe'?
>
> Correct. The source for the hook-handling code in Subversion only
> looks for .exe, .cmd and .bat. Windows is able to execute these
> directly, without an add-on interpreter, so it can call them directly.
> Windows doesn't have an execute bit on file permissions like *NIX
> does.

Windows is able to execute a lot more than just .exe, .cmd and .bat
directly: the shell will use the file associations from the registry to
open any executable script which it finds. The executable scripts are
defined by the PATHEXT environment variable which defaults to:

    .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

but you can add other extensions such as .py, .pl and these will then
also become directly executable.

Is there a good reason why Subversion couldn't use PATHEXT when looking
for hooks?

>
> Remember that hooks run with an empty environment, so the path to your
> Perl (or Python, or Ruby, or Windows Script Host) interpreter isn't
> readily known and nor would the paths to any dependent libraries.
>
Windows doesn't use the environment when looking for the program
associated with a script, or for the DLLs: it uses the registry. If you
completely clear the environment you can still execute scripts:

C:\Temp>set ALLUSERSPROFILE=

C:\Temp>set APPDATA=

C:\Temp>set CLASSPATH=

... snipped lots more set commands here ...

C:\Temp>set

C:\Temp>main.py hello
arguments ['C:\\Temp\\main.py', 'hello']

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Nov 15 12:39:59 2007

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.