HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/gitdb/__pycache__/base.cpython-310.pyc
o

;jW�@s�dZddlmZddlmZmZdZGdd�de�ZGdd�de�Z	Gd	d
�d
e	�Z
Gdd�de�ZGd
d�de�ZGdd�de	�Z
Gdd�de
�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)zPModule with basic data structures - they are designed to be lightweight and fast���
bin_to_hex)�type_id_to_type_map�type_to_type_id_map)	�OInfo�	OPackInfo�ODeltaPackInfo�OStream�OPackStream�ODeltaPackStream�IStream�InvalidOInfo�InvalidOStreamc@sbeZdZdZe�Zdd�Zdd�Zedd��Z	edd	��Z
ed
d��Zedd
��Zedd��Z
dS)ra�Carries information about an object in an ODB, providing information
    about the binary sha of the object, the type_string as well as the uncompressed size
    in bytes.

    It can be accessed using tuple notation and using attribute access notation::

        assert dbi[0] == dbi.binsha
        assert dbi[1] == dbi.type
        assert dbi[2] == dbi.size

    The type is designed to be as lightweight as possible.cC�t�||||f�S�N��tuple�__new__)�cls�sha�type�size�r�>/opt/saltstack/salt/lib/python3.10/site-packages/gitdb/base.pyr#�z
OInfo.__new__cG�t�|�dSr�r�__init__��self�argsrrrr&�zOInfo.__init__cC�|dS)z$:return: our sha as binary, 20 bytesrr�rrrr�binsha*�zOInfo.binshacC�t|d�S�z':return: our sha, hex encoded, 40 bytesrrr#rrr�hexsha/�zOInfo.hexshacCr"�N�rr#rrrr4�z
OInfo.typecC�t|dSr*)rr#rrr�type_id8�z
OInfo.type_idcCr"�N�rr#rrrr<r,z
OInfo.sizeN)�__name__�
__module__�__qualname__�__doc__r�	__slots__rr�propertyr$r(rr.rrrrrrs



rc@sVeZdZdZe�Zdd�Zdd�Zedd��Z	edd	��Z
ed
d��Zedd
��ZdS)ra`As OInfo, but provides a type_id property to retrieve the numerical type id, and
    does not include a sha.

    Additionally, the pack_offset is the absolute offset into the packfile at which
    all object information is located. The data_offset property points to the absolute
    location in the pack at which that actual data stream can be found.cCrrr)r�
packoffsetrrrrrrLrzOPackInfo.__new__cGrrrrrrrrOr!zOPackInfo.__init__cCr"�Nrrr#rrr�pack_offsetTr,zOPackInfo.pack_offsetcCr-r*)rr#rrrrXr/zOPackInfo.typecCr"r*rr#rrrr.\r,zOPackInfo.type_idcCr"r0rr#rrrr`r,zOPackInfo.sizeN)
r2r3r4r5rr6rrr7r:rr.rrrrrrBs


rc@s*eZdZdZe�Zdd�Zedd��ZdS)rz�Adds delta specific information,
    Either the 20 byte sha which points to some object in the database,
    or the negative offset from the pack_offset, so that pack_offset - delta_info yields
    the pack offset of the base objectcC�t�|||||f�Srr)rr8rr�
delta_inforrrro�zODeltaPackInfo.__new__cCr"�N�rr#rrrr<sr,zODeltaPackInfo.delta_infoN)	r2r3r4r5rr6rr7r<rrrrrgsrc@s<eZdZdZe�Zdd�Zdd�Zddd�Ze	d	d
��Z
dS)
r	z�Base for object streams retrieved from the database, providing additional
    information about the stream.
    Generally, ODB streams are read-only as objects are immutablecOr;�z+Helps with the initialization of subclassesr�rrrr�streamr �kwargsrrrr��zOStream.__new__cOrrr)rr rCrrrr�r!zOStream.__init__���cC�|d�|�Sr>��read�rrrrrrH�r!zOStream.readcCr"r>rr#rrrrB�r,zOStream.streamN�rE)r2r3r4r5rr6rrrHr7rBrrrrr	ys
r	c@s$eZdZdZdd�Zedd��ZdS)�ODeltaStreamz,Uses size info of its stream, delaying readscOr;r@rrArrrr�rDzODeltaStream.__new__cCs
|djSr>)rr#rrrr�s
zODeltaStream.sizeN)r2r3r4r5rr7rrrrrrK�s
rKc@�4eZdZdZe�Zdd�Zd
dd�Zedd��Z	d	S)r
z_Next to pack object information, a stream outputting an undeltified base object
    is providedcGr;r@r)rr8rrrBr rrrr�rDzOPackStream.__new__rEcCrFr>rGrIrrrrH�r!zOPackStream.readcCr"r>rr#rrrrB�r,zOPackStream.streamNrJ�
r2r3r4r5rr6rrHr7rBrrrrr
�s
r
c@rL)rzFProvides a stream outputting the uncompressed offset delta informationcCst�||||||f�Srr)rr8rrr<rBrrrr��zODeltaPackStream.__new__rEcCrF�N�rGrIrrrrH�r!zODeltaPackStream.readcCr"rOrr#rrrrB�r,zODeltaPackStream.streamNrJrMrrrrr�s
rc@s�eZdZdZe�Zd dd�Zd dd�Zedd��Z	d	d
�Z
dd�Zee
e�Zd!dd�Z
dd�Zdd�Zeee�Zdd�Zdd�Zeee�Zdd�Zdd�Zeee�Zdd�Zdd�Zeee�ZdS)"ragRepresents an input content stream to be fed into the ODB. It is mutable to allow
    the ODB to record information about the operations outcome right in this instance.

    It provides interfaces for the OStream and a StreamReader to allow the instance
    to blend in without prior conversion.

    The only method your content stream must support is 'read'NcCst�|||||df�Sr)�listr)rrrrBrrrrr�rNzIStream.__new__cCst�|||||df�dSr)rQr)rrrrBrrrrr�szIStream.__init__cCr&r'rr#rrrr(�r)zIStream.hexshacCr")zD:return: the error that occurred when processing the stream, or NonerPrr#rrr�_error�r,zIStream._errorcCs||d<dS)zFSet this input stream to the given exc, may be None to reset the errorrPNr)r�excrrr�
_set_error�r/zIStream._set_errorrEcCrF)zhImplements a simple stream reader interface, passing the read call on
            to our internal streamr?rGrIrrrrH�szIStream.readcC�||d<dSr9r)rr$rrr�_set_binsha��zIStream._set_binshacCr"r9rr#rrr�_binsha��zIStream._binshacCr"r*rr#rrr�_typerYz
IStream._typecCrUr*r)rrrrr�	_set_typerWzIStream._set_typecCr"r0rr#rrr�_sizerYz
IStream._sizecCrUr0rrIrrr�	_set_sizerWzIStream._set_sizecCr"r>rr#rrr�_streamrYzIStream._streamcCrUr>r)rrBrrr�_set_streamrWzIStream._set_streamrrJ)r2r3r4r5rr6rrr7r(rRrT�errorrHrVrXr$rZr[rr\r]rr^r_rBrrrrr�s.




	


rc@sJeZdZdZe�Zdd�Zdd�Zedd��Z	edd	��Z
ed
d��ZdS)
r
z�Carries information about a sha identifying an object which is invalid in
    the queried database. The exception attribute provides more information about
    the cause of the issuecCst�|||f�Srr)rrrSrrrr"szInvalidOInfo.__new__cCst�|||f�dSrr)rrrSrrrr%r=zInvalidOInfo.__init__cCr"r9rr#rrrr$(r,zInvalidOInfo.binshacCr&r9rr#rrrr(,r/zInvalidOInfo.hexshacCr")z2:return: exception instance explaining the failurer+rr#rrrr`0r%zInvalidOInfo.errorN)r2r3r4r5rr6rrr7r$r(r`rrrrr
s

r
c@seZdZdZe�ZdS)rz/Carries information about an invalid ODB streamN)r2r3r4r5rr6rrrrr6s
rN)r5Z
gitdb.utilrZ	gitdb.funrr�__all__rrrrr	rKr
rrQrr
rrrrr�<module>s.%Q