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__/convcmd.cpython-39.opt-1.pyc
a

�+�b�W�@s�ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)ej*Z*ej+Z+ej,Z,d	a-d%d
d�Z.dd
�Z/dd�Z0de#dfde$dfde,dfde(dfde%dfde)dfde&dfde"dfde*dfg	Z1de'fde+fgZ2dd�Z3dd�Z4Gdd �d e5�Z6Gd!d"�d"e5�Z7d&d#d$�Z8dS)'�)�absolute_importN)�_)�open)�encoding�error�hg�pycompat�scmutil�util)�dateutil�)�bzr�common�cvs�darcs�filemap�git�gnuarchr�monotone�p4�
subversionsasciic	Cs|duri}t|d���}|D]�}|��}|r|�d�r8qz|�dd�\}}Wn4ty�td�}|�|||��f�YqYn0|��}|��}|�|�d|fvr�td�}|�	|||f�|||<qtd�}|�
|||||f�qWd�n1s�0Y|S)N�rb�#�=rs,ignoring bad line in author map file %s: %s
smapping author %s to %s
s5overriding mapping for author %s, was %s, will be %s
)r�strip�
startswith�split�
ValueErrorr�warn�rstrip�get�debug�status)	�ui�
authorfile�authorsZafile�lineZ	srcauthorZ	dstauthor�msg�m�r)�;/usr/lib64/python3.9/site-packages/hgext/convert/convcmd.py�
readauthormap;s.
8r+cCs:t|tj�r|�t�t�d�S|�d��t�t�d�SdS)N�replacezutf-8)�
isinstancerZunicode�encodeZsysstr�
orig_encoding�decode)�sr)r)r*�recodeYs


�r2cCs$|�|p
d|�}|s |�d|�}|S)a�
    >>> bmap = {b'default': b'branch1'}
    >>> for i in [b'', None]:
    ...     mapbranch(i, bmap)
    'branch1'
    'branch1'
    >>> bmap = {b'None': b'branch2'}
    >>> for i in [b'', None]:
    ...     mapbranch(i, bmap)
    'branch2'
    'branch2'
    >>> bmap = {b'None': b'branch3', b'default': b'branch4'}
    >>> for i in [b'None', b'', None, b'default', b'branch5']:
    ...     mapbranch(i, bmap)
    'branch3'
    'branch4'
    'branch4'
    'branch4'
    'branch5'
    sdefaultsNone�r )�branch�	branchmapr)r)r*�	mapbranchbsr6scvs�
branchsortsgitssvnshg�
sourcesortsdarcssmtnsgnuarchsbzrsp4c	Cs�g}|r,|dd�tD�vr,t�td�|��tD]f\}}}z(|rH||kr`|||||�|fWSWq0ttfy�}z|�|�WYd}~q0d}~00q0|js�|D]}|�dt	�
|jd��q�t�td�|��dS)NcSsg|]}|d�qS�rr)��.0r1r)r)r*�
<listcomp>��z!convertsource.<locals>.<listcomp>s"%s: invalid source repository type�%s
rs%%s: missing or unsupported repository)�source_convertersr�Abortr�NoRepo�MissingTool�append�quiet�writerZbytestr�args)	r#�path�typeZrevs�
exceptions�name�source�sortmode�instr)r)r*�
convertsource�s"rNcCs�|r(|dd�tD�vr(t�td�|��tD]�\}}z"|rB||krT||||�WSWq,ty�}z|�td�|�WYd}~q,d}~0ty�}zt�d|��WYd}~q,d}~00q,t�td�|��dS)NcSsg|]}|d�qSr9r)r:r)r)r*r<�r=zconvertsink.<locals>.<listcomp>s'%s: invalid destination repository typesconvert: %s
r>s%s: unknown repository type)�sink_convertersrr@rrA�noterB)r#rGrHrJZsinkrMr)r)r*�convertsink�s&&rQc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�progresssourcecCs*||_||_|jtd�td�|d�|_dS)Ns
getting filessfiles�Zunit�total)r#rK�makeprogressr�progress)�selfr#rKZ	filecountr)r)r*�__init__�s
�zprogresssource.__init__cCs|jj|d�|j�||�S)N)�item)rVZ	incrementrK�getfile)rW�file�revr)r)r*rZ�szprogresssource.getfilecCs|j�|�S�N)rK�targetfilebelongstosource)rWZtargetfilenamer)r)r*r^�sz(progresssource.targetfilebelongstosourcecCs|j�|�Sr])rK�	lookuprev)rWr\r)r)r*r_�szprogresssource.lookuprevcCs|j��dSr])rV�complete�rWr)r)r*�close�szprogresssource.closeN)�__name__�
__module__�__qualname__rXrZr^r_rbr)r)r)r*rR�s
rRc@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�	convertercCs�||_||_||_||_i|_i|_d|_t||�|_|j��}|rZt	j
�|�rZ|�|�|�
d�r�|�|�
d��|j��|_|�|�
d��|_t||�
d��|_dS)N�	authormaps	splicemaps	branchmap)rK�destr#�opts�commitcacher%r$�mapfile�map�osrG�existsr+r �parsesplicemap�	splicemapr5)rWr#rKrh�
revmapfilerir$r)r)r*rX�s 


zconverter.__init__cCs|siSi}z�t|d�}tt�|��D]�\}}|��d��}|sDq&tj|dd�}t|�}dt	|�krrdks�nt
�td�||df��|D]}|j
�|�q�|d|dd�|dd	�}}	}
|	|
kr�|	||<q&|	|
||<q&Wn&t�yt
�td
�|��Yn0|S)a�check and validate the splicemap format and
        return a child/parents dictionary.
        Format checking has two parts.
        1. generic format which is same across all source types
        2. specific format checking which may be different for
           different source type.  This logic is implemented in
           checkrevformat function in source files like
           hg.py, subversion.py etc.
        rr�,)�dataZ
whitespace��s8syntax error in %s(%d): child parent1[,parent2] expectedrNs-splicemap file not found or error reading %s:)r�	enumerater
Ziterfile�
splitlinesrrZshlexer�list�lenrr@rrKZcheckrevformat�IOError)rWrGr(�fp�ir&Zlex�part�childZp1Zp2r)r)r*ro�s<
�
��$

�
zconverter.parsesplicemapcCs�t|�}t�}i}|j��}|jjtd�td�|d�}|r�|�d�}||vrNq6||jvrx|j|}|t	ks6|j
�|�rxq6|�|�|�
t|��|�|�}	g||<|	jD]}
||�|
�|�|
�q�q6|��|S)z`Return a mapping that identifies the uncommitted parents of every
        uncommitted changeset.sscanning�	revisionsrSr)rx�setrK�
numcommitsr#rUr�poprl�SKIPREVrhZhascommitfrommap�add�updatery�cachecommit�parentsrCr`)rW�heads�visitZknownr�r�rV�nr(�commit�pr)r)r*�walktrees0
�





zconverter.walktreecCs�t|�D]�}||vr@|j�|j�||��s|j�td�|�qg}||D]@}|j�|j�||��rhqL||vr�t�	td�|��|�
|�qL|||<qdS)z�A splicemap redefines child/parent relationships. Check the
        map contains valid revision identifiers and merge the new
        links in the source graph.
        s8splice map revision %s is not being converted, ignoring
sunknown splice map parent: %sN)�sortedrhZhascommitforsplicemaprlr r#rrrr@rC)rWr�rp�cZpcr�r)r)r*�mergesplicemap2s&���zconverter.mergesplicemapc
s��fdd�}�fdd�}�fdd�}�fdd�}�fd	d
�}|dkrL|�}nB|dkr\|�}n2|d
krl|�}n"|dkr||�}nt�td�|��|��\}	}
g}i}|
�r\||
�}
|
�|
�|�|
�|	�|
g�D]�}||vr��fdd��|D�||<z||�|
�Wn2t�y:t�td�t|�t|
�f��Yn0||s�|
�d|�d||<q�q�t	|�t	��k�r|t�td���|S)znReturn an ordering such that every uncommitted changeset is
        preceded by all its uncommitted ancestors.cs�t�t|��}t�}i}g}|r�|��}||vr2q|�|�|�|g�d}||D].}|�jvrp|�|�d}|�|g��|�qT|s|�|�q||fS)aReturn a (children, roots) tuple where 'children' maps parent
            revision identifiers to children ones, and 'roots' is the list of
            revisions without parents. 'parents' must be a mapping of revision
            identifier to its parents ones.
            FT)	�collections�dequer�r��popleftr��
setdefaultrlrC)r�r��seen�children�rootsr�Z	hasparentr�rar)r*�mapchildrenRs&


z'converter.toposort.<locals>.mapchildrencsdg���fdd�}|S)aIf the previously converted revision has a child in the
            eligible revisions list, pick it. Return the list head
            otherwise. Branch sort attempts to minimize branch
            switching, which is harmful for Mercurial backend
            compression.
            Ncs6|d}|D]}�d�|vr|}q*q|�d<|S)Nrr))�nodes�nextr�)r��prevr)r*�picknext|sz>converter.toposort.<locals>.makebranchsorter.<locals>.picknextr)�r�)r�)r�r*�makebranchsorterss	z,converter.toposort.<locals>.makebranchsortercs�fdd���fdd�}|S)zSource specific sort.cs�j|jSr])rj�sortkey�r�rar)r*�<lambda>�r=z>converter.toposort.<locals>.makesourcesorter.<locals>.<lambda>cst|�d�dS�N)�keyr�r��r��Zkeyfnr)r*r��sz>converter.toposort.<locals>.makesourcesorter.<locals>.picknextr)r�rar�r*�makesourcesorter�sz,converter.toposort.<locals>.makesourcesortercs�fdd���fdd�}|S)zClose order sort.csd�j|jv�j|jfS)Nsclose)rjZextrar�r�rar)r*r��s
�z=converter.toposort.<locals>.makeclosesorter.<locals>.<lambda>cst|�d�dSr�r�r�r�r)r*r��sz=converter.toposort.<locals>.makeclosesorter.<locals>.picknextr)r�rar�r*�makeclosesorter�sz+converter.toposort.<locals>.makeclosesortercs"i���fdd���fdd�}|S)zSort revisions by date.cs&|�vrt��j|j��|<�|Sr])rZ	parsedaterj�dater�)�datesrWr)r*�getdate�sz;converter.toposort.<locals>.makedatesorter.<locals>.getdatecst�fdd�|D��dS)Ncsg|]}�|�|f�qSr)r))r;r��r�r)r*r<�r=zPconverter.toposort.<locals>.makedatesorter.<locals>.picknext.<locals>.<listcomp>r)�minr�r�r)r*r��sz<converter.toposort.<locals>.makedatesorter.<locals>.picknextr)r�ra)r�r�r*�makedatesorter�sz*converter.toposort.<locals>.makedatesorterr7�datesortr8�	closesortsunknown sort mode: %scsg|]}|�jvr|�qSr)�rl�r;r�rar)r*r<�r=z&converter.toposort.<locals>.<listcomp>s cycle detected between %s and %srNsnot all revisions were sorted)
rr@r�removerCr rr2�insertry)rWr�rLr�r�r�r�r�r�r�Zactivesr1Zpendingsr�r�r))r�rWr*�toposortNsL!	

��
zconverter.toposortc	Cs^|j}|rZ|j�td�|�t|d�}|jD]"}|�t�d||j|f��q.|�	�dS)Nswriting author map file %s
swb+s%s=%s
)
r$r#r"rrr%rEr
Ztonativeeolrb)rWr$Zofile�authorr)r)r*�writeauthormap�s

��zconverter.writeauthormapcCst|j||j�|_dSr])r+r#r%)rWr$r)r)r*r+�szconverter.readauthormapcCs>|j�|�}|j�|j|j�|_t|j|j�|_||j|<|Sr])	rKZ	getcommitr%r r�r6r4r5rj)rWr\r�r)r)r*r��s

zconverter.cachecommitc
s��j|}�j�d�}�j�||�}t|t�rT|tkr<t}n
�j|}|�j|<dS|\}}}g}	|j	r�|j	D]4}
|
�jvr���
|
�|	��j|
�j|
jf�qn�j
�|j|	�zB�j|}�j�td�td��|�|f��fdd�|D�}Wn<t�y2dd�|	D�}|��fdd�|jD��Yn0t|	�d	k�rHt�}t|�d
k�rlt�j�jt|��}n t�j�jt|�t|�d�}�j
�|||||�j||�}
|���j�||
�|
�j|<dS)Nsfullsspliced in %s as parents of %s
s and csg|]}�j�||��qSr))rlr r�rar)r*r<r=z"converter.copy.<locals>.<listcomp>cSsg|]}|d�qSr9r))r;�br)r)r*r<r=c3s"|]}|�jvr�j|VqdSr]r�)r;�xrar)r*�	<genexpr>sz!converter.copy.<locals>.<genexpr>rtrur)rjrir rKZ
getchangesr-�bytesr�rlr�r�rCr4rhZ	setbranchrpr#r"r�join�KeyError�extendZ
optparentsryr�rRZ	putcommitrbZ	converted)rWr\r�ZfullZchangesrh�filesZcopiesZcleanp2Z	pbranchesr�r�rKZnewnoder)rar*�copy�sZ







�
�����zconverter.copycs`�zN|j��|j��|j�|j�|j�td��|j��}|�	|�}|�
||j�|j�td��|�||�}t
|�}d}|j�td��|jjtd�td�t
|�d�}t|�D]t\}}|d8}|j|j}	d|	vr�|	��d	}	|j�d
|t|	�f�|j�td�t|��|�|�|�|�q�|��|j�dd
��s�|j��}
i}|
D]0}|
|}
|j�|
t�tk�rV|j|
||<�qV|�r�|�r�|j�|�\}�|�r��r�fdd�t�|j�D�}|�r�||j|d	d	<|j��}i}|D]0}||}
|j�|
t�tk�r�|j|
||<�q�|�r>|�r>|j� |�|�!�W|�"�n
|�"�0dS)Nsscanning source...
ssorting...
sconverting...
s
convertingrrSr�
rs%d %s
ssource: %s
sconvertsskiptagscsg|]}|d�kr|�qS)rr))r;�e�Z
tagsparentr)r*r<Ks�z%converter.convert.<locals>.<listcomp>)#rK�beforerhZ	setrevmaprlr#r"rZgetheadsr�r�rpr�ryrUrvrj�descrwr2rPr�r�r`Z
configboolZgettagsr r�ZputtagsrZ	iteritemsZgetbookmarksZputbookmarksr��cleanup)rWrLr�r��tZnumr�rVr|r��tagsZctags�k�vZnrevZtagsparentsZ	bookmarksZ
cbookmarksr)r�r*�convertsf



�



�

zconverter.convertcCs4z|j��W|j��n|j��0|j��dSr])rhZafterrKrlrbrar)r)r*r�aszconverter.cleanupN)rcrdrerXror�r�r�r�r+r�r�r�r�r)r)r)r*rf�s/
4Crfc
s�t����tjadt_��d�s.��d��d<|sRt�|�d}|�td�|�t	||��d��}t
�|�}z"t||��d���d��\}}Wn,t
y�|jD]}t�|d	�q��Yn0d
}	�fdd�|	D�}
t|
�d
kr�t�td���|
r�|
d}
n|}
|
dk�r"|���s"t�td���|
dk�rD|���sDt�td�����d�}|�rlt�|||�}|�d	�|�sz|��}t||||��}|�|
�dS)NsUTF-8rgsauthorss-hgsassuming destination %s
s	dest_typessource_typesrevT)r7r�r8r�csg|]}��|�r|�qSr)r3)r;r(�rir)r*r<�r=zconvert.<locals>.<listcomp>rs!more than one sort mode specifiedrr8s1--sourcesort is not supported by this data sourcer�s0--closesort is not supported by this data sourcesfilemap)rZbyteskwargsrr/r rZdefaultdestr"rrQr	ZwrapconvertsinkrN�	ExceptionZcreated�shutil�rmtreeryrr@ZhasnativeorderZhasnativecloserZfilemap_sourceZsetfilemapmoderqrfr�)
r#�srcrhrqriZdestcZsrccZdefaultsortrGZ	sortmodesrLZfmapr�r)r�r*r�isR


�

��

r�)N)NN)9Z
__future__rr�rmr�Zmercurial.i18nrZmercurial.pycompatrZ	mercurialrrrrr	r
Zmercurial.utilsr�r
rrrrrrZ	hgconvertrrrrkrBrAr�Z
bzr_sourceZconvert_cvsZconvert_gitZdarcs_sourceZgnuarch_sourceZmercurial_sinkZmercurial_sourceZmonotone_sourceZ	p4_sourceZsvn_sinkZ
svn_sourcer/r+r2r6r?rOrNrQ�objectrRrfr�r)r)r)r*�<module>s` 4
	#�
�"

Youez - 2016 - github.com/yon3zu
LinuXploit