https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/statichttprepo.cpython-310.pyc
o

�]Lb��@s�ddlmZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZejZejZGdd	�d	e�ZGd
d�de�ZGdd
�d
ej�Zdd�Z Gdd�dej!�Z"Gdd�dej#ej$�Z%ddd�Z&dS)�)�absolute_importN�)�_)�sha1nodeconstants)�	branchmap�	changelog�error�	localrepo�manifest�
namespaces�pathutil�pycompat�requirements�url�util�vfs)�urlutilc@sNeZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	dd�Z
d	S)�httprangereadercCs||_d|_||_||_dS)Nr)r�pos�opener�name)�selfrr�r�:/usr/lib/python3/dist-packages/mercurial/statichttprepo.py�__init__'s
zhttprangereader.__init__cCs|S�Nr�rrrr�	__enter__.�zhttprangereader.__enter__cCs|��dSr)�close)r�exc_type�	exc_value�	tracebackrrr�__exit__1�zhttprangereader.__exit__cCs
||_dSr)r)rrrrr�seek4s
zhttprangereader.seekNc	
Cs t�t�|j��}d}|r|j|d}|js|r$|�dd|j|f�z|j�|�}|�	�}|j
}Wn0tjyQ}z|j
dkrDt
jpEd}t|t|���d}~wtjyc}ztd|j��d}~ww|dkr}|ru||j|j|�}n||jd�}n|r�|d|�}|jt|�7_|S)N�r�Rangezbytes=%d-%si���)�urlreq�requestr
�strurlrr�
add_headerr�open�read�code�urlerr�	httperror�errno�ENOENT�IOError�str�urlerror�reason�len)	r�bytes�req�end�f�datar/�inst�numrrrr.7s4

���zhttprangereader.readcCs|���d�S)NT)r.�
splitlinesrrrr�	readlinesXszhttprangereader.readlinescCst|���Sr)�iterrArrrr�__iter__[r$zhttprangereader.__iter__cC�dSrrrrrrr^rzhttprangereader.closer)�__name__�
__module__�__qualname__rrr#r%r.rArCrrrrrr&s
!rc@seZdZdZdS)�_RangeErrorz6Error raised when an unsatisfiable range is requested.N)rErFrG�__doc__rrrrrHesrHc@s eZdZdZdd�Zdd�ZdS)�_HTTPRangeHandleraHandler that enables HTTP Range headers.

    This was extremely simple. The Range header is a HTTP feature to
    begin with so all this class does is tell urllib2 that the
    "206 Partial Content" response from the HTTP server is what we
    expected.
    cCs"t�|||���}||_||_|Sr)r)�
addinfourl�get_full_urlr/�msg)rr:�fpr/rM�hdrs�rrrr�http_error_206rsz _HTTPRangeHandler.http_error_206cCstd��)NsRequested Range Not Satisfiable)rH)rr:rNr/rMrOrrr�http_error_416ysz _HTTPRangeHandler.http_error_416N)rErFrGrIrQrRrrrrrJisrJcs2t�||����t��G�fdd�dtj�}|S)Ncs*eZdZdd�Zd	�fdd�	Zdd�ZdS)
z#build_opener.<locals>.statichttpvfscSs||_i|_dSr)�base�options)rrSrrrr�s
z,build_opener.<locals>.statichttpvfs.__init__�rcs0|dvrtd��d�|jt�|�f�}t|��S)N)rUsrbsPermission denied�/)r4�joinrSr)�quoter)r�path�mode�args�kwr<��	urlopenerrr�__call__�s
z,build_opener.<locals>.statichttpvfs.__call__cSs|r	t�|j|�S|jSr)rrWrS)rrYrrrrW�sz(build_opener.<locals>.statichttpvfs.joinN)rU)rErFrGrr_rWrr]rr�
statichttpvfs�sr`)rr�add_handlerrJ�vfsmod�abstractvfs)�ui�authinfor`rr]r�build_opener~srfc@seZdZdd�Zdd�ZdS)�statichttppeercCrDrrrrrr�local�rzstatichttppeer.localcC�dS�NFrrrrr�canpush�rzstatichttppeer.canpushN)rErFrGrhrkrrrrrg�srgcs`eZdZejjZdd�Z�fdd�Zdd�Z	dd�Z
d	d
�Zddd
�Zddd�Z
dd�Z�ZS)�statichttprepositoryc

Cs>||_||_||_t�|�d�d�}|��\|_}t||�}||j�|_	||j	�
d��|_g|_t
�
�|_d|_d|_t�|_t�|_zt|j	�d����}WnKty�}z?|jtjkr_�t�}z|�	d�}|�d�|��Wnty�}z|jtjkr��td�|}	t�|	��d}~wwWYd}~nd}~wwtj|vr�||j	�
d��}
|t|
�d����O}t� |�}t�!||�t�"||�t#|_$|j$j%|_%t�&||j|�|_'|j'j|_(|j'j)|_*|j'j
|_+i|_,||_-t.�/|j$|j*�}t.�0|j*|||�1��|_0t2�2|j*�|_2d|_3d|_4t5�6�|_7d|_8d|_9d|_:d|_;dS)	NrVs/.hgscachesrequiress
00changelog.irs+'%s' does not appear to be an hg repositorysstore)<�_urlrd�rootrr�rstriprerYrfrrW�cachevfs�_phasedefaultsr�names�
filtername�_extrafilterid�set�_wanted_sidedata�featuresr.r@r4r2r3rrr�	RepoError�requirementsmod�SHARESAFE_REQUIREMENTr	�gathersupportedrequirements�ensurerequirementsrecognized�ensurerequirementscompatibler�
nodeconstants�nullid�	makestore�store�spathr�svfs�sjoin�
_filecacherr
�manifestrevlog�manifestlog�narrowmatchr�_tags�
nodetagscacher�BranchMapCache�
_branchcaches�_revbranchcache�
encodepats�
decodepats�	_transref)
rrdrY�ure�vfsclassrr>rNrM�storevfs�supportedrequirements�rootmanifestrrrr�s|




�����

�



�

zstatichttprepository.__init__cstt|��|�}|�dg�S)Nspushkey)�superrl�_restrictcapabilities�
difference)r�caps��	__class__rrr��sz*statichttprepository._restrictcapabilitiescCs|jSr)rmrrrrr�szstatichttprepository.urlcCrirjrrrrrrh�rzstatichttprepository.localcCst|�Sr)rgrrrr�peer�szstatichttprepository.peerTcC�t�dtd�dtd����Nrslock not availableslocks"cannot lock static-http repository�r�LockUnavailabler�r�waitrrr�wlock���zstatichttprepository.wlockcCr�r�r�r�rrr�lock�r�zstatichttprepository.lockcCrDrrrrrr�_writecachesrz!statichttprepository._writecaches)T)rErFrGr	�localrepository�_basesupported�	supportedrr�rrhr�r�r�r��
__classcell__rrr�rrl�sF

rlcCs$|r	t�td���t||dd��S)Ns(cannot create new static-http repository�)r�Abortrrl)rdrY�create�intents�
createoptsrrr�instancesr�)NN)'�
__future__rr2�i18nr�noder�rrrr	r
rrr
rryrrrrb�utilsrr0r)�objectrr4rH�basehandlerrJrf�	localpeerrgr��revlogfilestoragerlr�rrrr�<module>s"	8?
�l

https://t.me/RX1948 - 2025