????

Your IP : 18.216.71.10


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/git/index/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/git/index/__pycache__/typ.cpython-311.pyc

�

Ifl��
�dZddlmZddlmZddlmZmZddlm	Z	ddl
mZmZm
Z
mZmZmZmZddlmZe
rdd	lmZeZd
ZdZdZd
ZdZdZGd�de��ZGd�de��Z Gd�de ��Z!Gd�de!��Z"dS)z.Module with additional types used by the index�)�b2a_hex)�Path�)�pack�unpack)�Blob)�
NamedTuple�Sequence�
TYPE_CHECKING�Tuple�Union�cast�List)�PathLike)�Repo)�
BlobFilter�BaseIndexEntry�
IndexEntry�	StageTypei�i0i@i��c�R�eZdZdZdZdeeddfd�Zdee	e
fdefd�ZdS)rz�
    Predicate to be used by iter_blobs allowing to filter only return blobs which
    match the given list of directories or files.

    The given paths are given relative to the repository.
    �paths�returnNc��||_dS)z�
        :param paths:
            tuple or list of paths which are either pointing to directories or
            to files relative to the current repository
        N)r)�selfrs  �^/builddir/build/BUILD/cloudlinux-venv-1.0.5/venv/lib/python3.11/site-packages/git/index/typ.py�__init__zBlobFilter.__init__.s����
�
�
��
stage_blobc�~�|dj}t|t��r|nt|��}|jD]�}t|t��r|nt|��}|j}|j}t|��t|��kr�Wt
d�t||��D����rdS��dS)Nrc3�(K�|]
\}}||kV��dS)N�)�.0�i�js   r�	<genexpr>z&BlobFilter.__call__.<locals>.<genexpr>@s*����D�D�d�a��1��6�D�D�D�D�D�DrTF)�path�
isinstancerr�parts�len�all�zip)rr�
blob_pathlike�	blob_path�pathliker'�filter_parts�
blob_partss        r�__call__zBlobFilter.__call__6s���",�Q�-�"4�
�+5�m�T�+J�+J�c�-�-�PT�Ub�Pc�Pc�	��
�	�	�H�%/��$�%?�%?�S���T�(�^�^�D�&*�j�L�$-�O�J��<� � �3�z�?�?�2�2���D�D�c�,�
�&C�&C�D�D�D�D�D�
��t�t�
��ur)
�__name__�
__module__�__qualname__�__doc__�	__slots__r
rrrrr�boolr2r"rrrr#sw���������I��h�x�0��T������5��D��#9��d������rrc���eZdZUdZeed<eed<eed<eed<eddd��Z	eed<eddd��Z
eed	<dZeed
<dZeed<dZ
eed<dZeed
<dZeed<dS)�BaseIndexEntryHelperz�Typed namedtuple to provide named attribute access for BaseIndexEntry.
    Needed to allow overriding __new__ in child class to preserve backwards compat.�mode�binsha�flagsr'�>LLr�ctime_bytes�mtime_bytes�dev�inode�uid�gid�sizeN)r3r4r5r6�int�__annotations__�bytesrrr?r@rArBrCrDrEr"rrr:r:Es��������W�W��I�I�I��M�M�M��J�J�J�
�N�N�N���e�Q��*�*�K��*�*�*���e�Q��*�*�K��*�*�*��C��L�L�L��E�3�N�N�N��C��L�L�L��C��L�L�L��D�#�M�M�M�M�Mrr:c���eZdZdZdeeeeeefeeeeeeeeeeeeffddf�fd�Z	de
fd�Zde
fd�Ze
de
fd���Ze
defd���Zedd
ededdfd���Zd
ddefd�Z�xZS)raqSmall Brother of an index entry which can be created to describe changes
    done to the index in which case plenty of additional information is not required.

    As the first 4 data members match exactly to the IndexEntry type, methods
    expecting a BaseIndexEntry can also handle full IndexEntries even if they
    use numeric indices for performance reasons.
    �	inp_tuplerc�8��t��j|g|�R�S)zOOverride __new__ to allow construction from a tuple for backwards compatibility)�super�__new__)�clsrJ�	__class__s  �rrMzBaseIndexEntry.__new__`s#����u�w�w��s�/�Y�/�/�/�/rc�<�d|j|j|j|jfzS)Nz%o %s %i	%s�r;�hexsha�stager'�rs r�__str__zBaseIndexEntry.__str__js�����D�K���T�Y� O�O�Orc�<�d|j|j|j|jfzS)Nz(%o, %s, %i, %s)rQrTs r�__repr__zBaseIndexEntry.__repr__ms��!�T�Y���T�Z���$S�S�Src�P�t|j���d��S)zhex version of our sha�ascii)rr<�decoderTs rrRzBaseIndexEntry.hexshaps"���t�{�#�#�*�*�7�3�3�3rc�0�|jtztz	S)a�Stage of the entry, either:

            * 0 = default stage
            * 1 = stage before a merge or common ancestor entry in case of a 3 way merge
            * 2 = stage of entries from the 'left' side of the merge
            * 3 = stage of entries from the right side of the merge

        :note: For more information, see http://www.kernel.org/pub/software/scm/git/docs/git-read-tree.html
        )r=�CE_STAGEMASK�
CE_STAGESHIFTrTs rrSzBaseIndexEntry.stageus���
�\�)�m�;�;rr�blobrSc�N�||j|j|tz|jf��S)z9:return: Fully equipped BaseIndexEntry at the given stage)r;r<r]r')rNr^rSs   r�	from_blobzBaseIndexEntry.from_blob�s(���s�D�I�t�{�E�]�,B�D�I�N�O�O�Or�reporc�D�t||j|j|j��S)z7:return: Blob using the information of this index entry)rr<r;r')rras  r�to_blobzBaseIndexEntry.to_blob�s���D�$�+�t�y�$�)�<�<�<r�r)r3r4r5r6r
rrFrHrrM�strrUrW�propertyrRrS�classmethodrr`rc�
__classcell__)rOs@rrrVs����������0���#�u�c�8�+�,��#�u�c�8�U�E�3��S�#�s�R�S�
U�
�0�
�
0�0�0�0�0�0�P��P�P�P�P�T�#�T�T�T�T��4��4�4�4��X�4��
<�s�
<�
<�
<��X�
<��P�P�T�P�#�P�6F�P�P�P��[�P�=�F�=�t�=�=�=�=�=�=�=�=rrc��eZdZdZedeeeffd���Zedeeeffd���Ze	d
d���Z
e	dd	ed
eddfd���ZdS)rz�Allows convenient access to IndexEntry data without completely unpacking it.

    Attributes usully accessed often are cached in the tuple whereas others are
    unpacked on demand.

    See the properties for a mapping between names and tuple indices.rc�v�ttttftd|j����S)z{
        :return:
            Tuple(int_time_seconds_since_epoch, int_nano_seconds) of the
            file's creation timer>)rrrFrr?rTs r�ctimezIndexEntry.ctime�s)���E�#�s�(�O�V�E�4�3C�%D�%D�E�E�Erc�v�ttttftd|j����S)z1See ctime property, but returns modification timer>)rrrFrr@rTs r�mtimezIndexEntry.mtime�s)���E�#�s�(�O�V�E�4�3C�%D�%D�E�E�Er�baserc
��tddd��}t|j|j|j|j||dddddf��S)z�
        :return:
            Minimal entry as created from the given BaseIndexEntry instance.
            Missing values will be set to null-like values

        :param base: Instance of type BaseIndexEntryr>r)rrr;r<r=r')rNrn�times   r�	from_basezIndexEntry.from_base�sH���E�1�a� � ���4�9�d�k�4�:�t�y�$�PT�VW�YZ�\]�_`�bc�d�e�e�errr^rSc
��tddd��}t|j|j|tz|j||dddd|jf��S)z7:return: Minimal entry resembling the given blob objectr>r)rrr;r<r]r'rE)rNr^rSrps    rr`zIndexEntry.from_blob�sZ���E�1�a� � ����	�����&��	��������	�
�
�
�	
rN)rnrrrrd)
r3r4r5r6rfrrFrkrmrgrqrr`r"rrrr�s�������I�I��F�u�S�#�X��F�F�F��X�F��F�u�S�#�X��F�F�F��X�F��f�f�f��[�f��
�
�T�
�#�
�l�
�
�
��[�
�
�
rrN)#r6�binasciir�pathlibr�utilrr�git.objectsr�typingr	r
rrr
rr�	git.typesr�git.reporrFr�__all__�CE_NAMEMASKr\�CE_EXTENDED�CE_VALIDr]�objectrr:rrr"rr�<module>rs���4�4���������������������������
Q�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P����������������	�F�����������
�
���������D�����:����"3=�3=�3=�3=�3=�)�3=�3=�3=�l3
�3
�3
�3
�3
��3
�3
�3
�3
�3
r