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

Re: svn commit: r1344616 - in /subversion/trunk/subversion/tests/cmdline/svntest: actions.py main.py

From: Greg Stein <gstein_at_gmail.com>
Date: Fri, 1 Jun 2012 16:44:34 -0400

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

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.