ั๒ 9ีาTc @@s฿dZddklZddkZddkZddkZddklZddk l Z ddk l Z l Z lZlZlZddgZeieƒ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˜eZhZddddddgZd„Zd„Zed„ƒZed „ƒZed „ƒZ d „Z ddd „Z d „Z d„Zd„ZRS(tsshtgitthgtbzrtsftptsvncC@sTtii|iƒttddƒotii|iƒntt|ƒi ƒdS(Nt uses_fragment( t urllib_parset uses_netloctextendtschemestgetattrtNoneRtsuperR t__init__(tself((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyRscC@s |iiƒS(N(t _registryt__iter__(R((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyR"scC@st|iiƒƒS(N(tlistRtvalues(R((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytbackends%scC@s%g}|iD]}||iq~S(N(Rtdirname(Rt_[1]tbackend((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytdirnames)scC@s.g}x!|iD]}|i|iƒqW|S(N(RRR(RRR"((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyt all_schemes-s  cC@sSt|dƒptid|iƒdS|i|ijo||i|i+://, e.g. svn+http://myrepo/svn/MyApp#egg=MyAppt+it@R:N(R;tAssertionErrortsplitRturlsplitRtrsplitt urlunsplit( Rt error_messageR;tschemetnetlocR.tquerytfragtrev((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyt get_url_rev‰s! cC@sG|idƒi|iƒ ptd|‚|i|ƒ|i|ƒfS(sA Returns (url, revision), where both are strings RMsBad directory: %s(trstriptendswithR RVtget_urlt get_revision(RR1((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytget_infoœs  cC@sti|ƒidƒS(si Normalize a URL for comparison by unquoting it and removing any trailing slash. RM(RtunquoteRb(RR;((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyt normalize_urlคscC@s|i|ƒ|i|ƒjS(sV Compare two repo URLs for identity, ignoring incidental differences. (Rh(Rturl1turl2((s6/usr/lib/python2.6/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(RR(Rtdest((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytobtainฑscC@s t‚dS(sB Switch the repo at ``dest`` to point to ``URL``. N(RR(RRlR;t rev_options((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytswitchธscC@s t‚dS(sO Update an already-existing repo to the given ``rev_options``. N(RR(RRlRn((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytupdateพsc C@s?t}t}tii|ƒot}tiitii||iƒƒoฏ|i|ƒ}|i||ƒoXt i d|i i ƒt |ƒ|ƒt idt |ƒ|i |ƒ|i||ƒq!t id|i|i t |ƒ|ƒddf}q%t id ||i|i ƒd df}n|ot id |i|ƒtd |d |dƒ}|djo9t id|i t |ƒ||ƒ|i|||ƒq;|djoq;|djo*t idt |ƒƒt|ƒt}q;|djo?t|ƒ} t idt |ƒ| ƒti|| ƒ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(RqRrRsRt(RrRsRt(tTruetFalseR-R.R0R/R RdRkR'RJt repo_namettitleRtinfoRpR(R%RRoRRtshutiltmove( RRlR;Rnt rev_displaytcheckouttpromptt existing_urltresponsetdest_dir((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytcheck_destinationฤsx%               cC@s2tii|ƒot|ƒn|i|ƒdS(sq Clean up current location and download the url repository (and vcs infos) into location N(R-R.R0RRm(RR1((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pytunpackscC@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(RR(RtdistR1t find_tags((s6/usr/lib/python2.6/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(RR(RR1((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyRd&scC@s t‚dS(s_ Return the current revision of the files at location Used in get_info N(RR(RR1((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyRe-s(N(R)R7R%R RRRRBRIR8RLRQRSRaRfRhRkRmRoRpR‚RƒRvR RdRe(((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyR9]s*             O cC@sti|ƒ}|oQy|ƒi|||ƒSWqgtj o$tid||iƒ|iƒSXntid|ƒ|iƒ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)(RR6R RR'R(R%tas_requirement(R„R1R…tversion_control((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyR 5s    (t__doc__t __future__RR?R-Rztpip._vendor.six.moves.urllibRRtpip.exceptionsRt pip.utilsRRRRRt__all__t getLoggerR)R'tobjectR RR9R (((s6/usr/lib/python2.6/vendor-packages/pip/vcs/__init__.pyts   ( E ุ