Mercurial > hg
comparison tests/test-parseindex.t @ 39707:5abc47d4ca6b
tests: quote PYTHON usage
Python3 defaults to installing under "Program Files".
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 18 Sep 2018 23:47:21 -0400 |
parents | 828a45233036 |
children | ef6cab7930b3 |
comparison
equal
deleted
inserted
replaced
39706:030d558c6456 | 39707:5abc47d4ca6b |
---|---|
59 > cl = changelog.changelog(opener('.hg/store')) | 59 > cl = changelog.changelog(opener('.hg/store')) |
60 > print(len(cl), 'revisions:') | 60 > print(len(cl), 'revisions:') |
61 > for r in cl: | 61 > for r in cl: |
62 > print(short(cl.node(r))) | 62 > print(short(cl.node(r))) |
63 > EOF | 63 > EOF |
64 $ $PYTHON test.py | 64 $ "$PYTHON" test.py |
65 2 revisions: | 65 2 revisions: |
66 7c31755bf9b5 | 66 7c31755bf9b5 |
67 26333235a41c | 67 26333235a41c |
68 | 68 |
69 $ cd .. | 69 $ cd .. |
72 | 72 |
73 Test SEGV caused by bad revision passed to reachableroots() (issue4775): | 73 Test SEGV caused by bad revision passed to reachableroots() (issue4775): |
74 | 74 |
75 $ cd a | 75 $ cd a |
76 | 76 |
77 $ $PYTHON <<EOF | 77 $ "$PYTHON" <<EOF |
78 > from __future__ import print_function | 78 > from __future__ import print_function |
79 > from mercurial import changelog, vfs | 79 > from mercurial import changelog, vfs |
80 > cl = changelog.changelog(vfs.vfs('.hg/store')) | 80 > cl = changelog.changelog(vfs.vfs('.hg/store')) |
81 > print('good heads:') | 81 > print('good heads:') |
82 > for head in [0, len(cl) - 1, -1]: | 82 > for head in [0, len(cl) - 1, -1]: |
135 | 135 |
136 $ hg clone --pull -q --config phases.publish=False ../a limit | 136 $ hg clone --pull -q --config phases.publish=False ../a limit |
137 $ hg clone --pull -q --config phases.publish=False ../a segv | 137 $ hg clone --pull -q --config phases.publish=False ../a segv |
138 $ rm -R limit/.hg/cache segv/.hg/cache | 138 $ rm -R limit/.hg/cache segv/.hg/cache |
139 | 139 |
140 $ $PYTHON <<EOF | 140 $ "$PYTHON" <<EOF |
141 > data = open("limit/.hg/store/00changelog.i", "rb").read() | 141 > data = open("limit/.hg/store/00changelog.i", "rb").read() |
142 > for n, p in [(b'limit', b'\0\0\0\x02'), (b'segv', b'\0\x01\0\0')]: | 142 > for n, p in [(b'limit', b'\0\0\0\x02'), (b'segv', b'\0\x01\0\0')]: |
143 > # corrupt p1 at rev0 and p2 at rev1 | 143 > # corrupt p1 at rev0 and p2 at rev1 |
144 > d = data[:24] + p + data[28:127 + 28] + p + data[127 + 32:] | 144 > d = data[:24] + p + data[28:127 + 28] + p + data[127 + 32:] |
145 > open(n + b"/.hg/store/00changelog.i", "wb").write(d) | 145 > open(n + b"/.hg/store/00changelog.i", "wb").write(d) |
186 > print('uncaught buffer overflow?') | 186 > print('uncaught buffer overflow?') |
187 > except ValueError as inst: | 187 > except ValueError as inst: |
188 > print(inst) | 188 > print(inst) |
189 > EOF | 189 > EOF |
190 | 190 |
191 $ $PYTHON test.py limit/.hg/store | 191 $ "$PYTHON" test.py limit/.hg/store |
192 reachableroots: parent out of range | 192 reachableroots: parent out of range |
193 compute_phases_map_sets: parent out of range | 193 compute_phases_map_sets: parent out of range |
194 index_headrevs: parent out of range | 194 index_headrevs: parent out of range |
195 find_gca_candidates: parent out of range | 195 find_gca_candidates: parent out of range |
196 find_deepest: parent out of range | 196 find_deepest: parent out of range |
197 $ $PYTHON test.py segv/.hg/store | 197 $ "$PYTHON" test.py segv/.hg/store |
198 reachableroots: parent out of range | 198 reachableroots: parent out of range |
199 compute_phases_map_sets: parent out of range | 199 compute_phases_map_sets: parent out of range |
200 index_headrevs: parent out of range | 200 index_headrevs: parent out of range |
201 find_gca_candidates: parent out of range | 201 find_gca_candidates: parent out of range |
202 find_deepest: parent out of range | 202 find_deepest: parent out of range |