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/mercurial/upgrade_utils/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/upgrade_utils/__pycache__/actions.cpython-39.pyc
a

�+�b��@s�ddlmZddlmZddlmZmZmZmZm	Z	m
Z
ddlmZej
rZddlmZmZejejejejhZdd�Zd	Zd
ZGdd�de�ZgZd
d�ZGdd�de�ZGdd�de�ZeGdd�de��ZeGdd�de��Z eGdd�de��Z!eGdd�de��Z"eGdd�de��Z#eGdd�de��Z$eGdd �d e��Z%eGd!d"�d"e��Z&eGd#d$�d$e��Z'eGd%d&�d&e��Z(eGd'd(�d(e��Z)eGd)d*�d*e��Z*d+e
j+v�o�e
j+d+�,��o�e
j+d+�-�Z.eGd,d-�d-e��Z/eGd.d/�d/e��Z0d0d1�Z1d2d3�Z2gZ3d4d5�Z4Gd6d7�d7e�Z5e4Gd8d9�d9e5��Z6e4Gd:d;�d;e5��Z7e4Gd<d=�d=e5��Z8e4Gd>d?�d?e5��Z9d@dA�Z:dBdC�Z;GdDdE�dEe�Z<dFdG�Z=dHdI�Z>dJdK�Z?dLdM�Z@dNdO�ZAdPdQ�ZBdRdS�ZCdTdU�ZDdVS)W�)�absolute_import�)�_)�error�	localrepo�pycompat�requirements�revlog�util)�compression)�List�TypecCstjh}||j@S�N)r�SHARED_REQUIREMENT)�repoZ	preserved�r�E/usr/lib64/python3.9/site-packages/mercurial/upgrade_utils/actions.py�preservedrequirements&s�rs
deficiencysoptimizationc@sDeZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdS)�improvementzARepresents an improvement that can be made as part of an upgrade.NTF)�__name__�
__module__�__qualname__�__doc__�type�name�description�upgrademessage�default�postupgrademessage�postdowngrademessage�touches_filelogs�touches_manifests�touches_changelog�touches_requirements�touches_dirstate�compatible_with_sharerrrrr1s	rcCst�|�|Sr)�allformatvariant�append)�clsrrr�registerformatvariantns
r)c@s,eZdZdZeZedd��Zedd��ZdS)�
formatvariantz6an improvement subclass dedicated to repository formatcCs
t��dS)z.current value of the variant in the repositoryN��NotImplementedError�rrrr�fromrepoxszformatvariant.fromrepocCs
t��dS)z1current value of the variant in the configurationNr+r-rrr�
fromconfig}szformatvariant.fromconfigN)	rrrr�FORMAT_VARIANTr�staticmethodr.r/rrrrr*ss
r*c@s8eZdZdZdZedd��Zedd��Zedd��Z	dS)	�requirementformatvariantz�formatvariant based on a 'requirement' name.

    Many format variant are controlled by a 'requirement'. We define a small
    subclass to factor the code.
    NcCst�|t�|��Sr)rZnewreporequirementsZdefaultcreateopts)�uirrr�_newreporequirements�s
�z-requirementformatvariant._newreporequirementscCs|jdusJ�|j|jvSr)�_requirementr�r(rrrrr.�sz!requirementformatvariant.fromrepocCs |jdusJ�|j|�|j�vSr)r5r4r3r6rrrr/�sz#requirementformatvariant.fromconfig)
rrrrr5r1r4�classmethodr.r/rrrrr2�s

r2c@s*eZdZdZejZdZed�Z	ed�Z
dS)�fncachesfncacheTsYlong and reserved filenames may not work correctly; repository performance is sub-optimalssrepository will be more resilient to storing certain paths and performance of certain operations should be improvedN)rrrrr�FNCACHE_REQUIREMENTr5rrrrrrrrr8�s��r8c@sBeZdZdZejZdZed�Z	ed�Z
dZdZdZ
dZdZdZdS)�
dirstatev2sdirstate-v2Fs�version 1 of the dirstate file format requires reading and parsing it all at once.
Version 2 has a better structure,better information and lighter update mechanisms"hg status" will be fasterTN)rrrrr�DIRSTATE_V2_REQUIREMENTr5rrrrr r!r"r#r$r%rrrrr:�s�r:c@sBeZdZdZejZdZed�Z	ed�Z
dZdZdZ
dZdZdZdS)�dirstatetrackedkeystracked-hintFsDAdd a small file to help external tooling that watch the tracked setsHexternal tools will be informated of potential change in the tracked setTN)rrrrr�DIRSTATE_TRACKED_HINT_V1r5rrrrr r!r"r#r$r%rrrrr<�s��r<c@s*eZdZdZejZdZed�Z	ed�Z
dS)�	dotencodes	dotencodeTsLstorage of filenames beginning with a period or space may not work correctlysNrepository will be better able to store files beginning with a space or periodN)rrrrr�DOTENCODE_REQUIREMENTr5rrrrrrrrr>�s��r>c@s*eZdZdZejZdZed�Z	ed�Z
dS)�generaldeltasgeneraldeltaTs�deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slowersrepository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" fasterN)rrrrr�GENERALDELTA_REQUIREMENTr5rrrrrrrrr@�s��r@c@sJeZdZdZejZdZed�Z	ed�Z
ed�Zed�ZdZ
dZdZdZdS)	�	sharesafes
share-safeTs�old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.swUpgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.sirepository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.s�repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.FN)rrrrr�SHARESAFE_REQUIREMENTr5rrrrrrr r!r"r#rrrrrBs&����rBc@s*eZdZdZejZdZed�Z	ed�Z
dS)�sparserevlogssparserevlogTsXin order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.s�Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.N)rrrrr�SPARSEREVLOG_REQUIREMENTr5rrrrrrrrrD6s�
�rDc@s*eZdZdZejZdZed�Z	ed�Z
dS)�persistentnodemapspersistent-nodemapFs9persist the node -> rev mapping on disk to speedup lookups#Speedup revision lookup by node id.N)rrrrr�NODEMAP_REQUIREMENTr5rrrrrrrrrFPs�rFc@s*eZdZdZejZdZed�Z	ed�Z
dS)�	copiessdcs
copies-sdcFs/Stores copies information alongside changesets.sAAllows to use more efficient algorithm to deal with copy tracing.N)rrrrr�COPIESSDC_REQUIREMENTr5rrrrrrrrrH_s�rHc@s*eZdZdZejZdZed�Z	ed�Z
dS)�revlogv2s	revlog-v2FsVersion 2 of the revlog.svery experimentalN)rrrrr�REVLOGV2_REQUIREMENTr5rrrrrrrrrJns
rJc@s*eZdZdZejZdZed�Z	ed�Z
dS)�changelogv2schangelog-v2Fs7An iteration of the revlog focussed on changelog needs.squite experimentalN)rrrrr�CHANGELOGV2_REQUIREMENTr5rrrrrrrrrLws
rLc@s<eZdZdZdZed�Zed�Zedd��Z	edd��Z
d	S)
�removecldeltachainsplain-cl-deltaTs�changelog storage is using deltas instead of raw entries; changelog reading and any operation relying on changelog data are slower than they could beszchangelog storage will be reformated to store raw entries; changelog reading will be faster; changelog size may be reducedcs"|j}|j�t�fdd�|D��S)Nc3s|]}|�|�kVqdSrr)�.0Zrev��	chainbaserr�	<genexpr>��z.removecldeltachain.fromrepo.<locals>.<genexpr>)Z	changelogrQ�all)rZclrrPrr.�szremovecldeltachain.fromrepocCsdS�NTrr-rrrr/�szremovecldeltachain.fromconfigN)rrrrrrrrr1r.r/rrrrrN�s��
rN�zstdc@sFeZdZdZerdZndZed�Zed�Ze	dd��Z
e	dd	��Zd
S)�compressionengine�compressionrV�zlibsMCompresion algorithm used to compress data. Some engine are faster than others;revlog content will be recompressed with the new algorithm.cCs:d}|jD]*}|j}|d�s$|d�r
|�dd�d}q
|S)NrYsrevlog-compression-sexp-compression-�-r)r�
startswith�split)r(rrZreq�prefixrrrr.�s
zcompressionengine.fromrepocCsN|j�dd�}|D]0}|tjvrtj|}|��r|��r|Sqd�|�S)Nsformatsrevlog-compression�,)r3Z
configlistr
�compengines�	available�revlogheader�join)r(rr_�comp�errrr/�s


zcompressionengine.fromconfigN)rrrr�	_has_zstdrrrrr7r.r/rrrrrW�s��
rWc@s<eZdZdZdZed�Zed�Zedd��Z	edd��Z
d	S)
�compressionlevelscompression-level�defaultscompression levels#revlog content will be recompressedcCsPt�|�}d}|dkr&|j�dd�}n|dkr<|j�dd�}|durHdSt|�S�NrYsstoragesrevlog.zlib.levelrVsrevlog.zstd.levelrg)rWr.r3�	configint�bytes�r(rrc�levelrrrr.�s
zcompressionlevel.fromrepocCsPt�|�}d}|dkr&|j�dd�}n|dkr<|j�dd�}|durHdSt|�Srh)rWr/r3rirjrkrrrr/�s
zcompressionlevel.fromconfigN)rrrrrrrrr7r.r/rrrrrf�s
rfcCs&g}tD]}|�|�s|�|�q|S)zBreturns a list of format upgrades which can be perform on the repo)r&r.r')rZupgrades�fvrrr�find_format_upgrades�s

rncCsZg}tD]L}|jdkr6|�|�|�|�kr|�|�q|�|�r|�|�s|�|�q|S)zvreturns a list of format downgrades which will be performed on the repo
    because of disabled config option for themrX)r&rr.r/r')rZ
downgradesrmrrr�find_format_downgradess

rocCst�|�|Sr)�ALL_OPTIMISATIONSr')�objrrr�register_optimizations
rrc@seZdZdZeZdS)�optimizationz2an improvement subclass dedicated to optimizationsN)rrrr�OPTIMISATIONrrrrrrs#srsc@s$eZdZdZeZed�Zed�ZdS)�redeltaparents�re-delta-parents]deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slowersHdeltas within internal storage will choose a new base revision if neededN�	rrrrrtrrrrrrrrru)s�
�ruc@s$eZdZdZeZed�Zed�ZdS)�redeltamultibase�re-delta-multibases�deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of mergess�deltas within internal storage will choose an optimal delta by computing deltas against multiple parents; may slow down execution time significantlyNrwrrrrrx?s��rxc@s$eZdZdZeZed�Zed�ZdS)�
redeltaall�re-delta-alls�deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not neededsndeltas within internal storage will be fully recomputed; this will likely drastically slow down execution timeNrwrrrrrzYs��rzc@s$eZdZdZeZed�Zed�ZdS)�redeltafulladd�re-delta-fulladds�every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.s�each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need itNrwrrrrr|ms��r|cCstt�S)z8Determine optimisation that could be used during upgrade)�listrpr-rrr�findoptimizations�srcsbg�|D]8}t�|d�r |j}nd}|dur6||vr6q��|�q���fdd�t|�D���S)a�Determine upgrade actions that will be performed.

    Given a list of improvements as returned by ``find_format_upgrades`` and
    ``findoptimizations``, determine the list of upgrade actions that
    will be performed.

    The role of this function is to filter improvements if needed, apply
    recommended optimizations from the improvements list that make sense,
    etc.

    Returns a list of action names.
    r5Nc3s|]}|�vr|VqdSrr)rO�o�Z
newactionsrrrR�rSz,determine_upgrade_actions.<locals>.<genexpr>)r
Zsafehasattrr5r'�extend�sorted)rZformat_upgradesZ
optimizationsZ
sourcereqsZdestreqs�drrr�r�determine_upgrade_actions�sr�c@s�eZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zedd��Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)#�UpgradeOperationz/represent the work to be done during an upgradec
s�|�_|�_|�_|�_|�_|�_�j�j�_�j�j�_�j�j@�_t	d�}�fdd�|D��_
�j}	tjj
�_d|	vr�tjj�_n:d|	vr�tjj�_n&d|	vr�tjj�_nd|	vr�tjj�_d|	v�_|�_dS)Ncsg|]}|�jvr|�qSr)�upgrade_actions)rO�i��selfrr�
<listcomp>�sz-UpgradeOperation.__init__.<locals>.<listcomp>r{rvryr})r3�new_requirements�current_requirementsr��removed_actions�revlogs_to_process�_added_requirements�_removed_requirements�_preserved_requirementsr�unused_optimizations�upgrade_actions_namesr	ZDELTAREUSEALWAYSZdelta_reuse_modeZDELTAREUSENEVERZDELTAREUSESAMEREVSZDELTAREUSEFULLADDZforce_re_delta_both_parents�backup_store)
r�r3r�r�r�r�r�r�Zall_optimizationsr�rr�r�__init__�s:

�
�
�
�

�zUpgradeOperation.__init__cCstdd�|jD��S)NcSsg|]
}|j�qSr�r�rO�arrrr��rSz:UpgradeOperation.upgrade_actions_names.<locals>.<listcomp>)�setr�r�rrrr��sz&UpgradeOperation.upgrade_actions_namescCs&|jo$|jo$|jo$|jo$|jSr)r#r r!r"r$r�rrr�requirements_only�s����z"UpgradeOperation.requirements_onlycCsD|jD] }|jtkrdS|jrdSq|jD]}|jr.dSq.dS�NTF)r�rrtr r��r�r�rrrr �s


z!UpgradeOperation.touches_filelogscCsD|jD] }|jtkrdS|jrdSq|jD]}|jr.dSq.dSr�)r�rrtr!r�r�rrrr!s


z"UpgradeOperation.touches_manifestscCsD|jD] }|jtkrdS|jrdSq|jD]}|jr.dSq.dSr�)r�rrtr"r�r�rrrr"s


z"UpgradeOperation.touches_changelogcCs@|jD]}|jtkrq|jrdSq|jD]}|jr*dSq*dSrU)r�rrtr#r�r�rrrr#!s


z%UpgradeOperation.touches_requirementscCs@|jD]}|jtkrq|jrdSq|jD]}|jr*dSq*dSr�)r�rrtr$r�r�rrrr$.s


z!UpgradeOperation.touches_dirstatecCs:d}t|�D](}|s |j�d�|jj||d�d}qdS)zK
        Utility function to aid writing of a list under one label
        T�, )�labelFN)r�r3�write)r��lr��first�rrrr�_write_labeled<szUpgradeOperation._write_labeledcCs�|j�td��|j�td��|�|jd�|j�d�|jrj|j�td��|�|jd�|j�d�|jr�|j�td��|�|jd�|j�d�|j�d�dS)	Ns
requirements
s   preserved: z"upgrade-repo.requirement.preserved�
s   removed: z upgrade-repo.requirement.removeds
   added: zupgrade-repo.requirement.added)r3r�rr�r�r�r�r�rrr�print_requirementsGs&���z#UpgradeOperation.print_requirementscCsZdd�|jD�}|jdd�d�|rV|j�td��|�dd�|D�d�|j�d	�dS)
NcSsg|]}|jtkr|�qSr)rrtr�rrrr�]sz8UpgradeOperation.print_optimisations.<locals>.<listcomp>cSs|jSrr�)r�rrr�<lambda>`rSz6UpgradeOperation.print_optimisations.<locals>.<lambda>)�keysoptimisations: cSsg|]
}|j�qSrr�r�rrrr�drSz#upgrade-repo.optimisation.performeds

)r��sortr3r�rr�)r�Z
optimisationsrrr�print_optimisations\s��z$UpgradeOperation.print_optimisationscCs(|jD]}|j�d|j|jf�qdS�Ns
%s
   %s

)r�r3�statusrrr�rrr�print_upgrade_actionsis
z&UpgradeOperation.print_upgrade_actionscCsP|js|j�d�n,|j�d�t|j�D]}|j�d|�q*|j�d�dS)Nsno revlogs to process
sprocessed revlogs:
s  - %s
r�)r�r3r�r�)r�r�rrr�print_affected_revlogsmsz'UpgradeOperation.print_affected_revlogscCs,|jD] }|j�td�|j|jf�qdSr�)r�r3r�rrr)r�r�rrr�print_unused_optimizationsvs
z+UpgradeOperation.print_unused_optimizationscCs
||jvS)z<Check whether the upgrade operation will perform this action)Z_upgrade_actions_names)r�rrrr�has_upgrade_actionzsz#UpgradeOperation.has_upgrade_actioncCsT|jD] }|jdur|j�d|j�q|jD] }|jdur.|j�d|j�q.dS)z-print post upgrade operation warning messagesNs%s
)r�rr3�warnr�rr�rrr�print_post_op_messages~s



z'UpgradeOperation.print_post_op_messagesN)rrrrr��propertyr�r�r r!r"r#r$r�r�r�r�r�r�r�r�rrrrr��s08









	r�cCstjhS)z�Obtain requirements required to be present to upgrade a repo.

    An upgrade will not be allowed if the repository doesn't have the
    requirements returned by this function.
    )r�STORE_REQUIREMENTr-rrr�requiredsourcerequirements�s�r�cCs
tjdhS)z�Obtain requirements that will prevent an upgrade from occurring.

    An upgrade cannot be performed if the source repository contains a
    requirements in the returned set.
    sparentdelta)rZTREEMANIFEST_REQUIREMENTr-rrr�blocksourcerequirements�s	�r�cCs,tjtjh}|�|�s(td�}t�|��dS)z?Check that the requirements contain at least one Revlog versions3cannot upgrade repository; missing a revlog versionN)r�REVLOGV1_REQUIREMENTrK�intersectionrr�Abort)ZreqsZall_revlogs�msgrrr�check_revlog_version�s�
r�c	Cs�t|j�t|�}||j}|rDtd�}d�t|��}t�||��t|�}||j@}|r~td�}d�t|��}t�||��tj	|jvo�tj
|jv}|r�td�}td�}tj||d��dS)zCEnsure that no existing requirements prevent the repository upgrades2cannot upgrade repository; requirement missing: %sr�s=cannot upgrade repository; unsupported source requirement: %ss>cannot upgrade repository; share repository without share-safes-check :hg:`help config.format.use-share-safe`)�hintN)r�rr�rrbr�rr�r�rrC)	r�requiredZmissingreqsr��blockingZblockingreqs�mZ	bad_share�hrrr�check_source_requirements�s(



�r�c	Csvtjtjtjtjtjtjtjtjtj	h	}t
jD]B}t
j|}|��r.|�
�r.|�d|�|��dkr.|�d�q.|S)z�Obtain requirements that can be removed during an upgrade.

    If an upgrade were to create a repository that dropped a requirement,
    the dropped requirement must appear in the returned set for the upgrade
    to be allowed.
    �exp-compression-%srV�revlog-compression-zstd)rrErIrGrCrKrMr�r=r;rr_r`ra�addr�r�	supportedrZenginerrr�supportremovedrequirements�s"�

r�cCs�tjtjtjtjtjtjtjtjtj	tj
tjtjtj
tjh}tjD]B}tj|}|��rB|��rB|�d|�|��dkrB|�d�qB|S)z�Obtain requirements that upgrade supports in the destination.

    If the result of the upgrade would create requirements not in this set,
    the upgrade is disallowed.

    Extensions should monkeypatch this to add their custom requirements.
    r�rVr�)rrMrIr=r;r?r9rArGr�rKrrCrEr�rr_r`rar�rr�rrr�supporteddestrequirements�s,	�

r�cCs�tjtjtjtjtjtjtjtjtj	tj
tjtjh}t
jD]B}t
j|}|��r:|��r:|�d|�|��dkr:|�d�q:|S)a�Obtain requirements that can be added to a repository during upgrade.

    This is used to disallow proposed requirements from being added when
    they weren't present before.

    We use a list of allowed requirement additions instead of a list of known
    bad additions because the whitelist approach is safer and will prevent
    future, unknown requirements from accidentally being added.
    r�rVr�)rr?r9rArErIrGrCr�rKrMr=r;rr_r`rar�rr�rrr�allowednewrequirementss(�

r�cCs�|j}t|j�t|�}|||}|rLtd�}d�t|��}t�||��t|�}|||}|r�td�}d�t|��}t�||��t	|�}	||	}
|
r�td�}d�t|
��}
t�||
��dS)Ns;cannot upgrade repository; requirement would be removed: %sr�s>cannot upgrade repository; do not support adding requirement: sEcannot upgrade repository; do not support destination requirement: %s)
rr�r�rrbr�rr�r�r�)rZnew_reqsZold_reqsZsupport_removalZno_remove_reqsr�Zsupport_additionZno_add_reqsr�r�Zunsupported_reqsrrr�check_requirements_changes/s,
�r�N)EZ
__future__rZi18nr�rrrrr	r
Zutilsr�
TYPE_CHECKING�typingrr
rArErKrMZRECLONES_REQUIREMENTSrr0rt�objectrr&r)r*r2r8r:r<r>r@rBrDrFrHrJrLrNr_r`rarerWrfrnrorprrrsrurxrzr|rr�r�r�r�r�r�r�r�r�r�rrrr�<module>s� 	�:& ��,!&\ !!

Youez - 2016 - github.com/yon3zu
LinuXploit