ó œçƒQc@swdZddlZddlmZddlmZddlmZddlZddl Z de j fd„ƒYZ dS(s4remote largefile store; the base class for wirestoreiÿÿÿÿN(tutil(t_(t remotebatcht remotestorecBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(s)a largefile store accessed over a networkcCs tt|ƒj|||ƒdS(N(tsuperRt__init__(tselftuitrepoturl((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyRscCs^|j||ƒr7tjtdƒ||jfƒ‚n|jjtdƒ||jfƒdS(Ns0remotestore: could not put %s to remote store %ss&remotestore: put %s to remote store %s(tsendfileRtAbortRR Rtdebug(Rtsourcethash((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pytputs   cCs#td„|j|ƒjƒDƒƒS(Ncss'|]\}}||dkfVqdS(iN((t.0thts((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pys s(tdictt_statt iteritems(Rthashes((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pytexistsscCs£|jjd||fƒd}zhytj|j|ƒ}Wn8tk rv}tjtdƒ|t |ƒfƒ‚nX|j ||ƒSWd|rž|j ƒnXdS(Nsremotestore: sendfile(%s, %s) s'remotestore: could not open file %s: %s( RR tNonetlfutilt httpsendfiletIOErrorRR Rtstrt_puttclose(RtfilenameRtfdte((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyR "s cCsÄy|j|ƒ}Wnžtjk rL}tj|||jt|ƒƒ‚nhtjk r€}tj d|j|j fƒ‚n4t k r³}tj|||jt|ƒƒ‚nXt j ||ƒS(Ns%s: %s(t_getturllib2t HTTPErrort basestoret StoreErrorR RtURLErrorRR treasonRRt copyandhash(RttmpfileRRtchunksR!((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyt_getfile1s$"%c Csùtj|ƒ}|stS||}||jƒf}||krEtS|j|ƒ|jƒdd!} |j| gƒ| } | s…tS| dkrµ|jjt dƒ||fƒt S| dkrå|jjt dƒ||fƒt St d| ƒ‚dS(Nii(is"changeset %s: %s: contents differ ischangeset %s: %s missing s6verify failed: unexpected response from statlfile (%r)( Rt splitstandintFalsetfilenodetaddtdataRRtwarnRtTruet RuntimeError( RtcctxtcsettcontentststandintverifiedRtfctxtkeyt expecthashtstat((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyt _verifyfileBs0         cCs t|ƒS(sSupport for remote batching.(R(R((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pytbatch_s( t__name__t __module__t__doc__RRRR R,R>R?(((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyRs      ( RBR#t mercurialRtmercurial.i18nRtmercurial.wireprotoRRR%R(((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyts