HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1784574/root/usr/lib/python3/dist-packages/pbr/__pycache__/
Upload File :
Current File : //proc/1784574/root/usr/lib/python3/dist-packages/pbr/__pycache__/git.cpython-311.pyc
�

㦧b<-���ddlmZddlZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZdd�Zd	�Zd
�Zd�Zd�Zdd�Zd�Zd�Zd�Zdd�Zd�Zd�Zdd�Zd�Zd�Zdejjddfd�Z dde!��fd�Z"dS)�)�unicode_literalsN)�log)�options)�versionFTc�0�|rtj}tj}nd}d}tj���}|r|�|��tj||||���}|���}|jr+|r)tj
�d||jfz���t|��dks"|dr|d�
��sdS|d�
���dd��S)N)�stdout�stderr�envz%s returned %dr��utf-8�replace)�
subprocess�PIPE�os�environ�copy�update�Popen�communicate�
returncode�	distutils�errors�DistutilsError�len�strip�decode)	�cmd�throw_on_error�bufferr
�out_location�err_location�newenv�output�outs	         �)/usr/lib/python3/dist-packages/pbr/git.py�_run_shell_commandr&"s��
��!���!��������
�Z�_�_�
�
�F�
���
�
�c����
�
�c�%1�%1�"(�*�*�*�F��
�
�
�
�C�
��9�^�9���-�-���V�%6�7�7�9�9�	9�
�3�x�x�1�}�}�C��F�}�#�a�&�,�,�.�.�}��r��q�6�<�<�>�>� � ��)�4�4�4�c�j�t|ttf��s|g}tdd|zg|zfi|��S)N�gitz--git-dir=%s)�
isinstance�list�tupler&)r�git_dir�kwargss   r%�_run_git_commandr/=sP���c�D�%�=�)�)���e���	���(�)�C�/�;�;�39�;�;�;r'c��	tgd���S#t$r!}|jtjkrYd}~dS�d}~wwxYw)N)r)z	rev-parsez	--git-dirr)r&�OSError�errno�ENOENT)�es r%�_get_git_directoryr5DsZ���!�"C�"C�"C�D�D�D�������7�e�l�"�"��2�2�2�2�2�
�����	���s��
>�9�9�>c�N�	tddg��n#t$rYdSwxYwdS)Nr)z	--versionFT)r&r1�r'r%�_git_is_installedr8NsF���	�E�;�/�0�0�0�0�������u�u������4s��
"�"c�8�t|tj���S)z�Find the highest tag from a list.

    Pass in a list of tag strings and this will return the highest
    (latest) as sorted by the pkg_resources version parser.
    )�key)�max�
pkg_resources�
parse_version)�tagss r%�_get_highest_tagr?Ys���t��4�5�5�5�5r'rc���g}|�t��}|rNtjd��tddg|��}|�d�d����}d�|D��S)z�Behave like a file finder entrypoint plugin.

    We don't actually use the entrypoints system for this because it runs
    at absurd times. We only want to do this when we are building an sdist.
    Nz2[pbr] In git context, generating filelist from gitzls-filesz-z�rc��g|]}|�|��Sr7r7)�.0�fs  r%�
<listcomp>z#_find_git_files.<locals>.<listcomp>qs��&�&�&�!�A�&�A�&�&�&r')�_run_git_functionsr�infor/�splitr)�dirnamer-�	file_lists   r%�_find_git_filesrKbsy���I���$�&�&���=���E�F�F�F�$�j�$�%7��A�A�	��O�O�G�N�N�7�$;�$;�<�<�	�&�&�y�&�&�&�&r'c�v�tddg|��}d|vr|�dd��dSd|vrdSdS)N�describez--always�-�����.r)r/�rsplit)r-rMs  r%�_get_raw_tag_inforStsK����Z� 8�'�B�B�H�
�h������s�A�&�&�r�*�*�
�h����q��4r'c�(�t|��dkS)Nr)rS�r-s r%�get_is_releaserV}s���W�%�%��*�*r'c�F�d}t��rt��}|pdS�N)r8r5rUs r%rFrF�s*���G����'�$�&�&���?�d�r'c�N�|st��}|rtgd�|��SdS)z1Return the short sha for this repo, if it exists.)rz-n1z--pretty=format:%hN)rFr/rUs r%�get_git_short_sharZ�s?���'�$�&�&���;��0�0�0�'�;�;�	;��4r'c��|�dd��}|�dd��}|�dd��}|S)a�Cleans any instances of invalid sphinx wording.

    This escapes/removes any instances of invalid characters
    that can be interpreted by sphinx as a warning or error
    when translating the Changelog into an HTML file for
    documentation building within projects.

    * Escapes '_' which is interpreted as a link
    * Escapes '*' which is interpreted as a new line
    * Escapes '`' which is interpreted as a literal
    �*z\*�_z\_�`z\`)r
��msgs r%�_clean_changelog_messagera�sB���+�+�c�5�
!�
!�C�

�+�+�c�5�
!�
!�C�

�+�+�c�5�
!�
!�C��Jr'c#�nK�d}d}|dfV�|D]�\}}}|rAt|��}t|��dz}|s|dfV�|dt||���zfV�|�d��sE|�d	��r
|dd
�}t|��}|dt|���zfV�d
}��dS)z�Convert a oneline log iterator to formatted strings.

    :param changelog: An iterator of one line log entries like
        that given by _iter_log_oneline.
    :return: An iterator over (release, formatted changelog) tuples.
    TNzCHANGES
=======

rN�
z%(tag)s
%(underline)s

)�tag�	underlinezMerge rQ���z
* %(msg)s
r_F)r?r�dict�
startswith�endswithra)�	changelog�
first_line�current_release�hashr>r`res       r%�_iter_changelogrn�s!�����J��O�
�1�
1�1�1�1�$�����d�C��	@�.�t�4�4�O��O�,�,�s�2�I��
,�%�t�+�+�+�+�!�,���I�>�>�>�?�@�
@�
@�
@��~�~�h�'�'�	A��|�|�C� � �
��#�2�#�h��*�3�/�/�C�!�=�4�C�=�=�=�#@�@�@�@�@��
�
��r'c�H�|�t��}|sgSt|��S)aQIterate over --oneline log entries if possible.

    This parses the output into a structured form but does not apply
    presentation logic to the output - making it suitable for different
    uses.

    :return: An iterator of (hash, tags_set, 1st_line) tuples, or None if
        changelog generation is disabled / not available.
    )r5�_iter_log_innerrUs r%�_iter_log_onelinerq�s/����$�&�&�����	��7�#�#�#r'c�h�	tj�|��dS#t$rYdSwxYw)NTF)r�SemanticVersion�from_pip_string�
ValueError)�	candidates r%�_is_valid_versionrw�sE�����/�/�	�:�:�:��t�������u�u����s�#�
1�1c#�8K�tjd��gd�}t||��}|�d��D]�}|�d��}t	|��dkr�+|\}}}t��}d|vr�|���dd�}|�d��dd	�D]U}	|	�d
��d�dd
��}
t|
��r|�	|
���V|||fV���d	S)aIterate over --oneline log entries.

    This parses the output intro a structured form but does not apply
    presentation logic to the output - making it suitable for different
    uses.

    .. caution:: this function risk to return a tag that doesn't exist really
                 inside the git objects list due to replacement made
                 to tag name to also list pre-release suffix.
                 Compliant with the SemVer specification (e.g 1.2.3-rc1)

    :return: An iterator of (hash, tags_set, 1st_line) tuples.
    z[pbr] Generating ChangeLog)rz--decorate=fullz--format=%h%x00%s%x00%drc��z
refs/tags/�rfNz, rrNrQ)
rrGr/rHr�setrr
rw�add)r-�log_cmdrj�line�
line_parts�shar`�refnamer>�
tag_stringrvs           r%rprp�s=�����H�
)�*�*�*�C�C�C�G� ��'�2�2�I�����%�%�����Z�Z��'�'�
��z�?�?�a����&���S�'��u�u���7�"�"��m�m�o�o�a��d�+�G�&�m�m�L�9�9�!�"�"�=�
(�
(�
�'�,�,�T�2�2�1�5�=�=�c�3�G�G�	�$�Y�/�/�(��H�H�Y�'�'�'���4��n�����1�r'c��tj��}|si}tj|dd��}|rdS|s!t|���}|rt	|��}|sdSt
j�|d��}t
j�|��r5tj	|t
j
��stjd��dStjd��tj|dd	�
��5}|D]\}}	|�|	���	ddd��n#1swxYwYtj��}
tjd|
|z
z��dS)z-Write a changelog based on the git changelog.�skip_changelog�SKIP_WRITE_GIT_CHANGELOGNrU�	ChangeLogzI[pbr] ChangeLog not written (file already exists and it is not writeable)z[pbr] Writing ChangeLog�wr)�encodingz![pbr] ChangeLog complete (%0.1fs))�timer�get_boolean_optionrqrnr�path�join�exists�access�W_OKrrG�io�open�write)r-�dest_dir�option_dictrj�start�should_skip�
new_changelog�changelog_file�release�content�stops           r%�write_git_changelogr�s���
�I�K�K�E������,�[�:J�-G�I�I�K������3�%�g�6�6�6�	��	3�'�	�2�2�I������G�L�L��;�7�7�M�	�w�~�~�m�$�$��R�Y�}�b�g�-N�-N����4�	5�	5�	5����H�
&�'�'�'�	����g�	6�	6�	6�*�.� )�	*�	*��G�W�� � ��)�)�)�)�	*�*�*�*�*�*�*�*�*�*�*�*����*�*�*�*��9�;�;�D��H�
0�D�5�L�
A�B�B�B�B�Bs�8D#�#D'�*D'rQc����tj|dd��}|rdStj��}tj�|d��}tj�|d��}tj�|��r!tj|tj��sdStj
d��d�|�t��}|�rkg}dd	g}|t||���
d
��z
}�fd�|D��}td|��}	tjd|	tj��}
d
�|
D��}
||
z
}t#t%|����}t'|d��5}tj�|��rOt'|d��5}|�|�����ddd��n#1swxYwY|�d
�|��d
z�d����ddd��n#1swxYwYtj��}
tj
d|
|z
z��dS)z&Create AUTHORS file using git commits.�skip_authors�SKIP_GENERATE_AUTHORSNz
AUTHORS.in�AUTHORSz[pbr] Generating AUTHORSz5((jenkins|zuul)@review|infra@lists|jenkins@openstack)rz--format=%aN <%aE>rcc�>��g|]}tj�|���|��Sr7)�re�search)rC�a�
ignore_emailss  �r%rEz$generate_authors.<locals>.<listcomp>?s*���I�I�I��R�Y�}�a�-H�-H�I�1�I�I�Ir'zCo-authored-by:.+c�n�g|]2}|�|�dd��d�����3S)�:r{)rHr)rC�signeds  r%rEz$generate_authors.<locals>.<listcomp>EsK��:�:�:� �&�:�f�l�l�3��*�*�1�-�3�3�5�5�:�:�:r'�wb�rbrz[pbr] AUTHORS complete (%0.1fs))rr�r�rr�r�r�r�r�rrGr5r/rHr��findall�	MULTILINE�sortedr|r�r��read�encode)r-r�r�r�r��old_authors�new_authors�authors�git_log_cmd�co_authors_out�
co_authors�new_authors_fh�old_authors_fhr�r�s              @r%�generate_authorsr�'s�����,�[�.�-D�F�F�K������I�K�K�E��'�,�,�x��6�6�K��'�,�,�x��3�3�K�	�w�~�~�k�"�"��2�9�[�"�'�+J�+J�����H�
'�(�(�(�K�M���$�&�&���3����2�3���#�K��9�9�?�?��E�E�E��I�I�I�I�g�I�I�I��*�%��9�9���Z� 3�^� "��.�.�
�:�:�$.�:�:�:�
�	�:�����W���&�&��
�+�t�
$�
$�	3���w�~�~�k�*�*�
@��+�t�,�,�@��"�(�(��)<�)<�)>�)>�?�?�?�@�@�@�@�@�@�@�@�@�@�@����@�@�@�@�� � �$�)�)�G�"4�"4�t�";�"(�&��/�/�
3�
3�
3�		3�	3�	3�	3�	3�	3�	3�	3�	3�	3�	3����	3�	3�	3�	3��9�;�;�D��H�
.�$��,�
?�@�@�@�@�@s7�?0H8�/(G#�H8�#G'	�'H8�*G'	�+AH8�8H<�?H<)FTN)rNrX)#�
__future__r�distutils.errorsrrr2r�rr�rr�r<�pbrrrr&r/r5r8r?rKrSrVrFrZrarnrqrwrpr��curdirr�rgr�r7r'r%�<module>r�s���"(�'�'�'�'�'���������������	�	�	�	�	�	�	�	�	�	�	�	�������������������������5�5�5�5�6;�;�;�������6�6�6�'�'�'�'�$���+�+�+�����������(���8$�$�$�$�"���)�)�)�X!%�r�w�~�$(�D�C�C�C�C�@"�C�T�T�V�V�+A�+A�+A�+A�+A�+Ar'