�
�c@s�ddklZddkZddkZddkZddkZddkZddkZddkZddk Z ddk
Z
ddkZddkZde
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}Wnttij
o8}|i
djo
ti
pd}t||��n/tij
o}td|id��nX|d jo3|o||i|i|!}q�||i}n|o|| }n|it|�7_|S(
NtitRangesbytes=%d-%stgetcodetcodei�i�i�(turllib2tRequestRRt
add_headerRtopentreadthasattrR
Rt HTTPErrorterrnotENOENTtNonetIOErrortURLErrortreasontlen( RtbytestreqtendtftdataRtinsttnum((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(RRtadd_handlert byterangetHTTPRangeHandler(tuitauthinfoR((R*s+/sys/lib/python/mercurial/statichttprepo.pytbuild_opener<ststatichttprepositorycBs/eZd�Zd�Zd�Zed�ZRS(c
Cs�||_||_ti|id�d�\|_}t||�}||i�|_y|id�i�i �}Wn�t
j
o�}|itijo�ny|id�id�WnNt
j
oB}|itijo�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_urlR1RtgetauthinfotrstripR(R3RRt
splitlinesRRRRterrort RepoErrort supportedtstoretspathtsopenerR%tsjointmanifestt changelogRt_tagst
nodetagscachet
encodepatst
decodepats(
RR1R(R2RtrequirementsRtmsgR#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&RRtobjectRR3tlocalrepositoryR4RT(((s+/sys/lib/python/mercurial/statichttprepo.pys<module>
s00$- 8
|