o ]Lb @sZdZddlmZddlmZddlmZddlmZddl m Z m Z Gdd d e j Z d S) z store class for local filesystem)absolute_import)_)open)util) basestorelfutilcs@eZdZdZfddZddZddZdd Zd d ZZ S) localstorezlocalstore first attempts to grab files out of the store in the remote Mercurial repository. Failing that, it attempts to grab the files from the user cache.cs(||_tt||||jdSN)localremotesuperr __init__url)selfuirepor  __class__=/usr/lib/python3/dist-packages/hgext/largefiles/localstore.pyrs zlocalstore.__init__cCs,t|j|r dSt|t|j|dSr )rinstorer link storepath)rsourcehashrrrputszlocalstore.putcCs$i}|D] }t|j|||<q|Sr )rrr )rhashesretvalrrrrexists$szlocalstore.existscCsht|j|}|st|||jtdt|d}tt ||WdS1s-wYdS)Nscan't get file locallysrb) rfindfiler r StoreErrorrrr copyandhashr filechunkiter)rtmpfilefilenamerpathfdrrr_getfile*s $zlocalstore._getfilec Csd}|D]E\}}}t|j|\}}|st|j|\}}|s/|jtd|||fd}q|rIt|} | |krI|jtd|||fd}q|S)NFs'changeset %s: %s references missing %s Ts)changeset %s: %s references corrupted %s )r findstorepathrr rwarnrhashfile) rcontents filestocheckfailedcsetr% expectedhashrr actualhashrrr _verifyfiles3s2 zlocalstore._verifyfiles) __name__ __module__ __qualname____doc__rrrr(r2 __classcell__rrrrr s  r N) r6 __future__rmercurial.i18nrmercurial.pycompatr mercurialrrrr rrrrs