Mercurial > public > mercurial-scm > hg-stable
comparison tests/testlib/ext-stream-clone-steps.py @ 52391:3f0cf7bb3086
stream: preserve volatile cache early
Since cache file are not protected by the lock, their state might change between
their initial detection, the computation of their size and they preservation by
the VolatileManager. So we gather all theses step in a single one to avoid such
race.
This also handle disappearing cache file in the "copy/hardlink" clone cases.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 04 Dec 2024 23:31:46 +0100 |
parents | 11484a19cd77 |
children |
comparison
equal
deleted
inserted
replaced
52390:11484a19cd77 | 52391:3f0cf7bb3086 |
---|---|
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'] | |
25 WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2'] | |
24 WALKED_FILE_3 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_3'] | 26 WALKED_FILE_3 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_3'] |
25 WALKED_FILE_4 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_4'] | 27 WALKED_FILE_4 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_4'] |
28 | |
29 | |
30 def _test_sync_point_walk_1_2(orig, repo): | |
31 testing.write_file(WALKED_FILE_1) | |
32 testing.wait_file(WALKED_FILE_2) | |
26 | 33 |
27 | 34 |
28 def _test_sync_point_walk_3(orig, repo): | 35 def _test_sync_point_walk_3(orig, repo): |
29 testing.write_file(WALKED_FILE_3) | 36 testing.write_file(WALKED_FILE_3) |
30 | 37 |
34 testing.wait_file(WALKED_FILE_4) | 41 testing.wait_file(WALKED_FILE_4) |
35 | 42 |
36 | 43 |
37 def uisetup(ui): | 44 def uisetup(ui): |
38 extensions.wrapfunction( | 45 extensions.wrapfunction( |
46 streamclone, '_test_sync_point_walk_1_2', _test_sync_point_walk_1_2 | |
47 ) | |
48 | |
49 extensions.wrapfunction( | |
39 streamclone, '_test_sync_point_walk_3', _test_sync_point_walk_3 | 50 streamclone, '_test_sync_point_walk_3', _test_sync_point_walk_3 |
40 ) | 51 ) |
41 | 52 |
42 extensions.wrapfunction( | 53 extensions.wrapfunction( |
43 streamclone, '_test_sync_point_walk_4', _test_sync_point_walk_4 | 54 streamclone, '_test_sync_point_walk_4', _test_sync_point_walk_4 |