HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/lib64/python2.7/site-packages/hgext/transplant.pyo
�
1�3\c@@s dZddlmZddlZddlmZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZddlmZmZde	jfd��YZiZ ej!e �Z!d	Z"iZ#ej$e#�Z$e$d
dde%�e$d
d
de%�de&fd��YZ'de&fd��YZ(de&fd��YZ)d�Z*d�Z+e!d
ddded�ed�fddged�ed�fdd e%ed!�fd"d#ged$�ed�fd%d&ged'�ed�fdd(ded)�ed�fd*d+e,ed,�fdd
e%ed-�fd.d/e%ed0�fddded1�ed2�fg
ed3�d4e!j-�d5��Z.d6�Z/ej0�Z0e0d7�d8��Z1ej2�Z2e2d9d:d;h�d<��Z3d=�Z4e1e3gZ5dS(>sVcommand 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.
i(tabsolute_importN(t_(t
bundlerepotcmdutilterrortexchangethgt
logcmdutiltmatchtmergetnodetpatchtpycompatt	registrartrevlogtrevsettscmutiltsmartsettutiltvfs(tprocutilt
stringutiltTransplantErrorcB@seZRS((t__name__t
__module__(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR.ssships-with-hg-coret
transplanttfiltertdefaulttlogttransplantentrycB@seZd�ZRS(cC@s||_||_dS(N(tlnodetrnode(tselfRR((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt__init__Ds	(RRR!(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRCsttransplantscB@sGeZdddd�Zd�Zd�Zd�Zd�Zd�ZRS(cC@sY||_||_||_|s9tj|j�|_ni|_t|_|j�dS(N(	tpathttransplantfiletopenertvfsmodRR"tFalsetdirtytread(R R#R$R%((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR!Is					cC@s�tjj|j|j�}|jr�tjj|�r�xr|jj|j�j�D]R}tt	j
|jd��\}}|jj
|g�}|jt||��qRWndS(Nt:(tosR#tjoinR$texistsR%R)t
splitlinestmapRtbintsplitR"t
setdefaulttappendR(R tabspathtlineRRtlist((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR)Ts"!cC@s�|jr�|jr�tjj|j�s:tj|j�n|j|jd�}xe|jj�D]T}xK|D]C}t	t
j|j|j
f�\}}|j|d|d�qlWq_W|j�nt|_dS(NtwR*s
(R(R$R+R#tisdirtmkdirR%R"t
itervaluesR/tnodemodthexRRtwritetcloseR'(R tfpR6tttltr((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR=\s
$!
cC@s|jj|�pgS(N(R"tget(R R((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRChscC@s8|jj|g�}|jt||��t|_dS(N(R"R2R3RtTrueR((R RRR6((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytsetkscC@s;|jj|j�}|r7||j|�=t|_ndS(N(R"RCRtindexRDR((R RR6((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytremovepsN(	RRtNoneR!R)R=RCRERG(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR"Hs				ttransplantercB@s�eZd�Zd�Zdd�Zd�Zeedd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zed�Zd�Zd
�Zd�ZRS(c@sp||_�jjd�|_tj|j�|_t|jdd|j�|_��fd�}||_dS(NRR"R%c@s2tj�dd�}tjd|tj���S(NRteditform(Rt
mergeeditformRHtgetcommiteditorRt	strkwargs(RJ(toptstrepo(s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRL}s(tuiRR,R#R&R%R"RL(R RPRORNRL((RNROs6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR!ws	c	C@s�t||�r$|jj|�}nt||�rv|jj|�}|jj|g|dt�}||krvtSnx}|jj|�D]i}t||j�s�|jj|�t	S|jj|j�}||jj|g|dt�kr�tSq�Wt	S(smreturns True if a node is already an ancestor of parent
        or is parent or has already been transplantedt	inclusive(
thasnodet	changelogtrevt	ancestorsRDR"RCRRGR'(	R ROR
tparentt	parentrevRTt	reachableR@tlnoderev((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytapplied�s"	c
C@s�|dkri}nt|�}|jj�\}}g}	tj|j|�}
t|
_d}}z8|j	�}|j
d�}x�|D]�}
||
}d|
tj|�f}|j
|||�r�|jjtd�|�q�n|jj|�}|jd�p|jd�s�|d|kr@|	j|�|}q�n|	r�||krqtj||j�d|	�ntj||	dd	td
t�|jj�\}}g}	q�nt}||kr�t}t||�s�tj||j�d|g�q�nt}|dtjkr�|jd�sX|jjtd
�|
tj|�f�t}q�|j|d�}||kr�tjtd�tj|�tj|�f��q�n
|d}|r�d}nmt j!dd�\}}t"j#|d�}tj$|||d|
�}x|D]}|j%|�qW|j&�||
=|sG|r�z�yL|j'|||jj(|�|d|d|jd�d|jd��}Wnt)k
r�|j&��nX|r�|r�|jj*td�|tj|�f�n;|r*|jj*td�tj|�tj|�f�nWd|rDt"j+|�nXq�q�W|j&�|	r�tj||j�d|	�tj||	dd	td
t�nWd|j,||�|j-j%�|r�|j.�n|r�|j.�nXdS(s:apply the revisions in revmap one by one in revision orderRs%d:%ss%skipping already applied revision %s
RRitheadsi����tbranchmergetforceiRVsskipping merge changeset %d:%s
s%s is not a parent of %stprefixshg-transplant-twbRNR	s%s merged at %s
s%s transplanted to %s
N(/RHtsortedtdirstatetparentsRtdifffeatureoptsRPRDtgittlockttransactionR;tshortRZtwarnRRSRCR3RtpulltpeerR	tupdateR'RRRtnullidtnotetlookupRtAbortRtmkstempR+tfdopentdiffR=R>tapplyoneR)Rtstatustunlinkt
saveseriesR"trelease(R ROtsourcetrevmaptmergesRNtrevstp1tp2tpullstdiffoptsRettrRTR
trevstrRbtdomerget	skipmergeRVt	patchfiletfdR?tgentchunktn((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytapply�s�		



%	
	




'

c
C@sc|jjtd�|�|d|d|d}}}tjdd�\}}	tj|d�}
|
jd�|
jd	|�|
jd
|�|
j|d�|
j�z�|jj	d|t
j|	�t
j|�fd
i|dd6tj
|�d6dtjdtd�dd�|jt|	d��dd!\}}}Wdtj|	�X|||fS(s0arbitrarily rewrite changeset before applying its
filtering %s
iiiR^shg-transplant-R_s# HG changeset patch
s
# User %s
s
# Date %d %d
s
s%s %s %stenvirontHGUSERt
HGREVISIONtonerrt	errprefixs
filter failedt
blockedtagttransplant_filtertrbN(RPRtRRRpR+RqR=R>tsystemRt
shellquoteR;R<RRotparselogtopenRu(R RR
RSR�tusertdatetmsgR�t
headerfileR?((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRs( 

,c
C@s�|d \}}	\}
}}}
d|
|f}i|d6}|rf|j||||�\}	}}
n|r�|
dtj|�7}
n|jjtd�tj|��|jjd|	||
f�|r�|r�tj	td���n|r�y;t
�}tj|j||d|d	d�t
|�}Wq�tk
r�}tjj|jd
�}tjj|�rytj|�n|jj�}|}|j|	||
||d|�|jjtj|�d�ttd
���q�Xnd}|r,|jj�\}}|j||�tj|jd�}ntj |jd|�}|j!|
|	|d|d|d|j"��}|s�|jj#td�tj|��dS|s�|j$j
||�n|S(s>apply the patch in patchfile to the repository as a transplantis%d %dttransplant_sources
(transplanted from %s)sapplying %s
s	%s %s
%s
s"can only omit patchfile if mergingtfilesteolmodetseriesR	s
s=fix up the working directory and run hg transplant --continuettextraRteditorsskipping emptied changeset %s
N(%RR;R<RPRtRRgRmRRoRERRHR6t	ExceptionR+R#R,R-RuRaR|RR=RtforcebytestrRRbt
setparentsRtalwaystroottexacttcommitRLRhR"(R ROR
tclR�R	RRtmanifestR�ttimettimezoneR�tmessageR�R�tinstt
seriespathR|R}tmR�((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRs"sP
$#	"cC@s"tjjtjj|jd��S(Ntjournal(R+R#R-R,(R ((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt	canresumeWsc
C@sGtjjtjj|jd��r�|j|||�\}}|rz|jjtd�tj	|�tj	|�f�q�|jjtd�tj	|�f�ntjj|jd�}tjj|�s�|j
j�dS|j�\}}i}	x$|D]}||	|j
j|�<q�Wtj|�|j|||	||�dS(s7recover last transaction and apply remaining changesetsR�s%s transplanted as %s
s%s skipped due to empty diff
R�N(R+R#R-R,trecoverRPRtRR;RgR"R=t
readseriesRSRTRuR�(
R RORxRNR�R
R�tnodesRzRy((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytresumeZs$$


cC@s|j�\}}}}}t}	|sA|sA|sA|drYtjtd���n|d}
t|�dkr�|jd�r�|j|d�}
|
|kr�tjtd�tj	|
�tj	|�f��q�q�t
}	ni|d6}z|jj�\}}
||
kr9tjtd�tj
|
���n|	rV|j||d�n|j�d \}}}}|	s�|s�|s�|s�|r�|j|||d	|d
|j��}|s�tjtd���n|	s�|jj||�q�nd}|j�||fSWdXdS(
s/commit working directory using journal metadataistransplant log file is corruptiRVs%s is not a parent of %sR�s-working directory not at transplant parent %siR�R�s
commit failedN(treadlogR'RRoRtlenRCRnR;RgRDRaRbR<R�RtR�RLR"RERHtunlog(R RORxRNR
R�R�R�RbR	RVR�R|R}tmodifiedtaddedtremovedtdeletedR�((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR�qsB 
	

cC@spg}g}|}xQ|jjd�j�D]7}|jd�rL|}q+n|jtj|��q+W||fS(NR�s# Merges(R%R)R.t
startswithR3RR0(R R�RztcurR5((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR��scC@s�|s
dStjj|j�s2tj|j�n|jdd�}x2t|�D]$}|jtj||�d�qQW|r�|jd�x+|D] }|jtj|�d�q�Wn|j	�dS(NR�R7s
s	# Merges
(
R+R#R8R9R%R`R=R;R<R>(R RyRzR�RTR�((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRv�s"

!c	C@sNg}g}tj}t}d}d}x�|j�j�D]�}|rV|j|�q:|jd�rr|d}q:|jd�r�|d}q:|jd�r�tj|d�}q:|jd�r�|jtj|d��q:|jd�s:t	}|j|�q:q:Wd||fkr2t
jtd	���n|||d
j
|�|fS(Ns# User is# Date s
# Node ID i
s	# Parent i	s# s,filter corrupted changeset (no user or date)s
(RRlR'RHR)R.R3R�R0RDRRoRR,(	R R?RbR�R
tinmsgR�R�R5((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR��s.	

cC@s�tjj|j�s(tj|j�n|jdd�}|jd|�|jd|�|jdtj|��|jdtj|�d�|r�|jdtj|�d�n|j|j�d�|j	�dS(	s,journal changelog metadata for later recoverR�R7s
# User %s
s
# Date %s
s
# Node ID %s
s	# Parent s
N(
R+R#R8R9R%R=R;R<trstripR>(R R�R�R�R|R}R	R?((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR�s!cC@s|j|jd��S(NR�(R�R%(R ((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR��scC@s>tjj|jd�}tjj|�r:tj|�ndS(sremove changelog journalR�N(R+R#R,R-Ru(R tabsdst((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR��sc@s����fd�}|S(Nc@s��j�|��rtS�jj|�dtjkr<tS�jj|�d}|jd�}|r��j�|��r�tStS(NiiR�(	RZR'RSRbRRlR)RCRD(R
R�tcnode(ROR�R Rx(s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytmatchfn�s((R RORxR�R�((ROR�R Rxs6/usr/lib64/python2.7/site-packages/hgext/transplant.pyttransplantfilter�sN(RRR!RZRHR�RR'RsR�R�R�R�RvR�RR�R�R�(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRIvs 		m	4			-					cC@s6y|jj|�dk	SWntjk
r1tSXdS(N(RSRTRHRtStorageErrorR'(ROR
((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyRR�scC@s�tj|||�}g}g}td�}x^|D]V}|j||�d}	x�|	s%|j|�}
d|
|
d!}	|	dkr�x8|j|�dD]#\}}|jd||f�q�Wd}	qT|	dkrT|jj	|�d}
x*t
j||
|�D]}|j|�qWd}	qTqTW|	dkrB|j|�q4|	d	kr^|j|�q4|	d
krnPq4|	dkr4d
}d}Pq4q4W|j
�||fS(s#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)synmpcq?it?s%s: %s
tpityR�tctqN(((RtchangesetdisplayerRtshowRHtpromptchoicetextractchoicesR=RSRbRRrR3R>(RPROR�RNt	displayerR"RztpromptR
tactiontchoiceR�R@RVR�((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt
browserevs�s>
	 	

tsRxR�stransplant changesets from REPOtREPOtbtbranchs!use this source changeset as headtREVtatalls0pull all changesets up to the --branch revisionsR�tprunes
skip over REVR�R	smerge at REVRVs)parent to choose when transplanting mergetetedits invoke editor on commit messagess%append transplant info to log messageR�tcontinues7continue last transplant session after fixing conflictss!filter changesets through commandtCMDsChg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] [-m REV] [REV]...thelpcategoryc	O@s*|j��t||||�SWdQXdS(s�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(twlockt
_dotransplant(RPROR{RN((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR'sD
c@s�tjd�}tjd�}d�}tj|�}|||�|jd�sk|jdd�|d<n|jd�s�|jdd�|d<nt|||�}|jj�\}}	t	|�dkr�|t
jkr�tj
td���n|jd	�r)|j�s�tj
td
���q�n�tj|�|	t
jkr]tj
td���n|j�d \}
}}}
|
s�|s�|s�|
r�tj
td
���n|jd�}|r~tj|||j|��}tj|j|jdd��}t|�}x?|D]7}y|j|j|��Wqtjk
rFqXqWtj|||dt|�dt�\�}}n-|�tj�j|jdd��}d}z�|jd	�r�|j |�|�dS|j!|�|��|jd�r>t�fd�t"j#�|jd��D�����fd�}n�}tj�j|jdd��}i}|r�x�t"j#�|�D] }�|j$�|t%|�<q�Wn�|jd�s�|rg�|kr�|�|d|�}n|�||d|�}|jd�r|}n(t&|�||�\}}|j'|�x'|D]}||�j(j)|�<qDWnx$|D]}||�j(j)|�<qnW|j*|�|||�Wd|r�|�nXdS(Ncs@s)x"|D]}||�r|VqqWdS(N((ROtcsetsRR
((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytincwalkos
cs@s�|s|j�}ng}||}x.|D]&}|j|j||�j��q,Wx5|jj||�dD]}||�rp|VqpqpWdS(s�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.iN(R[R3tancestorR
RStnodesbetween(ROtdestR[RRUtctxtheadR
((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyttransplantwalkts

$ cS@s�|jd�rX|jd�s<|jd�s<|jd�rTtjtd���ndS|jd�p�|p�|jd�p�|jd�s�tjtd���n|jd�r�|jd�s�tjtd���n|r�tjtd	���q�ndS(
NR�R�R�R	s;--continue is incompatible with --branch, --all and --mergeRxs9no source URL, branch revision, or revision list provideds --all requires a branch revisions*--all is incompatible with a revision list(RCRRoR(RNR{((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt	checkopts�s-RRRisno revision checked outR�sno transplant to continuesoutstanding uncommitted mergesisoutstanding local changesRxR�t	onlyheadsR]R�c3@s|]}�|j�VqdS(N(R
(t.0RB(Rx(s6/usr/lib64/python2.7/site-packages/hgext/transplant.pys	<genexpr>�sc@s�|�o|�kS(N((tx(R�ttf(s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt<lambda>�R�R	R�R((((+RR�RtbyteskwargsRCtconfigRIRaRbR�RRlRRoRR�RtcheckunfinishedRtRRjt
expandpathtmaplistRnREtaddt	RepoErrorRtgetremotechangesR`RDRHR�R�RtrevrangeR
tintR�textendRSRTR�(RPROR{RNR�R�R�ttpR|R}R�R�RBtdt
sourcerepoRjR[ttargetR�t	cleanupfnR�RzRytalltransplantst	newmerges((R�RxR�s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyR�ns�	
!
!
!!"!!		


stransplanted([set])cC@s]|rtj|||�}n|}tjg|D]%}||j�jd�r1|^q1�S(sDTransplanted changesets in set, or all transplanted changesets.
    R�(RtgetsetRtbasesetR�RC(ROtsubsetR�R�RB((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytrevsettransplanted�s
ttransplantedtrequiresR�cC@s@|j|d�}|j�jd�}|r<tj|�p?dS(sEString. The node identifier of the transplanted
    changeset if any.R�R�R�(tresourceR�RCR;R<(tcontexttmappingR�R�((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytkwtransplanted�scC@s/tjjdtttd�td�g�dS(Nstransplant/journalstransplant in progresss6use 'hg transplant --continue' or 'hg update' to abort(RtunfinishedstatesR3RDR'R(RP((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pytextsetup�s	(6t__doc__t
__future__RR+tmercurial.i18nRt	mercurialRRRRRRRR	R
R;RRR
RRRRRRR&tmercurial.utilsRRRoRtcmdtabletcommandt
testedwithtconfigtablet
configitemRHtobjectRR"RIRRR�R'tCATEGORY_CHANGE_MANAGEMENTRR�trevsetpredicateRttemplatekeywordRRt
i18nfunctions(((s6/usr/lib64/python2.7/site-packages/hgext/transplant.pyt<module>sVv.��		)		7	v