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

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

�+�b�b�@s�ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZmZmZmZmZmZmZmZmZmZmZmZddlmZejZdd	lm Z e j!Z!e j"Z"e�#d
�Z$Gdd�de j%�Z&Gd
d�de j'�Z(dS)�)�absolute_importN)�_)�open)�bin�hex�sha1nodeconstants)�	bookmarks�context�error�exchange�hg�lock�
logcmdutil�merge�
mergestate�phases�pycompat�util)�dateutil�)�commons\b[0-9a-f]{12,40}\bc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) �mercurial_sinkc
Csltj�||||�|�dd�|_|�dd�|_|�dd�|_d|_t	j
�|�r�tt	�
|��dkr�z.t�|j|�|_|j��s�ttd�|��Wn<tjy�}z"|��t|jd��WYd}~n
d}~00n�zR|�td�|�tj|j|dd	�|_|j���sttd�|��|j�|�Wn.tj�yN|��ttd
�|��Yn0d|_d|_d|_i|_dS)N�convertshg.usebranchnamesshg.clonebranchess
hg.tagsbranchr�&%s is not a local Mercurial repositorys'initializing destination %s repository
T�Zcreates)could not create hg repository %s as sinkF) r�converter_sink�__init__�
configbool�branchnames�
clonebranches�config�
tagsbranch�
lastbranch�os�path�isdir�len�listdirr�
repository�ui�repo�local�NoReporr
�	RepoError�	traceback�args�statusZcreated�appendr
�wlock�filemapmode�
subrevmaps)�selfr)�repotyper$�err�r8�6/usr/lib64/python3.9/site-packages/hgext/convert/hg.pyr;s@

�&
�
�
zmercurial_sink.__init__cCs(|j�d�|j��|_|j��|_dS)Ns"run hg sink pre-conversion action
)r)�debugr*r2r
�r5r8r8r9�before^szmercurial_sink.beforecCs0|j�d�|jr|j��|jr,|j��dS)Ns#run hg sink post-conversion action
)r)r:r
�releaser2r;r8r8r9�aftercs

zmercurial_sink.aftercCs|jj�d�S)N�shamap�r*�vfs�joinr;r8r8r9�
revmapfilejszmercurial_sink.revmapfilecCs|jj�d�S)Ns	authormapr@r;r8r8r9�
authorfilemszmercurial_sink.authorfilec
	sj|js
dS||jk}||_|s"d}dd�|D�}tj�|j|�}|r�|��zt�|j|�|_	Wn&t
y�tj|j|dd�|_	Yn0|��i}|D]F}z|j	�|d�Wq�t
y�|�
|dg��|d�Yq�0q�|�rf|��tt�|��D]`\}}tj�|j|�}	t�|ji|	��|j�td�||f�tj|j	��fd	d�|D�d
�q�|��dS)N�defaultcSs(g|] }|d|dr|dp df�qS)rrrEr8)�.0�br8r8r9�
<listcomp>x�z,mercurial_sink.setbranch.<locals>.<listcomp>Trrrspulling from %s into %s
csg|]}��|��qSr8)�lookup�rF�h�Zprepor8r9rH�rI)�heads)rr"r#r$rBr>rr(r)r*�	Exceptionr<rJ�
setdefaultr1�sortedr�	iteritemsZpeerZnoterrZpull)
r5�branchZ	pbranches�	setbranchZ
branchpathZmissingsrGZpbranchrNZpbranchpathr8rMr9rTpsB
"��zmercurial_sink.setbranchcCs�t�}|��D]�}|�dd�}t|�dkrN|j�td�|�|�d|�q|�|�	|d��}|s�|dt
jkr~|d}n$|j�td�|�|�d|�q|�d||df�q|��S)	N� r�sinvalid tag entry: "%s"
s%s
rsmissing tag entry: "%s"
�%s %s
)
�stringio�
splitlines�splitr&r)�warnr�write�get�	lookuprevr�nullhex�getvalue)r5�source�revmap�data�fp�line�s�revidr8r8r9�_rewritetags�s 
zmercurial_sink._rewritetagscCst�}|��D]�}|�dd�}t|�dkr,q|d}|d}|tjkr�|j�|�}|dur�t|j	|j
�|d��}||j|<td�}	t|�dkr�|j
j
�|d�}
|j
j
�|
�r�|j	�|	|�|�|�}|s�t|�dkr�|j	�td�||f�n|}|�d	||f�q|��S)
NrUrrVrs
.hg/shamaps/no ".hgsubstate" updates will be made for "%s"
s.hgs!%s is missing from %s/.hg/shamap
rW)rXrYrZr&rr_r4r]�mapfiler)r*ZwjoinrZwvfsZreljoin�existsr[r\r`)r5rarcrdrerfrgZsubpathrb�msg�subZnewidr8r8r9�_rewritesubstate�s<
�

��zmercurial_sink._rewritesubstatec

cs�|�|�g}tj|j|||ddddd�}|��D]R\}\}}}	|�|�rJq0|tjvrnt�	t
d�|||f��q0|tjkr|q0q0|Vq0dS)aRCalculates the files from p2 that we need to pull in when merging p1
        and p2, given that the merge is coming from the given source.

        This prevents us from losing files that only exist in the target p2 and
        that don't come from the source repo (like if you're merging multiple
        repositories together).
        TF)Zbranchmerge�forceZacceptremoteZfollowcopiesseunable to convert merge commit since target parents do not merge cleanly (file %s, parents %s and %s)N)Zancestor�mergemodZcalculateupdatesr*ZfilemapZtargetfilebelongstosourcerZCONVERT_MERGE_ACTIONSr
�AbortrZACTION_KEEP)
r5ra�p1ctx�p2ctxZancZmresult�file�action�inforkr8r8r9�_calculatemergedfiles�s2�

���
z$mercurial_sink._calculatemergedfilesc	#
s�t����������fdd�}	g}
|D]}||
vr(|
�|�q(|
}t|�}�jr||dkr|�jj�t|d��d}
|d}t|�dkr�|��jj�t|�dkr�|��jj�|�	d�}|j
}t�t
|�}|D]8}��|�}��|�}|dur�|�||dt|���}q�|j��}�jj�dd�}|�r2||d<d	D]^}|�|�}|du�rR�q6|d
k�rdt|�}��|�}|du�r6|d
k�r�t|�}|||<�q6�j�r�|j�r�|j|d<|j�r�|j�r�|j|d<|�rT|}|�	d�}�j|}d�|�jjk�r�j|�t��}|�r2|��j|�|��j|���rjt|�����|��D]}��|�|�|��qNt��j||f|||	|j |j!|�}�jj�"d
dt#j$|j%d��j�&d���}�jj�dd��r�|j'}nd}t�jj(||d��}|j|k�r(�j|}|�%�t#j)k�r(t#�*�j|t#j)|��g�Wd�n1�s>0Yd}|}�qʈj�r�|dk�rЈjj+�,d�} �jj�t|��d}!d|jv}"|"�s�| �-|
| �.|!���sЈj�/t0d���jj1dd�|S|S)Ncs��rF|�vrF|�vrF�j�d|�z
�|WStjyDYdS0z�|}WntyfYdS0��||�\}}|dur�dS|dkr�����|�}|dkr����|�}t�	�j
|||d|vd|v��|��S)Nsreusing %s from p2
�.hgtagss.hgsubstate�l�x)r)r:r
ZManifestLookupError�KeyError�getfilerhrmr	�
memfilectxr*r])r*�memctx�f�vrc�mode��copies�filesrrZp2filesrbr5rar8r9�
getfilectx
s4
�z,mercurial_sink.putcommit.<locals>.getfilectxrrrVrs
hg.sourcenamesconvert_source)ssource�transplant_sources
rebase_sourcesintermediate-sourcer��branchsconvert_revisionsphasess
new-commitshg.preserve-hash)�origctxs(octopus merge fixup)
rIsclosesfiltering out empty revision
T)rn)2�dictr1r&r3r*�	changelog�readr�nullid�pop�desc�re�findall�sha1rer^r]�replace�extra�copyr)r rrrS�rev�saverev�set�updaterv�addr	r}�author�dateZ	setconfigrZ
phasenames�phase�transaction�ctx�	commitctxZdraftZregisternewZmanifestlogZ
getstorage�cmpZrevisionr0rZrollback)#r5r�r��parents�commitrarb�full�cleanp2r��pl�pZnparentsZm1node�parentZp2�textZsha1sZsha1ZoldrevZnewrevr�Z
sourcenameZlabel�nodeZp1rqZfilesetrsr��trr�ZmanZmnode�closedr8r�r9�	putcommits�















�

�
�$
zmercurial_sink.putcommitc
s�|jj|jdd�}|p|jj}t�}t�|j���D]B\}}|D]4}d|j|vr@|�t|j|d�	��
d���q@q4tt|��}t�fdd��D��}||kr�dSt�}t�}	|D]0}
|
�
��dd�}t|�d	kr�q�|�|d�q�|D]B}
|
�
��dd�}t|�d	k�rq�|d|vr�|	�|d�
��q�|	�s:dSd
�|���fdd�}|j�td
��dtt�t����}
d|ji}t�|j|dfddg|d|
|�}|j�|�}t|�t|�fS)NT)Z
ignoremissingrwcsg|]}d�||f�qS)rWr8)rF�tag)�tagsr8r9rH�rIz*mercurial_sink.puttags.<locals>.<listcomp>�NNrUrrVrIc	st�|||�ddd�S)NF)r	r|)r*r}r~)rcr8r9r��sz*mercurial_sink.puttags.<locals>.getfilectxsupdating tags
s%d 0r�supdate tagssconvert-repo)r*Z	branchtipr!r�r�rrRZ	branchmapr�rcrYrQ�list�striprZr&r�rBr)r0r�int�time�mktime�gmtimer	r}r�r)r5r�Z	tagparentZoldlinesrSrNrL�newlinesZoldtagsZnewtagsrerfr�r�r�r�r�r8)rcr�r9�puttags�sZ�

�
zmercurial_sink.puttagscCs
||_dS�N)r3)r5Zactiver8r8r9�setfilemapmode�szmercurial_sink.setfilemapmodecs�t��sdSd}}}zt|j��}|j��}|j�d�}|j�td��|jj}�fdd��D�}|�	|j||�|�
�Wt�|||�nt�|||�0dS)Nsbookmarksupdating bookmarks
csg|]}|t�|�f�qSr8)r)rFZbookmark��updatedbookmarkr8r9rH�s�z/mercurial_sink.putbookmarks.<locals>.<listcomp>)
r&r*r2r
r�r)r0rZ
_bookmarksZapplychanges�close�lockmodr=)r5r�r2r
r�Z	destmarks�changesr8r�r9�putbookmarks�s


�
zmercurial_sink.putbookmarkscCs||jvp|jSr�)r*r�r5r�r8r8r9�hascommitfrommap�szmercurial_sink.hascommitfrommapcCs,||jvr"|jr"t�td�|��||jvS)Nserevision %s not found in destination repository (lookups with clonebranches=true are not implemented))r*rr
rprr�r8r8r9�hascommitforsplicemap�s���z$mercurial_sink.hascommitforsplicemapN)�__name__�
__module__�__qualname__rr<r>rCrDrTrhrmrvr�r�r�r�r�r�r8r8r8r9r:s #)*."8rc@s�eZdZd+dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd,d)d*�ZdS)-�mercurial_sourceNc
stj��||||�|�dd��_t��_|�dd��_z$t�	�j
|��_�j��sZt
j�Wn,t
jy�|��ttd�|��Yn0d�_d�_d�_d�_|�dd�}|�dd�}|du�r�|du�rRz�j�|�}Wn(t
j�yt
�td�|��Yn0�jj�|�}|d	i}�jj�|g�D]}	d	|�jj�|	�<�q.|j�_ntj �_|�rv�fd
d�|D��_!n�j�"��_!n�|�s�|du�r�t
�td���t�}
t�}t#�$�j|g�D]6}	�j|	}|
�%|���|�&d
d�|�'�D���q�|
j�_|
|�_!dS)Nrshg.ignoreerrorss
hg.saverevrr�shg.startrevshg.revss %s is not a valid start revisionrcsg|]}�j�|��qSr8)r*rJ)rF�rr;r8r9rH+rIz-mercurial_source.__init__.<locals>.<listcomp>s4hg.revs cannot be combined with hg.startrev or --revcss|]}|��VqdSr�)r��rFr�r8r8r9�	<genexpr>;rIz,mercurial_source.__init__.<locals>.<genexpr>)(r�converter_sourcerr�ignoreerrorsr��ignoredr�rr(r)r*r+r
r-r.r,r�lastrev�lastctx�
_changescache�	convertfpr rJrpr�r�Zdescendantsr��__contains__�keepr�always�_headsrNrZrevranger�r�r�)
r5r)r6r$ZrevsZ	startnodeZhgrevsZstartrevZchildrenr�Znodesr�r�r8r;r9rs`




�

��
zmercurial_source.__init__cCs"|j|kr|j||_||_|jSr�)r�r*r�r�r8r8r9�
_changectx?s
zmercurial_source._changectxcs�fdd�|��D�S)Ncs"g|]}|r��|���r|�qSr8)r�r�r�r;r8r9rHFrIz-mercurial_source._parents.<locals>.<listcomp>)r�)r5r�r8r;r9�_parentsEszmercurial_source._parentscs�fdd��jD�S)Ncsg|]}��|�rt|��qSr8�r�rrKr;r8r9rHIrIz-mercurial_source.getheads.<locals>.<listcomp>)r�r;r8r;r9�getheadsHszmercurial_source.getheadscCs<z |�|�|}|��|��fWStjy6YdS0dS)Nr�)r�rc�flagsr
�LookupError)r5�namer�Zfctxr8r8r9r{Ks
zmercurial_source.getfilec
Csjgg}}|j}|j}|���|���}t�|�D].\}\\}	}
\}}|durX||�q2||�q2||fSr�)r1�manifest�diffrrR)
r5Zctx1Zctx2�mar�ZmaappendZrappend�dr~Znode1Zflag1Znode2Zflag2r8r8r9�
_changedfilesRs


zmercurial_source._changedfilescs�����}��|�}|s|s(|��}}|rn�jd�krJ�jd\}}n��|d|�\}}|sj||}|}��|||�}	t�}
t|�dkr�|d��j|��dd�}t	�
|�D]\}}
|
dur�|
�|�q���fdd�|D�}|��||	|
fS)NrrrVT)Zcleancsg|]}|�jvr|�f�qSr8�r��rFr~�r�r5r8r9rHtrIz/mercurial_source.getchanges.<locals>.<listcomp>)
r�r�r�r�r��
_getcopiesr�r&r�rrRr��sort)r5r�r�r�r�r�Z	copyfilesr�r�r�r�r�r~�valuer�r8r�r9�
getchanges^s*

zmercurial_source.getchangescs�i}|D]�}||jvrqzB|�|�����|jvr6Wqt�fdd�|D��sPWq�||<WqtylYqtjy�}z4|js��|j�|�|j	�
td�|�WYd}~qd}~00q|S)Nc3s|]}�|vVqdSr�r8r���
copysourcer8r9r��rIz.mercurial_source._getcopies.<locals>.<genexpr>s
ignoring: %s
)r�Zfilectxr��any�	TypeErrorr
r�r�r�r)r[r)r5r�r�r�r�r��er8r�r9r�xs&

,zmercurial_source._getcopiescs�|�|�}|�|��dd��D�}�fdd�|��D�}|}tj|��t�|��d�|�	�||||�
�|��|��|j
|��|d�S)NcSsg|]}|���qSr8�rr�r8r8r9rH�rIz.mercurial_source.getcommit.<locals>.<listcomp>cs g|]}|r|�vr|���qSr8r�r��r�r8r9rH�rIs%Y-%m-%d %H:%M:%S %1%2)r�r�r�r�r��
optparentsrSr�Zsortkeyr�r�r�)r�r�r�rr��userrZdatestrr��descriptionrSr�r�r�r�)r5r�r�r�r�Zcrevr8r�r9�	getcommit�s&

�zmercurial_source.getcommitcCs
t|j�Sr�)r&r*r;r8r8r9�
numcommits�szmercurial_source.numcommitscs*�fdd��j��D�}�fdd�|D�S)Ncs$g|]}�j�|d�dkr|�qS)rsglobal)r*Ztagtype)rF�tr;r8r9rH�s�z,mercurial_source.gettags.<locals>.<listcomp>cs$i|]\}}��|�r|t|��qSr8r�)rFr�r�r;r8r9�
<dictcomp>�rIz,mercurial_source.gettags.<locals>.<dictcomp>)r*Ztagslist)r5r�r8r;r9�gettags�s
�zmercurial_source.gettagscs���|�}��|�}|s8|dur8d}|����g}}n|p>d}��|||�\}}�fdd�||fD�\}}|dkr�|||ff�_||S)Nrcsg|]}�fdd�|D��qS)csg|]}|�jvr|�qSr8r�r�r;r8r9rH�rIz?mercurial_source.getchangedfiles.<locals>.<listcomp>.<listcomp>r8)rF�lr;r8r9rH�rIz4mercurial_source.getchangedfiles.<locals>.<listcomp>)r�r�r��keysr�r�)r5r��ir�r�r�r�r8r;r9�getchangedfiles�s

z mercurial_source.getchangedfilescCsH|jdur t|jj�d�d�|_|j�t�d||f��|j��dS)Nr?sabrW)	r�rr*rArBr\rZtonativeeol�flush)r5r�Zdestrevr8r8r9�	converted�s
zmercurial_source.convertedcCs|j�d�dS)Ns$run hg source pre-conversion action
�r)r:r;r8r8r9r<�szmercurial_source.beforecCs|j�d�dS)Ns%run hg source post-conversion action
r�r;r8r8r9r>�szmercurial_source.aftercCsdS�NTr8r;r8r8r9�hasnativeorder�szmercurial_source.hasnativeordercCsdSr�r8r;r8r8r9�hasnativeclose�szmercurial_source.hasnativeclosec	Cs4zt|j�|��WStjtjfy.YdS0dSr�)rr*rJr
r-r�r�r8r8r9r^�szmercurial_source.lookuprevcCst�|j�Sr�)rZ
listbookmarksr*r;r8r8r9�getbookmarks�szmercurial_source.getbookmarks�	splicemapcCs|�||�dS)z+Mercurial, revision string is a 40 byte hexN)Zcheckhexformat)r5ZrevstrZmapnamer8r8r9�checkrevformat�szmercurial_source.checkrevformat)N)r)r�r�r�rr�r�r�r{r�r�r�r�r�r�r�r�r<r>r�r�r^rrr8r8r8r9r�s(
9	r�))Z
__future__rr#r�r�Zmercurial.i18nrZmercurial.pycompatrZmercurial.noderrrZ	mercurialrr	r
rrr
r�rrrorrrrZmercurial.utilsrrX�rrir,�compiler�rrr�r�r8r8r8r9�<module>s$8
N

Youez - 2016 - github.com/yon3zu
LinuXploit