File "git.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib/python3.4/site-packages/pip/vcs/__pycache__/git.cpython-34.pyc
File size: 6.92 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


Re@sddlZddlZddlZddlmZddlmZmZddlm	Z	m
Z
ddlmZddl
mZmZejZejZGddde
Ze	jedS)	N)call_subprocess)display_pathrmtree)vcsVersionControl)logger)url2pathnameurlparsecseZdZdZdZdZd&Zd	Zd
Zdfdd
Z	ddZ
ddZddZddZ
ddZddZddZddZddZd d!Zfd"d#Zd$d%ZS)'Gitgitz.gitclonegit+http	git+httpsgit+sshgit+gitgit+filez
git-clone.txtzs# This was a Git repo; to make it a repo again run:
git init
git remote add origin %(url)s -f
git checkout %(rev)s
Ncs|rt|\}}}}}|jdr|dt|jd}	|	t|jddjd}
t|||
||f}|jdd}|d|t||d||
||f}qntt	|j
|||dS)Nfile/\+)urlsplitendswithlenlstriprreplace
urlunsplitfindsuperr
__init__)selfurlargskwargsschemenetlocpathqueryfragmentinitial_slashesnewpath
after_plus)	__class__&/tmp/pip-ztkk0jow-build/pip/vcs/git.pyrs %9zGit.__init__cCsd}}x|jD]}|js|jjdrEqntjd|}|ru|jdj}ntjd|}|r|jdj}n|r|r||fSqWdS)N#z$git\s*remote\s*add\s*origin(.*)\s*-frz^git\s*checkout\s*-q\s*(.*)\s*)NN)
splitlinesstrip
startswithresearchgroup)r contentr!revline	url_match	rev_matchr-r-r.parse_vcs_bundle_file%s
"zGit.parse_vcs_bundle_filecCstjdd}|j|zT|jds>|d}nt|jdddd|gd|jd	d
d|Wdt|XdS)
z@Export the Git repository at the url to the destination locationz-exportzpip-rzcheckout-indexz-az-fz--prefix
filter_stdoutshow_stdoutFcwdN)tempfilemkdtempunpackrrcmd_filterr)r locationtemp_dirr-r-r.export4s

z
Git.exportcCs`|j|}d|}||kr0||gS||krG||gStjd||SdS)zCheck 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.
        z	origin/%sz5Could not find a tag or branch '%s', assuming commit.N)get_refsrwarn)r r7destrev_options	revisions
origin_revr-r-r.check_rev_optionsAs
zGit.check_rev_optionscCsPt|jdd|gd|t|jddg|d||j|dS)Nconfigzremote.origin.urlr>checkoutz-q)rrBupdate_submodules)r rIr!rJr-r-r.switchSs
z
Git.switchcCsrt|jddgd||r>|j|d||}nt|jdddg|d||j|dS)Nfetchz-qr>rresetz--hard)rrBrMrP)r rIrJr-r-r.update[s
#z
Git.updatecCs|j\}}|r.|g}d|}ndg}d}|j||||rtjd||t|ft|jdd||g|j||r|j|||}|j	|j
|dst|jddg|d	|qqndS)
Nz (to %s)z
origin/masterzCloning %s%s to %srz-qrrOr>)get_url_revcheck_destinationrnotifyrrrBrPrMget_revisionr2)r rIr!r7rJrev_displayr-r-r.obtaines	
	 
z
Git.obtaincCs.t|jddgddd|}|jS)NrNzremote.origin.urlr=Fr>)rrBr1)r rDr!r-r-r.get_urlxszGit.get_urlcCs.t|jddgddd|}|jS)Nz	rev-parseHEADr=Fr>)rrBr1)r rDcurrent_revr-r-r.rY~s!zGit.get_revisioncCs	t|jdgddd|}i}x|jjD]}|jdd\}}|j}d}|jdr|tdd}nP|jd	r|td	d}n(|jd
r|td
d}n|dk	r:|j||<q:q:W|S)z=Return map of named refs (branches or tags) to commit hashes.zshow-refr=Fr> rNz
refs/remotes/zrefs/heads/z
refs/tags/)rrBr1r0splitr2r)r rDoutputrvr8commitrefref_namer-r-r.rGs zGit.get_refsc
Cs|j|}|jjds1d|}n|jjddd}|sWdS|j|}|j|}tdd|jD}||krd|||f}	n
d	|}	d
|||	fS)Nzgit:zgit+-rrcss!|]\}}||fVqdS)Nr-).0rdrcr-r-r.	<genexpr>sz*Git.get_src_requirement.<locals>.<genexpr>z%s-%sz%s-devz%s@%s#egg=%s)	r\lowerr2egg_namer`rYrGdictitems)
r distrD	find_tagsrepoegg_project_namer^refsnames_by_commit
full_egg_namer-r-r.get_src_requirements

zGit.get_src_requirementcsd|jkrld|jks$t|jjdd|_tt|j\}}|jdd}ntt|j\}}||fS)a;
        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.
        z://zfile:zgit+z
git+ssh://zssh://rU)r!AssertionErrorrrr
rV)r r!r7)r,r-r.rVszGit.get_url_revcCsNtjjtjj|ds%dSt|jdddddgd|dS)Nz.gitmodules	submodulerTz--initz--recursivez-qr>)osr&existsjoinrrB)r rDr-r-r.rPs!zGit.update_submodules)zgitr
rrrr)__name__
__module____qualname__namedirname	repo_nameschemesbundle_fileguiderr;rFrMrQrTr[r\rYrGrtrVrPr-r-)r,r.r

s&

r
)r?r3os.pathrwpip.utilrrrpip.vcsrrpip.logrZpip.backwardcompatrr	rrr
registerr-r-r-r.<module>s