Mercurial > evolve
comparison tests/test-doctest.py @ 6864:16fd24f6cf22 stable
tests: use system hg by restoring environment in test-doctest.py
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 11 Oct 2024 11:40:47 +0200 |
parents | 7ad8107d953a |
children |
comparison
equal
deleted
inserted
replaced
6863:c7f37762eab1 | 6864:16fd24f6cf22 |
---|---|
65 sys.path.insert(0, cwd) | 65 sys.path.insert(0, cwd) |
66 | 66 |
67 if not os.path.isdir(os.path.join(cwd, ".hg")): | 67 if not os.path.isdir(os.path.join(cwd, ".hg")): |
68 sys.exit(0) | 68 sys.exit(0) |
69 | 69 |
70 files = subprocess.check_output( | 70 files_cmd = 'hg files --print0 "%s"' % fileset |
71 "hg files --print0 \"%s\"" % fileset, | 71 |
72 shell=True, | 72 # we prefer system hg for reading the repository, unless we're on python2 |
73 cwd=cwd, | 73 # because then we assume that system hg is too old (this is not always true, |
74 ).split(b'\0') | 74 # but it's an easy check and works well enough for us) |
75 if ispy3 and 'HGTEST_RESTOREENV': | |
76 files_cmd = '. $HGTEST_RESTOREENV; ' + files_cmd | |
77 | |
78 files = subprocess.check_output(files_cmd, shell=True, cwd=cwd).split(b'\0') | |
75 | 79 |
76 if sys.version_info[0] >= 3: | 80 if sys.version_info[0] >= 3: |
77 cwd = os.fsencode(cwd) | 81 cwd = os.fsencode(cwd) |
78 | 82 |
79 mods_tested = set() | 83 mods_tested = set() |