Show More
@@ -1956,41 +1956,45 b' class TestRunner(object):' | |||
|
1956 | 1956 | This will also configure hg with the appropriate testing settings. |
|
1957 | 1957 | """ |
|
1958 | 1958 | vlog("# Performing temporary installation of HG") |
|
1959 | installerrs = os.path.join("tests", "install.err") | |
|
1959 | installerrs = os.path.join(b"tests", b"install.err") | |
|
1960 | 1960 | compiler = '' |
|
1961 | 1961 | if self.options.compiler: |
|
1962 | 1962 | compiler = '--compiler ' + self.options.compiler |
|
1963 | 1963 | if self.options.pure: |
|
1964 | pure = "--pure" | |
|
1964 | pure = b"--pure" | |
|
1965 | 1965 | else: |
|
1966 | pure = "" | |
|
1966 | pure = b"" | |
|
1967 | 1967 | py3 = '' |
|
1968 | if sys.version_info[0] == 3: | |
|
1969 | py3 = '--c2to3' | |
|
1970 | 1968 | |
|
1971 | 1969 | # Run installer in hg root |
|
1972 | 1970 | script = os.path.realpath(sys.argv[0]) |
|
1971 | exe = sys.executable | |
|
1972 | if sys.version_info[0] == 3: | |
|
1973 | py3 = b'--c2to3' | |
|
1974 | compiler = compiler.encode('utf-8') | |
|
1975 | script = script.encode('utf-8') | |
|
1976 | exe = exe.encode('utf-8') | |
|
1973 | 1977 | hgroot = os.path.dirname(os.path.dirname(script)) |
|
1974 | 1978 | self._hgroot = hgroot |
|
1975 | 1979 | os.chdir(hgroot) |
|
1976 | nohome = '--home=""' | |
|
1980 | nohome = b'--home=""' | |
|
1977 | 1981 | if os.name == 'nt': |
|
1978 | 1982 | # The --home="" trick works only on OS where os.sep == '/' |
|
1979 | 1983 | # because of a distutils convert_path() fast-path. Avoid it at |
|
1980 | 1984 | # least on Windows for now, deal with .pydistutils.cfg bugs |
|
1981 | 1985 | # when they happen. |
|
1982 | nohome = '' | |
|
1983 | cmd = ('%(exe)s setup.py %(py3)s %(pure)s clean --all' | |
|
1984 | ' build %(compiler)s --build-base="%(base)s"' | |
|
1985 | ' install --force --prefix="%(prefix)s"' | |
|
1986 | ' --install-lib="%(libdir)s"' | |
|
1987 | ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1' | |
|
1988 |
% {'exe': |
|
|
1989 | 'compiler': compiler, | |
|
1990 | 'base': os.path.join(self._hgtmp, b"build"), | |
|
1991 | 'prefix': self._installdir, 'libdir': self._pythondir, | |
|
1992 | 'bindir': self._bindir, | |
|
1993 | 'nohome': nohome, 'logfile': installerrs}) | |
|
1986 | nohome = b'' | |
|
1987 | cmd = (b'%(exe)s setup.py %(py3)s %(pure)s clean --all' | |
|
1988 | b' build %(compiler)s --build-base="%(base)s"' | |
|
1989 | b' install --force --prefix="%(prefix)s"' | |
|
1990 | b' --install-lib="%(libdir)s"' | |
|
1991 | b' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1' | |
|
1992 | % {b'exe': exe, b'py3': py3, b'pure': pure, | |
|
1993 | b'compiler': compiler, | |
|
1994 | b'base': os.path.join(self._hgtmp, b"build"), | |
|
1995 | b'prefix': self._installdir, b'libdir': self._pythondir, | |
|
1996 | b'bindir': self._bindir, | |
|
1997 | b'nohome': nohome, b'logfile': installerrs}) | |
|
1994 | 1998 | |
|
1995 | 1999 | # setuptools requires install directories to exist. |
|
1996 | 2000 | def makedirs(p): |
@@ -2030,16 +2034,16 b' class TestRunner(object):' | |||
|
2030 | 2034 | f.write(line + '\n') |
|
2031 | 2035 | f.close() |
|
2032 | 2036 | |
|
2033 | hgbat = os.path.join(self._bindir, 'hg.bat') | |
|
2037 | hgbat = os.path.join(self._bindir, b'hg.bat') | |
|
2034 | 2038 | if os.path.isfile(hgbat): |
|
2035 | 2039 | # hg.bat expects to be put in bin/scripts while run-tests.py |
|
2036 | 2040 | # installation layout put it in bin/ directly. Fix it |
|
2037 | 2041 | f = open(hgbat, 'rb') |
|
2038 | 2042 | data = f.read() |
|
2039 | 2043 | f.close() |
|
2040 | if '"%~dp0..\python" "%~dp0hg" %*' in data: | |
|
2041 | data = data.replace('"%~dp0..\python" "%~dp0hg" %*', | |
|
2042 | '"%~dp0python" "%~dp0hg" %*') | |
|
2044 | if b'"%~dp0..\python" "%~dp0hg" %*' in data: | |
|
2045 | data = data.replace(b'"%~dp0..\python" "%~dp0hg" %*', | |
|
2046 | b'"%~dp0python" "%~dp0hg" %*') | |
|
2043 | 2047 | f = open(hgbat, 'wb') |
|
2044 | 2048 | f.write(data) |
|
2045 | 2049 | f.close() |
@@ -2071,7 +2075,7 b' class TestRunner(object):' | |||
|
2071 | 2075 | # The pythondir has been inferred from --with-hg flag. |
|
2072 | 2076 | # We cannot expect anything sensible here. |
|
2073 | 2077 | return |
|
2074 | expecthg = os.path.join(self._pythondir, 'mercurial') | |
|
2078 | expecthg = os.path.join(self._pythondir, b'mercurial') | |
|
2075 | 2079 | actualhg = self._gethgpath() |
|
2076 | 2080 | if os.path.abspath(actualhg) != os.path.abspath(expecthg): |
|
2077 | 2081 | sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n' |
General Comments 0
You need to be logged in to leave comments.
Login now