# HG changeset patch # User Manuel Jacob # Date 1653492196 -7200 # Node ID cdb85d0512b81031d4a7b30d6a5ddbe69ef1a876 # Parent 13e523228623db859c6c63ab7d4c0984d45c4789 branching: fix wrong merge conflict resolution from 13dfad0f9f7a 13dfad0f9f7a merged stable into default, but accidentally added the _blockingreader class from stable (but deindented) instead of merging the changes from stable (2fe4efaa59af) into the existing _blockingreader class. This resulted in the _blockingreader being there two times. diff -r 13e523228623 -r cdb85d0512b8 mercurial/worker.py --- a/mercurial/worker.py Thu May 19 00:51:36 2022 +0100 +++ b/mercurial/worker.py Wed May 25 17:23:16 2022 +0200 @@ -68,7 +68,7 @@ return threading.current_thread() == threading.main_thread() -class _blockingreader(object): +class _blockingreader: def __init__(self, wrapped): self._wrapped = wrapped @@ -114,37 +114,6 @@ return bytes(buf) -class _blockingreader: - def __init__(self, wrapped): - self._wrapped = wrapped - - # Do NOT implement readinto() by making it delegate to - # _wrapped.readinto(), since that is unbuffered. The unpickler is fine - # with just read() and readline(), so we don't need to implement it. - - def readline(self): - return self._wrapped.readline() - - # issue multiple reads until size is fulfilled - def read(self, size=-1): - if size < 0: - return self._wrapped.readall() - - buf = bytearray(size) - view = memoryview(buf) - pos = 0 - - while pos < size: - ret = self._wrapped.readinto(view[pos:]) - if not ret: - break - pos += ret - - del view - del buf[pos:] - return bytes(buf) - - if pycompat.isposix or pycompat.iswindows: _STARTUP_COST = 0.01 # The Windows worker is thread based. If tasks are CPU bound, threads