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__/bzr.cpython-39.pyc
a

�+�b*0�@s�ddlmZddlZddlmZddlmZmZmZm	Z	ddl
mZej�
gd��zDddlZddlZddlZddlZejjZejZejZejZejWney�Yn0dZGd	d
�d
ej�ZdS)�)�absolute_importN)�_)�demandimport�error�pycompat�util�)�common)sbreezy.transactionssbreezy.urlutilssElementPath)�file�symlinkcs�eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Z�ZS)�
bzr_sourcez>Reads Bazaar repositories by using the Bazaar Python librariesNcs�tt|�j||||d�tj�tj�|d��s@t�t	d�|��zt
Wn tyht�t	d���Yn0t�
|�}|�|�zt
j�|���}|��|_Wn&tjy�t�t	d�|��Yn0i|_|�dd�|_dS)N)�revss.bzrs)%s does not look like a Bazaar repositorys"Bazaar modules could not be loadedsconvertsbzr.saverev)�superr�__init__�os�path�exists�joinr	ZNoRepor�bzrdir�	NameErrorr�abspath�_checkrepotype�BzrDir�open�decodeZopen_repository�
sourcerepo�errorsZNoRepositoryPresent�
_parentidsZ
configbool�_saverev)�self�uiZrepotyperr
Zbzr_dir��	__class__��7/usr/lib64/python3.9/site-packages/hgext/convert/bzr.pyr7s(
�


�
zbzr_source.__init__c	Cs�z�tj�|���d}z|jdd�}|j}Wn&tjtjfyRd}|�	�}Yn0|dur�|j
jj|j
jjkr�|j
�td��Wn"ty�|j
�td��Yn0dS)NrF)Zrecommend_upgradesawarning: lightweight checkouts may cause conversion failures, try with a regular branch instead.
s(bzr source type could not be determined
)rrZopen_containingrZopen_workingtree�branchrZ
NoWorkingTreeZNotLocalUrlZopen_branchZ
controldirZroot_transport�baser �warnr�	ExceptionZnote)rr�dirZtreer%r#r#r$rQs*
�����zbzr_source._checkrepotypecCs|j��dS)aBefore the conversion begins, acquire a read lock
        for all the operations that might need it. Fortunately
        read locks don't block other reads or writes to the
        repository, so this shouldn't have any impact on the usage of
        the source repository.

        The alternative would be locking on every operation that
        needs locks (there are currently two: getting the file and
        getting the parent map) and releasing immediately after,
        but this approach can take even 40% longer.N)rZ	lock_read�rr#r#r$�beforekszbzr_source.beforecCs|j��dS�N)rZunlockr*r#r#r$�afterxszbzr_source.aftercCs|jjdd�S)NT)Zusing)rZ
find_branchesr*r#r#r$�_bzrbranches{szbzr_source._bzrbranchesc	Cs�|jstdd�|��D��}n|d}|��D]H}z(|jd��}tj�|�}|�|�}Wntj	yjYn0|j
}q*|dur�t�t
d�|jd��|g}dd�|D�}|S)NcSsg|]}|���qSr#)Z
last_revision)�.0�br#r#r$�
<listcomp>��z'bzr_source.getheads.<locals>.<listcomp>rs%s is not a valid revisioncSsg|]}|dkr|�qS)snull:r#)r/�hr#r#r$r1�r2)r
�sortedr.r�revisionspec�RevisionSpecZfrom_stringZ
in_historyrZBzrErrorZrev_idr�Abortr)rZheads�revidr%Zrevspec�r�infor#r#r$�getheads~s$�zbzr_source.getheadscCs�|��}|j�|�}z|�|�}Wntjjy:YdS0|tvrHdS|j|�	�|f}|dkr�|�
|�}|dur�t�t
d�||f��|�	�|fS|�|�}|��|fSdS)N)NNrs%s.%s symlink has no target)rr�
revision_tree�kind�breezyrZ
NoSuchFile�supportedkinds�
_modecache�encodeZget_symlink_targetrr7rZget_file�read)r�name�revZrevtreer=�mode�targetZsior#r#r$�getfile�s$
�
zbzr_source.getfilecCs`|rt�td���i|_|j�|�|_|j�|�}|j�|d�}|�	|j|�\}}||t
�fS)Ns(convert from cvs does not support --fullr)rr7rr@rr<Z_revtreer�pop�_gettreechanges�set)r�versionZfullZ	parentids�prevtree�files�changesr#r#r$�
getchanges�szbzr_source.getchangesc	Cs�|j�|�}|js&g}tjf|j|<n|�|j�}||j|<|j�dd�}|dkrVd}t	j
|d|j|jf|�
|j�|�
|j�|�d�||jd�S)Nzbranch-nick�defaultZtrunks%d %d�utf8)�parents�dateZauthorZdescr%rDZsaverev)rZget_revisionZ
parent_ids�revision�
NULL_REVISIONr�
_filterghostsZ
properties�getr	ZcommitZ	timestamp�timezone�recodeZ	committer�messagerAr)rrKrDrRr%r#r#r$�	getcommit�s$


�zbzr_source.getcommitcCsRi}|��D]@}|��s iS|j��}t�|�D]\}}|||�|�<q4q|Sr,)r.Z
supports_tags�tagsZget_tag_dictrZ	iteritemsrY)rZbytetagsr%ZtagdictrCrDr#r#r$�gettags�s
zbzr_source.gettagscCsZi|_|j�|�}|dur*|j||}ntj}|j�|�}dd�|�||�dD�}|S)NcSsg|]}|d�qS)rr#�r/�er#r#r$r1�r2z.bzr_source.getchangedfiles.<locals>.<listcomp>r)r@rr<rrTrUrI)rrD�iZcurtreeZparentidrLrNr#r#r$�getchangedfiles�szbzr_source.getchangedfilescCs�|j}g}i}t�}z
|j}Wnty6|j}Yn0dd�}t|�|�|dd�}	|	D�]*}
|
j}|
j}|
j	}
|ddksX|ddkr�qX|ddk�r�|dd	vr�|�
|�|d�|f�|ddkrXd|vrX|d|dk}|�|d�}|�
|�D]�\}}|jdk�rq�|�|dd
|�}||v�r0q�|�|�|�sBq�|�|dd
|�}|�
||f�|�
||f�|j	�r�d�p�|jdk�r�d
�p�d}||j||f<|||<q�qX|\}}|du�r�|�|�}|du�r�|�|�}|�|�p�|�|du�r|�
||f�qX|�r2||k�r2|||<|�
||f�dd�||
fD�\}}
|
�rTd�pf|dk�rdd�pfd}||j||f<|�
||f�qX||fS)NcSs|jdp|jdpdS)Nrr�)r)�cr#r#r$�key�sz'bzr_source._gettreechanges.<locals>.keyT)rd�reverserrbr�	directory)Nrf�/�xr�sr2cSsg|]}|d�qS)rr#r^r#r#r$r1Fr2z.bzr_source._gettreechanges.<locals>.<listcomp>�l)Z_revision_idrJZroot_inventory�AttributeError�	inventoryr4Ziter_changesrr=�
executable�appendrYZpath2idZiter_entries�addr@)r�current�originr8rN�renames�seenrlrdZ
curchangesZchange�pathsr=rmZrenamingZsubdirrC�entryZfrompathZtopathrErr#r#r$rI�s~
�


��





 zbzr_source._gettreechangescs&|j�|��t�fdd�|D��}|S)zqFilters out ghost revisions which hg does not support, see
        <http://bazaar-vcs.org/GhostRevision>
        csg|]}|�vr|�qSr#r#)r/�parent�Z	parentmapr#r$r1Rr2z,bzr_source._filterghosts.<locals>.<listcomp>)rZget_parent_map�tuple)rZidsrRr#rwr$rVMszbzr_source._filterghosts)N)�__name__�
__module__�__qualname__�__doc__rrr+r-r.r;rGrOr[r]rarIrV�
__classcell__r#r#r!r$r4s


gr)Z
__future__rrZmercurial.i18nrZ	mercurialrrrrrbr	ZIGNORES�updateZbreezy.bzr.bzrdirr>Z
breezy.errorsZbreezy.revisionZbreezy.revisionspecZbzrrrrTr5r6�ImportErrorr?Zconverter_sourcerr#r#r#r$�<module>s*�


Youez - 2016 - github.com/yon3zu
LinuXploit