HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyo
�
1�3\c@@s�ddlmZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZejZde
fd��YZde
fd��YZd	efd
��YZdefd��YZd
efd��YZdS(i(tabsolute_importN(tnodetpycompat(tprocutiltBundleWriteExceptioncB@seZRS((t__name__t
__module__(((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyRstBundleReadExceptioncB@seZRS((RR(((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyRstabstractbundlestorecB@s;eZdZejZejd��Zejd��ZRS(s6Defines 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).
    cC@sdS(s�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.
        N((tselftdata((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pytwrite(tcC@sdS(s�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().
        N((R	tkey((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pytread1R(	RRt__doc__tabctABCMetat
__metaclass__tabstractmethodRR(((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyRs		tfilebundlestorecB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(skbundle store in filesystem

    meant for storing bundles somewhere on disk and on network filesystems
    cC@sz||_||_|jdd�|_|jsN|jjjdd�|_ntjj|j�svtj	|j�ndS(Nt
scratchbrancht	storepathtscratchbranchesR(
tuitrepot
configpathRtvfstjointostpathtexiststmakedirs(R	RR((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyt__init__@s			cC@s'tjj|j|dd!|dd!�S(s�First two bytes of the hash are the name of the upper
        level directory, next two bytes are the name of the
        next level directoryiii(RRRR(R	t	hashvalue((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyt_dirpathJscC@stjj|j|�|�S(N(RRRR#(R	tfilename((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyt	_filepathPscC@s�tjtj|�j��}|j|�}tjj|�sOtj	|�nt
|j|�d��}|j|�WdQX|S(Ntwb(
Rthexthashlibtsha1tdigestR#RRRR topenR%R(R	R
R$tdirpathtf((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyRSscC@sHy/t|j|�d��}|j�SWdQXWntk
rCdSXdS(Ntrb(R+R%RtIOErrortNone(R	R
R-((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyR_s

(RRRR!R#R%RR(((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyR;s	
			texternalbundlestorecB@s,eZd�Zd�Zd�Zd�ZRS(cC@s(||_||_||_||_dS(s6
        `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(tput_argstget_argst
put_binaryt
get_binary(R	R4R2R5R3((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyR!gs			cC@s^tjtjtj|�dtjdtjdt�}|j�\}}|j	}|||fS(Ntstdouttstderrt	close_fds(
t
subprocesstPopenRtrapplyRttonativestrtPIPEtTruetcommunicatet
returncode(R	targstpR6R7R@((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyt_call_binaryxs		c		C@s�t���}|j|�|j�|jd�g|jD]}|jd|j�^q:}|j|jg|�\}}}|dkr�t	d|��n|j
�}t|�dkr�|dSt	d|j|f��WdQXdS(NiR$s&Failed to upload to external store: %sisBad output from %s: %s(tNamedTemporaryFileRtflushtseekR2tformattnameRCR4Rt
splitlinestlen(	R	R
ttemptargtformatted_argsR@R6R7tstdout_lines((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyR�s 


(cC@s�t���}g|jD]!}|jd|jd|�^q}|j|jg|�\}}}|dkr~td|��n|j�SWdQXdS(NR$thandleis*Failed to download from external store: %s(RDR3RGRHRCR5RR(R	RORKRLRMR@R6R7((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyR�s.(RRR!RCRR(((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyR1fs				(t
__future__RRR(RR9ttempfilet	mercurialRRtmercurial.utilsRRDt	ExceptionRRtobjectRRR1(((s>/usr/lib64/python2.7/site-packages/hgext/infinitepush/store.pyt<module>s	+