^cHddlZddlmZddlmZddlmZmZmZm Z m Z m Z m Z m Z mZmZmZmZddlmZejZejZGddZGd d eZGd d ejZd ZGdde jZGdde j e j!Z"ddZ#dS)N)_)sha1nodeconstants) branchmap changelogerror localrepomanifest namespacespathutilpycompat requirementsurlutilvfs)urlutilc@eZdZdZdZdZdZd dZdZdZ d Z dS) httprangereaderc>||_d|_||_||_dS)Nr)rposopenername)selfrrs :/usr/lib/python3/dist-packages/mercurial/statichttprepo.py__init__zhttprangereader.__init__&s"  c|SNrs r __enter__zhttprangereader.__enter__-s rc.|dSr)close)rexc_type exc_value tracebacks r__exit__zhttprangereader.__exit__0s rc||_dSr)r)rrs rseekzhttprangereader.seek3s rNcttj|j}d}|r |j|zdz }|js|r |dd|j|fz |j|}| }|j }nt#tj $r;}|j dkr tjpd}t|t!|d}~wtj$r}td|jd}~wwxYw|dkr*|r||j|j|z}n||jd}n |r |d|}|xjt'|z c_|S)NrrRangez bytes=%d-%si)urlreqrequestr strurlrr add_headerropenreadcodeurlerr httperrorerrnoENOENTIOErrorstrurlerrorreasonlen) rbytesreqendfdatar3instnums rr2zhttprangereader.read6snnX_TX6677  '(U"Q&C 8 Es E NN7MTXsO$C D D D -   %%A6688D6DD * * *)s"3u|;tC#s4yy)) ) - - -$ ,, , - 3;; (DHtx%'778DHJJ'  fpr3rWhdrsrs rhttp_error_206z _HTTPRangeHandler.http_error_206qs8   b$(8(8(:(: ; ;rc td)NsRequested Range Not Satisfiable)rP)rr>rXr3rWrYs rhttp_error_416z _HTTPRangeHandler.http_error_416xs<===rN)rLrMrNrQr[r]rrrrSrShs<>>>>>rrSctj||tGfddtj}|S)Nc(eZdZdZdfd ZdZdS)#build_opener..statichttpvfsc"||_i|_dSr)baseoptions)rrbs rrz,build_opener..statichttpvfs.__init__sDIDLLLrrc|dvrtdd|jt|f}t |S)N)rdsrbsPermission denied/)r8joinrbr-quoter)rpathmodeargskwr@ urlopeners r__call__z,build_opener..statichttpvfs.__call__sQ=((2333 49fll4&8&89::A"1i00 0rcH|rtj|j|S|jSr)r rgrb)rris rrgz(build_opener..statichttpvfs.joins& !}TY555y rN)rd)rLrMrNrrnrg)rmsr statichttpvfsr`sQ    1 1 1 1 1 1  ! ! ! ! !rrp)rr add_handlerrSvfsmod abstractvfs)uiauthinforprms @r build_openerrv}sn 2x((I +--...!!!!!!!*!!!" rceZdZdZdZdS)statichttppeercdSrrr s rlocalzstatichttppeer.localstrcdSNFrr s rcanpushzstatichttppeer.canpushurN)rLrMrNrzr}rrrrxrxs2rrxcdeZdZejjZdZfdZdZ dZ dZ d dZ d dZ d ZxZS) statichttprepositorycB||_||_||_tj|ddz}|\|_}t||}||j|_ ||j d|_ g|_ tj |_d|_d|_t#|_t#|_ t#|j d}n#t,$rt#} | d}|d|n4#t,$r't1d|z}t3j|wxYwYnwxYwt6j|vrZ||j d} |t#| dz}t;j|} t;j|| t;j ||tB|_"|j"j#|_#t;j$||j||_%|j%j|_&|j%j'|_(|j%j |_)i|_*||_+tYj-|j"|j(} tYj.|j(|| |/|_.taj0|j(|_0d|_1d|_2tgj4|_5d|_6d|_7d|_8d|_9dS) Nrfs/.hgscachesrequiress 00changelog.irs+'%s' does not appear to be an hg repositorysstore):_urlrtrootrrrstriprurirvrrgcachevfs_phasedefaultsr names filtername_extrafilteridset_wanted_sidedatafeaturesr2rEFileNotFoundErrorr#rr RepoErrorrequirementsmodSHARESAFE_REQUIREMENTr gathersupportedrequirementsensurerequirementsrecognizedensurerequirementscompatibler nodeconstantsnullid makestorestorespathrsvfssjoin _filecacherr manifestrevlog manifestlog narrowmatchr_tags nodetagscacherBranchMapCache _branchcaches_revbranchcache encodepats decodepats _transref) rrtriuruvfsclassrrXrWstorevfssupportedrequirements rootmanifests rrzstatichttprepository.__init__s(  K D))G3 4 4jjll 8H--8DI&& x!8!899  *,, " #  +tx}}[99DDFFGGLL + + +55L +XX.//  $ + + +FGG$Noc*** +  +  0L @ @x h 7 788H C k : : E E G GHH HL ) Eb I I. /    .r<@@@.(/ (ty(KK Z_ J% Z_ (.t/A49MM #/ It\4+;+;+=+=  #,TY77 !&577#s*=9D77G>FG1GGGctt||}|dgS)Nspushkey)superr_restrictcapabilities difference)rcaps __class__s rrz*statichttprepository._restrictcapabilitiess5)400FFtLL |,,,rc|jSr)rr s rrzstatichttprepository.urls yrcdSr|rr s rrzzstatichttprepository.localr~rc t|Sr)rxr s rpeerzstatichttprepository.peersd###rTcdtjdtddtdNrslock not availableslocks"cannot lock static-http repositoryrLockUnavailablerrwaits rwlockzstatichttprepository.wlock5# # $ $  3 4 4    rcdtjdtddtdrrrs rlockzstatichttprepository.lockrrcdSrrr s r _writecachesz!statichttprepository._writecachesrKr)T)rLrMrNr localrepository_basesupported supportedrrrrzrrrr __classcell__)rs@rrrs)8I@@@D-----$$$               rrcx|r!tjtdt||ddS)Ns(cannot create new static-http repository)rAbortrr)rtricreateintents createoptss rinstancers< Jk!GHHIII DH - --r)NN)$r6i18nrnoderrrrr r r r r rrrrrrrutilsrr4r-rr8rP basehandlerrSrv localpeerrxrrevlogfilestoragerrrrrrs  ######                              9 9 9 9 9 9 9 9 ~AAAAA'AAA>>>>>*>>>*2Y(e e e e e  y:e e e P......r