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 :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/linelog.cpython-39.opt-1.pyc
a

�+�b�;�@s�dZddlmZmZddlZddlZddlmZddlm	Z	e�
d�ZGdd	�d	e�Z
ejGd
d�de��ZejGdd
�d
e��ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�ZGdd�de�ZdS)a�linelog is an efficient cache for annotate data inspired by SCCS Weaves.

SCCS Weaves are an implementation of
https://en.wikipedia.org/wiki/Interleaved_deltas. See
mercurial/helptext/internals/linelog.txt for an exploration of SCCS weaves
and how linelog works in detail.

Here's a hacker's summary: a linelog is a program which is executed in
the context of a revision. Executing the program emits information
about lines, including the revision that introduced them and the line
number in the file at the introducing revision. When an insertion or
deletion is performed on the file, a jump instruction is used to patch
in a new body of annotate information.
�)�absolute_import�print_functionN�)�attr)�pycompats>IIc@seZdZdZdS)�LineLogErrorz>Error raised when something bad happens internally in linelog.N)�__name__�
__module__�__qualname__�__doc__�rr�7/usr/lib64/python3.9/site-packages/mercurial/linelog.pyr src@s$eZdZe��Ze��Ze��ZdS)�lineinfoN)rr	r
r�ib�rev�linenum�_offsetrrrr
r$src@s,eZdZe��Ze��Ze��Zdd�ZdS)�annotateresultcCs
t|j�S�N)�iter�lines��selfrrr
�__iter__4szannotateresult.__iter__N)	rr	r
rrrr�_eofrrrrr
r.src@s`eZdZejZejdd��Zejdd��Zdd�Z	ejdd��Z
ejd	d
��Zejdd��Zd
S)�_llinstructioncCsdSrr�r�op1�op2rrr
�__init__<sz_llinstruction.__init__cCsdSrrrrrr
�__str__@sz_llinstruction.__str__cCst|�Sr)�strrrrr
�__repr__Dsz_llinstruction.__repr__cCsdSrr�r�otherrrr
�__eq__Gsz_llinstruction.__eq__cCsdS)z5Encode this instruction to the binary linelog format.Nrrrrr
�encodeKsz_llinstruction.encodecCsdS)agExecute this instruction.

        Args:
          rev: The revision we're annotating.
          pc: The current offset in the linelog program.
          emit: A function that accepts a single lineinfo object.

        Returns:
          The new value of pc. Returns None if exeuction should stop
          (that is, we've found the end of the file.)
        Nr�rr�pc�emitrrr
�executeOsz_llinstruction.executeN)
rr	r
�abc�ABCMetaZ
__metaclass__�abstractmethodrr r"r%r&r*rrrr
r8s



rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_jgez@If the current rev is greater than or equal to op1, jump to op2.cCs||_||_dSr��_cmprev�_targetrrrr
rasz
_jge.__init__cCsd|j|jfS)Nz	JGE %d %dr/rrrr
r esz_jge.__str__cCs(t|�t|�ko&|j|jko&|j|jkSr��typer0r1r#rrr
r%hs

�
�z_jge.__eq__cCst�|jd>|j�S�N���_llentry�packr0r1rrrr
r&osz_jge.encodecCs||jkr|jS|dS�Nrr/r'rrr
r*rs
z_jge.executeN�	rr	r
rrr r%r&r*rrrr
r.^sr.c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_jumpz=Unconditional jumps are expressed as a JGE with op1 set to 0.cCs|dkrtd|��||_dS)Nrs%malformed JUMP, op1 must be 0, got %d)rr1rrrr
r{sz_jump.__init__cCs
d|jS)NzJUMP %d�r1rrrr
r �sz
_jump.__str__cCst|�t|�ko|j|jkSr)r3r1r#rrr
r%�sz_jump.__eq__cCst�d|j�S�Nr)r7r8r1rrrr
r&�sz_jump.encodecCs|jSrr<r'rrr
r*�sz
_jump.executeNr:rrrr
r;xsr;c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rz1EOF is expressed as a JGE that always jumps to 0.cCs,|dkrtd|��|dkr(td|��dS)Nrs$malformed EOF, op1 must be 0, got %ds$malformed EOF, op2 must be 0, got %d)rrrrr
r�sz
_eof.__init__cCsdS)NZEOFrrrrr
r �sz_eof.__str__cCst|�t|�kSr)r3r#rrr
r%�sz_eof.__eq__cCst�dd�Sr=)r7r8rrrr
r&�sz_eof.encodecCsdSrrr'rrr
r*�sz_eof.executeNr:rrrr
r�src@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_jlz1If the current rev is less than op1, jump to op2.cCs||_||_dSrr/rrrr
r�sz_jl.__init__cCsd|j|jfS)NzJL %d %dr/rrrr
r �sz_jl.__str__cCs(t|�t|�ko&|j|jko&|j|jkSrr2r#rrr
r%�s

�
�z
_jl.__eq__cCst�d|jd>B|j�S)Nrr5r6rrrr
r&�sz
_jl.encodecCs||jkr|jS|dSr9r/r'rrr
r*�s
z_jl.executeNr:rrrr
r>�sr>c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_linezEmit a line.cCs||_||_dSr��_rev�_origlinenorrrr
r�sz_line.__init__cCsd|j|jfS)Nz
LINE %d %dr@rrrr
r �sz
_line.__str__cCs(t|�t|�ko&|j|jko&|j|jkSr)r3rArBr#rrr
r%�s

�
�z_line.__eq__cCst�d|jd>B|j�Sr4)r7r8rArBrrrr
r&�sz_line.encodecCs|t|j|j|��|dSr9)rrArBr'rrr
r*�sz
_line.executeNr:rrrr
r?�sr?c
Cs�zt�||�\}}Wn2tjyF}ztd|��WYd}~n
d}~00|d@}|d?}|dkr�|dkr�|dkrzt||�St||�St||�S|dkr�t||�S|dkr�t	||�St
d|��dS)z?Decode a single linelog instruction from an offset in a buffer.s!reading an instruction failed: %rN�r5rrsUnimplemented opcode %r)r7�unpack_from�struct�errorrrr;r.r>r?�NotImplementedError)�data�offsetrr�eZopcoderrr
�
_decodeone�s""




rKc@s�eZdZdZd dd�Zdd�Zdd	�Zd
d�Zedd
��Z	dd�Z
dd�Zdd�Zd!dd�Z
dd�Zedd��Zedd��Zdd�Zd"dd�ZdS)#�linelogz1Efficient cache for per-line history information.NrcCs2|durtdd�tdd�g}||_d|_||_dSr=)r�_program�
_lastannotate�_maxrev)rZprogram�maxrevrrr
r�s
zlinelog.__init__cCs(t|�t|�ko&|j|jko&|j|jkSr)r3rMrOr#rrr
r%�s

�
�zlinelog.__eq__cCsdtt|��|jt|j�fS)Nz"<linelog at %s: maxrev=%d size=%d>)�hex�idrO�lenrMrrrr
r"s

�zlinelog.__repr__csDdttt|j����t�d���fdd�t|jdd�d�D��S)Nz	%%%dd %%s�
c3s|]\}}�||fVqdSrr)�.0�idx�i�Zfmtrr
�	<genexpr>
sz#linelog.debugstr.<locals>.<genexpr>r)rSr!rMrZsysstr�join�	enumeraterrrXr
�debugstrs�zlinelog.debugstrcCs�t|�tjdkr(tdt|�tjf��t|�tj}t|d�}t|t�rPd}n(t|ttf�rf|j	}ntdt
|�j��|j}||kr�td||f��t
dd�g}t�d|�D]}|�t||tj��q�|||d�S)Nrs9invalid linelog buffer size %d (must be a multiple of %d)z,Expected one of _jump, _jge, or _jl. Got %s.sFcorrupt linelog data: claimed %d entries but given data for %d entriesr)rP)rSr7�sizerrK�
isinstancer;r.r>r0r3rr1rr�xrange�append)�cls�bufZexpectedZfakejgerPZ
numentriesZinstructionsrIrrr
�fromdatas8��

����zlinelog.fromdatacCs8t|jt|j����}|d�dd�|jdd�D��S)N�css|]}|��VqdSr)r&)rUrWrrr
rY/rdz!linelog.encode.<locals>.<genexpr>r)r.rOrSrMr&rZ)rZhdrrrr
r&-szlinelog.encodecCsg|_d|_d|_dSr=)rMrOrNrrrr
�clear1sz
linelog.clearcCs|j|||dt|�|d�S)Nr)�_internal_blines)�replacelinesrS)rr�a1�a2Zblinesrrr
�replacelines_vec6s�zlinelog.replacelines_veccCsf|jr|j}n
|�|�}|t|j�kr@td|t|j�|f��n>|t|j�krhtdd�}tdd|j�}	n|j|}	|j|	j}|jj	}
|
�}|jj
}g}
|
j
}||k�r0|||d}|t||��t�
||�D]\}|du�r|t|||
���|t||��q�||\}}|t|||
���|t||��q�||k�r�|t|j�k�rdtd|t|j�|f��n$|t|j�k�r||j}n|j|j}|dk�r�||jk�r�|j|djd}|t||��|
�}||�t|ttf��s�|td|	jd��td|�|j|	j<t|jj�|k�r&||jj|_n||j_|
|jj||�<t|jj|�|j_||jk�rb||_dS)z+Replace lines [a1, a2) with lines [b1, b2).s-%d contains %d lines, tried to access line %drrN)rN�annotaterSrrrrrMr�__len__r`r>rr_r?rOr.r^r;�maxr)rrrhri�b1�b2rf�arZa1instZa1infoZ
programlenZ
oldproglenZ
appendinstZ
blineinfosZbappendZtgtrZnewrevZ
newlinenumZendaddrZa1instpcrrr
rg;sl
��




��zlinelog.replacelinescCsxd}g}d}|durJ|t|j�krJ|j|}|}|�|||j�}|d7}q|durbtd|����t|||�}||_|S)Nrrz4Probably hit an infinite loop in linelog. Program:\n)rSrMr*r`rr\rrN)rrr(rZexecuted�instZlastpcrprrr
rk�s"

��zlinelog.annotatecCs|jSr)rOrrrr
rP�szlinelog.maxrevcCsdd�|jjD�S)z?Return the last annotation result. C linelog code exposed this.cSsg|]}|j|jf�qSr)rr)rU�lrrr
�
<listcomp>�rdz*linelog.annotateresult.<locals>.<listcomp>)rNrrrrr
r�szlinelog.annotateresultcCs|jj|jSr)rNrr)r�linerrr
�	getoffset�szlinelog.getoffsetcCs�|pd}g}t�t|j��D]�}|j|}|d}t|t�rD|j}nLt|t�rV|St|tt	f�rfn*t|t
�r�|�|j|j
f�ntd|��||kr�|S|}qtd��dS)z�Get all lines that ever occurred in [start, end).

        Passing start == end == 0 means "all lines ever".

        This works in terms of *internal* program offsets, not line numbers.
        rsIllegal instruction %rsFailed to perform getalllinesN)rr_rSrMr^r;r1rr>r.r?r`rArBr)r�start�endr(r�steprqZnextpcrrr
�getalllines�s$



zlinelog.getalllines)Nr)N)rr)rr	r
rrr%r"r\�classmethodrcr&rerjrgrk�propertyrPrruryrrrr
rL�s$



X

rL)rZ
__future__rrr+rEZ
thirdpartyr�r�Structr7�	Exceptionr�s�objectrrrr.r;rr>r?rKrLrrrr
�<module>s&
		&

Youez - 2016 - github.com/yon3zu
LinuXploit