Current File : //proc/3/root/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyo
�
�wMVc@s�dZddlZddlZddlmZmZddlmZddlm Z m
Z
mZmZm
Z
ddgZdefd ��YZe�Zd
efd��YZd�ZdS(
s)Handles all VCS (version control) supporti����N(turlparseturllib(tlogger(tdisplay_patht
backup_dirtfind_commandtrmtreetask_path_existstvcstget_src_requirementt
VcsSupportcBs�eZiZddddddgZd�Zd�Zed��Zed ��Zed
��Z d�Z
ddd�Zd
�Z
d�Zd�ZRS(tsshtgitthgtbzrtsftptsvncCsRtjj|j�ttdd�r;tjj|j�ntt|�j �dS(Nt
uses_fragment(
Rtuses_netloctextendtschemestgetattrtNoneRtsuperR
t__init__(tself((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyRscCs
|jj�S(N(t _registryt__iter__(R((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyRscCst|jj��S(N(tlistRtvalues(R((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytbackendsscCsg|jD]}|j^q
S(N(Rtdirname(Rtbackend((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytdirnames"scCs.g}x!|jD]}|j|j�qW|S(N(RRR(RRR ((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytall_schemes&scCsPt|d�s'tjd|j�dS|j|jkrL||j|j<ndS(NtnamesCannot register VCS %s(thasattrRtwarnt__name__R#R(Rtcls((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytregister-s
cCsR||jkr|j|=n2||jj�krA|j|j=n
tjd�dS(Ns0Cannot unregister because no class or name given(RRR#RR%(RR'R#((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyt
unregister4s
cCsOxH|jj�D]7}tjj||j�}tjj|�r|jSqWdS(s�
Return the name of the version control backend if found at given
location, e.g. vcs.get_backend_name('/path/to/vcs/checkout')
N( RRtostpathtjoinRtexistsR#R(Rtlocationtvc_typeR+((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytget_backend_name<s
cCs*|j�}||jkr&|j|SdS(N(tlowerR(RR#((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytget_backendGscCs&|j|�}|r"|j|�SdS(N(R0R2R(RR.R/((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytget_backend_from_locationLs
N(R&t
__module__RRRRtpropertyRR!R"R(RR)R0R2R3(((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyR
s tVersionControlcBs�eZdZdZdd�Zd�Zd�Zed��Z d�Z
d�Zd�Zd�Z
d �Zd
�Zd�Zd�Zd
�Zd�Zed�ZRS(tcOs/||_d|_tt|�j||�dS(N(turlRt_cmdRR6R(RR8targstkwargs((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyRZs cCs
tj|fS(N(RtINFO(Rtline((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyt_filter_scCs1tjj|�\}}|jtjj�p0|S(s~
posix absolute paths start with os.path.sep,
win32 ones ones start with drive (like c:\folder)
(R*R+t
splitdrivet
startswithtsep(Rtrepotdrivettail((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyt_is_local_repositorybscCsL|jdk r|jSt|j�}tjd|j|f�||_|S(NsFound command %r at %r(R9RRR#Rtinfo(Rtcommand((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytcmdjs c Cs�d}|jjdd�d}tj|�\}}}}}d}d|krj|jdd�\}}ntj||||df�}||fS(sm
Returns the correct repository URL and revision by parsing the given
repository URL
svSorry, '%s' is a malformed VCS url. The format is <vcs>+<protocol>://<url>, e.g. svn+http://myrepo/svn/MyApp#egg=MyAppt+it@R7N(R8tsplitRturlsplitRtrsplitt
urlunsplit( Rt
error_messageR8tschemetnetlocR+tquerytfragtrev((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytget_url_revsscCs|j|�|j|�fS(sA
Returns (url, revision), where both are strings
(tget_urltget_revision(RR.((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytget_info�scCstj|�jd�S(sa
Normalize a URL for comparison by unquoting it and removing any trailing slash.
t/(Rtunquotetrstrip(RR8((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyt
normalize_url�scCs|j|�|j|�kS(sV
Compare two repo URLs for identity, ignoring incidental differences.
(R\(Rturl1turl2((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytcompare_urls�scCs
t�dS(s�
Takes the contents of the bundled text file that explains how to revert
the stripped off version control data of the given package and returns
the URL and revision of it.
N(tNotImplementedError(Rtcontent((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytparse_vcs_bundle_file�scCs
t�dS(sx
Called when installing or updating an editable package, takes the
source path of the checkout.
N(R`(Rtdest((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytobtain�scCs
t�dS(sB
Switch the repo at ``dest`` to point to ``URL``.
N(tNotImplemented(RRcR8trev_options((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytswitch�scCs
t�dS(sO
Update an already-existing repo to the given ``rev_options``.
N(R`(RRcRf((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytupdate�sc
CsLt}t}tjj|�r/t}tjjtjj||j��r|j|�}|j||�r�t j
d|jj�t
|�|f�t jdt
|�|j|f�|j||�q,t jd|j|jt
|�|f�ddf}q/t jd ||j|jf�d
df}n|rHt jd|j|f�td|d
|d�}|dkr�t jd|jt
|�||f�|j|||�qH|dkr�qH|dkr�t jdt
|��t|�t}qH|dkrHt|�} t jdt
|�| f�tj|| �t}qHn|S(s�
Prepare a location to receive a checkout/clone.
Return True if the location is ready for (and requires) a
checkout/clone, False otherwise.
s)%s in %s exists, and has correct URL (%s)sUpdating %s %s%ss%s %s in %s exists with URL %ss%(s)witch, (i)gnore, (w)ipe, (b)ackup tstitwtbs0Directory %s already exists, and is not a %s %s.s(i)gnore, (w)ipe, (b)ackup s+The plan is to install the %s repository %ssWhat to do? %siisSwitching %s %s to %s%ssDeleting %ssBacking up %s to %s(RiRjRkRl(RjRkRl(tTruetFalseR*R+R-R,RRVR_RRFt repo_namettitleRtnotifyRhR%R#RRgRRtshutiltmove(
RRcR8Rftrev_displaytcheckouttprompttexisting_urltresponsetdest_dir((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytcheck_destination�sZ$
cCs0tjj|�rt|�n|j|�dS(N(R*R+R-RRd(RR.((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pytunpack�s
cCs
t�dS(N(R`(RtdistR.t find_tags((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyR �sN(R&R4R#RRRR>RER5RHRURXR\R_RbRdRgRhRzR{RnR (((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyR6Vs" : cCsFtj|�}|r+|�j|||�Stjd|�|j�S(Nstcannot determine version of editable source in %s (is not SVN checkout, Git clone, Mercurial clone or Bazaar branch)(RR3R RR%tas_requirement(R|R.R}tversion_control((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyR �s
(t__doc__R*Rrtpip.backwardcompatRRtpip.logRtpip.utilRRRRRt__all__tobjectR
RR6R (((sA/opt/alt/python35/lib/python3.5/site-packages/pip/vcs/__init__.pyt<module>s(D �