³ò ø$•Jc@sÙddklZddkZddkZddkZddkZddkZddkZddkZddk Z ddk Z ddk Z ddk Z de fd„ƒYZd„Zdeifd„ƒYZd„ZdS( iÿÿÿÿ(t_NthttprangereadercBs&eZd„Zd„Zdd„ZRS(cCs||_d|_||_dS(Ni(turltpostopener(tselfRR((s+/sys/lib/python/mercurial/statichttprepo.pyt__init__s  cCs ||_dS(N(R(RR((s+/sys/lib/python/mercurial/statichttprepo.pytseeksc Cs›ti|iƒ}d}|o|i|d}n|idd|i|fƒye|ii|ƒ}|iƒ}t|dƒo|i ƒ}n$t|dƒo |i }nd}Wntti j o8}|i djo t i pd}t||ƒ‚n/tij o}td|idƒ‚nX|d jo3|o||i|i|!}q‚||i}n|o|| }n|it|ƒ7_|S( NtitRanges bytes=%d-%stgetcodetcodeiÎi”iÈ(turllib2tRequestRRt add_headerRtopentreadthasattrR R t HTTPErrorterrnotENOENTtNonetIOErrortURLErrortreasontlen( RtbytestreqtendtftdataR tinsttnum((s+/sys/lib/python/mercurial/statichttprepo.pyRs4     N(t__name__t __module__RRRR(((s+/sys/lib/python/mercurial/statichttprepo.pyRs  cs8ti||ƒ‰ˆitiƒƒ‡fd†}|S(Ncs|‰d‡‡fd†}|S(s,return a function that opens files over httptrcs+diˆti|ƒfƒ}t|ˆƒS(Nt/(tjointurllibtquoteR(tpathtmodeR(t urlopenertp(s+/sys/lib/python/mercurial/statichttprepo.pytoDs((tbaseR,(R*(R+s+/sys/lib/python/mercurial/statichttprepo.pyRAs(RRt add_handlert byterangetHTTPRangeHandler(tuitauthinfoR((R*s+/sys/lib/python/mercurial/statichttprepo.pyt build_opener<ststatichttprepositorycBs/eZd„Zd„Zd„Zed„ZRS(c Csþ||_||_ti|idƒdƒ\|_}t||ƒ}||iƒ|_y|idƒiƒi ƒ}Wn t j o”}|i t i jo‚ny|idƒidƒWnNt j oB}|i t i jo‚nt dƒ|}ti|ƒ‚nXg}nXx;|D]3}||ijotit dƒ|ƒ‚q!q!Wd„} ti||i|| ƒ|_|ii|_|ii|_|ii|_ti|iƒ|_ti|iƒ|_d|_d|_d|_d|_dS( NR$s/.hgtrequiress 00changelog.iis+'%s' does not appear to be an hg repositorysrequirement '%s' not supportedcSs |d|S(NR$((tatb((s+/sys/lib/python/mercurial/statichttprepo.pytpjoinls(t_urlR1Rt getauthinfotrstripR(R3RRt splitlinesRRRRterrort RepoErrort supportedtstoretspathtsopenerR%tsjointmanifestt changelogRt_tagst nodetagscachet encodepatst decodepats( RR1R(R2Rt requirementsRtmsgR#R8((s+/sys/lib/python/mercurial/statichttprepo.pyRLsB  % !    cCs|iS(N(R9(R((s+/sys/lib/python/mercurial/statichttprepo.pyRzscCstS(N(tFalse(R((s+/sys/lib/python/mercurial/statichttprepo.pytlocal}scCstitdƒƒ‚dS(Ns"cannot lock static-http repository(tutiltAbortR(Rtwait((s+/sys/lib/python/mercurial/statichttprepo.pytlock€s(R!R"RRRMtTrueRQ(((s+/sys/lib/python/mercurial/statichttprepo.pyR4Ks .  cCs1|otitdƒƒ‚nt||dƒS(Ns(cannot create new static-http repositoryi(RNRORR4(R1R(tcreate((s+/sys/lib/python/mercurial/statichttprepo.pytinstanceƒs(ti18nRRER/RR=t localrepoRDRNR@R&R RtobjectRR3tlocalrepositoryR4RT(((s+/sys/lib/python/mercurial/statichttprepo.pys s00$- 8