\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s0ddlmZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z mZmZmZmZmZmZmZmZmZmZddlmZmZmZejZejZejZdZ de!fd YZ"d Z#d Z$d Z%d e j&fdYZ'e(dZ)dej*fdYZ+dZ,dej-j.fdYZ/ej0ej1de!fdYZ2ej0ej3de!fdYZ4iie4d6dd6ej56Z6dZ7dej9dZ:dddZ;dS(i(tabsolute_importNi(t_( tbundle2terrorthttpconnectiontpycompatt repositorytstatichttprepoturltutiltwireprotoframingtwireprototypestwireprotov1peertwireprotov2peertwireprotov2server(tcborutilt interfaceutilt stringutilcC@stj|d}|t|dtd}g}d}x^tjdt||D]A}|d7}|j|t|tj||||!fqYW|S(scEncode a string value into multiple HTTP headers. ``value`` will be encoded into 1 or more HTTP headers with the names ``header-`` where ```` is an integer starting at 1. Each header name + value will be at most ``limit`` bytes long. Returns an iterable of 2-tuples consisting of header names and values as native strings. s-%st000s: ii(Rtstrurltlentxrangetappendtstr(tvaluetheadertlimittfmttvaluelentresulttnti((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pytencodevalueinheaders,s " 5t _multifilecB@s;eZdZedZddZejdZ RS(cG@sTx;|D]3}tj|dstdt||qqW||_d|_dS(NtlengthsO_multifile only supports file objects that have a length but this one does not:i(R t safehasattrt ValueErrorttypet _fileobjst_index(tselftfileobjstf((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt__init__Is  cC@std|jDS(Ncs@s|]}|jVqdS(N(R"(t.0R*((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pys Ts(tsumR&(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR"RscC@s|dkr&djd|jDSg}xz|r|jt|jkr|j|j|jj|t|d}||kr|jd7_n||8}q/Wdj|S(Nitcs@s|]}|jVqdS(N(tread(R,R*((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pys Xsii(tjoinR&R'RRR/(R(tamttpartstgot((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR/Vs !  cC@sg|tjkrtdn|dkr9tdnx|jD]}|jdqCWd|_dS(NsP_multifile does not support anything other than os.SEEK_SET for whence on seek()isQ_multifile only supports seeking to start, but that could be fixed if you need it(tostSEEK_SETtNotImplementedErrorR&tseekR'(R(toffsettwhenceR*((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR7bs   N( t__name__t __module__R+tpropertyR"tNoneR/R4R5R7(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR!Hs  cC@sY|dkrd|ds(RthandlerstcloseR(R(th((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt__del__s cC@s|jS(N(R(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRscC@sdS(N(R=(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pytlocalscC@s|S(N((R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pytpeerscC@stS(N(R(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pytcanpushscC@sfy*|jj|jj|jj}}}Wntk r>dSX|jjtd|||fdS(NsE(sent %d HTTP requests and %d bytes; received %d bytes in responses) (Rt requestscounttsentbytescounttreceivedbytescountRRatnoteR(R(treqstsenttrecv((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRs   cC@s|jS(N(R(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRCsc K@stj|}t|j|j|j|j|j||\}}}t|j|j |}t |j|j||||\|_}}|S(N( Rt byteskwargsRxRaRRtcapableRRRR( R(RAt _compressibleRfRwRnRmRtct((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt _callstreams cK@s2|j||}z|jSWd|jXdS(N(RR/R(R(RARftfp((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt_callsc K@s|jd}y|jd}Wntk r>dg}nXx'|D]}|tjkrF|}PqFqFWtj|j|d|}tj |j|d}idd6} zye|j |d|d| |} | jd d } t | d kr t j td | n| SWntjk r*nntj k r} | jd tjtjfkr~t jtd| jd nt j| jd nXWd|jtj|XdS(NtunbundleRER.trbsapplication/mercurial-0.1s Content-TypeR?R@s iisunexpected response:ispush failed: %s(RRVRRt bundletypest writebundleRaR=Rt httpsendfileRRRt ResponseErrorRRRtsocketRfterrnot ECONNRESETtEPIPERRR4tunlink( R(RAtcgRfttypestxR%ttempnameRR@trtvalsterr((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt _callpushs6    # c K@sd}d}d}ztjdddd\}}tj|d}|jd}x&|r||j||jd}qWW|jtj |j |d}idd 6} |j |d |d | |SWd|dk r|jn|dk r |jtj |nXdS( Ntprefixs hg-bundle-tsuffixs.hgtwbiRsapplication/mercurial-0.1s Content-TypeR?R@( R=RtmkstempR4tfdopenR/twriteRRRRaRR( R(RARRftfhtfp_tfilenametfdtdR@((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt_calltwowaystreams&         cK@s|j|dt|S(NR(RR(R(RARf((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt_callcompressablescC@s |dS(N((R(t exception((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt_aborts(R:R;R+RRRRRRRCRRRRRRR(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR{s           (  cC@sytj|jdd}|rrg}xP|D]<} | tjkr^|jtd| q/|j| q/Wn tj}tj|dt dt d|} t j || d|d|} d ||f} t |d kr| d 7} n| d |d d 7} |jdt |xe|D]]\} }}|jd| tj|ddft| j| ||d| stqWdjtt| j}itjd6tjd6}|tj| ||}|jddt |y|j|}Wnntjk r@}|j dkr:t!j"tdnn/t#j$k rn}|j%t&d|nX| |fS(Nt experimentalshttppeer.v2-encoder-ordersQwire protocol version 2 encoder referenced in config (%s) is not known; ignoring thasmultiplesendt buffersendstclientcontentencodersRRbs%s/%sis /multirequests/%sissending %d commands ssending command %s: %s tindentitredirectR.tAccepts Content-TypesContent-Lengths%disauthorization failed((R tpopulatestreamencoderst configlisttSTREAM_ENCODERSRRRtSTREAM_ENCODERS_ORDERt clientreactorRRR t clienthandlerRRKRtpprinttlistt callcommandRTR0tmapRQt flushcommandsRt FRAMINGTYPERRR`RRRRRRRRRRR=(RaRRbtapiurlt permissiontrequestsR t uiencoderstencoderstencodertreactorthandlerRtcommandRfR*tbodyR@RwRRs((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt sendv2requestsV            tqueuedcommandfuturecB@seZdZddZRS(s@Wraps result() on command futures to trigger submission on call.cC@s<|jr"tjjj||S|jj|j|S(N(tdoneRtfuturestFutureRt _peerexecutort sendcommands(R(ttimeout((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRMs  N(R:R;t__doc__R=R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR#Jsthttpv2executorcB@sGeZdZdZdZdZdZdZdZRS(cC@s||_||_||_||_||_||_t|_t|_t |_ g|_ t j |_d|_d|_dS(N(t_uit_openerRt_apiurlt _descriptort _redirectRt_sentt_closedRWt_neededpermissionst_callstweakreftWeakSett_futuresR=t_responseexecutort _responsef(R(RaRRbRt descriptorR ((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR+Ys           cC@s|S(N((R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt __enter__iscC@s|jdS(N(R(R(texctypetexcvaluetexctb((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt__exit__lscC@s0|jrtjdn|jr6tjdn||jdkr_tjd|n|jd|}t|jt|jdi}|rtjd|djt |fn|j t|dO_ t j j }t|_||_|jj||jj|||f|S( Ns4callcommand() cannot be used after commands are sents*callcommand() cannot be used after close()tcommandss)wire protocol command %s is not availableRfs5wire protocol command %s does not accept argument: %ss, t permissions(R1RtProgrammingErrorR2R/RWtkeysRR0RNR3RR%R&R#t __class__R'R7RXR4R(R(R Rftcmdinfot unknownargsR*((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRos(  ("  c C@s|jr dS|jsdSt|_x;|jD]0}t|tr-tjj|_ d|_ q-q-Wg|jD]*\}}}|j rk|||f^qk}d|_|sdSt |j}d|krd|kr|jdnt|dkr(tjtdtdjt|nidd6dd6|j}t|j|j|j|j|||j\}}tjjd|_|jj|j |||_!dS(Ntpushtpullis6cannot make request requiring multiple permissions: %ss, trwtro("R1R4RR7RPR#RR%R&RDR=R'tset_running_or_notify_cancelRWR3tremoveRRRRR0RNRJR"R,R-RR.R0tThreadPoolExecutorR8tsubmitt_handleresponseR9( R(R*R RftcallsRARRR((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR(s>   ! " cC@s|jr dS|jt|_|js-dSz|jjWd|jjdtd|_d|_x<|jD]1}|j sp|j t j t dqpqpWd|_XdS(Ntwaitsunfulfilled command response(R2R(RR9RR8tshutdownR=R7R$t set_exceptionRRR(R(R*((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRs         cC@sx|j|rqWdS(N(treaddata(R(RR((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyROs( R:R;R+R;R?RR(RRO(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR+Ws    ) 4 t httpv2peercB@sbeZdZdZdZdZdZdZdZdZ dZ d Z RS( cC@s~||_||_|jdr.|d }n||_||_d||f|_||_||_tj |||_ dS(NRis%s/%s( Rat apidescriptorRRt_apipathR.R-RR tsupportedredirectsR0(R(RatrepourltapipathRRbRV((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR+s       cC@s|jS(N(R(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRscC@sdS(N(R=(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRscC@s|S(N((R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR scC@stS(N(R(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR scC@s9|jjtd|jj|jj|jjfdS(NsE(sent %d HTTP requests and %d bytes; received %d bytes in responses) (RaRRR-RRR(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRs  cC@sN|d krtS|dkr tS|jdrJ|td|jdkStS( Nt branchmapt getbundletknowntlookupR>Rscommand-R@(R[R\R]R^R>(RR_RRVR(R(R]((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRs  cC@s6|j|rdStjtd||fdS(NsIcannot %s; client or remote repository does not support the %r capability(RRtCapabilityErrorR(R(R]tpurpose((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt requirecap.s  cK@s/|j}|j||jSWdQXdS(N(tcommandexecutorRR(R(R]RfRs((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR8scC@s+t|j|j|j|j|j|jS(N(R+RaR-RR.RVR0(R(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRb<s( R:R;R+RRRRRRRaRRb(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRUs       tiniti2tpriorityc C@sdd}d}i}|jdd}|rmidd6|d<|djtdjttdd nt|||||d |\}} } t|||} y1t ||| | | d t d |\} } } Wn|t k rU}t|||||j d |\}} } t|||} t ||| | | d t d |\} } } nXz| j }Wd| jX| jd stjd| n|rA| dkrytj|d}Wq>tjk rtjtddtdq>XqZ| dkr%it|jd6}qZtjtd| nit|jd6}| |fS(NcS@stjddS(Nsshould not be called(RRB(R((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRVsRshttppeer.advertise-v2Rs X-HgProto-1R@RHs X-HgUpgradeiRCRRsapplication/mercurial-sunexpected content-type: %ssapplication/mercurial-cboris&error decoding CBOR from remote serverthints5try again and consider contacting the server operatorsapplication/mercurial-0.1sapplication/mercurial-0.2tv1capabilitiess(unexpected response type from server: %s(sapplication/mercurial-0.1sapplication/mercurial-0.2(R=RtupdateR R0RNt API_PEERSRxRRRRRR/RR_RRBRt decodealltCBORDecodeErrorRRRWRVR(RaRRRbRcRRft advertisev2RwRRmRRRRstrawdatatinfo((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pytperformhandshakeRs^          c C@sYtj|}|js!|jrItjtd|jp?|jn|j\}}|jd||pt j ||}t ||||\}}t |j dijt tj@} t| dddt} xQ| D]I} d|djd | f} t| d ||| |||d| SWt||||||d S( s-Construct an appropriate HTTP peer instance. ``opener`` is an ``url.opener`` that should be used to establish connections, perform HTTP requests. ``requestbuilder`` is the type used for constructing HTTP requests. It exists as an argument so extensions can override the default. sunsupported URL component: "%s"s using %s tapistkeycS@s t|dS(NRd(Rh(R((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyRstreverses%s/%stapibaseRRcRf(R RtquerytfragmentRRRtauthinfoRKRRRnRWRRCRhRNRRR( RaRRRbtuRRuRRmtapipeerchoicestpreferredchoicestserviceRZ((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pytmakepeers&  .    cC@s|rtjtdnyH|jdrRtj rRtjtdnt||}|SWngtjk r}y4tj |d||}|j td|SWqtjk r|qXnXdS(Ns!cannot create new http repositoryshttps:s1Python support for SSL and HTTPS is not installedsstatic-s(falling back to static-http) ( RRRR_Rt has_httpsRzRRtinstanceR(RaRtcreatetintentst createoptsRt httpexceptionR((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyR|s(<t __future__RRRRR4RRR5ti18nRR.RRRRRRRRR R R R R RtutilsRRRRRRLR tobjectR!RxR|RRRRRtwirepeerRR"R%R&R#t implementertipeercommandexecutorR+tipeerv2RUtHTTP_WIREPROTO_V2RhRnR=trequestRzR|(((s8/usr/lib64/python2.7/site-packages/mercurial/httppeer.pyt sB      X    ' w  : M C [ [0