On Wed, Nov 09, 2005 at 10:46:28PM +0530, Madan U Sreenivasan wrote:
> Index: subversion/tests/clients/cmdline/commit_tests.py
> ===================================================================
> + post_commit_hook_code = ( "#!"+ sys.executable +"\n"
> + "import sys\n"
> + "\n"
> + "sys.stderr.write('Post-commit Hook says nothing "
> + "doing on stderr')\n"
> + "sys.exit(-1)\n")
> + svntest.main.create_python_hook_script (post_commit_hook,
> + post_commit_hook_code)
> +
> Index: subversion/tests/clients/cmdline/svntest/main.py
> ===================================================================
> +# Parameters : hook_name - full path of the target
> +# hook file to be created.
nit: on Windows, you're suffixing '.py' and '.bat' to this path, so it's
not really the "full path" as described.
> +# hook_script_code - python code for
> +# the hook.
> +def create_python_hook_script (hook_name, hook_script_code):
> + if sys.platform == 'win32':
> + # on windows, create a batch file wrapper to the python script
> + hook_py = os.path.join (hook_name, ".py")
> + hook = os.path.join (hook_name, ".bat")
> + # fill the python file
> + file_append (hook_py,
> + "#!"+ sys.executable +"\n")
Why are you prefixing the hook code with a shebang line again? It already
has one.
> + file_append (hook_py,
> + hook_script_code)
> + # fill the batch wrapper file
> + file_append (hook,
> + "@echo off\n",
> + hook_py)
You're going to need to do something a little more complex than that
to get Windows to run the python script. Probably something involving
sys.executable, but I don't know exactly what.
> + else: # For all other platforms
> + file_append (hook_name,
> + "#!"+ sys.executable +"\n")
Again, why add the shebang line?
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 9 18:26:00 2005