ó 9ÕÒTc@@sßdZddlmZddlZddlZddlZddlmZddl m Z ddl m Z m Z mZmZmZddgZejeƒZd efd „ƒYZeƒZd efd „ƒYZd „ZdS(s)Handles all VCS (version control) supporti(tabsolute_importN(tparse(t BadCommand(t display_patht backup_dirt find_commandtrmtreetask_path_existstvcstget_src_requirementt VcsSupportcB@s˜eZiZddddddgZd„Zd„Zed„ƒZed „ƒZed „ƒZ d „Z ddd „Z d „Z d„Zd„ZRS(tsshtgitthgtbzrtsftptsvncC@sRtjj|jƒttddƒr;tjj|jƒntt|ƒj ƒdS(Nt uses_fragment( t urllib_parset uses_netloctextendtschemestgetattrtNoneRtsuperR t__init__(tself((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyRscC@s |jjƒS(N(t _registryt__iter__(R((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyR"scC@st|jjƒƒS(N(tlistRtvalues(R((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytbackends%scC@sg|jD]}|j^q S(N(Rtdirname(Rtbackend((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytdirnames)scC@s.g}x!|jD]}|j|jƒqW|S(N(RRR(RRR!((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyt all_schemes-scC@sOt|dƒs&tjd|jƒdS|j|jkrK||j|j+://, e.g. svn+http://myrepo/svn/MyApp#egg=MyAppt+it@R9N(R:tAssertionErrortsplitRturlsplitRtrsplitt urlunsplit( Rt error_messageR:tschemetnetlocR-tquerytfragtrev((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyt get_url_rev‰s" cC@sH|jdƒj|jƒ s,td|ƒ‚|j|ƒ|j|ƒfS(sA Returns (url, revision), where both are strings RLsBad directory: %s(trstriptendswithR RUtget_urlt get_revision(RR0((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytget_infoœs cC@stj|ƒjdƒS(si Normalize a URL for comparison by unquoting it and removing any trailing slash. RL(RtunquoteRa(RR:((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyt normalize_url¤scC@s|j|ƒ|j|ƒkS(sV Compare two repo URLs for identity, ignoring incidental differences. (Rg(Rturl1turl2((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyt compare_urls«scC@s t‚dS(sx Called when installing or updating an editable package, takes the source path of the checkout. N(RQ(Rtdest((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytobtain±scC@s t‚dS(sB Switch the repo at ``dest`` to point to ``URL``. N(RQ(RRkR:t rev_options((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytswitch¸scC@s t‚dS(sO Update an already-existing repo to the given ``rev_options``. N(RQ(RRkRm((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytupdate¾sc C@s/t}t}tjj|ƒrt}tjjtjj||jƒƒrô|j|ƒ}|j||ƒrÀt j d|j j ƒt |ƒ|ƒt jdt |ƒ|j |ƒ|j||ƒqt jd|j|j t |ƒ|ƒddf}qt jd ||j|j ƒd df}n|r+t jd |j|ƒtd |d |dƒ}|dkršt jd|j t |ƒ||ƒ|j|||ƒq+|dkr©q+|dkrÞt jdt |ƒƒt|ƒt}q+|dkr+t|ƒ} t jdt |ƒ| ƒtj|| ƒt}q+n|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%ss Deleting %ssBacking up %s to %s(RpRqRrRs(RqRrRs(tTruetFalseR,R-R/R.R RcRjR&RIt repo_namettitleRtinfoRoR'R$RRnRRtshutiltmove( RRkR:Rmt rev_displaytcheckouttpromptt existing_urltresponsetdest_dir((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytcheck_destinationÄsx$                cC@s0tjj|ƒrt|ƒn|j|ƒdS(sq Clean up current location and download the url repository (and vcs infos) into location N(R,R-R/RRl(RR0((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pytunpacks cC@s t‚dS(s0 Return a string representing the requirement needed to redownload the files currently present in location, something like: {repository_url}@{revision}#egg={project_name}-{version_identifier} If find_tags is True, try to find a tag matching the revision N(RQ(RtdistR0t find_tags((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyR scC@s t‚dS(s_ Return the url used at location Used in get_info or check_destination N(RQ(RR0((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyRc&scC@s t‚dS(s_ Return the current revision of the files at location Used in get_info N(RQ(RR0((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyRd-s(N(R(R6R$R RRRRARHR7RKRPRRR`ReRgRjRlRnRoRR‚RuR RcRd(((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyR8]s*             O cC@s}tj|ƒ}|rcy|ƒj|||ƒSWqctk r_tjd||jƒ|jƒSXntjd|ƒ|jƒS(NsPcannot determine version of editable source in %s (%s command not found in path)stcannot determine version of editable source in %s (is not SVN checkout, Git clone, Mercurial clone or Bazaar branch)(RR5R RR&R'R$tas_requirement(RƒR0R„tversion_control((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyR 5s     (t__doc__t __future__RR>R,Rytpip._vendor.six.moves.urllibRRtpip.exceptionsRt pip.utilsRRRRRt__all__t getLoggerR(R&tobjectR RR8R (((s6/usr/lib/python2.7/vendor-packages/pip/vcs/__init__.pyts   ( E Ø