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/remotefilelog/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/remotefilelog/__pycache__/remotefilelog.cpython-39.opt-1.pyc
a

�+�b�=�@s�ddlmZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
ddlmZddlmZdd	lmZmZmZGd
d�de�ZGdd
�d
e�ZdS)�)�absolute_importN)�bin)�_)�ancestor�error�mdiff�pycompat�revlog)�storageutil)�flagutil�)�	constants�fileserverclient�shallowutilc@s$eZdZdd�Zdd�Zdd�ZdS)�remotefilelognodemapcCs||_||_dS�N)�	_filename�_store)�self�filename�store�r�G/usr/lib64/python3.9/site-packages/hgext/remotefilelog/remotefilelog.py�__init__!szremotefilelognodemap.__init__cCs|j�|j|fg�}t|�Sr)rZ
getmissingr�bool)r�node�missingrrr�__contains__%sz!remotefilelognodemap.__contains__cCs||vrt|��|Sr)�KeyError�rrrrr�__get__)szremotefilelognodemap.__get__N)�__name__�
__module__�__qualname__rrr rrrrr src@s:eZdZdZejZdd�Zdd�ZdFdd�Z	d	d
�Z
ddejdfdd�Z
dGd
d�Zdd�Zdd�ZeZdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdHd(d)�Zd*d+�Zd,d-�Zd.d/�Z d0d1�Z!dId2d3�Z"d4d5�Z#d6d7�Z$d8d9�Z%d:d;�Z&d<d=�Z'd>d?�Z(d@dA�Z)dBdC�Z*dDdE�Z+dS)J�
remotefilelogTcCs8||_||_||_t|j|j�|_d|_ttj	�|_
dS)Nr)�openerr�repor�contentstore�nodemap�version�dictrZflagprocessorsZ_flagprocessors)rr%�pathr&rrrr4szremotefilelog.__init__cCs4|�|�}|�d�s|S|�dd�}||dd�S)z&returns the file contents at this nodes
�N)�revision�
startswith�index)rr�t�srrr�read>s


zremotefilelog.readNc	Cs>t�||�d�|�d��}t�|||�}|j||||||d�S)N�copy�copyrev)r)rZcreaterevlogtext�getr
�hashrevisionsha1�addrevision)	r�text�meta�transaction�linknode�p1�p2Zhashtextrrrr�addFs��zremotefilelog.addcCs�t�t|�|�}d||f}	|}
d}|rDd|vrD|d}t|d�}
|	d||
|||f7}	t�}i}
g}|
|jjkr�|}|r�t|j||j�}|
�	|�
|
��|�|
�|�|
�||jjkr�|
�	|�
|��|�|�|�|�d}|�rz|�
d�}|
|\}}}}|�pd}|d|||||f7}||jjk�rP||v�rP|�|�|�|�||jjkr�||vr�|�|�|�|�q�|	|7}	|	S)Ns%s%s�r3r4s%s%s%s%s%sr)rZbuildfileblobheader�lenr�setr&�nullidr$r%�update�ancestormap�appendr>�pop)rr8r9�flagsr<r=rr;�header�dataZrealp1�copyfromZvisitedZ
pancestors�queueZp1flogZancestortext�cZpa1Zpa2ZancestorlinknodeZ
pacopyfromrrr�_createfileblobPsT





�


zremotefilelog._createfileblobc
CsV|durt�|||�}t�|�\}
}t�|||�\}}
|j|||||||||
|fd�	S)N)�
_metatuple)r
r6�	parsemetarZprocessflagswrite�addrawrevision)rr8r:r;r<r=�
cachedeltarrG�sidedatar9�
metaoffset�rawtextZvalidatehashrrrr7�s&
��zremotefilelog.addrevisionc
	Csl|	r|	\}
}nt�|�\}
}|dkr(d}|r:||d�}n|}|�||
|||||�}
|jj�|j||
�|S)Nr)r
rOrMr&r'Zaddremotefilelognoder)rrTr:r;r<r=rrGrQrNr9rSZblobtextrIrrrrP�s

�zremotefilelog.addrawrevisioncCs2|jj�|j|�}||\}}}}|r.||fSdS�NF�r&�
metadatastore�getancestorsr)rr�	ancestorsr<r=r;rJrrr�renamed�s
zremotefilelog.renamedcCst|�|��S)z#return the size of a given revision)r@r2rrrr�size�szremotefilelog.sizecCs"||jjkrdS|�|�}||kS)zpcompare text with a given file revision

        returns True if text is different than what is stored.
        T)r&rBr2)rrr8Znodetextrrr�cmp�s
zremotefilelog.cmpcCsdS)NTr�rrrr�__nonzero__�szremotefilelog.__nonzero__cCs|jdvrdStd��dS)N)s.hgtagss.hgsubs.hgsubstaterslen not supported)r�RuntimeErrorr]rrr�__len__�s
zremotefilelog.__len__cCsgSrrr]rrr�headsszremotefilelog.headscCsdSrUrr]rrr�emptyszremotefilelog.emptycCs4t|t�rt�d��|jj}|�|j|��t	j
d�S)Ns3remotefilelog does not accept integer rev for flagsr)�
isinstance�intr�ProgrammingErrorr&r'�getmetarr5r
�METAKEYFLAG)rrrrrrrGs
�zremotefilelog.flagscCsR||jjkr|jj|jjfS|jj�|j|�}||\}}}}|rJ|jj}||fSr)r&rBrWrXr�rrrDr<r=r;rJrrr�parentsszremotefilelog.parentscCs
|�|�Sr)ri�r�revrrr�
parentrevsszremotefilelog.parentrevscCs&|jj�|j|�}||\}}}}|SrrVrhrrrr;szremotefilelog.linknodecCs|j��j�|�|��Sr)r&Z
unfilteredZ	changelogrkr;rrrr�linkrev$szremotefilelog.linkrevFccs�~~~~~d}|D]�}	|�|	�\}
}|dur4|
}}||	krD|jj}||jjkrbd}
|�||	�}n|�|	�}
d}tj|	|
||�|	�||�|	�d|
|ddd�VqdS)Nr)rZp1nodeZp2noder;�basenoderGZbaserevisionsizer-�deltarRZprotocol_flags)	rir&rB�revdiff�rawdatar	Zrevlogrevisiondeltar;rG)rZnodesZ
nodesorderZrevisiondataZassumehaveparentrevisionsZ
deltapreviousZ	deltamodeZsidedata_helpersZprevnoderr<r=rnr-rorrr�
emitrevisions's6
�zremotefilelog.emitrevisionscCst�|�|�|�|��Sr)rZtextdiffrq)rZnode1Znode2rrrrpQszremotefilelog.revdiffcCs8t|�dkrt|�}t|�dkr4t�||jtd���|S)N�(�sinvalid lookup input)r@rr�LookupErrorrrrrrr�lookupTs�zremotefilelog.lookupcCs|Srrrrrrrk^szremotefilelog.revcCst|t�rt�d��|S)Ns2remotefilelog does not convert integer rev to node)rcrdrrerjrrrrbs

�zremotefilelog.nodecCs�||jjkrdSt|�dkr0t�||jtd���||jjjksL||jjj	vrRtj
�|jj}|�|j|�}|rp|S|�
|j|��tjd�}|dkr�|St�|||�dS)z�returns the revlog contents at this node.
        this includes the meta data traditionally included in file revlogs.
        this is generally only used for bundling and communicating with vanilla
        hg clients.
        r?rtsinvalid revision inputr)r&rBr@rrurrZ
nodeconstantsZwdiridZwdirfilenodeidsZWdirUnsupportedr'r5rfr
rgrZprocessflagsread)rr�rawrrTrGrrrr-js&���zremotefilelog.revisioncCs|j|dd�S)NF)rw)r-rrrrrq�szremotefilelog.rawdatacCs�|jj}|j}t�|jj|j|�}z|�|�WSty@Yn0t�	|j|�}t
j�|j
|�}zt�|�WSty~Yn0|�|j|fg�z|�|�WSty�Yn0t�||jtd���dS)z3reads the raw file blob from disk, cache, or serversno nodeN)r&�fileservice�
localcacherZgetcachekey�namerr2rZgetlocalkey�osr+�join�	localpathrZreadfile�IOErrorZprefetchrrur)r�idrxryZcachekeyZlocalkeyr}rrr�_read�s*�zremotefilelog._readcCs|jj�|j|�SrrVrrrrrD�szremotefilelog.ancestormapcCsv||jjks||jjkr |jjS|�||�\}}dd�t�|�D�}t�|||||�}|rntt|j	|��S|jjS)NcSsi|]\}}||�qSrr��.0�k�vrrr�
<dictcomp>�r?z*remotefilelog.ancestor.<locals>.<dictcomp>)
r&rB�_buildrevgraphr�	iteritemsrrY�min�map�__getitem__�r�a�b�revmapZ
parentfuncr(Zancsrrrr�szremotefilelog.ancestorcCsf||jjks||jjkr |jjS|�||�\}}dd�t�|�D�}t�|||||�}t|j|�S)z@calculate all the heads of the common ancestors of nodes a and bcSsi|]\}}||�qSrrr�rrrr��r?z6remotefilelog.commonancestorsheads.<locals>.<dictcomp>)	r&rBr�rr�r�commonancestorsheadsr�r�r�rrrr��sz"remotefilelog.commonancestorsheadscsR|�|�}|�|�}t�t�}t��||fD]p}t�|�D]`\}}||}	|\}
}}}
|
|jjkrz|
sz|	�	|
���
|
�||jjkr:|	�	|���
|�q:q,t�t�}i}t��fdd�|D��}|�rH|��\}}||vr�|r�||�	||�q�t
|�t
|�d}|||<|�r&||�	|�|�|�D]}|�||f��q0q�||jfS)z�Builds a numeric revision graph for the given two nodes.
        Returns a node->rev map and a rev->[revs] parent function.
        c3s|]}|�vrd|fVqdSrr)r��n�Z
allparentsrr�	<genexpr>�r?z/remotefilelog._buildrevgraph.<locals>.<genexpr>r)rD�collections�defaultdict�listrArr�r&rBrEr>�dequerFr@r5�
appendleftr�)rr�r�ZamapZbmapZ
parentsmap�mappingrZpdatarir<r=r;rJrlr�rKZprevrev�currentZ
currentrev�parentrr�rr��s@






�zremotefilelog._buildrevgraphcCsdSrr)rZminlinkr:rrr�strip�szremotefilelog.stripcCsgSrrr]rrr�files�szremotefilelog.filescCsdS)N)rrrr]rrr�	checksize�szremotefilelog.checksize)NN)NN)NFFFNN)F),r!r"r#Z
_generaldeltarZRevlogErrorZ_flagserrorclassrr2r>rMr	ZREVIDX_DEFAULT_FLAGSr7rPrZr[Zrawsizer\r^�__bool__r`rarbrGrirlr;rmrrrprvrkrr-rqr�rDrr�r�r�r�r�rrrrr$/sb


@�
+�
,
�
*


1r$)Z
__future__rr�r{Zmercurial.noderZmercurial.i18nrZ	mercurialrrrrr	Zmercurial.utilsr
Zmercurial.revlogutilsr�r
rr�objectrr$rrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit