# Path: vcs/utils/compat.py
# class deque(object):
# class _Condition(_Verbose):
# class _Event(_Verbose):
#     def __init__(self, iterable=(), maxlen= -1):
#     def append(self, x):
#     def appendleft(self, x):
#     def pop(self):
#     def popleft(self):
#     def clear(self):
#     def extend(self, iterable):
#     def extendleft(self, iterable):
#     def rotate(self, n=1):
#     def __getitem__(self, i):
#     def __setitem__(self, i, value):
#     def __delitem__(self, i):
#     def __len__(self):
#     def __cmp__(self, other):
#     def __repr__(self, _track=[]):
#     def __getstate__(self):
#     def __setstate__(self, s):
#     def __hash__(self):
#     def __copy__(self):
#     def __deepcopy__(self, memo={}):
# def Condition(*args, **kwargs):
#     def __init__(self, lock=None, verbose=None):
#     def __enter__(self):
#     def __exit__(self, *args):
#     def __repr__(self):
#     def _release_save(self):
#     def _acquire_restore(self, x):
#     def _is_owned(self):
#     def wait(self, timeout=None):
#     def notify(self, n=1):
#     def notifyAll(self):
# def Event(*args, **kwargs):
#     def __init__(self, verbose=None):
#     def isSet(self):
#     def set(self):
#     def clear(self):
#     def wait(self, timeout=None):


import os
import subprocess
from vcs.utils.compat import deque, Event, Thread, _bytes, _bytearray

git_http_backend.py Project is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 2.1 of the License,
or (at your option) any later version.

git_http_backend.py Project is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with git_http_backend.py Project.
If not, see <http://www.gnu.org/licenses/>.
'''


class StreamFeeder(Thread):
    """
    Normal writing into pipe-like is blocking once the buffer is filled.
    This thread allows a thread to seep data from a file-like into a pipe
    without blocking the main thread.
    We close inpipe once the end of the source stream is reached.
    """
    def __init__(self, source):
        super(StreamFeeder, self).__init__()
        self.daemon = True
        filelike = False
        self.bytes = _bytes()
        if type(source) in (type(''), _bytes, _bytearray):  # string-like

# Path: vcs/utils/compat.py
# class deque(object):
# class _Condition(_Verbose):
# class _Event(_Verbose):
#     def __init__(self, iterable=(), maxlen= -1):
#     def append(self, x):
#     def appendleft(self, x):
#     def pop(self):
#     def popleft(self):
#     def clear(self):
#     def extend(self, iterable):
#     def extendleft(self, iterable):
#     def rotate(self, n=1):
#     def __getitem__(self, i):
#     def __setitem__(self, i, value):
#     def __delitem__(self, i):
#     def __len__(self):
#     def __cmp__(self, other):
#     def __repr__(self, _track=[]):
#     def __getstate__(self):
#     def __setstate__(self, s):
#     def __hash__(self):
#     def __copy__(self):
#     def __deepcopy__(self, memo={}):
# def Condition(*args, **kwargs):
#     def __init__(self, lock=None, verbose=None):
#     def __enter__(self):
#     def __exit__(self, *args):
#     def __repr__(self):
#     def _release_save(self):
#     def _acquire_restore(self, x):
#     def _is_owned(self):
#     def wait(self, timeout=None):
#     def notify(self, n=1):
#     def notifyAll(self):
# def Event(*args, **kwargs):
#     def __init__(self, verbose=None):
#     def isSet(self):
#     def set(self):
#     def clear(self):
#     def wait(self, timeout=None):


# Path: vcs/subprocessio.py
import os
import subprocess
from vcs.utils.compat import deque, Event, Thread, _bytes, _bytearray


git_http_backend.py Project is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 2.1 of the License,
or (at your option) any later version.

git_http_backend.py Project is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with git_http_backend.py Project.
If not, see <http://www.gnu.org/licenses/>.
'''


class StreamFeeder(Thread):
    """
    Normal writing into pipe-like is blocking once the buffer is filled.
    This thread allows a thread to seep data from a file-like into a pipe
    without blocking the main thread.
    We close inpipe once the end of the source stream is reached.
    """
    def __init__(self, source):
        super(StreamFeeder, self).__init__()
        self.daemon = True
        filelike = False
        self.bytes = _bytes()
        if type(source) in (type(''), _bytes, _bytearray):  # string-like

            self.bytes = _bytes(source)