def iter_entries(cls, stream: Union[str, "BytesIO", mmap]) -> Iterator[RefLogEntry]:
        """
        :return:
            Iterator yielding :class:`RefLogEntry` instances, one for each line read
            from the given stream.

        :param stream:
            File-like object containing the revlog in its native format or string
            instance pointing to a file to read.
        """
        new_entry = RefLogEntry.from_line
        if isinstance(stream, str):
            # Default args return mmap since Python 3.
            _stream = file_contents_ro_filepath(stream)
            assert isinstance(_stream, mmap)
        else:
            _stream = stream
        # END handle stream type
        while True:
            line = _stream.readline()
            if not line:
                return
            yield new_entry(line.strip())
        # END endless loop

        :return:
            Iterator yielding :class:`RefLogEntry` instances, one for each line read
            from the given stream.

        :param stream:
            File-like object containing the revlog in its native format or string
            instance pointing to a file to read.
        
git/refs/log.py