Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/mercurial/filemerge.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�
�c@s�ddklZddklZddkZddkZddkZddkZddkZddk	Z	ddk
Z
dd�Zed�Z
gZdi�D]Zedeq�[Zd	�Zd
�Zd�Zd�Zd
�ZdS(i�(tshort(t_NtcCs|id|d||�S(Nsmerge-toolst.(tconfig(tuittooltparttdefault((s&/sys/lib/python/mercurial/filemerge.pyt_toolstr
scCs|id|d||�S(Nsmerge-toolsR(t
configbool(RRRR((s&/sys/lib/python/mercurial/filemerge.pyt	_toolboolss"fail local other merge prompt dumps	internal:cCs�|tjo|Snt||d�}|o[ti|t||d��}|o2ti|t||d��}|o|Sq�q�ntit||d|��S(Ntregkeytregnamet	regappendt
executable(t	_internalR	tutilt
lookup_regtfind_exe(RRtktp((s&/sys/lib/python/mercurial/filemerge.pyt	_findtools
c
s5�fd�}tiid�}|o||fSnx��id�D]o\}}ti|id|g�}	|	|�o;||||t�o%t�|�}
|d|
dfSqFqFWh}x`�id�D]O\}}
|id�d}||jo#t	t
�|d	d
��||<q�q�W|i�}tg}|i
�D]\}}|||fqB~�}�idd�}|o5||jo||fSn|idd|f�n|id�xO|D]G\}}||d||�o%t�|�}
|d|
dfSq�q�W|p|odpddfS(Ncs|}|o|d|7}nt�|�p=|o�itd�|�q�itd�|�n�|o/t�|d�o�itd�|�nw|o/t�|d�o�itd�|�nAti�o.t�|d�o�itd�|�ntStS(	Ns specified for scouldn't find merge tool %s
tsymlinkstool %s can't handle symlinks
tbinarystool %s can't handle binary
tguistool %s requires a GUI
(	RtwarnRtnoteRRRtTruetFalse(RtpatRRttmsg(R(s&/sys/lib/python/mercurial/filemerge.pytcheck#s!tHGMERGEsmerge-patternsRt"smerge-toolsRitpriorityt0Rtmergethgmergesinternal:merge(Nshgmerge(tostenvirontgettconfigitemstmatchtrootRRtsplittintR	tkeystsortedtitemsRtinserttNonetappend(trepoRtpathRRR R&RRtmfttoolpathttoolsRtvtttnamest_[1]Rtuimerge((Rs&/sys/lib/python/mercurial/filemerge.pyt	_picktool"s<#
':

cCsXd|jodSnd|jodSnd|jodSnd|jodSndS(sGuess the EOL type of a filets
s
s
N(R3(tdata((s&/sys/lib/python/mercurial/filemerge.pyt_eoltypeWs



cCs�tt|d�i��}|oit|d�i�}t|�}|o=|i||�}||jot|d�i|�q�q�ndS(s/Convert EOL markers in a file to match origfiletrbtwbN(RBtopentreadtreplacetwrite(tfiletorigfilettostyleRAtstyletnewdata((s&/sys/lib/python/mercurial/filemerge.pyt	_matcheolcs
cs��fd�}d�}|i|i��pd6Sn�i}|i�}	||�p||�p
||�}
d|i�|i�j}t�||	|
|�\}}
|itd�||	|
|f�|p
|djoFd}|i	td�|	td�td	�fd
�o
d}q)n|djod
Sn|djo'�i
|	|i�|i��d
Sn|djod
Sn�i|	�}|d|�}|d|�}d}|d}ti
||�||i�jo*|itd�||i�|	f�n|itd�|	�|itd�|||f�t||d|
p|�o{ti||||dt�}|pB|itd��ti|�ti|�ti|�d
Snti
||�ntd|	dt|�dt|i��dd|i�jdd|i�jdd|i�j�}|djo(ti||||dd dg�}n|d!joq�i|	�}ti
||d"��i
|	d#|i�|i���i
|	d$|i�|i��d
Sn�t||d%d&�}d'|jo||}}ntd |d|d|d(|��tid)�fd*�|�}ti|
d+|d,�id-|�}|o:t||d.�o'tid/|i��o
d
}q�n|ost||d0�o`ti�i|	�|�o@|i	td1�|	td2�td3�fd
�o
d
}qHqLnt||d4�ot�i|	�|�n|o|i td5�|	�nti|�ti|�ti|�|S(7sperform a 3-way merge in the working directory

    mynode = parent node before merge
    orig = original local filename before merge
    fco = other file context
    fca = ancestor file context
    fcd = local file context for current/destination file
    cs�dtii|i��|f}tid|�\}}�i|i�|i��}ti|d�}|i|�|i	�|S(Ns%s~%s.tprefixRD(
R'R6tbasenamettempfiletmkstempt
wwritedataRAtfdopenRHtclose(ROtctxtpretfdtnameRAtf(R5(s&/sys/lib/python/mercurial/filemerge.pyttempxs"

cSs5yti|i��SWntj
otSnXdS(N(RRRAtIOErrorR(RV((s&/sys/lib/python/mercurial/filemerge.pytisbin�stls/picked tool '%s' for %s (binary %s symlink %s)
sinternal:promptsinternal:locals8 no tool found to merge %s
keep (l)ocal or take (o)ther?s&Locals&Otherisinternal:others
internal:failitbasetotherRs.origsmerging %s and %s to %s
smerging %s
smy %s other %s ancestor %s
tpremergetquiets premerge successful
tHG_FILEt
HG_MY_NODEt
HG_OTHER_NODEtHG_MY_ISLINKtHG_OTHER_ISLINKtHG_BASE_ISLINKsinternal:mergetlabeltlocals
internal:dumps.locals.others.basetargss$local $base $others$outputtoutputs\$(local|base|other|output)csd�|i�dS(s"%s"i(tgroup(tx(RG(s&/sys/lib/python/mercurial/filemerge.pyt<lambda>�st tcwdR(tcheckconflictss!^(<<<<<<< .*|=======|>>>>>>> .*)$tcheckchangeds< output file %s appears unchanged
was merge successful (yn)?s&Yess&Notfixeolsmerging %s failed!
N(!tcmpRAR3RR6tflagsR?tdebugRtpromptchoicetwwritetwjoinRtcopyfiletstatusRtsimplemergeRR'tunlinktdictRtstrt	changectxR	tretsubtsystemR,R+tfilecmpRNR(R5tmynodetorigtfcdtfcotfcaR[R]RRXRRRR8tatbtctouttbacktrtenvRk((RGR5s&/sys/lib/python/mercurial/filemerge.pyt	filemergens�
			&



* 



(
##
!	&


(tnodeRti18nRRR}R+R'RQR�R�R	RRR=R-tsRRR?RBRNR�(((s&/sys/lib/python/mercurial/filemerge.pys<module>s$0$		5		

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].