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/hgext/git/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/hgext/git/__pycache__/manifest.cpython-39.opt-1.pyc
a

�+�b0�@s�ddlmZddlmZmZmZmZddlm	Z	mZ
ddlmZe�
�Ze
�e	j�Gdd�de��Ze
�e	j�Gdd	�d	e��Ze
�e	j�Gd
d�de��ZdS)
�)�absolute_import)�match�pathutil�pycompat�util)�
repositoryr�)�gitutilc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e	Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd:dd�Zejdd��Zdd �Zd!d"�d#fd$d%�Zd&d'�Zd;d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z dS)<�gittreemanifestz�Expose git trees (and optionally a builder's overlay) as a manifestdict.

    Very similar to mercurial.manifest.treemanifest.
    cCs"||_||_|duri}||_dS)a�Initializer.

        Args:
          git_repo: The git_repo we're walking (required to look up child
              trees).
          root_tree: The root Git tree object for this manifest.
          pending_changes: A dict in which pending changes will be
              tracked. The enclosing memgittreemanifestctx will use this to
              construct any required Tree objects in Git during it's
              `write()` method.
        N)�	_git_repo�_tree�_pending_changes)�selfZgit_repoZ	root_treeZpending_changes�r�8/usr/lib64/python3.9/site-packages/hgext/git/manifest.py�__init__s
zgittreemanifest.__init__c
Cs�t�|�}d}||jvr2|j|}|dur.t�|S|j}|�d�}|j}|dd�D]}||}|j|j}qT||d}|jt	j
kr�d}	n6|jt	jkr�d}	n$|jt	jkr�d}	nt
dt|j���|jj|	fS)z�Given a path, load its node and flags, or raise KeyError if missing.

        This takes into account any pending writes in the builder.
        N�/�����x�lzunsupported mode %s)r�fsdecoder
�KeyErrorr�splitr�id�filemode�pygit2�GIT_FILEMODE_BLOB�GIT_FILEMODE_BLOB_EXECUTABLE�GIT_FILEMODE_LINK�
ValueError�oct�raw)
r�pathZupathZent�val�t�comps�te�comp�flagsrrr�_resolve_entry-s,



zgittreemanifest._resolve_entrycCs|�|�dS�Nr�r*�rr#rrr�__getitem__Jszgittreemanifest.__getitem__cCs
|�|�S�Nr,r-rrr�findMszgittreemanifest.findcCstt|�t�����Sr/)�len�list�walk�matchmod�always�rrrr�__len__Pszgittreemanifest.__len__cCs,ztt|��WdSty&YdS0dS�NTF)�next�iter�
StopIterationr6rrr�__nonzero__Ss
zgittreemanifest.__nonzero__cCs*z|�|�WdSty$YdS0dSr8�r*rr-rrr�__contains__\s

zgittreemanifest.__contains__cCs|�t���Sr/)r3r4r5r6rrr�iterkeyscszgittreemanifest.iterkeyscCst|���Sr/)r2r?r6rrr�keysfszgittreemanifest.keyscCs|��Sr/)r?r6rrr�__iter__iszgittreemanifest.__iter__cCs||�|�f|j|<dSr/)r)r
)rr#�noderrr�__setitem__lszgittreemanifest.__setitem__cCsd|j|<dSr/)r
r-rrr�__delitem__oszgittreemanifest.__delitem__NcsP|dur>t�|dd��}t��|����fdd�|�|�D�S�fdd�|D�S)NcSsdSr/r)r#�msgrrr�<lambda>urz,gittreemanifest.filesnotin.<locals>.<lambda>csh|]}|�vr|�qSrr��.0�f)�sm2rr�	<setcomp>wrz-gittreemanifest.filesnotin.<locals>.<setcomp>csh|]}|�vr|�qSrrrG)�otherrrrKxr)r4Zbadmatch�setr3)rrLrr)rLrJr�
filesnotinss
zgittreemanifest.filesnotincCs
t�|�Sr/)r�dirsr6rrr�_dirszszgittreemanifest._dirscCs
||jvSr/)rP)r�dirrrr�hasdir~szgittreemanifest.hasdircCsdS)NTr��xrrrrF�rzgittreemanifest.<lambda>FcsRi�������fdd�}g�|�j�jd��rN���\}}}||||�q.�S)a�Finds changes between the current manifest and m2.

        The result is returned as a dict with filename as key and
        values of the form ((n1,fl1),(n2,fl2)), where n1/n2 is the
        nodeid in the current/other manifest and fl1/fl2 is the flag
        in the current/other manifest. Where the file does not exist,
        the nodeid will be None and the flags will be the empty
        string.
        c
	s�|duri}|duri}|D�] }|t�|j�}|jtjkr�z||j}|jtjkrZd}Wntyrd}Yn0��|d||f�q��|�\}}z||j}��|�\}}	Wnty�d}d\}}	Yn0|dur�|jtjkr���|dd|f��|��sq||k�s||	k�r2||f||	ff�|<q�rd�|<q|D]r}|j|v�rX�qD|t�|j�}|jtjk�r���|dd|f�n(�|��rD��|�\}}	d||	ff�|<�qDdS)zQcompares two trees and appends new tree nodes to examine to
            the stackN�/)Nr)	r�fsencode�name�typer�GIT_OBJ_TREEr�appendr0)
�t1�t2�subdir�e1�realname�e2Zn1Zfl1Zn2Zfl2��cleanrrL�resultr�stackrr�_iterativediff�sL






z,gittreemanifest.diff.<locals>._iterativediffr)r�pop)rrLrrbrer]r[r\rrar�diff�s
5zgittreemanifest.diffcCs |�|�\}}||f|j|<dSr/)r*r
)rr#�flagrBZunused_flagrrr�setflag�szgittreemanifest.setflagcCs,z|�|�dWSty&|YS0dSr+r=)rr#�defaultrrr�get�szgittreemanifest.getcCs*z|�|�dWSty$YdS0dS)Nrrr=r-rrrr)�szgittreemanifest.flagscCst|j|jt|j��Sr/)r
rr�dictr
r6rrr�copy�s�zgittreemanifest.copyccs|D]}||VqdSr/r�rrIrrr�items�szgittreemanifest.itemscCs|��Sr/)ror6rrr�	iteritems�szgittreemanifest.iteritemsccs|D]}|�|�VqdSr/r,rnrrr�iterentries�szgittreemanifest.iterentriescCsdSr/rr6rrr�text�szgittreemanifest.textccsf|D]\}|t�|j�}|jtjkrL|�|j|j||d�D]
}|Vq>q||�rt�|�VqdS)NrU)	rrVrWrXrrY�_walkonetreerr)r�treerr]r'r_�innerrrrrs�s�
zgittreemanifest._walkonetreecsPt|�|j�d��}dd�|j��D�}�fdd�|jD�}tt||B|��S)NrcSsh|]\}}|dur|�qSr/r)rH�p�vrrrrKrz'gittreemanifest.walk.<locals>.<setcomp>csh|]}�|�r|�qSrr)rHrv�rrrrKr)rMrsrr
ror:�sorted)rrZbaselineZdeletedZpendrrxrr3�szgittreemanifest.walk)N)N)!�__name__�
__module__�__qualname__�__doc__rr*r.r0r7r<�__bool__r>r?r@rArCrDrNrZ
propertycacherPrRrgrirkr)rmrorprqrrrsr3rrrrr
s:

J
r
c@s6eZdZdd�Zdd�Zd
dd�Zdd	�Zd
d�ZdS)�gittreemanifestctxcCs||_||_dSr/)�_repor)r�repoZgittreerrrrszgittreemanifestctx.__init__cCst|j|jd�Sr/)r
r�rr6rrr�readszgittreemanifestctx.readFcCs|��Sr/�r�)r�shallowrrr�readfastszgittreemanifestctx.readfastcCst|j|j�Sr/��memgittreemanifestctxr�rr6rrrrmszgittreemanifestctx.copycCs|��|Sr/r�r-rrrr0szgittreemanifestctx.findN)F)rzr{r|rr�r�rmr0rrrrrs

rc@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)r�cCs||_||_i|_dSr/)r�rr
)rr�rtrrrrszmemgittreemanifestctx.__init__cCst|j|j|j�Sr/)r
r�rr
r6rrrr�#szmemgittreemanifestctx.readcCst|j|j�Sr/r�r6rrrrm&szmemgittreemanifestctx.copyNc
Cs�t�t|j��}d|ji}	d|j�|j�i}
t|dd�d�D]�}|dkrJq<|�d�}d}
|D]�}|	|
}z|t	�
|�j}|j|}Wnty�d}Yn0|
d|7}
|dur�||	|
<|j�|�|
|
<q\i|	|
<|j��|
|
<q\q<|j�
�D]�\}}d|v�rd}|}n|�dd�\}}d|}|du�rD|
|�t	�
|��q�|\}}tjtjtjd�|}|
|�t	�
|�t�|�|�q�t|
tdd	�D]L}|dk�r��q�|
|}|�dd�\}}|
|�t	�
|�|��tj��q�|
d��jS)
NrcSst|�|fSr/)r1rSrrrrF<rz-memgittreemanifestctx.write.<locals>.<lambda>)�keyrUr)rrrT)r��reverse)rrOr2r
rr�ZTreeBuilderryrrrrrro�rsplit�removerrrr�insertr	Z	togitnoder1�writeZGIT_FILEMODE_TREEr")rZtransaction�linkZp1Zp2ZaddedZremovedrZtouched_dirsZtreesZbuilders�dr&Zfull�part�parentZparent_tree_id�newrI�info�dirname�basename�nZfl�mode�b�cbZdnZbnrrrr�+sd��



���
�zmemgittreemanifestctx.write)N)rzr{r|rr�rmr�rrrrr�sr�N)Z
__future__rZ	mercurialrr4rrrZmercurial.interfacesrZ
interfaceutil�r	Z
get_pygit2rZimplementerZ
imanifestdict�objectr
ZimanifestrevisionstoredrZimanifestrevisionwritabler�rrrr�<module>s
s



Youez - 2016 - github.com/yon3zu
LinuXploit