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/git/index/__pycache__/typ.cpython-310.pyc
o

;jk�@s�dZgd�ZddlmZddlmZddlmZddlm	Z	m
Z
ddlmZm
Z
mZmZmZmZdd	lmZer>dd
lmZeZdZdZd
ZdZdZd
ZdZGdd�d�ZGdd�de�Z Gdd�de �Z!Gdd�de!�Z"dS)z#Additional types used by the index.)�
BlobFilter�BaseIndexEntry�
IndexEntry�	StageType�)�b2a_hex)�Path)�Blob�)�pack�unpack)�
NamedTuple�Sequence�
TYPE_CHECKING�Tuple�Union�cast)�PathLike)�Repoi�i0i@i��i c@sDeZdZdZdZdeeddfdd�Zdee	e
fdefd	d
�ZdS)rz�Predicate to be used by
    :meth:`IndexFile.iter_blobs <git.index.base.IndexFile.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.
    ��pathsr�returnNcCs
||_dS)z�
        :param paths:
            Tuple or list of paths which are either pointing to directories or to files
            relative to the current repository.
        Nr)�selfr�r�A/opt/saltstack/salt/lib/python3.10/site-packages/git/index/typ.py�__init__3s
zBlobFilter.__init__�
stage_blobcCs�|dj}t|t�r|nt|�}|jD]+}t|t�r|nt|�}|j}|j}t|�t|�kr/qtdd�t||�D��r>dSqdS)Nr	css�|]	\}}||kVqdS)Nr)�.0�i�jrrr�	<genexpr>Fs�z&BlobFilter.__call__.<locals>.<genexpr>TF)�path�
isinstancerr�parts�len�all�zip)rrZ
blob_pathlikeZ	blob_pathZpathliker!Zfilter_partsZ
blob_partsrrr�__call__;s

�zBlobFilter.__call__)
�__name__�
__module__�__qualname__�__doc__�	__slots__r
rrrrr�boolr'rrrrr)s
rc@s�eZdZUdZeed<eed<eed<eed<eddd�Z	eed<eddd�Z
eed	<dZeed
<dZeed<dZ
eed<dZeed
<dZeed<dZeed<dS)�BaseIndexEntryHelperz�Typed named tuple to provide named attribute access for :class:`BaseIndexEntry`.

    This is needed to allow overriding ``__new__`` in child class to preserve backwards
    compatibility.
    �mode�binsha�flagsr!�>LLr�ctime_bytes�mtime_bytes�dev�inode�uid�gid�size�extended_flagsN)r(r)r*r+�int�__annotations__�bytesrr
r3r4r5r6r7r8r9r:rrrrr.Ks
r.cs�eZdZdZdeeeeeefeeeeeeeeeeeeeffddf�fdd�Z	de
fdd�Zde
fdd	�Ze
de
fd
d��Ze
defdd
��Ze
defdd��Ze
defdd��Zeddededdfdd��Zdddefdd�Z�ZS)ra�Small 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 :class:`IndexEntry` type, methods
    expecting a :class:`BaseIndexEntry` can also handle full :class:`IndexEntry`\s even
    if they use numeric indices for performance reasons.
    �	inp_tuplercst�j|g|�R�S)z\Override ``__new__`` to allow construction from a tuple for backwards
        compatibility.)�super�__new__)�clsr>��	__class__rrr@js	zBaseIndexEntry.__new__cC�d|j|j|j|jfS)Nz%o %s %i	%s�r/�hexsha�stager!�rrrr�__str__u�zBaseIndexEntry.__str__cCrD)Nz(%o, %s, %i, %s)rErHrrr�__repr__xrJzBaseIndexEntry.__repr__cCst|j��d�S)zhex version of our sha�ascii)rr0�decoderHrrrrF{szBaseIndexEntry.hexshacCs|jt@t?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 :manpage:`git-read-tree(1)`.
        )r1�CE_STAGEMASK�
CE_STAGESHIFTrHrrrrG�szBaseIndexEntry.stagecC�|jt@dkS�Nr)r:�CE_EXT_SKIP_WORKTREErHrrr�
skip_worktree��zBaseIndexEntry.skip_worktreecCrPrQ)r:�CE_EXT_INTENT_TO_ADDrHrrr�
intent_to_add�rTzBaseIndexEntry.intent_to_addr�blobrGcCs||j|j|t>|jf�S)z9:return: Fully equipped BaseIndexEntry at the given stage)r/r0rOr!)rArWrGrrr�	from_blob��zBaseIndexEntry.from_blob�reporcCst||j|j|j�S)z7:return: Blob using the information of this index entry)rr0r/r!)rrZrrr�to_blob�szBaseIndexEntry.to_blob�r)r(r)r*r+rrr;r=rr@�strrIrK�propertyrFrGr-rSrV�classmethodrrXr[�
__classcell__rrrBrras0����
rc@sneZdZdZedeeeffdd��Zedeeeffdd��Ze	dd	d
��Z
e	dded
eddfdd��ZdS)ra-Allows convenient access to index entry data as defined in
    :class:`BaseIndexEntry` without completely unpacking it.

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

    See the properties for a mapping between names and tuple indices.
    rcC�ttttftd|j��S)z�
        :return:
            Tuple(int_time_seconds_since_epoch, int_nano_seconds) of the
            file's creation time
        r2)rrr;rr3rHrrr�ctime�szIndexEntry.ctimecCra)z:See :attr:`ctime` property, but returns modification time.r2)rrr;rr4rHrrr�mtime�rYzIndexEntry.mtime�basercCs2tddd�}t|j|j|j|j||dddddf�S)z�
        :return:
            Minimal entry as created from the given :class:`BaseIndexEntry` instance.
            Missing values will be set to null-like values.

        :param base:
            Instance of type :class:`BaseIndexEntry`.
        r2r)r
rr/r0r1r!)rArd�timerrr�	from_base�s
&zIndexEntry.from_baserrWrGcCs6tddd�}t|j|j|t>|j||dddd|jf�S)z7:return: Minimal entry resembling the given blob objectr2r)r
rr/r0rOr!r9)rArWrGrerrrrX�s��zIndexEntry.from_blobN)rdrrrr\)
r(r)r*r+r^rr;rbrcr_rfrrXrrrrr�s	rN)#r+�__all__�binasciir�pathlibrZgit.objectsr�utilr
r�typingrr
rrrrZ	git.typesrZgit.reporr;rZCE_NAMEMASKrNZCE_EXTENDEDZCE_VALIDrOrRrUrr.rrrrrr�<module>s, "?