Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��c@swdZddlZddlmZddlmZddlmZddlZddl	Z	de	j	fd��YZ
dS(s4remote largefile store; the base class for wirestorei�N(tutil(t_(tremotebatchtremotestorecBsMeZdZd�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	<genexpr> 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httpsendfiletIOErrorRRRtstrt_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��n4tk
r�}tj|||jt|���nXtj
||�S(Ns%s: %s(t_getturllib2t	HTTPErrort	basestoret
StoreErrorR	RtURLErrorRRtreasonRRtcopyandhash(RttmpfileRRtchunksR!((s@/sys/lib/python2.7/site-packages/hgext/largefiles/remotestore.pyt_getfile1s$"%cCs�tj|�}|stS||}||j�f}||krEtS|j|�|j�dd!}	|j|	g�|	}
|
s�tS|
dkr�|jjt	d�||f�t
S|
dkr�jjt	d�||f�t
Std|
��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.pyt<module>s

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].