tests/testlib/ext-stream-clone-steps.py
author Anton Shestakov <av6@dwimlabs.net>
Mon, 09 Jan 2023 18:09:36 +0400
branchstable
changeset 49870 9c7fb04843b5
parent 48875 6000f5b25c9b
child 50624 c2633c69cbe0
permissions -rw-r--r--
tests: optional PEP 657 error location in test-extension.t (issue6781)

from mercurial import (
    encoding,
    extensions,
    streamclone,
    testing,
)


WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1']
WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2']


def _test_sync_point_walk_1(orig, repo):
    testing.write_file(WALKED_FILE_1)


def _test_sync_point_walk_2(orig, repo):
    assert repo._currentlock(repo._lockref) is None
    testing.wait_file(WALKED_FILE_2)


def uisetup(ui):
    extensions.wrapfunction(
        streamclone, '_test_sync_point_walk_1', _test_sync_point_walk_1
    )

    extensions.wrapfunction(
        streamclone, '_test_sync_point_walk_2', _test_sync_point_walk_2
    )