403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/git/objects/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/git/objects/__pycache__/commit.cpython-310.pyc
o

;j�}�@s�dgZddlmZddlZddlmZddlZddlZddlZddl	m
Z
mZddlZddl
mZmZmZm
Z
mZddlZddlmZddlmZdd	lmZdd
lmZmZmZmZddlmZdd
l m!Z!ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3ej4dkr�ddl)m5Z5nddl6m5Z5ddl7m8Z8e1r�ddl9m:Z:ddl;m<Z<e�=e>�Z?Gdd�dej@e$ee#�ZAdS)�Commit�)�defaultdictN)�BytesIO)�Popen�PIPE)�altzone�daylight�	localtime�time�timezone)�IStream)�Git)�Diffable)�Actor�Stats�finalize_process�
hex_to_bin�)�base)�Tree)�Serializable�TraversableIterableObj�altz_to_utctz_str�from_timestamp�parse_actor_and_date�
parse_date)
�Any�Dict�IO�Iterator�List�Sequence�Tuple�
TYPE_CHECKING�Union�cast)��)�Literal)�PathLike)�SymbolicReference)�Repocs�eZdZUdZdZdZdZdZdZe	de
d<dZd	Ze
de
d
<											dVdd
dedeedfdeedfdeedfdedefdeedfdeedfdedefdeeedfd
ee
ddfdeedfdeedfddf�fdd�
Zedddedfdd��Zedd
dddefdd ��Zd!eddfd"d#�Zd$eddf�fd%d&�Zedejfd'd(��Zedejfd)d*��Z edeeeffd+d,��Z!dWd.ee"e
e"fd!edefd/d0�Z#edefd1d2��Z$e	-dWdd
d3eedd4fd.ee"e
e"fd!ede%df
d5d6��Z&dWd.ee"e
e"fd!ede%dfd7d8�Z'ede(fd9d:��Z)ede*eeffd;d<��Z+ede,eeeffd=d>��Z-eefdd
deeefd?e
ededef
d@dA��Z.ede*ee,effdBdC��Z/edd
dDee0e1fde%dfdEdF��Z2e		G					dXdd
deeefdedHede,dfdIe3dedefdedefdJedeejfdKedeejfdLede*eefe,eeeffddfdMdN��Z4dOe5ddfdPdQ�Z6dOe5ddfdRdS�Z7ede,efdTdU��Z8�Z9S)Yra1Wraps a git commit object.

    See :manpage:`gitglossary(7)` on "commit object":
    https://git-scm.com/docs/gitglossary#def_commit_object

    :note:
        This class will act lazily on some of its attributes and will query the value on
        demand only if it involves calling the git binary.
    ZGIT_AUTHOR_DATEZGIT_COMMITTER_DATEzi18n.commitencodingzUTF-8�commit�type)�tree�author�
authored_date�author_tz_offset�	committer�committed_date�committer_tz_offset�message�parents�encoding�gpgsig�hexshar6N�repor+�binshar.r/r0r1r2r3r4r5r7r8�returncs�t��||�||_|durt|t�sJdt|���|dur"||_|dur)||_|dur0||_|dur7||_	|dur>||_
|durE||_|	durL|	|_|
durS|
|_
|durZ||_|dura||_|
durj|
|_dSdS)aInstantiate a new :class:`Commit`. All keyword arguments taking ``None`` as
        default will be implicitly set on first query.

        :param binsha:
            20 byte sha1.

        :param tree:
            A :class:`~git.objects.tree.Tree` object.

        :param author:
            The author :class:`~git.util.Actor` object.

        :param authored_date: int_seconds_since_epoch
            The authored DateTime - use :func:`time.gmtime` to convert it into a
            different format.

        :param author_tz_offset: int_seconds_west_of_utc
            The timezone that the `authored_date` is in.

        :param committer:
            The committer string, as an :class:`~git.util.Actor` object.

        :param committed_date: int_seconds_since_epoch
            The committed DateTime - use :func:`time.gmtime` to convert it into a
            different format.

        :param committer_tz_offset: int_seconds_west_of_utc
            The timezone that the `committed_date` is in.

        :param message: string
            The commit message.

        :param encoding: string
            Encoding of the message, defaults to UTF-8.

        :param parents:
            List or tuple of :class:`Commit` objects which are our parent(s) in the
            commit dependency graph.

        :return:
            :class:`Commit`

        :note:
            Timezone information is in the same format and in the same sign as what
            :func:`time.altzone` returns. The sign is inverted compared to git's UTC
            timezone.
        Nz(Tree needs to be a Tree instance, was %s)�super�__init__r;�
isinstancerr-r.r/r0r1r2r3r4r5r6r7r8)�selfr:r;r.r/r0r1r2r3r4r5r6r7r8��	__class__��F/opt/saltstack/salt/lib/python3.10/site-packages/git/objects/commit.pyr>ms6?
�zCommit.__init__)r.cCs
t|j�S�N)�tupler6)�clsr,rCrCrD�_get_intermediate_items�s
zCommit._get_intermediate_itemscCs>t�}|�|�|��}|�d�|j�t|j||��}|jS)z�Calculate the sha of a commit.

        :param repo:
            :class:`~git.repo.base.Repo` object the commit should be part of.

        :param commit:
            :class:`Commit` object for which to generate the sha.
        r)	r�
_serialize�tell�seek�odb�storerr-r;)rGr:r,�streamZ	streamlen�istreamrCrCrD�_calculate_sha_�s

zCommit._calculate_sha_�kwargscsf�fdd��jD�}|D]}|�jvrtd��q|�|��j�j�jfi|��}���j|�|_|S)z�Create new commit object from an existing commit object.

        Any values provided as keyword arguments will replace the corresponding
        attribute in the new object.
        csi|]}|t�|��qSrC)�getattr)�.0�k�r@rCrD�
<dictcomp>�sz"Commit.replace.<locals>.<dictcomp>zinvalid attribute name)�	__slots__�
ValueError�updaterBr:�NULL_BIN_SHArPr;)r@rQ�attrs�attrname�
new_commitrCrUrD�replace�s
�
zCommit.replace�attrcsJ|tjvr|jj�|j�\}}|_}|�t|�	���dSt
��|�dSrE)rrWr:rLrNr;�size�_deserializer�readr=�_set_cache_)r@r_Z_binshaZ	_typenamerNrArCrDrc�s
zCommit._set_cache_cC�t|j|j�SrE)rr0r1rUrCrCrD�authored_datetime��zCommit.authored_datetimecCrdrE)rr3r4rUrCrCrD�committed_datetime�rfzCommit.committed_datetimecCs0t|jt�r|j�dd�dS|j�dd�dS)z):return: First line of the commit message�
rr�
)r?r5�str�splitrUrCrCrD�summaryszCommit.summary��pathscKsH|rt|jjj|jd|fi|�����St|jjj|jfi|�����S)aCount the number of commits reachable from this commit.

        :param paths:
            An optional path or a list of paths restricting the return value to commits
            actually containing the paths.

        :param kwargs:
            Additional options to be passed to :manpage:`git-rev-list(1)`. They must not
            alter the output style of the command, or parsing will yield incorrect
            results.

        :return:
            An int defining the number of reachable commits
        �--)�lenr:�git�rev_listr9�
splitlines)r@rnrQrCrCrD�count
s$ zCommit.countcCs|jj�|�S)z�
        :return:
            String describing the commits hex sha based on the closest
            :class:`~git.refs.reference.Reference`.

        :note:
            Mostly useful for UI purposes.
        )r:rq�name_revrUrCrCrDrus
zCommit.name_rev�revr*cKsjd|vrtd��dg}|r"t|ttjf�r|f}nt|�}|�|�|jj||fddi|��}|�	||�S)aFind all commits matching the given criteria.

        :param repo:
            The :class:`~git.repo.base.Repo`.

        :param rev:
            Revision specifier. See :manpage:`git-rev-parse(1)` for viable options.

        :param paths:
            An optional path or list of paths. If set only :class:`Commit`\s that
            include the path or paths will be considered.

        :param kwargs:
            Optional keyword arguments to :manpage:`git-rev-list(1)` where:

            * ``max_count`` is the maximum number of commits to fetch.
            * ``skip`` is the number of commits to skip.
            * ``since`` selects all commits since some date, e.g. ``"1970-01-01"``.

        :return:
            Iterator yielding :class:`Commit` items.
        Zprettyz<--pretty cannot be used as parsing expects single sha's onlyro�
as_processT)
rXr?rj�osr)rF�extendrqrr�_iter_from_process_or_stream)rGr:rvrnrQZ	args_listZ	paths_tup�procrCrCrD�
iter_items+s
zCommit.iter_itemscKs8|�dd�}|dkrd}||d<|j|j||fi|��S)a�Iterate *all* parents of this commit.

        :param paths:
            Optional path or list of paths limiting the :class:`Commit`\s to those that
            contain at least one of the paths.

        :param kwargs:
            All arguments allowed by :manpage:`git-rev-list(1)`.

        :return:
            Iterator yielding :class:`Commit` objects which are parents of ``self``
        �skiprr)�getr|r:)r@rnrQr}rCrCrD�iter_parents_s
zCommit.iter_parentscCs�dttdtfdd�}|js'|jjj|jdddddd���dd	�}||�}n|jjj|jd
j|jddddd���}||�}t	�
|j|�S)z�Create a git stat from changes between this commit and its first parent
        or from all changes done if this is the very first commit.

        :return:
            :class:`Stats`
        �linesr<cSsbd}t||t|�dd��D]\}}|�d�dd}|�d�\}}}|d||||f7}q|S)Nrm��	r���z%s	%s	%s	%s
)�ziprprk)r��text�	file_info�lineZchange_typeZ
insertionsZ	deletions�filenamerCrCrD�
process_lines}s"z#Commit.stats.<locals>.process_linesroT)�numstat�
no_renames�root�rawrNr)r�r�r�)r rjr6r:rqZ	diff_treer9rs�diffrZ_list_from_string)r@r�r�r�rCrCrD�statsts	�
�
��zCommit.statscCs$tjdtdd�dd�|j��D�S)alDeprecated. Get the trailers of the message as a dictionary.

        :note:
            This property is deprecated, please use either :attr:`trailers_list` or
            :attr:`trailers_dict`.

        :return:
            Dictionary containing whitespace stripped trailer information.
            Only contains the latest instance of each trailer key.
        zWCommit.trailers is deprecated, use Commit.trailers_list or Commit.trailers_dict insteadr�)�
stacklevelcSsi|]	\}}||d�qS)rrC)rSrT�vrCrCrDrV�sz#Commit.trailers.<locals>.<dictcomp>)�warnings�warn�DeprecationWarning�
trailers_dict�itemsrUrCrCrD�trailers�s�zCommit.trailerscCsd|j|j|jdg|jd���}|sgSg}|�d�D]}|�dd�\}}|�|��|��f�q|S)a�Get the trailers of the message as a list.

        Git messages can contain trailer information that are similar to :rfc:`822`
        e-mail headers. See :manpage:`git-interpret-trailers(1)`.

        This function calls ``git interpret-trailers --parse`` onto the message to
        extract the trailer information, returns the raw trailer data as a list.

        Valid message with trailer::

            Subject line

            some body information

            another information

            key1: value1.1
            key1: value1.2
            key2 :    value 2 with inner spaces

        Returned list will look like this::

            [
                ("key1", "value1.1"),
                ("key1", "value1.2"),
                ("key2", "value 2 with inner spaces"),
            ]

        :return:
            List containing key-value tuples of whitespace stripped trailer information.
        z--parse)r7rh�:r)�_interpret_trailersr:r5r7�striprk�append)r@ZtrailerZtrailer_list�t�key�valrCrCrD�
trailers_list�s!zCommit.trailers_list�trailer_argsc
Cspt|t�r|n|j|dd�}|jjdg|�}|jj|dtd�}z|�|�\}}	|j|dd�Wt	|�St	|�w)N�strict)�errorszinterpret-trailersT)rwrO)
r?�bytes�encoderqZGIT_PYTHON_GIT_EXECUTABLEZexecuter�communicate�decoder)
rGr:r5r�r7Z
message_bytes�cmdr{Zstdout_bytes�_rCrCrDr��s�zCommit._interpret_trailerscCs.tt�}|jD]\}}||�|�qt|�S)aGet the trailers of the message as a dictionary.

        Git messages can contain trailer information that are similar to :rfc:`822`
        e-mail headers. See :manpage:`git-interpret-trailers(1)`.

        This function calls ``git interpret-trailers --parse`` onto the message to
        extract the trailer information. The key value pairs are stripped of leading and
        trailing whitespaces before they get saved into a dictionary.

        Valid message with trailer::

            Subject line

            some body information

            another information

            key1: value1.1
            key1: value1.2
            key2 :    value 2 with inner spaces

        Returned dictionary will look like this::

            {
                "key1": ["value1.1", "value1.2"],
                "key2": ["value 2 with inner spaces"],
            }


        :return:
            Dictionary containing whitespace stripped trailer information, mapping
            trailer keys to a list of their corresponding values.
        )r�listr�r��dict)r@�dr�r�rCrCrDr��s#zCommit.trailers_dict�proc_or_streamccs��t|d�rtt|�}|jdur|j}nt|d�r tt|�}|}|j}	|�}|s*n'|��}t|�dkr<|�dd�\}}t|�dksHJd|��||t	|��Vq$t|d�ratt|�}t
|�dSdS)a�Parse out commit information into a list of :class:`Commit` objects.

        We expect one line per commit, and parse the actual commit information directly
        from our lighting fast object database.

        :param proc:
            :manpage:`git-rev-list(1)` process instance - one sha per line.

        :return:
            Iterator supplying :class:`Commit` objects
        �waitN�readlineT�(rzInvalid line: %s)�hasattrr%r�stdoutrr�r�rprkrr)rGr:r�rNr�r�r9r�rCrCrDrzs0�


�

�

�z#Commit._iter_from_process_or_streamF�parent_commits�head�author_date�commit_dater�c 
Cs�|durz|jjg}Wntyg}Ynw|D]}t||�s*td|�d|����q|��}tj}
|p8t�|�}|p?t�	|�}t
t��}toLt
�jdk}|rQtnt}|
�|jd�}|rct|�\}}n|rlt|�\}}n||}}|
�|jd�}|	r�t|	�\}}n|r�t|�\}}n||}}|j�d�\}}|�|||j�}t|t�s�td��t|t�r�|�|�}|
r�g}t|
t�r�|
��D]\}}|�d�|�|�d	|���q�n|
D]\}}|�d�|�|�d	|���q�|�|t|�|�}|||j ||||||||||�}|�!||�|_"|�rAddl#}z|jj$||d
�W|St�y@|j%j&j'||jj(|d|d
�}|jj)|d|d
�Y|Sw|S)
a�Commit the given tree, creating a :class:`Commit` object.

        :param repo:
            :class:`~git.repo.base.Repo` object the commit should be part of.

        :param tree:
            :class:`~git.objects.tree.Tree` object or hex or bin sha.
            The tree of the new commit.

        :param message:
            Commit message. It may be an empty string if no message is provided. It will
            be converted to a string, in any case.

        :param parent_commits:
            Optional :class:`Commit` objects to use as parents for the new commit. If
            empty list, the commit will have no parents at all and become a root commit.
            If ``None``, the current head commit will be the parent of the new commit
            object.

        :param head:
            If ``True``, the HEAD will be advanced to the new commit automatically.
            Otherwise the HEAD will remain pointing on the previous commit. This could
            lead to undesired results when diffing files.

        :param author:
            The name of the author, optional.
            If unset, the repository configuration is used to obtain this value.

        :param committer:
            The name of the committer, optional.
            If unset, the repository configuration is used to obtain this value.

        :param author_date:
            The timestamp for the author field.

        :param commit_date:
            The timestamp for the committer field.

        :param trailers:
            Optional trailer key-value pairs to append to the commit message.
            Can be a dictionary mapping trailer keys to values, or a list of
            ``(key, value)`` tuples (useful when the same key appears multiple
            times, e.g. multiple ``Signed-off-by`` trailers). Trailers are
            appended using ``git interpret-trailers``.
            See :manpage:`git-interpret-trailers(1)`.

        :return:
            :class:`Commit` object representing the new commit.

        :note:
            Additional information about the committer and author are taken from the
            environment or from the git configuration. See :manpage:`git-commit-tree(1)`
            for more information.
        NzParent commit 'z' must be of type rrm�.z)conf_encoding could not be coerced to strz	--trailerz: )Zlogmsgzcommit (initial): %szcommit: Switching to %s)*r�r,rXr?Z
config_readerrx�environrr2r/�intr
rr	�tm_isdstrrr~�env_author_dater�env_committer_date�
conf_encodingrk�	get_value�default_encodingrj�	TypeErrorr.r�r�r�r�rZrPr;�git.refsZ
set_commitZrefsZHead�create�refZ
set_reference) rGr:r.r5r�r�r/r2r�r�r��pZcr�envZ	unix_timeZis_dst�offsetZauthor_date_strZauthor_timeZ
author_offsetZcommitter_date_strZcommitter_timeZcommitter_offsetZenc_sectionZ
enc_optionr�r�r�r�r]rqZmasterrCrCrD�create_from_tree?s�D�
�







�
����
zCommit.create_from_treerNc	CsT|j}|d|j�d��|jD]}|d|�d��q|j}|j}|j}d}||d||j|jt	|j
�f�|j��|j}||d||j|jt	|j
�f�|j��|j|jkrb|d|j�d��z"|�d�r�|d	�|j�d
��d
�D]
}|d|d
�d��quWn	ty�Ynw|d�t|jt�r�||j�|j��|S||j�|S)
Nztree %s
�asciiz
parent %s
z%s %s <%s> %s %s
r/r2zencoding %s
r8sgpgsigrh� ri)�writer.r�r6r/�namer2�emailr0rr1r7r3r4r��__getattribute__r8�rstriprk�AttributeErrorr?r5rj)	r@rNr�r��aZaname�c�fmtZsiglinerCrCrDrI�s`
������

��
�zCommit._serializec	Cs�|j}t|jt|���d�tjd>d�|_g|_d}	|�}|�d�s'|}n|j�	t
|�|jt|��d�d����qt|j�|_|}|�}|�}|�d�re|�}|�d	�r`|�}|�d	�sX|�d�sP|j
|_d|_|}|��}|r�|d
d�dkr�||�d	�dd��|jd
�|_nD|d
d�dkr�||�d	�dd�d}	d}
	|�}|s�n|d
d�d	kr�|��}d}
n	|	|dd�7}	q�|	�d��|jd
�|_|
r�qr|���}|stzt|�|jd��\|_|_|_Wnty�tjd||jdd�Ynwzt|�|jd��\|_|_|_Wnt�y#tjd||jdd�Ynw|��|_z|j�|jd�|_W|St�yKtjd|j|jdd�Y|Sw)Nr�rmTsparentr�r�s	mergetag � r�
s	encoding �ignore�sgpgsig riFr^z3Failed to decode author line '%s' using encoding %s)�exc_infoz6Failed to decode committer line '%s' using encoding %sz/Failed to decode message '%s' using encoding %s)r�rr:rrkZtree_idr.r6�
startswithr�r-r�rFr�r7r8r��findr�rr/r0r1�UnicodeDecodeError�_logger�errorr2r3r4rbr5)r@rNr�Z	next_lineZparent_lineZauthor_lineZcommitter_line�enc�buf�sigZis_next_headerZsigbufrCrCrDra4s�&
*�


�
�$�

��
���
��

���zCommit._deserializecCs<g}|jrt�dt|j�tj�}|D]	}|�t|��q|S)aSearch the commit message for any co-authors of this commit.

        Details on co-authors:
        https://github.blog/2018-01-29-commit-together-with-co-authors/

        :return:
            List of co-authors for this commit (as :class:`~git.util.Actor` objects).
        z^Co-authored-by: (.*) <(.*?)>$)r5�re�findallrj�	MULTILINEr�r)r@�
co_authors�resultsr/rCrCrDr��s
�zCommit.co_authors)NNNNNNNNNNN)rm)NFNNNNN):�__name__�
__module__�__qualname__�__doc__r�r�r�r�r-r(�__annotations__rWZ_id_attribute_r!r�r$rrr��floatrjr>�classmethodr"rHrPrr^rc�property�datetimerergrlr)rtrurr|rrr�rr�r r�r�r�rrrz�boolr�rrIrar��
__classcell__rCrCrArDrCs
���
�
�
�
�
�
	�

���

�
��Z	$������(3,��
����'$0��
����
�
�	�
� ��:;j)B�__all__�collectionsrr��ior�loggingrxr��
subprocessrr�sysr
rrr	rr�ZgitdbrZgit.cmdr
Zgit.diffrZgit.utilrrrrrmrr.r�utilrrrrrr�typingrrrrr r!r"r#r$r%�version_infor(Ztyping_extensionsZ	git.typesr)r�r*Zgit.repor+�	getLoggerr�r�ZObjectrrCrCrCrD�<module>s8 0




Youez - 2016 - github.com/yon3zu
LinuXploit