[PATCH] tests: remove python link during cleanup

Mads Kiilerich mads at kiilerich.com
Fri Nov 15 20:06:46 CST 2013


On 11/15/2013 08:35 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley at gmail.com>
> # Date 1384462134 18000
> #      Thu Nov 14 15:48:54 2013 -0500
> # Node ID 38c5f62b663a4e1f2d0a301fbfd8aa375caa218d
> # Parent  c38c3fdc8b9317ba09e03ab09364c3800da7c50c
> tests: remove python link during cleanup

Why? What problem do it solve?

Why should python be removed from BINDIR if the other things we do with 
BINDIR shouldn't?

And how secure will this be if run-tests is run with --with-hg pointing 
at a hg installed somewhere special?

(Run-tests is fragile and could use some major clean-ups. Apparently 
good changes like this can easily break other obscure use cases.)

/Mads

> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -415,10 +415,15 @@
>   def killdaemons(pidfile):
>       return killmod.killdaemons(pidfile, tryhard=False, remove=True,
>                                  logfn=vlog)
>   
>   def cleanup(options):
> +    pyexename = sys.platform == 'win32' and 'python.exe' or 'python'
> +    mypython = os.path.join(BINDIR, pyexename)
> +    if os.path.isfile(mypython):
> +        os.remove(mypython)
> +
>       if not options.keep_tmpdir:
>           vlog("# Cleaning up HGTMP", HGTMP)
>           shutil.rmtree(HGTMP, True)
>   
>   def usecorrectpython():
>




More information about the Mercurial-devel mailing list