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

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/__pycache__/transplant.cpython-39.pyc
a

�+�bWx�@sddZddlmZddlZddlmZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"Gd	d
�d
ej#�Z$iZ%e�&e%�Z&dZ'iZ(e�)e(�Z)e)dd
dd�e)dddd�Gdd�de*�Z+Gdd�de*�Z,Gdd�de*�Z-dd�Z.dd�Z/e&dddded�ed�fdd ged!�ed"�fd#d$ded%�fd&d'ged(�ed"�fd)d*ged+�ed"�fdd,ded-�ed"�fd.d/d0ed1�fddded2�fdd3d0ed4�fd5d6ded7�fdd
ded8�ed9�fged:�e&j0d;�d<d=��Z1d>d?�Z2d@dA�Z3e�4�Z4e4dB�dCdD��Z5e�6�Z6e6dEdFhdG�dHdI��Z7dJdK�Z8e5e7gZ9dS)LaVcommand to transplant changesets from another branch

This extension allows you to transplant changes to another parent revision,
possibly in another repository. The transplant is done using 'diff' patches.

Transplanted patches are recorded in .hg/transplant/transplants, as a
map from a changeset hash to its hash in the source repository.
�)�absolute_importN)�_)�open)�bin�hex�short)�
bundlerepo�cmdutil�error�exchange�hg�
logcmdutil�match�merge�patch�pycompat�	registrar�revset�smartset�state�util�vfs)�procutil�
stringutil�urlutilc@seZdZdS)�TransplantErrorN)�__name__�
__module__�__qualname__�rr�6/usr/lib64/python3.9/site-packages/hgext/transplant.pyr4srsships-with-hg-core�
transplant�filter)�default�logc@seZdZdd�ZdS)�transplantentrycCs||_||_dS�N)�lnode�rnode)�selfr'r(rrr �__init__Psztransplantentry.__init__N)rrrr*rrrr r%Osr%c@s>eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�transplantsNcCs<||_||_||_|s$t�|j�|_i|_d|_|��dS�NF)�path�transplantfile�opener�vfsmodrr+�dirty�read)r)r-r.r/rrr r*Vsztransplants.__init__cCsrtj�|j|j�}|jrntj�|�rn|j�|j���D]6}tt	|�
d��\}}|j�|g�}|�
t||��q6dS)N�:)�osr-�joinr.�existsr/r2�
splitlines�mapr�splitr+�
setdefault�appendr%)r)�abspath�liner'r(�listrrr r2asztransplants.readcCs�|jr�|jr�tj�|j�s&t�|j�|�|jd�}t�|j	�D]:}|D]0}t
t|j|j
f�\}}|�|d|d�qHq@|��d|_dS)N�wr3�
F)r1r.r4r-�isdir�mkdirr/rZ
itervaluesr+r8rr'r(�write�close)r)�fpr>�t�l�rrrr rCisztransplants.writecCs|j�|�pgSr&)r+�get)r)r(rrr rIusztransplants.getcCs(|j�|g�}|�t||��d|_dS�NT)r+r:r;r%r1)r)r'r(r>rrr �setxsztransplants.setcCs(|j�|j�}|r$||�|�=d|_dSrJ)r+rIr(�indexr1)r)�
transplantr>rrr �remove}sztransplants.remove)NNN)	rrrr*r2rCrIrKrNrrrr r+Us
r+c@s�eZdZdd�Zdd�Zd#dd�Zdd	�Zd$dd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd%dd�Zdd�Zdd �Zd!d"�ZdS)&�transplantercsT||_�|_�j�d�|_t�|j�|_t|jd|jd�|_��fdd�}||_dS)Nr!stransplants)r/cs*t��dd�}tjfd|it�����S)Nr!�editform)r	Z
mergeeditform�getcommiteditorrZ	strkwargs)rP��opts�reporr rQ�s��z.transplanter.__init__.<locals>.getcommiteditor)	�uirTrr5r-r0r/r+rQ)r)rUrTrSrQrrRr r*�s
�ztransplanter.__init__c	Cs�t||�r|j�|�}t||�rL|j�|�}|jj|g|dd�}||vrLdS|j�|�D]N}t||j�sz|j�|�dS|j�|j�}||jj|g|dd�vrXdSqXdS)zmreturns True if a node is already an ancestor of parent
        or is parent or has already been transplantedT)Z	inclusiveF)�hasnode�	changelog�rev�	ancestorsr+rIr'rN)	r)rT�node�parentZ	parentrevrXZ	reachablerFZlnoderevrrr �applied�s&

��ztransplanter.appliedNcCs�|duri}t|�}|j��}g}t�|j|�}	d|	_d}
}�z,|��}
|�d�}|D�]�}||}
d|t	|
�f}|�
||
|�r�|j�td�|�qX|j
�|
�}|�d��s|�d��s|d|kr�|�|
�|
}qX|�r||kr�tj||��|d	�t�||d
�|j��}g}d}|
|v�rPd}t||
��sPtj||��|
gd	�d}|d|jk�r�|�d
��s�|j�td�|t	|
�f�d}n6|�|d
�}||v�r�t�td�t	|�t	|
�f��n|d}|�r�d}nLtjdd�\}}t�|d�}tj |||
|	d�}|D]}|�!|��q|�"�||=|�s:|rXz�z0|j#||
|j
�$|
�|||�d�|�d�d�}Wnt%�y�|�"��Yn0|�r�|�r�|j�&td�|t	|�f�n&|�r�|j�&td�t	|
�t	|�f�W|�rt�'|�qX|�rt�'|�0qX|�"�|�r8tj||��|d	�t�||d
�W|�(||�|j)�!�|�r^|�*�|
�r�|
�*�n4|�(||�|j)�!�|�r�|�*�|
�r�|
�*�0dS)z:apply the revisions in revmap one by one in revision orderNTr!s%d:%ss%skipping already applied revision %s
r"r$r)�heads���F��parentsskipping merge changeset %d:%s
�%s is not a parent of %s�hg-transplant-��prefix�wb)rS)r�log�filters%s merged at %s
s%s transplanted to %s
)+�sorted�dirstate�p1rZdifffeatureoptsrU�git�lockZtransactionrr\�warnrrW�parentsrIr;rZpull�peerr�updaterV�nullid�note�lookupr
�Abortr�mkstempr4�fdopen�diffrCrD�applyoner2r�status�unlink�
saveseriesr+�release)r)rT�source�revmap�mergesrS�revsrjZpullsZdiffoptsrl�trrXrZZrevstrrnZdomergeZ	skipmerger[�	patchfile�fdrE�gen�chunk�nrrr �apply�s�



�



��
��

�
	����

�
ztransplanter.applyc	Cs|j�td�|�|d|d|d}}}tjdd�\}}	t�|d�}
|
�d�|
�d	|�|
�d
|�|
�|d�|
��zl|jj	d|t
�|	�t
�|�f|dt|�d
�t
jtd�dd�|�t|	d��dd�\}}}Wt�|	�nt�|	�0|||fS)z0arbitrarily rewrite changeset before applying its
filtering %s
r_��rbrcres# HG changeset patch
�
# User %s
s
# Date %d %d
r@s%s %s %s)sHGUSERs
HGREVISIONs
filter failedstransplant_filter)�environZonerrZ	errprefixZ
blockedtagsrb)rUryrrrur4rvrCrD�systemrZ
shellquoterr
rt�parselogrrz)r)rgrZrWr��user�date�msgr�Z
headerfilerErrr rg$s6
���� ztransplanter.filterFcCs�|dd�\}}	\}
}}}
d|
|f}d|i}|rH|�||||�\}	}}
|r\|
dt|�7}
|j�td�t|��|j�d|	||
f�|s�|s�t�td���|�rfz(t	�}t
j
|j|||dd	�t|�}Wn�t�yb}zzt
j�|jd
�}t
j�|��rt
�|�|j��}|}|j|	||
|||d�|j�t�|�d�ttd
���WYd}~n
d}~00nd}|�r�|j��}|�||�t��}n
t�|�}|j|
|	||||��d�}|�s�|j�td�t|��dS|�s�|j �	||�|S)z>apply the patch in patchfile to the repository as a transplantN�s%d %d�transplant_sources
(transplanted from %s)sapplying %s
s	%s %s
%s
s"can only omit patchfile if merging)�filesZeolmode�series)rr@s=fix up the working directory and run hg transplant --continue)�extrar�editorsskipping emptied changeset %s
)!rgrrUryrrrrr
rtrKrr>�	Exceptionr4r-r5r6rzrirjrfrCrZforcebytestrr�
setparentsr�always�exact�commitrQrmr+)r)rTrZZclr�rrfrgZmanifestr��time�timezoner��messager�r��inst�
seriespathrj�p2�mr�rrr rxGsb

��


�ztransplanter.applyonecCstj�tj�|jd��S�N�journal)r4r-r6r5�r)rrr �	canresume�sztransplanter.canresumec
Cs�tj�tj�|jd��rj|�|||�\}}|rP|j�td�t|�t|�f�n|j�td�t|�f�tj�|jd�}tj�|�s�|j	�
�dS|��\}}i}	|D]}||	|j�
|�<q�t�|�|�|||	||�dS)z7recover last transaction and apply remaining changesetsr�s%s transplanted as %s
s%s skipped due to empty diff
r�N)r4r-r6r5�recoverrUryrrr+rC�
readseriesrWrXrzr�)
r)rTr}rSr�rZr��nodesrr~rrr �resume�s&��

ztransplanter.resumecCsv|��\}}}}}d}	|r*|r*|r*|ds8t�td���|d}
t|�dkr�|�d�r�|�|d�}
|
|vr�t�td�t|
�t|�f��nd}	d|i}z�|j�	�}||
kr�t�td	�t
|
���|	r�|�||d�|��}
|
j
|
j|
j|
jf\}}}}|	�s|�s|�s|�s|�rZ|j|||||��d
�}|�sDt�td���|	�s^|j�||�nd}|��||fWS0dS)
z/commit working directory using journal metadataFrstransplant log file is corruptr_r`raTr�s-working directory not at transplant parent %s)r�r�s
commit failedN)�readlogr
rtr�lenrIrsrrirjrr�ry�modified�added�removed�deletedr�rQr+rK�unlog)r)rTr}rSrZr�r�r�rnrr[r�rj�str�r�r�r�r�rrr r��s`
��
����
ztransplanter.recovercCsV|��rR|d}t�|�|�td��|�td�|��dd��|��dSdS)z'logic to stop an interrupted transplant�.s#stopped the interrupted transplant
sworking directory is now at %s
N�r)r�rZclean_updateryrrr�)r)rUrTZstartctxrrr �stop�s
�ztransplanter.stopcCsHg}g}|}|j�d���D]"}|�d�r0|}q|�t|��q||fS)Nr�s# Merges)r/r2r7�
startswithr;r)r)r�rZcurr=rrr r��s
ztransplanter.readseriescCs�|sdStj�|j�s"t�|j�|�dd�}t|�D]}|�t||�d�q6|r||�d�|D]}|�t|�d�qd|��dS)Nr�r?r@s	# Merges
)	r4r-rArBr/rhrCrrD)r)r~rZseriesrXr�rrr r{�s
ztransplanter.saveseriesc	Cs�g}g}|jj}d}d}d}|����D]�}|r<|�|�q(|�d�rT|dd�}q(|�d�rl|dd�}q(|�d�r�t|dd��}q(|�d�r�|�t|dd���q(|�d	�s(d
}|�|�q(d||fvr�t�t	d���|||d�
|�|fS)
NFs# User �s# Date s
# Node ID �
�	# Parent �	s# Ts,filter corrupted changeset (no user or date)r@)rTrqr2r7r;r�rr
rtrr5)	r)rErnr�rZZinmsgr�r�r=rrr r�s2




�ztransplanter.parselogcCs�tj�|j�st�|j�|�dd�}|�d|�|�d|�|�dt|��|�dt|�d�|r�|�dt|�d�|�|��d�|��dS)	z,journal changelog metadata for later recoverr�r?r�s
# Date %s
s
# Node ID %s
r�r@N)	r4r-rArBr/rCr�rstriprD)r)r�r�r�rjr�rrErrr rfsztransplanter.logcCs|�|�d��Sr�)r�r/r�rrr r�-sztransplanter.readlogcCs*tj�|jd�}tj�|�r&t�|�dS)zremove changelog journalr�N)r4r-r5r6rz)r)Zabsdstrrr r�0sztransplanter.unlogcs����fdd�}|S)Ncs`���|��rdS�j�|�d�jkr,dS�j�|�d}|�d�}|r\���|��r\dSdS)NFr_r�r�T)r\rWrnrqr2rI)rZr�Zcnode�rT�rootr)r}rr �matchfn7s
z.transplanter.transplantfilter.<locals>.matchfnr)r)rTr}r�r�rr�r �transplantfilter6sztransplanter.transplantfilter)N)FFN)F)rrrr*r\r�rgrxr�r�r�r�r�r{r�rfr�r�r�rrrr rO�s"
v$�
?;
rOcCs.z|j�|�duWStjy(YdS0dSr,)rWrXr
ZStorageError)rTrZrrr rVEsrVcCs,t�|||�}g}g}td�}|D]�}|�||�d}	|	s�|�|�}
d|
|
d�}	|	dkr�|�|�dD]\}}|�d||f�qld}	q8|	dkr8|j�|�d}
t	�
||
|�D]}|�|�q�d}	q8|	d	kr�|�|�q"|	d
kr�|�|�q"|	dk�r�qq"|	dkr"d
}d
}�qq"|��||fS)z#interactively transplant changesetss�apply changeset? [ynmpcq?]:$$ &yes, transplant this changeset$$ &no, skip this changeset$$ &merge at this changeset$$ show &patch$$ &commit selected changesets$$ &quit and cancel transplant$$ &? (show this help)Nsynmpcq?r_�?s%s: %s
�pr�y�m�c�qr)
r
ZchangesetdisplayerrZshowZpromptchoiceZextractchoicesrCrWrnrrwr;rD)rUrTr�rSZ	displayerr+r�promptrZ�action�choice�crFr[r�rrr �
browserevsLsB�


r��s�source�stransplant changesets from REPOsREPO�b�branchs!use this source changeset as headsREV�a�alls0pull all changesets up to the --branch revisionsr��prunes
skip over REVr��mergesmerge at REVr`s)parent to choose when transplanting merge�eseditFs invoke editor on commit messagess%append transplant info to log message�stopsstop interrupted transplantr��continues7continue last transplant session after fixing conflictss!filter changesets through commandsCMDsChg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...)ZhelpcategorycOsD|���(t||g|�Ri|��Wd�S1s60YdS)a�transplant changesets from another branch

    Selected changesets will be applied on top of the current working
    directory with the log of the original changeset. The changesets
    are copied and will thus appear twice in the history with different
    identities.

    Consider using the graft command if everything is inside the same
    repository - it will use merges and will usually give a better result.
    Use the rebase extension if the changesets are unpublished and you want
    to move them instead of copying them.

    If --log is specified, log messages will have a comment appended
    of the form::

      (transplanted from CHANGESETHASH)

    You can rewrite the changelog message with the --filter option.
    Its argument will be invoked with the current changelog message as
    $1 and the patch as $2.

    --source/-s specifies another repository to use for selecting changesets,
    just as if it temporarily had been pulled.
    If --branch/-b is specified, these revisions will be used as
    heads when deciding which changesets to transplant, just as if only
    these revisions had been pulled.
    If --all/-a is specified, all the revisions up to the heads specified
    with --branch will be transplanted.

    Example:

    - transplant all changes up to REV on top of your current revision::

        hg transplant --branch REV --all

    You can optionally mark selected transplanted changesets as merge
    changesets. You will not be prompted to transplant any ancestors
    of a merged transplant, and you can merge descendants of them
    normally instead of transplanting them.

    Merge changesets may be transplanted directly by specifying the
    proper parent changeset by calling :hg:`transplant --parent`.

    If no merges or revisions are provided, :hg:`transplant` will
    start an interactive changeset browser.

    If a changeset application fails, you can fix the merge by hand
    and then resume where you left off by calling :hg:`transplant
    --continue/-c`.
    N)�wlock�
_dotransplant)rUrTr�rSrrr rMxsj
rMc	sltjfdd�}tjfdd�}dd�}t�|�}|||�|�d�sR|�dd�|d<|�d	�sl|�dd	�|d	<t|||�}|j��}t	|�d
kr�||j
kr�t�t
d���|�d�r�|��s�t�t
d
���n@|�d�r�|��s�t�t
d���|�||�St�|�t�|�|�d�}	|	�r�t�d|||	�d
}
t�|||
�}t�|j|�dd��}t|�}
|D]2}z|
�|�|��Wntj�y�Yn0�q\tj|||t|
�dd�\�}}n|�t��j|�dd��}d}�z�|�d��r�|� |�|�W|�r�|�dS|�!|�|��|�d��rH�fdd�t"�#�|�d��D����fdd�}n�}t��j|�dd��}i}|�r�t"�#�|�D]}�|�$�|t%|�<�qxn�|�d��s�|�s�|k�r�|�||d�}n|�|||d�}|�d��r�|}nt&|�||�\}}|�'|�|D]}||�j(�)|�<�q|D]}||�j(�)|�<�q |�*|�|||�W|�rh|�n|�rf|�0dS)Ncss|D]}||�r|VqdSr&r)rT�csetsrrZrrr �incwalk�sz_dotransplant.<locals>.incwalkcssd|s|��}g}||}|D]}|�|�||����q|j�||�dD]}||�rL|VqLdS)z�Yield all nodes that are ancestors of a head but not ancestors
        of dest.
        If no heads are specified, the heads of repo will be used.rN)r]r;ZancestorrZrWZnodesbetween)rT�destr]rrY�ctx�headrZrrr �transplantwalk�sz%_dotransplant.<locals>.transplantwalkcSs�|�d�r t�|dgd��dS|�d�r@t�|dgd��dS|�d�sp|sp|�d�sp|�d�spt�td���|�d�r�|�d�s�t�td	���|r�t�td
���dS)Nr�)r�r�r�r�r�r�r�s9no source URL, branch revision, or revision list providedr�s --all requires a branch revisions*--all is incompatible with a revision list)rIr	Zcheck_incompatible_argumentsr
rtr)rSr�rrr �	checkopts�s<

�

�������

�z _dotransplant.<locals>.checkoptsr$r!r"rsno revision checked outr�sno transplant to continuer�sno interrupted transplant foundr�r�rT)Z	onlyheads�forcer�csh|]}�|���qSr)rZ��.0rH)r}rr �	<setcomp>Ms�z _dotransplant.<locals>.<setcomp>cs�|�o|�vSr&r)�x)�prune�tfrr �<lambda>Qr�z_dotransplant.<locals>.<lambda>r�r�)r)+rr�rZbyteskwargsrIZconfigrOrirjr�rqr
rtrr�Z
StateErrorr�r	ZcheckunfinishedZ
bailifchangedrZget_unique_pull_pathrroZmaplistrsrK�addZ	RepoErrorrZgetremotechangesrhr�r�r
ZrevrangerZ�intr��extendrWrXr�)rUrTr�rSr�r�r��tprjZ
sourcerepo�uror]�targetrHr�Z	cleanupfnr�rr~ZalltransplantsZ	newmergesr)r�r}r�r r��s�










�#�
�
�
�r�cCsF|���*t||i�}|�||i�Wd�S1s80YdS)zAlogic to resume an interrupted transplant using
    'hg continue'N)r�rOr�)rUrTr�rrr �continuecmdps
r�stransplanted([set])cs0|rt��||�}n|}t��fdd�|D��S)z?Transplanted changesets in set, or all transplanted changesets.cs"g|]}�|���d�r|�qS)r�)r�rIr��rTrr �
<listcomp>�r�z&revsettransplanted.<locals>.<listcomp>)rZgetsetrZbaseset)rTZsubsetr��srr�r �revsettransplanted{s�r�stransplanted�ctx)ZrequirescCs*|�|d�}|���d�}|r&t|�p(dS)zEString. The node identifier of the transplanted
    changeset if any.r�r�r�)�resourcer�rIr)�context�mappingr�r�rrr �kwtransplanted�sr�cCs"tjdddttd�td�d�dS)Nr!stransplant/journalTsMTo continue:    hg transplant --continue
To stop:        hg transplant --stops8use 'hg transplant --continue' or 'hg transplant --stop')�fnameZ	clearableZcontinuefuncZ
statushintZcmdhint)�statemodZ
addunfinishedr�r)rUrrr �extsetup�s��r�):�__doc__Z
__future__rr4Zmercurial.i18nrZmercurial.pycompatrZmercurial.noderrrZ	mercurialrr	r
rrr
rrrrrrrrr�rrr0Zmercurial.utilsrrrrtrZcmdtableZcommandZ
testedwithZconfigtableZ
configitem�objectr%r+rOrVr�ZCATEGORY_CHANGE_MANAGEMENTrMr�r�Zrevsetpredicater�Ztemplatekeywordr�r�Z
i18nfunctionsrrrr �<module>s�H

��/D,�������/��7
7



Youez - 2016 - github.com/yon3zu
LinuXploit