If we want to know that something happened, we should simply track that this
things happened.
This will be useful to start using tmpbindir more in a different form.
hg-reviewers |
If we want to know that something happened, we should simply track that this
things happened.
This will be useful to start using tmpbindir more in a different form.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | tests/run-tests.py (7 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
6b1dc42977be | 7d8f78687add | Pierre-Yves David | Jul 9 2021, 10:18 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | Alphare | ||
Closed | marmoute | ||
Abandoned | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | D11067 windows: use abspath in url | |
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | Alphare | ||
Closed | Alphare |
self._hgroot = None | self._hgroot = None | ||||
self._testdir = None | self._testdir = None | ||||
self._outputdir = None | self._outputdir = None | ||||
self._hgtmp = None | self._hgtmp = None | ||||
self._installdir = None | self._installdir = None | ||||
self._bindir = None | self._bindir = None | ||||
self._tmpbindir = None | self._tmpbindir = None | ||||
self._pythondir = None | self._pythondir = None | ||||
# True if we had to infer the pythondir from --with-hg | |||||
self._pythondir_inferred = False | |||||
self._coveragefile = None | self._coveragefile = None | ||||
self._createdfiles = [] | self._createdfiles = [] | ||||
self._hgcommand = None | self._hgcommand = None | ||||
self._hgpath = None | self._hgpath = None | ||||
self._portoffset = 0 | self._portoffset = 0 | ||||
self._ports = {} | self._ports = {} | ||||
def run(self, args, parser=None): | def run(self, args, parser=None): | ||||
# If it looks like our in-repo Rust binary, use the source root. | # If it looks like our in-repo Rust binary, use the source root. | ||||
# This is a bit hacky. But rhg is still not supported outside the | # This is a bit hacky. But rhg is still not supported outside the | ||||
# source directory. So until it is, do the simple thing. | # source directory. So until it is, do the simple thing. | ||||
elif re.search(b'/rust/target/[^/]+/hg', normbin): | elif re.search(b'/rust/target/[^/]+/hg', normbin): | ||||
self._pythondir = os.path.dirname(self._testdir) | self._pythondir = os.path.dirname(self._testdir) | ||||
# Fall back to the legacy behavior. | # Fall back to the legacy behavior. | ||||
else: | else: | ||||
self._pythondir = self._bindir | self._pythondir = self._bindir | ||||
self._pythondir_inferred = True | |||||
else: | else: | ||||
self._installdir = os.path.join(self._hgtmp, b"install") | self._installdir = os.path.join(self._hgtmp, b"install") | ||||
self._bindir = os.path.join(self._installdir, b"bin") | self._bindir = os.path.join(self._installdir, b"bin") | ||||
self._hgcommand = b'hg' | self._hgcommand = b'hg' | ||||
self._tmpbindir = self._bindir | self._tmpbindir = self._bindir | ||||
self._pythondir = os.path.join(self._installdir, b"lib", b"python") | self._pythondir = os.path.join(self._installdir, b"lib", b"python") | ||||
if e.errno != errno.EEXIST: | if e.errno != errno.EEXIST: | ||||
raise | raise | ||||
osenvironb[b'COVERAGE_DIR'] = covdir | osenvironb[b'COVERAGE_DIR'] = covdir | ||||
def _checkhglib(self, verb): | def _checkhglib(self, verb): | ||||
"""Ensure that the 'mercurial' package imported by python is | """Ensure that the 'mercurial' package imported by python is | ||||
the one we expect it to be. If not, print a warning to stderr.""" | the one we expect it to be. If not, print a warning to stderr.""" | ||||
if (self._bindir == self._pythondir) and ( | if self._pythondir_inferred: | ||||
self._bindir != self._tmpbindir | |||||
): | |||||
# The pythondir has been inferred from --with-hg flag. | # The pythondir has been inferred from --with-hg flag. | ||||
# We cannot expect anything sensible here. | # We cannot expect anything sensible here. | ||||
return | return | ||||
expecthg = os.path.join(self._pythondir, b'mercurial') | expecthg = os.path.join(self._pythondir, b'mercurial') | ||||
actualhg = self._gethgpath() | actualhg = self._gethgpath() | ||||
if os.path.abspath(actualhg) != os.path.abspath(expecthg): | if os.path.abspath(actualhg) != os.path.abspath(expecthg): | ||||
sys.stderr.write( | sys.stderr.write( | ||||
'warning: %s with unexpected mercurial lib: %s\n' | 'warning: %s with unexpected mercurial lib: %s\n' |