Mercurial > public > mercurial-scm > hg-stable
comparison tests/testlib/ext-stream-clone-steps.py @ 52390:11484a19cd77
stream: rename all test hook point one number up
This leave room for a new hook point earlier to detect some race condition with
caches.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 04 Dec 2024 17:13:39 +0100 |
parents | c2633c69cbe0 |
children | 3f0cf7bb3086 |
comparison
equal
deleted
inserted
replaced
52389:a260d326458f | 52390:11484a19cd77 |
---|---|
1 # A utility extension that help taking a break during streamclone operation | 1 # A utility extension that help taking a break during streamclone operation |
2 # | 2 # |
3 # This extension is used through two environment variable | 3 # This extension is used through two environment variable |
4 # | 4 # |
5 # HG_TEST_STREAM_WALKED_FILE_1 | 5 # HG_TEST_STREAM_WALKED_FILE_3 |
6 # | 6 # |
7 # path of a file created by the process generating the streaming clone when | 7 # path of a file created by the process generating the streaming clone when |
8 # it is done gathering data and is ready to unlock the repository and move | 8 # it is done gathering data and is ready to unlock the repository and move |
9 # to the streaming of content. | 9 # to the streaming of content. |
10 # | 10 # |
11 # HG_TEST_STREAM_WALKED_FILE_2 | 11 # HG_TEST_STREAM_WALKED_FILE_4 |
12 # | 12 # |
13 # path of a file to be manually created to let the process generating the | 13 # path of a file to be manually created to let the process generating the |
14 # streaming clone proceed to streaming file content. | 14 # streaming clone proceed to streaming file content. |
15 | 15 |
16 from mercurial import ( | 16 from mercurial import ( |
19 streamclone, | 19 streamclone, |
20 testing, | 20 testing, |
21 ) | 21 ) |
22 | 22 |
23 | 23 |
24 WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1'] | 24 WALKED_FILE_3 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_3'] |
25 WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2'] | 25 WALKED_FILE_4 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_4'] |
26 | 26 |
27 | 27 |
28 def _test_sync_point_walk_1(orig, repo): | 28 def _test_sync_point_walk_3(orig, repo): |
29 testing.write_file(WALKED_FILE_1) | 29 testing.write_file(WALKED_FILE_3) |
30 | 30 |
31 | 31 |
32 def _test_sync_point_walk_2(orig, repo): | 32 def _test_sync_point_walk_4(orig, repo): |
33 assert repo._currentlock(repo._lockref) is None | 33 assert repo._currentlock(repo._lockref) is None |
34 testing.wait_file(WALKED_FILE_2) | 34 testing.wait_file(WALKED_FILE_4) |
35 | 35 |
36 | 36 |
37 def uisetup(ui): | 37 def uisetup(ui): |
38 extensions.wrapfunction( | 38 extensions.wrapfunction( |
39 streamclone, '_test_sync_point_walk_1', _test_sync_point_walk_1 | 39 streamclone, '_test_sync_point_walk_3', _test_sync_point_walk_3 |
40 ) | 40 ) |
41 | 41 |
42 extensions.wrapfunction( | 42 extensions.wrapfunction( |
43 streamclone, '_test_sync_point_walk_2', _test_sync_point_walk_2 | 43 streamclone, '_test_sync_point_walk_4', _test_sync_point_walk_4 |
44 ) | 44 ) |