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/mercurial/linelog.pyc
�
1�3\c@@s^dZddlmZmZddlZddlZddlmZddlm	Z	ej
d�Zdefd	��YZ
ejd
efd��Y�Zejdefd
��Y�Zdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZd�Zdefd��YZdS(s�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/help/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.
i(tabsolute_importtprint_functionNi(tattr(tpycompats>IItLineLogErrorcB@seZdZRS(s>Error raised when something bad happens internally in linelog.(t__name__t
__module__t__doc__(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR#stlineinfocB@s,eZej�Zej�Zej�ZRS((RRRtibtrevtlinenumt_offset(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR&stannotateresultcB@s5eZej�Zej�Zej�Zd�ZRS(cC@s
t|j�S(N(titertlines(tself((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__iter__5s(RRRR	R
Rt_eofR(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR
/st_llinstructioncB@steZejZejd��Zejd��Zd�Zejd��Z	ejd��Z
ejd��ZRS(cC@sdS(N((Rtop1top2((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__init__<scC@sdS(N((R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__str__@scC@s
t|�S(N(tstr(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__repr__DscC@sdS(N((Rtother((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt__eq__GscC@sdS(s5Encode this instruction to the binary linelog format.N((R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytencodeKtcC@sdS(sgExecute 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.)
        N((RR
tpctemit((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytexecuteOR(RRtabctABCMetat
__metaclass__tabstractmethodRRRRRR (((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR8s		t_jgecB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(s@If the current rev is greater than or equal to op1, jump to op2.cC@s||_||_dS(N(t_cmprevt_target(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR`s	cC@sd|j|jfS(Ns	JGE %d %d(R&R'(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRdscC@s:t|�t|�ko9|j|jko9|j|jkS(N(ttypeR&R'(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRgscC@stj|jd>|j�S(Ni(t_llentrytpackR&R'(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRlscC@s||jkr|jS|dS(Ni(R&R'(RR
RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR os(RRRRRRRR (((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR%]s				t_jumpcB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(s=Unconditional jumps are expressed as a JGE with op1 set to 0.cC@s,|dkrtd|��n||_dS(Nis%malformed JUMP, op1 must be 0, got %d(RR'(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRwscC@sd|jS(NsJUMP %d(R'(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR|scC@s(t|�t|�ko'|j|jkS(N(R(R'(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRscC@stjd|j�S(Ni(R)R*R'(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@s|jS(N(R'(RR
RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR �s(RRRRRRRR (((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR+ts				RcB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(s1EOF is expressed as a JGE that always jumps to 0.cC@sB|dkrtd|��n|dkr>td|��ndS(Nis$malformed EOF, op1 must be 0, got %ds$malformed EOF, op2 must be 0, got %d(R(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@sdS(NtEOF((R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@st|�t|�kS(N(R((RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@stjdd�S(Ni(R)R*(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@sdS(N(tNone(RR
RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR �s(RRRRRRRR (((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�s				t_jlcB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(s1If the current rev is less than op1, jump to op2.cC@s||_||_dS(N(R&R'(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�s	cC@sd|j|jfS(NsJL %d %d(R&R'(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@s:t|�t|�ko9|j|jko9|j|jkS(N(R(R&R'(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@stjd|jd>B|j�S(Nii(R)R*R&R'(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@s||jkr|jS|dS(Ni(R&R'(RR
RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR �s(RRRRRRRR (((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR.�s				t_linecB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(sEmit a line.cC@s||_||_dS(N(t_revt_origlineno(RRR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�s	cC@sd|j|jfS(Ns
LINE %d %d(R0R1(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@s:t|�t|�ko9|j|jko9|j|jkS(N(R(R0R1(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@stjd|jd>B|j�S(Ni(R)R*R0R1(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@s$|t|j|j|��|dS(Ni(RR0R1(RR
RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR �s(RRRRRRRR (((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR/�s				cC@s�ytj||�\}}Wn&tjk
rD}td|��nX|d@}|d?}|dkr�|dkr�|dkr�t||�St||�St||�S|dkr�t||�S|dkr�t	||�St
d|��dS(s?Decode a single linelog instruction from an offset in a buffer.s!reading an instruction failed: %riiiisUnimplemented opcode %rN(R)tunpack_fromtstructterrorRRR+R%R.R/tNotImplementedError(tdatatoffsetRRtetopcode((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt
_decodeone�s"






tlinelogcB@s�eZdZddd�Zd�Zd�Zd�Zed��Z	d�Z
d�Zd	�Zdd
�Z
d�Zed��Zed
��Zd�Zddd�ZRS(s1Efficient cache for per-line history information.icC@sL|dkr-tdd�tdd�g}n||_d|_||_dS(Ni(R-Rt_programt
_lastannotatet_maxrev(Rtprogramtmaxrev((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�s
!		cC@s:t|�t|�ko9|j|jko9|j|jkS(N(R(R<R>(RR((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�scC@s)dtt|��|jt|j�fS(Ns"<linelog at %s: maxrev=%d size=%d>(thextidR>tlenR<(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR�sc@sUdttt|j����tjd�j�fd�t|jdd�D��S(Ns	%%%dd %%ss
c3@s%|]\}}�||fVqdS(N((t.0tidxti(tfmt(s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pys	<genexpr>�si(RCRR<Rtsysstrtjoint	enumerate(R((RGs7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytdebugstr�scC@st|�tjdkr;tdt|�tjf��nt|�tj}t|d�}t|t�rud}n	|j}|j}||kr�td||f��nt	dd�g}x7t
jd|�D]#}|jt||tj��q�W||d|�S(Nis9invalid linelog buffer size %d (must be a multiple of %d)sFcorrupt linelog data: claimed %d entries but given data for %d entriesiR@(
RCR)tsizeRR:t
isinstanceR+R&R'RRtxrangetappend(tclstbuftexpectedtfakejgeR@t
numentriestinstructionsR7((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytfromdata�s"			!cC@sCt|jt|j��j�}|djd�|jdD��S(NRcs@s|]}|j�VqdS(N(R(RDRF((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pys	<genexpr>si(R%R>RCR<RRI(Rthdr((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRs!cC@sg|_d|_d|_dS(Ni(R<R>R-R=(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytclears		cC@s%|j|||dt|�d|�S(Nit_internal_blines(treplacelinesRC(RR
ta1ta2tblines((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytreplacelines_vecscC@sl|jr|j}n|j|�}|t|j�kr^td|t|j�|f��nY|t|j�kr�tdd�}tdd|j�}	n|j|}	|j|	j}|jj	}
|
�}|jj
}g}
|
j
}||kr�|||d}|t||��x�tj
||�D]}}|dkrl|t|||
���|t||��q+||\}}|t|||
���|t||��q+Wn||krr|t|j�kr�td|t|j�|f��n1|t|j�kr|j}n|j|j}|dkr\||jkr\|j|djd}n|t||��n|
�}||�t|ttf�s�|td|	jd��ntd|�|j|	j<t|jj�|kr�||jj|_n!t|t�st�||j_|
|jj||+t|jj|�|j_||jkrh||_ndS(s+Replace lines [a1, a2) with lines [b1, b2).s-%d contains %d lines, tried to access line %diiN(R=tannotateRCRRRRR<Rt__len__ROR.RRNR-R/R>R%RMR+tAssertionErrortmaxR
(RR
R[R\tb1tb2RYtarta1instta1infot
programlent
oldproglent
appendinstt
blineinfostbappendttgtRtnewrevt
newlinenumtendaddrta1instpc((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyRZsf	
			
cC@s�d}g}d}xZ|dk	rn|t|j�krn|j|}|}|j|||j�}|d7}qW|dk	r�td|j���nt|||�}||_|S(Niis4Probably hit an infinite loop in linelog. Program:\n(	R-RCR<R RORRKR
R=(RR
RRtexecutedtinsttlastpcRe((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR_us$
	cC@s|jS(N(R>(R((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR@�scC@s)g|jjD]}|j|jf^q
S(s?Return the last annotation result. C linelog code exposed this.(R=RR
R(Rtl((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR
�scC@s|jj|jS(N(R=RR(Rtline((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt	getoffset�scC@s�|p	d}g}x�tjt|j��D]�}|j|}|d}t|t�rc|j}nft|t�rv|St|tt	f�r�n;t|t
�r�|j|j|j
f�ntd|��||kr�|S|}q+Wtd��dS(s�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.
        isIllegal instruction %rsFailed to perform getalllinesN(RRNRCR<RMR+R'RR.R%R/ROR0R1R(RtstarttendRRtstepRstnextpc((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pytgetalllines�s$


N(RRRR-RRRRKtclassmethodRVRRXR^RZR_tpropertyR@R
RwR|(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyR;�s
						V		(Rt
__future__RRR!R3t
thirdpartyRRRtStructR)t	ExceptionRtstobjectRR
RR%R+RR.R/R:R;(((s7/usr/lib64/python2.7/site-packages/mercurial/linelog.pyt<module>s&		%