comparison tests/test-doctest.py @ 6919:6859ed744625 mercurial-5.1

test-compat: merge mercurial-5.2 into mercurial-5.1
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 25 Oct 2024 17:55:54 +0400
parents 16fd24f6cf22
children
comparison
equal deleted inserted replaced
6814:c203bc3114bb 6919:6859ed744625
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()