https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/hgext/largefiles/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/hgext/largefiles/__pycache__/basestore.cpython-310.pyc
o

�]Lb�@spdZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZGd	d
�d
e
�ZGdd�de�Zd
S)zCbase class for store implementations and store-related utility code�)�absolute_import)�_)�short)�util)�urlutil�)�lfutilc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
StoreErrorzZRaised when there is a problem getting files from or putting
    files to a central store.cCs||_||_||_||_dS�N)�filename�hash�url�detail)�selfrrr
r�r�</usr/lib/python3/dist-packages/hgext/largefiles/basestore.py�__init__s
zStoreError.__init__cCs"td�|jt�|j�|j|jfS)Ns0error getting id %s from url %s for file %s: %s
)rrr�hidepasswordr
rr�rrrr�longmessage!s
�zStoreError.longmessagecCsdt�|j�|jfS)Ns%s: %s)rrr
rrrrr�__str__)szStoreError.__str__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrr	s
r	c@sNeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zddd
�Zdd�Z	dd�Z
dS)�	basestorecCs||_||_||_dSr
)�ui�repor
)rrrr
rrrr.s
zbasestore.__init__cC�td��)z>Put source file into the store so it can be retrieved by hash.�abstract method��NotImplementedError)r�sourcerrrr�put3sz
basestore.putcCr)z�Check to see if the store contains the given hashes. Given an
        iterable of hashes it returns a mapping from hash to bool.rr )r�hashesrrr�exists7szbasestore.existsc

Csg}g}|j}d}|�dd�|D��}|jtd�td�t|�d��T}|D]F\}}	|�|�|d7}|�td�||	f�|�|	�sW|�td	�||	t	�
|j�f�|�|�q$|�
||	�re|�||	f�q$|�|�q$Wd
�||fS1sxwY||fS)a�Get the specified largefiles from the store and write to local
        files under repo.root.  files is a list of (filename, hash)
        tuples.  Return (success, missing), lists of files successfully
        downloaded and those not found in the store.  success is a list
        of (filename, hash) tuples; missing is a list of filenames that
        we could not get.  (The detailed error message will already have
        been presented to the user, so missing is just supplied as a
        summary.)rcSsh|]\}}|�qSrr)�.0�	_filenamerrrr�	<setcomp>J�z basestore.get.<locals>.<setcomp>sgetting largefilessfiles)�unit�totalrsgetting %s:%s
s'%s: largefile %s not available from %s
N)rr%�makeprogressr�len�update�note�get�warnrrr
�append�_gethash)
r�files�success�missingr�at�	available�progressrrrrrr0<s:	�

��
�
��z
basestore.getcCst�t�|jd��t�|j|�}|d}tj||jjjd��.}z	|�|||�}Wnt	yE}z|j
�|���d}WYd}~nd}~wwWd�n1sPwY||krq|dkrj|j
�t
d�|||f�t�|�dSt�||�t�|j|�dS)z�Get file with the provided hash and store it in the local repo's
        store and in the usercache.
        filename is for informational messages only.
        �s.tmp)�
createmodeNs*%s: data corruption (expected %s, got %s)
FT)r�makedirsr�	storepathr�atomictempfile�storer;�_getfiler	rr1rr�unlink�rename�linktousercache)rrr�
storefilename�tmpname�tmpfile�gothash�errrrrr3bs8
�����	��
zbasestore._gethashFcCs|j�td�t|��t�}g}|D]?}|j|}d|��t|���f}|D])}t	�
|�}	|	rQ||}
|	|
��f}||vrQ|�|�t	�
|
�}|�||	|f�q(q|�||�}
t|�}tdd�|D��}|rx|j�td�||f�t|
�S|j�td�||f�t|
�S)z�Verify the existence (and, optionally, contents) of every big
        file revision referenced by every changeset in revs.
        Return 0 if all is well, non-zero on any errors.s'searching %d changesets for largefiles
s%d:%scSsh|]\}}|�qSrr)r&�fname�fnoderrrr(�r)z#basestore.verify.<locals>.<setcomp>s3verified contents of %d revisions of %d largefiles
s4verified existence of %d revisions of %d largefiles
)r�statusrr-�setr�revr�noder�splitstandin�filenode�add�
readasstandinr2�_verifyfiles�int)r�revs�contents�verified�filestocheckrM�cctx�cset�standinr�fctx�key�expectedhash�failed�numrevs�	numlfilesrrr�verify�sF�



��
��	���zbasestore.verifycCr)aFetch one revision of one file from the store and write it
        to tmpfile.  Compute the hash of the file on-the-fly as it
        downloads and return the hash.  Close tmpfile.  Raise
        StoreError if unable to download the file (e.g. it does not
        exist in the store).rr )rrFrrrrrr@��zbasestore._getfilecCr)z�Perform the actual verification of files in the store.
        'contents' controls verification of content hash.
        'filestocheck' is list of files to check.
        Returns _true_ if any problems are found!
        rr )rrVrXrrrrS�rczbasestore._verifyfilesN)F)rrrrr#r%r0r3rbr@rSrrrrr-s&
(rN)r�
__future__r�mercurial.i18nr�mercurial.noder�	mercurialr�mercurial.utilsr�r�	Exceptionr	�objectrrrrr�<module>s

https://t.me/RX1948 - 2025