KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /lib/python3/dist-packages/pbr/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/pbr/__pycache__/git.cpython-38.pyc
U

jP�^<-�@sddlmZddlZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZd,dd	�Zd
d�Zdd
�Zdd�Zdd�Zd-dd�Zdd�Zdd�Zdd�Zd.dd�Zdd�Zdd �Zd/d!d"�Zd#d$�Zd%d&�Zdejjddfd'd(�Z dd)e!�fd*d+�Z"dS)0�)�unicode_literalsN)�log)�options)�versionFTc	Cs�|rtj}tj}nd}d}tj��}|r2|�|�tj||||d�}|��}|jrl|rlt	j
�d||jf��t|�dks�|dr�|d�
�s�dS|d�
��dd�S)N)�stdout�stderr�envz%s returned %dr��utf-8�replace)�
subprocess�PIPE�os�environ�copy�update�PopenZcommunicate�
returncode�	distutils�errorsZDistutilsError�len�strip�decode)	�cmdZthrow_on_error�bufferrZout_locationZerr_locationZnewenv�output�out�r�)/usr/lib/python3/dist-packages/pbr/git.py�_run_shell_command"s*

�
� rcKs,t|ttf�s|g}tdd|g|f|�S)N�gitz--git-dir=%s)�
isinstance�list�tupler)r�git_dir�kwargsrrr�_run_git_command=s��r&c
CsPztdddg�WStk
rJ}z|jtjkr8WY�
dS�W5d}~XYnXdS)Nr z	rev-parsez	--git-dirr	)r�OSError�errnoZENOENT)�errr�_get_git_directoryDs
r*cCs,ztddg�Wntk
r&YdSXdS)Nr z	--versionFT)rr'rrrr�_git_is_installedNs
r+cCst|tjd�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_resourcesZ
parse_version)�tagsrrr�_get_highest_tagYsr0r	cCsLg}|dkrt�}|r>t�d�tddg|�}|�d�d��}dd�|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
cSsg|]}|r|�qSrr)�.0�frrr�
<listcomp>qsz#_find_git_files.<locals>.<listcomp>)�_run_git_functionsr�infor&�splitr)�dirnamer$Z	file_listrrr�_find_git_filesbs
r9cCs6tddg|�}d|kr&|�dd�dSd|kr2dSdS)N�describez--always�-�����.r)r&�rsplit)r$r:rrr�_get_raw_tag_infotsr@cCst|�dkS)Nr)r@�r$rrr�get_is_release}srBcCsd}t�rt�}|pdS)N)r+r*rArrrr5�sr5cCs"|s
t�}|rtdddg|�SdS)z1Return the short sha for this repo, if it exists.rz-n1z--pretty=format:%hN)r5r&rArrr�get_git_short_sha�s�rCcCs(|�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��msgrrr�_clean_changelog_message�s
rIccs�d}d}|dfV|D]�\}}}|r\t|�}t|�d}|sF|dfV|dt||d�fV|�d�s�|�d	�r||dd
�}t|�}|dt|d�fVd
}qdS)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
=======

r;�
z%(tag)s
%(underline)s

)�tag�	underlinezMerge r>���z
* %(msg)s
rGF)r0r�dict�
startswith�endswithrI)�	changelogZ
first_lineZcurrent_release�hashr/rHrLrrr�_iter_changelog�s(


��

rScCs|dkrt�}|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.
    N)r*�_iter_log_innerrArrr�_iter_log_oneline�s

rUcCs.ztj�|�WdStk
r(YdSXdS)NTF)rZSemanticVersionZfrom_pip_string�
ValueError)�	candidaterrr�_is_valid_version�s
rXccs�t�d�dddg}t||�}|�d�D]�}|�d�}t|�dkrDq(|\}}}t�}d|kr�|��d	d
�}|�d�d	d�D],}	|	�d�d
�dd�}
t|
�r~|�	|
�q~|||fVq(dS)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 ChangeLogrz--decorate=fullz--format=%h%x00%s%x00%drJ��z
refs/tags/�rMNz, rr;r>)
rr6r&r7r�setrrrX�add)r$Zlog_cmdrQ�lineZ
line_partsZsharHZrefnamer/Z
tag_stringrWrrrrT�s 




rTc	Cs�t��}|si}t�|dd�}|r&dS|s@t|d�}|r@t|�}|sHdStj�|d�}tj�|�r~t�	|tj
�s~t�d�dSt�d�t
j|dd	d
��}|D]\}}	|�|	�q�W5QRXt��}
t�d|
|�dS)z-Write a changelog based on the git changelog.Zskip_changelogZSKIP_WRITE_GIT_CHANGELOGNrAZ	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_optionrUrSr�path�join�exists�access�W_OKrr6�io�open�write)r$�dest_dir�option_dictrQ�start�should_skipZ
new_changelogZchangelog_file�releaseZcontent�stoprrr�write_git_changelogs0�


rqr>c
sht�|dd�}|rdSt��}tj�|d�}tj�|d�}tj�|�rXt�|tj�sXdSt	�
d�d�|dkrtt�}|�rJg}dd	g}|t||��
d
�7}�fdd�|D�}td|�}	t�d
|	tj�}
dd�|
D�}
||
7}tt|��}t|d��R}tj�|��r&t|d��}|�|���W5QRX|�d
�|�d
�d��W5QRXt��}
t	�
d|
|�dS)z&Create AUTHORS file using git commits.Zskip_authorsZSKIP_GENERATE_AUTHORSNz
AUTHORS.inZAUTHORSz[pbr] Generating AUTHORSz5((jenkins|zuul)@review|infra@lists|jenkins@openstack)rz--format=%aN <%aE>rJcsg|]}t��|�s|�qSr)�re�search)r2�a�Z
ignore_emailsrrr4?sz$generate_authors.<locals>.<listcomp>zCo-authored-by:.+cSs$g|]}|r|�dd�d���qS)�:r[)r7r)r2Zsignedrrrr4Es��wb�rbr
z[pbr] AUTHORS complete (%0.1fs))rrbrarrcrdrerfrgrr6r*r&r7rr�findall�	MULTILINE�sortedr\rirj�read�encode)r$rkrlrnrmZold_authorsZnew_authorsZauthorsZgit_log_cmdZco_authors_outZ
co_authorsZnew_authors_fhZold_authors_fhrprrur�generate_authors'sJ�

���r~)FTN)r	N)N)N)#Z
__future__rZdistutils.errorsrrr(rhrrrrrar.Zpbrrrrr&r*r+r0r9r@rBr5rCrIrSrUrXrTrc�curdirrqrNr~rrrr�<module>s>

	
	


,�
 

Anon7 - 2021