[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@13.59.26.63: ~ $


�t�_�6�@s�ddlmZddlZddlZddlZddlmZddl	mZ
ddl	mZddl
mZmZddlmZmZddlmZddlmZdd	lmZdd
lmZmZmZmZer$ddlmZm Z ddlm!Z!dd
lm"Z"m#Z#e
j$Z$e
j%Z%ej&e'�Z(ej)d�Z*dd�Z+Gdd�de�Z,ej-e,�dS)�)�absolute_importN)�parse)�request)�
BadCommand�SubProcessError)�display_path�hide_url)�make_command)�
TempDirectory)�MYPY_CHECK_RUNNING)�RemoteNotFoundError�VersionControl�!find_path_to_setup_from_repo_root�vcs)�Optional�Tuple)�
HiddenText)�AuthInfo�
RevOptionsz^[a-fA-F0-9]{40}$cCsttj|��S)N)�bool�
HASH_REGEX�match)�sha�r��/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-1.el7.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/vcs/git.py�looks_like_hash*srcsQeZdZdZdZdZd/Zd0ZdZe	dd
��Z
dd�Zdd�Ze
dd��Zdd�Ze
dd��Ze
dd��Ze
dd��Zdd�Zdd�Zd d!�Ze
d"d#��Ze
d$d%d&��Ze
d'd(��Ze
�fd)d*��Ze
d+d,��Ze
�fd-d.��Z�S)1�Git�gitz.git�clone�git+http�	git+https�git+ssh�git+git�git+file�GIT_DIR�
GIT_WORK_TREE�HEADcCs|gS)Nr)�revrrr�get_base_rev_args:szGit.get_base_rev_argscCse|jt|��\}}|js(dS|j||j�sAdSt|j||j�d�}|S)NFr)�get_url_rev_optionsrr'�is_commit_id_equalr�get_revision_sha)�self�url�dest�_�rev_options�is_tag_or_branchrrr�is_immutable_rev_checkout>s	zGit.is_immutable_rev_checkoutcCs|d}|jdg�}|j|�rJ|t|�d�j�d}nd}dj|jd�dd��}t|�S)Nzgit version �versionr��.�)�run_command�
startswith�len�split�join�
parse_version)r,�VERSION_PFXr3rrr�get_git_versionOs#"zGit.get_git_versioncCs]dddg}|j|dd	d|�}|j�}|jd�rY|td�d�SdS)
zl
        Return the current branch, or None if HEAD isn't at a branch
        (e.g. detached HEAD).
        zsymbolic-refz-qr&�extra_ok_returncodes��cwdzrefs/heads/N)r@)r7�stripr8r9)�cls�location�args�output�refrrr�get_current_branch\s
zGit.get_current_branchc
Csq|jd�s|d}tdd��B}|j|jd|�|jdddd|gd	|j�Wd
QRXd
S)z@Export the Git repository at the url to the destination location�/�kind�exportr-zcheckout-indexz-az-fz--prefixrAN)�endswithr
�unpack�pathr7)r,rDr-�temp_dirrrrrKqs
z
Git.exportc
Csd}y|jd|gd|�}Wntk
r9YnXi}xd|j�j�D]P}y|j�\}}Wn'tk
r�tdj|���YnX|||<qSWdj|�}dj|�}	|j|�}|dk	r�|dfS|j|	�}|d	fS)
z�
        Return (sha_or_none, is_branch), where sha_or_none is a commit hash
        if the revision names a remote branch or tag, otherwise None.

        Args:
          dest: the repository directory.
          rev: the revision name.
        r4zshow-refrAzunexpected show-ref line: {!r}zrefs/remotes/origin/{}zrefs/tags/{}NTF)r7rrB�
splitlinesr:�
ValueError�format�get)
rCr.r'rF�refs�linerrG�
branch_ref�tag_refrrrr+~s&


zGit.get_revision_shacCs�|j}|dk	st�|j||�\}}|dk	rg|j|�}|rZ|nd|_|St|�s�tjd|�|jd�s�|S|j	t
dd||j��d|�|j|dd�}|j|�}|S)	z�
        Resolve a revision to a new RevOptions object with the SHA1 of the
        branch, tag, or ref if found.

        Args:
          rev_options: a RevOptions object.
        Nz:Did not find branch or tag '%s', assuming revision or ref.zrefs/�fetchz-qrAr'�
FETCH_HEAD)
�arg_rev�AssertionErrorr+�make_new�branch_namer�logger�warningr8r7r	�to_args�get_revision)rCr.r-r0r'r�	is_branchrrr�resolve_revision�s&
	zGit.resolve_revisioncCs|s
dS|j|�|kS)z�
        Return whether the current commit hash equals the given name.

        Args:
          dest: the repository directory.
          name: a string name.
        F)ra)rCr.�namerrrr*�s	zGit.is_commit_id_equalcCs |j�}tjd||t|��|jtdd||��|jr|j|||�}t|dd�}|dkr�|j	||j�stdd|j
��}|j|d|�nL|j|�|krdj|�}dd|d	|g}|j|d|�|j
|�dS)
NzCloning %s%s to %srz-qr]�checkoutrAz	origin/{}z-bz--track)�
to_displayr^�inforr7r	r'rc�getattrr*r`rHrR�update_submodules)r,r.r-r0�rev_displayr]�cmd_args�track_branchrrr�	fetch_new�s 	z
Git.fetch_newcCs[|jtdd|�d|�tdd|j��}|j|d|�|j|�dS)N�configzremote.origin.urlrArez-q)r7r	r`ri)r,r.r-r0rkrrr�switchsz
Git.switchcCs�|j�td�kr7|jdddgd|�n|jddgd|�|j|||�}tddd|j��}|j|d|�|j|�dS)Nz1.9.0rXz-qz--tagsrA�resetz--hard)r>r<r7rcr	r`ri)r,r.r-r0rkrrr�updatesz
Git.updatecCs�|jdddgdd
d|�}|j�}y|d}Wntk
rXt�YnXx$|D]}|jd�r`|}Pq`W|jd	�d}|j�S)z�
        Return URL of the first remote encountered.

        Raises RemoteNotFoundError if the repository does not have a remote
        url configured.
        rnz--get-regexpzremote\..*\.urlr?r@rArzremote.origin.url � )r@)r7rP�
IndexErrorrr8r:rB)rCrD�stdout�remotes�found_remote�remoter-rrr�get_remote_urls


zGit.get_remote_urlNcCs7|dkrd}|jd|gd|�}|j�S)Nr&z	rev-parserA)r7rB)rCrDr'�current_revrrrra5s
zGit.get_revisioncCsv|jddgd|�j�}tjj|�sHtjj||�}tjjtjj|d��}t||�S)z~
        Return the path to setup.py, relative to the repo root.
        Return None if setup.py is in the repo root.
        z	rev-parsez	--git-dirrAz..)r7rB�osrN�isabsr;�abspathr)rCrD�git_dir�	repo_rootrrr�get_subdirectory>s!zGit.get_subdirectorycsgt|�\}}}}}|jd�r�|dt|jd���}|tj|�jdd�jd�}t|||||f�}|jd�d}	|d|	�t||	d�||||f�}d|kr9d|ks�t	�|jd	d
�}t
t|�j|�\}}
}|jdd�}n!t
t|�j|�\}}
}||
|fS)
a9
        Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
        That's required because although they use SSH they sometimes don't
        work with a ssh:// scheme (e.g. GitHub). But we need a scheme for
        parsing. Hence we remove it again afterwards and return it as a stub.
        �fileNrI�\�+r@z://zfile:zgit+z
git+ssh://zssh://r4)
�urlsplitrLr9�lstrip�urllib_request�url2pathname�replace�
urlunsplit�findr[�superr�get_url_rev_and_auth)rCr-�scheme�netlocrN�query�fragment�initial_slashes�newpath�
after_plusr'�	user_pass)�	__class__rrr�Ms" #!!zGit.get_url_rev_and_authcCsKtjjtjj|d��s%dS|jdddddgd|�dS)Nz.gitmodules�	submodulerqz--initz--recursivez-qrA)rzrN�existsr;r7)rCrDrrrrips
!zGit.update_submodulescs�tt|�j|�}|r"|Sy%|jddgd|dd�}Wn;tk
rotjd|�dSYntk
r�dSYnXtj	j
|jd��S)Nz	rev-parsez--show-toplevelrA�log_failed_cmdFzKcould not determine if %s is under git control because git is not availablez
)r�r�get_repository_rootr7rr^�debugrrzrN�normpath�rstrip)rCrD�loc�r)r�rrr�ys

	
	zGit.get_repository_root)rrr r!r"r#)r$r%)�__name__�
__module__�__qualname__rd�dirname�	repo_name�schemes�
unset_environ�default_arg_rev�staticmethodr(r2r>�classmethodrHrKr+rcr*rmrorqrxrarr�rir�rr)r�rr.s0

(-#	r).�
__future__r�logging�os.pathrz�re�pip._vendor.packaging.versionrr<Zpip._vendor.six.moves.urllib�urllib_parserr��pip._internal.exceptionsrr�pip._internal.utils.miscrr�pip._internal.utils.subprocessr	�pip._internal.utils.temp_dirr
�pip._internal.utils.typingr� pip._internal.vcs.versioncontrolrr
rr�typingrrrrrr�r��	getLoggerr�r^�compilerrr�registerrrrr�<module>s0"		�`

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.pyc File 541 B 0644
bazaar.cpython-35.pyc File 3.94 KB 0644
git.cpython-35.pyc File 10.17 KB 0644
mercurial.cpython-35.pyc File 5.22 KB 0644
subversion.cpython-35.pyc File 8.96 KB 0644
versioncontrol.cpython-35.pyc File 21.68 KB 0644