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/revlogutils/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�+�b��@s�dZddlmZddlZddlZddlmZmZddl	m
Z
mZddlm
Z
dZdZd	Zd
ZdZdZd
ZdZdZdZdZdZe�d�Ze�d�Zdd�Zdd�Zd dd�Zdd�Z dd�Z!dS)!aacore code for "sidedata" support

The "sidedata" are stored alongside the revision without actually being part of
its content and not affecting its hash. It's main use cases is to cache
important information related to a changesets.

The current implementation is experimental and subject to changes. Do not rely
on it in production.

Sidedata are stored in the revlog itself, thanks to a new version of the
revlog. The following format is currently used::

    initial header:
        <number of sidedata; 2 bytes>
    sidedata (repeated N times):
        <sidedata-key; 2 bytes>
        <sidedata-entry-length: 4 bytes>
        <sidedata-content-sha1-digest: 20 bytes>
        <sidedata-content; X bytes>
    normal raw text:
        <all bytes remaining in the rawtext>

This is a simple and effective format. It should be enough to experiment with
the concept.
�)�absolute_importN�)�error�requirements)�	constants�flagutil)�hashutil��������	�
��z>Hz>HL20scCs~t|���}|��t�t|��g}|D].\}}t�|���}|�	t
�|t|�|��q(|D]\}}|�	|�q\d�|�}|S)N�)�list�items�sort�SIDEDATA_HEADER�pack�lenr�sha1�digest�append�SIDEDATA_ENTRY�join)�sidedata�buf�key�valuer�r$�D/usr/lib64/python3.9/site-packages/mercurial/revlogutils/sidedata.py�serialize_sidedata@s
r&c
Cs�i}d}t�|dtj��\}|tj7}tjtj|}t|�D]r}|tj}t�|||��\}}}	|}||}
t|||
��}t�|���}|	|kr�t	�
||	|��|||<|
}q@|S)Nr)r�unpack�sizer�range�bytesrrrrZSidedataHashError)
Zblobr �offsetZnbentryZ
dataoffset�iZ
nextoffsetr"r(ZstoreddigestZnextdataoffsetZ	entrytextZ
readdigestr$r$r%�deserialize_sidedataMs"

r-FcCs�t�t�}t�t�}||j}|j|}|r6||}}|j��D]F\}}|��D]4\}	}
|	|vrn||�|
�|	|vrP||�|
�qPq@|||f}|S)a
    Returns a dictionary mapping revlog types to tuples of
    `(repo, computers, removers)`:
        * `repo` is used as an argument for computers
        * `computers` is a list of `(category, (keys, computer, flags)` that
           compute the missing sidedata categories that were asked:
           * `category` is the sidedata category
           * `keys` are the sidedata keys to be affected
           * `flags` is a bitmask (an integer) of flags to remove when
              removing the category.
           * `computer` is the function `(repo, store, rev, sidedata)` that
             returns a tuple of
             `(new sidedata dict, (flags to add, flags to remove))`.
             For example, it will return `({}, (0, 1 << 15))` to return no
             sidedata, with no flags to add and one flag to remove.
        * `removers` will remove the keys corresponding to the categories
          that are present, but not needed.
        If both `computers` and `removers` are empty, sidedata will simply not
        be transformed.
    )�collections�defaultdictrZ_wanted_sidedataZ_sidedata_computersrr)�repoZremote_sd_categoriesZpull�sd_computers�sd_removersZto_generate�	to_remove�revlog_kindZ	computers�categoryZcomputer�sidedata_helpersr$r$r%�get_sidedata_helpersbs





r7cCs�|\}}}|j}d}d}	|�|g�D]4\}
}}|||||�\}}
||
dO}|	|
dO}	q$|�|g�D](\}}}
|D]}|�|d�qt|	|
O}	qf|||	ffS)aOReturns the sidedata for the given revision after running through
    the given helpers.
    - `store`: the revlog this applies to (changelog, manifest, or filelog
      instance)
    - `sidedata_helpers`: see `get_sidedata_helpers`
    - `sidedata`: previous sidedata at the given rev, if any
    - `rev`: affected rev of `store`
    rr	N)r4�get�pop)�storer6r Zrevr0r1r2�kindZflags_to_addZflags_to_removeZ_keysZsd_computerZ_flags�flags�keysZ	_computerr"r$r$r%�run_sidedata_helpers�s	

r>cCs@ddlm}tj|jvr"|�t�|�tj	ttf|j
tj�dS)Nr)�metadata)
�r?�requirementsmodZCOPIESSDC_REQUIREMENTrZregister_wanted_sidedata�SD_FILESZregister_sidedata_computerrZKIND_CHANGELOGZcopies_sidedata_computerrZREVIDX_HASCOPIESINFO)r0r?r$r$r%�set_sidedata_spec_for_repo�s
�rC)F)"�__doc__Z
__future__rr.�structr@rrrAZrevlogutilsrrZutilsrZSD_TEST1ZSD_TEST2ZSD_TEST3ZSD_TEST4ZSD_TEST5ZSD_TEST6ZSD_TEST7ZSD_P1COPIESZSD_P2COPIESZ
SD_FILESADDEDZSD_FILESREMOVEDrB�Structrrr&r-r7r>rCr$r$r$r%�<module>s2



)

Youez - 2016 - github.com/yon3zu
LinuXploit