tests/testlib/ext-stream-clone-steps.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 22 Sep 2022 01:50:53 +0200
changeset 49497 1baf0fffd82f
parent 48875 6000f5b25c9b
child 50624 c2633c69cbe0
permissions -rw-r--r--
run-tests: display the time it took to install Mercurial It will help make people aware of this critical step and to assess the time it takes in various options (like a CI run for example).

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
    )