On Thu, May 31, 2012 at 5:28 AM, <rhuijben_at_apache.org> wrote:
>...
> +++ subversion/trunk/subversion/tests/cmdline/svntest/main.py Thu May 31 09:28:13 2012
> @@ -934,18 +934,23 @@ def canonicalize_url(input):
> return input
>
>
> -def create_python_hook_script(hook_path, hook_script_code):
> +def create_python_hook_script(hook_path, hook_script_code,
> + cmd_alternative=None):
> """Create a Python hook script at HOOK_PATH with the specified
> HOOK_SCRIPT_CODE."""
>
> if windows:
> - # Use an absolute path since the working directory is not guaranteed
> - hook_path = os.path.abspath(hook_path)
> - # Fill the python file.
> - file_write("%s.py" % hook_path, hook_script_code)
> - # Fill the batch wrapper file.
> - file_append("%s.bat" % hook_path,
> - "@\"%s\" %s.py %%*\n" % (sys.executable, hook_path))
> + if cmd_alternative is not None:
> + file_write("%s.bat" % hook_path,
> + cmd_alternative)
> + else:
> + # Use an absolute path since the working directory is not guaranteed
> + hook_path = os.path.abspath(hook_path)
You didn't do this in the other branch.
> + # Fill the python file.
> + file_write("%s.py" % hook_path, hook_script_code)
> + # Fill the batch wrapper file.
> + file_write("%s.bat" % hook_path,
> + "@\"%s\" %s.py %%*\n" % (sys.executable, hook_path))
> else:
> # For all other platforms
> file_write(hook_path, "#!%s\n%s" % (sys.executable, hook_script_code))
And it isn't done here.
But thinking on it: that call to abspath() is bogus. Passing "foo"
into it will use the current directory, just like file_write() will
use the current directory. The abspath() accomplishes nothing.
(unless I'm missing something here...)
Cheers,
-g
Received on 2012-06-01 22:45:06 CEST