\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@s?ddlmZddlZddlmZddlmZmZmZm Z m Z m Z m Z mZddlmZdZdd hZd d hZd Zd ZdefdYZdefdYZdZdZdZdZdZdZied6ed6ed6ed6ed6ed6ZdS(i(tabsolute_importNi(t_(tencodingterrortpycompattsslutilturltutiltwireprotoframingtwireprototypes(tcborutilcC@sdg}xN|D]F}t|d}d|krF|t|d}n|j|q Wdj|S(s4Format an encoded message from the framing protocol.tmsgtargst(Rttupletappendtjoin(tatomstchunkstatomR ((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytformatrichmessages  thttpthttpstsha1tsha256cC@s=|jdtkrF|jtd|d|jddftS|jdr~tj r~|jtd|dtSd|krt|d}t}x7tjD],}|j dst |j |d qW||@s|jtd |dd j t |ftSn|jtd |dtS( sDetermine whether a redirect target entry is supported. ``target`` should come from the capabilities data structure emitted by the server. tprotocols:(remote redirect target %s uses unsupported protocol: %s) tnameR t snirequireds8(redirect target %s requires SNI, which is unsupported) t tlsversionsttlsisB(remote redirect target %s requires unsupported TLS versions: %s) s, s*(remote redirect target %s is compatible) (tgettSUPPORTED_REDIRECT_PROTOCOLStnoteRtFalseRthassnitsettsupportedprotocolst startswithtAssertionErrortaddRtsortedtTrue(tuittargetRt supportedtv((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytredirecttargetsupported4s(    !cC@s| sd|krdSg|ddD]}t||r&|d^q&}g|ddD]}|tkrZ|^qZ}i|d6|d6S(spResolve the "redirect" command request key given an API descriptor. Given an API descriptor returned by the server, returns a data structure that can be used in hte "redirect" field of command requests to advertise support for compatible redirect targets. Returns None if no redirect targets are remotely advertised or if none are supported. tredirectttargetsRthashesN(tNoneR.tSUPPORTED_CONTENT_HASHES(R*t apidescriptorttR0thR1((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytsupportedredirectsVs tcommandresponsecB@sGeZdZedZdZdZdZdZdZ RS(sRepresents the response to a command request. Instances track the state of the command and hold its results. An external entity is required to update the state of the object when events occur. cC@sy||_||_||_t|_tj|_tj|_ g|_ d|_ t j|_t|_d|_dS(N(t requestidtcommandt fromredirectR!t_inputcompletet threadingtRLockt_locktEventt _serviceablet_pendingeventsR2t _pendingerrorR tbufferingdecodert_decodert _seeninitialt _redirect(tselfR9R:R;((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt__init__ws       cC@s*|jt|_|jjWdQXdS(N(R?R)R<RAR#(RH((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt_oninputcompletes  cC@s|jj|\}}}|s%dS|jxo|jjD]^}|j rl|j rl|j|q?n|jrtj t dn|j j |q?W|j jWdQXdS(NsMreceived unexpected response data after content redirect; the remote is buggy(REtdecodeR?t getavailableRFR;t_handleinitialRGRtAbortRRBRRAR#(RHtdatat availablet readcounttwantedto((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt_onresponsedatas   cC@s*||_|j|jjWdQXdS(N(RCR?RAR#(RHte((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt_onerrors  cC@st|_|ddkrdS|ddkr|d}tjd|dd|dd|jdd|jdd |jd d |jd d |jd |_dSi|d d d6g}d|d kr|d d|dd       cC@s|j|d|dr5|j|j|j=n |jsBdS|jre|j|j|jdS|j|jkr{dS|jt kr|j|jj |j |j|j=nI|j rt |j|j }|j|jj ||j|j=ndS(NROteos( RTRJRpR9RFRGt_followredirectRqR:tCOMMAND_DECODERSt set_resultRiR<(RHRRRtdecoded((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyRxs$     cC@s|jjtd|j|jdkrKtjtd|jn|jrm|jjtdn|j s|j r|jjtdni|jd6}|j t j |jd |}y|jj|}Wntjjk r$}|jdkrtjtdnnOtjjk rr}|jjd |j|jjtd |nXtj||j|}t||jd t |j|<|j!j"||fd S( s4Called to initiate redirect following for a request.s(following redirect to %s) sapplication/mercurial-cbors-cannot handle redirects for the %s media typesC(support for validating hashes on content redirects not supported) sM(support for pinning server certificates on content redirects not supported) tAcceptisauthorization failedshttp error requesting %s R;N(#RnR RRRZRRNR\twarnR^R_RxRtstrurlR2RwtopenRturlerrt httperrortcodethttplibt HTTPExceptiontdebugt get_full_urlt tracebacktIOErrorRut wrapresponseRrR8R:R)RsR(RHR9R/theaderstreqtresRUt oldresponse((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyRs6  !    cC@s|j|}y|jd}|j||s?|jn||jkrXt|S|jtkr|j|j|j |j|=nC|j rt|j|j }|j|j||j|=nt|SWn<t k r}|j|j ||j|=|jt SXdS(sCalled to continue processing a response from a redirect. Returns a bool indicating if the redirect is still serviceable. iN(RrtreadRTRJRqtboolR:RRRiR<RRR!(RHRRRRORRU((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyRs*         N(RjRkRlR2RturlreqRRIR|RRRRRR(((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyRms    8 , -cC@s t|}d|jDS(NcS@s(i|]\}}|tj|qS((Rttolocal(t.0tkR-((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pys s (tnexttitems(tobjstbm((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytdecodebranchmaps cC@s t|S(N(R(R((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt decodeheadsscC@s5t|}g|D]}|dkr+tnt^qS(Nt1(RR)R!(Rtrawtc((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt decodeknowns cC@s t|S(N(R(R((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytdecodelistkeysscC@s t|S(N(R(R((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt decodelookupscC@s t|S(N(R(R((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt decodepushkey st branchmaptheadstknowntlistkeystlookuptpushkey( t __future__RR=ti18nRR RRRRRRuRRR tutilsR RRR3R.R7tobjectR8RmRRRRRRR(((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyts6 :     "