https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/filemerge.cpython-310.pyc
o

�]Lb���@s0ddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZddl
mZmZmZmZmZmZmZmZmZmZmZmZmZddlmZmZd	d
�Zdd�Zd
d�ZiZ iZ!e�"�Z#e#j$Z$e#j%Z%e#j&Z&ed�Z'ed�Z(Gdd�de)�Z*dd�Z+dd�Z,dd�Z-dd�Z.dd�Z/dd�Z0e#de$�d d!��Z1e#d"e$�d#d$��Z2e#d%e$�d&d'��Z3e#d(e$�d)d*��Z4d+d,�Z5d-d.�Z6d/d0�Z7d1d2�Z8d3d4�Z9e#d5e&ed6�e8d7�d8d9��Z:e#d:e&ed6�e8d7�d;d<��Z;e#d=e&ed6�e8d7�d>d?��Z<e#d@e&dAe8d7�dBdC��Z=e#dDe&ed6�e8d7�dEdF��Z>e#dGe%e8d7�dHdI��Z?e#dJe%e8d7�dKdL��Z@e#dMe%edN��dOdP��ZAe#dQe&dRdRdS�dTdU��ZBe#dVe%dRdRdS�dWdX��ZCdYdZ�ZDd[d\�ZEd]d^�ZFd_d`�ZGdwdadb�ZHdcdd�ZIdedf�ZJejKdgdh��ZLdwdidj�ZMdkdl�ZNdmdn�ZOdodp�ZPdqdr�ZQdsdt�ZRdudv�ZSeSdde#�e �T�ZUdS)x�)�absolute_importN�)�_)�hex�short)�getattr)
�encoding�error�	formatter�match�pycompat�	registrar�scmutil�simplemerge�tagmerge�
templatekw�	templater�templateutil�util)�procutil�
stringutilcG�|jd|d|g|�R�S�N�merge-tools�.)�config��ui�tool�part�args�r!�5/usr/lib/python3/dist-packages/mercurial/filemerge.py�_toolstr.�r#cGrr)�
configboolrr!r!r"�	_toolbool2r$r&cCs|�d|d|�Sr)�
configlist)rrrr!r!r"�	_toollist6sr(s�file '%(fd)s' was deleted in other%(o)s but was modified in local%(l)s.
You can use (c)hanged version, (d)elete, or leave (u)nresolved.
What do you want to do?$$ &Changed $$ &Delete $$ &Unresolveds�file '%(fd)s' was deleted in local%(l)s but was modified in other%(o)s.
You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
What do you want to do?$$ &Changed $$ &Deleted $$ &Unresolvedc@sleZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dZ
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�
absentfilectxz�Represents a file that's ostensibly in a context but is actually not
    present in it.

    This is here because it's very specific to the filemerge code for now --
    other code is likely going to break with the values this returns.cCs||_||_dS�N)�_ctx�_f)�self�ctx�fr!r!r"�__init___s
zabsentfilectx.__init__cCsd|j|jfS)Nsabsent file %s@%s)r,r+�r-r!r!r"�	__bytes__cszabsentfilectx.__bytes__cC�|jSr*)r,r1r!r!r"�pathf�zabsentfilectx.pathcC�dSr*r!r1r!r!r"�sizei�zabsentfilectx.sizecCr6r*r!r1r!r!r"�datalr8zabsentfilectx.datacCs|j��jSr*)r+�repo�nullidr1r!r!r"�filenodeoszabsentfilectx.filenodeTcCs*|��o|��|��ko|��|��kS)zVcompare with other file context

        returns True if different from fctx.
        ��isabsent�	changectxr4)r-�fctxr!r!r"�cmpts
��zabsentfilectx.cmpcC�dS)N�r!r1r!r!r"�flagsr8zabsentfilectx.flagscCr3r*)r+r1r!r!r"r?�r5zabsentfilectx.changectxcCrB�NFr!r1r!r!r"�isbinary�r8zabsentfilectx.isbinarycCrB)NTr!r1r!r!r"r>�r8zabsentfilectx.isabsentN)�__name__�
__module__�__qualname__�__doc__r0r2r4r7r9r<�
_customcmprArDr?rFr>r!r!r!r"r)Xsr)cCs2|tvr|St||d|�}|�d�r|St||�S)N�
executable�python:)�	internalsr#�
startswith�findexternaltool)rr�cmdr!r!r"�	_findtool�s

rRcCs|�d�r|St�|�S)NrM)rOr�
shellquote)rQr!r!r"�_quotetoolpath�s

rTc	CsvdD])}t|||�}|s
qt�|t||d��}|r+t�|t||dd��}|r+|Sqt||d|�}t�t�|��S)N)sregkeys	regkeyaltsregnames	regappendrCrL)r#r�	lookupregr�findexe�
expandpath)rr�kn�k�p�exer!r!r"rP�s�rPcsx��dd��d�fdd�	�dd������fdd	�}��d
d�}|r;t�|�}|r/�|�s/dS|r7|t|�fS||fStj�d
�}	|	rO|rK�|	�sKdS|	|	fS|oR�}
��d�D]@\}}t�|j	d|g�}
|
|�r�|||||
|�r�|r��|ddd�s���
td�t�
|�t�
|�f�t�|�}|t|�fSqXi}t����d�D]$\}}|�d�d}||vr�tt�|d��||<t�|d�rLj�|�q�|��}t�fdd�|��D��}��d
d�}|r�||||||�r�||vr�|s�||fS|�dd|f�|�d�|D]\}}||d|||��rt�|�}|t|�fS�q|�s'|�s'|�r:|�s8t|��r8��
td�|�dSdS)N�mergesstrict-capability-checkFcs(|tvr|o
t|j�|�St�||�Sr*)rN�capabilities�getr&)r�
capability�strict)rr!r"�
hascapability�sz _picktool.<locals>.hascapabilitycSs|tvo
t|jtkSr*)rN�	mergetype�nomerge�rr!r!r"�
supportscd�sz_picktool.<locals>.supportscdcs�|}|rtd�||f}t�|�s)|r��td�|�d
S��td�|�d
S|r<�|d��s<��td�|�d
S|rO�|d��sO��td�|�d
S|rX�|�sX	d
St��smt�|d�rm��td�|�d
Sd	S)Ns%s (for pattern %s)scouldn't find merge tool %s
ssymlinkstool %s can't handle symlinks
�binarystool %s can't handle binary
�guistool %s requires a GUI
TF)rrR�warn�noter�guir&)r�pat�symlink�binary�changedelete�tmsg)ra�strictcheckrerr!r"�check�s,
�
��	���z_picktool.<locals>.check�uis
forcemerge)s:promptNsHGMERGEsmerge-patternsrCrfT)r`s�warning: check merge-patterns configurations, if %r for binary file %r is unintentional
(see 'hg help merge-tools' for binary files capability)
rrrsprioritysdisabledcs"g|]
\}}|�vr||f�qSr!r!)�.0rrZ)�disabledr!r"�
<listcomp>s"z_picktool.<locals>.<listcomp>)Nshgmergesno tool found to merge %s
)s:mergeN)F)r%rrRrTr�environr^�configitemsr�rootrhrr�bytestr�set�split�intr#r&�add�keys�sorted�items�insert�append�len)r:rr4rmrlrnrq�force�toolpath�hgmerge�	binarycaprkr�mf�toolsrY�v�t�names�uimergerZr!)rtrarprerr"�	_picktool�s|
���
	�
��

�r�cCs4d|vrdSd|vrdSd|vrdSd|vrdSdS)zGuess the EOL type of a file�Ns
�
�
r!�r9r!r!r"�_eoltypesr�cCsVt|���}|r%t�|�}t|�}|r'|�||�}||kr)t�||�dSdSdSdS)z/Convert EOL markers in a file to match origfileN)r�r9r�readfile�replace�	writefile)�file�backup�tostyler9�style�newdatar!r!r"�	_matcheol's
�r��promptc
CsJ|j}|j��}t�|�}|j����rt�d��t	|j
|j
g�}	||�|	d<ze|j��r<|�t
|	d�}
gd�|
}n$|j��rP|�t|	d�}
gd�|
}n|�td�|	d�}
gd�|
}|dkrnt||||||�WS|dkr|t||||||�WS|d	kr�t||||||�WSWdStjy�|�d
�t||||||�YSw)zfAsks the user which of the local `p1()` or the other `p2()` version to
    keep as the merged version.s/in-memory merge does not support file conflictssfd�)�local�other�
unresolved)r�r�r�s�file '%(fd)s' needs to be resolved.
You can keep (l)ocal%(l)s, take (o)ther%(o)s, or leave (u)nresolved.
What do you want to do?$$ &Local $$ &Other $$ &Unresolvedr�r�r�r�N)rr@r4r�getuipathfnr?�
isinmemoryr	�InMemoryMergeConflictsError�
partextras�labelr>�promptchoice�_localchangedotherdeletedmsg�_otherchangedlocaldeletedmsgr�_iother�_ilocal�_ifail�ResponseExpected�write)r:�mynode�local�other�base�toolconfr�fd�uipathfn�prompts�index�choicer!r!r"�_iprompt3sH

�

����
�r�r�cCsd|j��fS)z=Uses the local `p1()` version of files as the merged version.r)r@r>�r:r�r�r�r�r�r!r!r"r�gsr�r�cCsN|j��rt|j���d}d|fSt|j��|j��|j���d}d|fS)z=Uses the other `p2()` version of files as the merged version.TFr)r@r>�_underlyingfctxifabsent�remover�r9rD)r:r�r�r�r�r��deletedr!r!r"r�ms

��r�sfailcCs,|j��rt|j��|j��|j���dS)z�
    Rather than attempting to merge files that were modified on both
    branches, it marks them as unresolved. The resolve command must be
    used to resolve these conflicts.�rF)r@r>r�r�r9rDr�r!r!r"r�|s


�r�cCs|��r|��|��S|S)z�Sometimes when resolving, our fcd is actually an absentfilectx, but
    we want to write to it (to do the resolve). This helper returns the
    underyling workingfilectx in that case.
    r=)�filectxr!r!r"r��sr�cCs@t�|���rtd�|j��}|�td�|�t�|��dS)z verifies that text is non-binarys%s looks like a binary file.swarning: %s
N)	rrm�textrr@r4rhr	�Abort)�inputr�msgr!r!r"�_verifytext�s

�r�c	Cs2|\}}}}}	|s|j��s|j��rdS|j}
gd�}z
t|
|d|�}Wn-tjySt|
|dd���}||vrQd�dd�|D��}
t�t	d�|||
f��Ynw|r�d	}|d
kr_d}n|dkred
}t
dd�|||fD��rsdStj||||d�\}}|r�||vr�|j�||j�
��|s�|
�d�dSdS)Nr)skeep�keep-merge3�keep-mergediffspremergerC�, cSsg|]}d|d�qS)�'r!)rsr�r!r!r"ru��z_premerge.<locals>.<listcomp>s6%s.premerge not valid ('%s' is neither boolean nor %s)r\r��	mergediffr��merge3css�|]
}t�|���VqdSr*)rrmr�)rsr�r!r!r"�	<genexpr>�s�
�z_premerge.<locals>.<genexpr>��modes premerge successful
r)r@r>rr&r	�ConfigErrorr#�lower�joinr�anyrr�rD�debug)r:r�r�r�r�rr�rmrl�scriptfnr�	validkeep�premerge�_validr��merged_text�	conflictsr!r!r"�	_premerge�sJ����	�
�
r�cCsx|\}}}}	}
t�|�}|	r |j�td�|||���f�dS|��s(|��r:|j�td�|||���f�dSdS)Ns2warning: internal %s cannot merge symlinks for %s
Fs@warning: internal %s cannot merge change/delete conflict for %s
T)rr�rrhrr4r>)r:r��fcd�fco�fcar�rr�rmrlr�r�r!r!r"�_mergecheck�s&
�����r�cCst|j}zt||�t||�t||�WntjyYdSwtj||||d�\}}|j�||j���d|dfS)a)
    Uses the internal non-interactive simple merge algorithm for merging
    files. It will fail if there are any conflicts and leave markers in
    the partially merged file. Markers will have two sections, one for each side
    of merge, unless mode equals 'union' which suppresses the markers.)TTFr�TF)rr�r	r�rr@r�rD)r:r�r�r�r�rr�r�r!r!r"�_merge�s

�
�
r��unionsJwarning: conflicts while merging %s! (edit, then use 'hg resolve --mark')
)�precheckcC�t||||d�S)z�
    Uses the internal non-interactive simple merge algorithm for merging
    files. It will use both left and right sides for conflict regions.
    No markers are inserted.r��r��r:r�r�r�r�r�r�r!r!r"�_iunion�sr�r\cCr�)z�
    Uses the internal non-interactive simple merge algorithm for merging
    files. It will fail if there are any conflicts and leave markers in
    the partially merged file. Markers will have two sections, one for each side
    of merge.r\r�r�r!r!r"�_imerge�r�r�cCr�)a
    Uses the internal non-interactive simple merge algorithm for merging
    files. It will fail if there are any conflicts and leave markers in
    the partially merged file. Marker will have three sections, one from each
    side of the merge and one for the base content.r�r�r�r!r!r"�_imerge3r�r�smerge3-lie-about-conflictsrCcOst|i|��\}}}|d|fSrE)r�)r �kwargs�b1�junk�b2r!r!r"�_imerge3alwaysgood+s
r�r�cCr�)ag
    Uses the internal non-interactive simple merge algorithm for merging
    files. It will fail if there are any conflicts and leave markers in
    the partially merged file. The marker will have two sections, one with the
    content from one side of the merge, and one with a diff from the base
    content to the content on the other side. (experimental)r�r�r�r!r!r"�_imerge_diff>sr�smerge-localcCr�)zg
    Like :merge, but resolve all conflicts non-interactively in favor
    of the local `p1()` changes.r�r�r�r!r!r"�_imergelocalQ�r�smerge-othercCr�)zg
    Like :merge, but resolve all conflicts non-interactively in favor
    of the other `p2()` changes.r�r�r�r!r!r"�_imergeotherYr�r�stagmergesjautomatic tag merging of %s failed! (use 'hg resolve --tool :merge' or another merge tool of your choice)
c	Cs$t�||j|j|j�\}}||dfS)z?
    Uses the internal tag merge algorithm (experimental).
    F)r�merger@)	r:r�r�r�r�r�r��success�statusr!r!r"�
_itagmergeas
r�sdumpT)rmrlc
Cs�t||j�}|j��}ddlm}	t|j|	j�rt�d��t	�
|d|j���|�|d|j�
�|j���|�|d|j�
�|j���dS)a
    Creates three versions of the files to merge, containing the
    contents of local, other and base. These files can then be used to
    perform a merge manually. If the file to be merged is named
    ``a.txt``, these files will accordingly be named ``a.txt.local``,
    ``a.txt.other`` and ``a.txt.base`` and they will be placed in the
    same directory as ``a.txt``.

    This implies premerge. Therefore, files aren't dumped, if premerge
    runs successfully. Use :forcedump to forcibly write files out.
    r��contexts0in-memory merge does not support the :dump tool.s.locals.others.base)FrF)�_workingpathr@r4�r��
isinstance�overlayworkingfilectxr	r�rr��decodeddata�wwriter9rD)
r:r�r�r�r�r�r��ar�r�r!r!r"�_idumprs
�r�s	forcedumpcCst|||||||�S)zS
    Creates three versions of the files as same as :dump, but omits premerge.
    )r�r�r!r!r"�
_forcedump�srcCs
t�d��)Ns5in-memory merge does not support external merge tools)r	r�r�r!r!r"�
_xmergeimm�s	�rc	Cs�|�dd�}	|	s
dStj}
|��t|�|��|
|��|t|�td�d|��v|dd��|
|��|td�d|��v|dd	��|
|��|td
�d|��v|dd	��||d�}t�	|	�}	t
�||�}t
j||	t
j|d
�}
|�|
�|��dS)N�command-templatesspre-merge-tool-outputr��l�HG_MY_LABEL)�ctx�fctx�node�name�islink�label�base�
HG_BASE_LABEL)rrrr	r
r��HG_OTHER_LABEL)rrspathr�rr�stoolpathstoolargs��defaults�	resources)rr�mappingdictr?rr4rrDr�
unquotestringr
�templateresources�
maketemplaterr�keywordsr��
renderdefault)rr:r��fcl�fcbr��envr�r �tmplr�props�tresr�r!r!r"�_describemerge�sR
��

��	
��	�
%
�rc&Cs4|j}|j}|j}	|\}
}}}
}t�|�}|��s|��r/|j�td�|
||���f�dSt||�}t	|j|
d�}d|	��|	�
�fd|��|�
�fg}d}d|vrp|}|��}|�d�rftj�
|�\}}|�d	||��f�t|���}|dd
�\}}t|�dkr�|d
}dd
�}|��t|�t|�����t|	�����d|��vd|��vd|	��v||�||�||�d�
}|j}||||||�||�||�d�}t�d||dd��}t||
d�r�|j�td�|
||���f�|du�r|d|}|j�d|�t|||||	||||�	|j||j|dd�}nc|j�d||f�d}zddlm}|� |d|
�} Wnt!�yEt"�#td�|��wt$| |d�}!|!du�r\t"�#td �||f��t%�&|�}"dd!lm'}#|#�(||d"||!d|"id#�\}$}%|%�r{d}|j�d$|�d#|d%fWd�S1�s�wYdS)&Ns7warning: %s cannot merge change/delete conflict for %s
)FrNsargsrr�rCs$outputs.origr�r��cSs|jrd|j|jfS|jS)Ns%s: %s)�label_detailr�)r�r!r!r"�format_label�sz_xmerge.<locals>.format_labelr)
sHG_FILEs
HG_MY_NODEs
HG_OTHER_NODEsHG_BASE_NODEsHG_MY_ISLINKsHG_OTHER_ISLINKsHG_BASE_ISLINKrr
r)r�rr�soutputs
labellocals
labelothers	labelbases\$cSst�t�|��Sr*)rrSr�	localpath)�sr!r!r"�<lambda>sz_xmerge.<locals>.<lambda>rgs"running merge tool %s for file %s
� slaunching merge tool: %s
s	mergetool)�cwdrv�
blockedtags%launching python merge script: %s:%s
rr)�
extensionss
hgmerge.%ss&loading python merge script failed: %ss%s does not have function: %s)�hookr\Tsmerge tool returned: %d
F))r@rr�r>rrhrr4r�r#r��endswith�os�splitextr�r9�_maketempfilesr�rr?�noderDr�interpolater&r�r�r�systemrxr�r'�loadpath�	Exceptionr	r�rr�
shellsplitr(�
pythonhook)&r:r�r�r�r�r�r�r�r�r�rr�rmrlr�r�r!r �files�outpath�localoutputpath�ext�	temppaths�basepath�	otherpathr rrr�rQ�rr'�mod�mergefn�argslistr(�ret�raisedr!r!r"�_xmerge�s�
��
�



��	���

�
�
��
�
�&�rAcCsB|j��}|��dur|��}d|i}|�|�}|��d|_dS)zAApplies the given template to the ctx and stores it in the input.Nrr)r@r?r-�p1r�
splitlinesr)r��templater.r�templateresultr!r!r"�_populate_label_detailLs

rFcCsj|j}|�dd�}|durt||d|�}t�|�}t�||�}tj||tj	|d�}|D]}t
||�q+dS)z?Populates the label details using the conflict marker template.rsmergemarkerNsmergemarkertemplater)rrr#rrr
rrrrrF)r:�inputsrrrDrrr�r!r!r"�_populate_label_detailsWs

��rHcCs,|dur	ddd�Sd|dd|dd�S)z�Return a dictionary of extra labels for use in prompts to the user

    Intended use is in strings of the form "(l)ocal%(l)s".
    NrC)r�os [%s]rrr!)�labelsr!r!r"r�gs�

�r�cCs�|��rdSddlm}t||j�r7t�d�\}}t�|d��}|�	|�
��Wd�n1s1wYnt�|||�
��}t||�}t�||�|j||d�S)a�Makes and returns a filectx-like object for ``fcd``'s backup file.

    In addition to preserving the user's pre-existing modifications to `fcd`
    (if any), the backup is used to undo certain premerges, confirm whether a
    merge changed anything, and determine what line endings the new file should
    have.

    Backups only need to be written once since their content doesn't change
    afterwards.
    Nrr�shg-merge-backup�wb)r:)r>r�r�r�r�r�mkstempr*�fdopenr�r9r�
backuppathr4r�r�copyfile�arbitraryfilectx)r:rr�r�r�r�r/r�r!r!r"�_makebackupxs��
rQc	#sd�tjdd���fdd�}g}|D]\}}}|�||||��qz|VWt���dSt���w)zyCreates a temporary file for each (prefix, path, data) tuple in `files`,
    so an external merge tool may use them.
    shgmerge-)�prefixcsNtj�|�\}}dtj�|�|f}tj��|�}|r||7}t�||�|S)Ns%s~%s)r*r4r+�basenamer�rr�)rRr4r9�fullbaser7�pre�name��tmprootr!r"�maketempfrompath�sz(_maketempfiles.<locals>.maketempfrompathN)r�mkdtempr��shutil�rmtree)r4rY�
temp_filesrRr4r9r!rWr"r,�s�	r,c$
Cs0|j}|��}	t�|�}
|
|	�}|��p|��p|��}d|��|��v}
|��p-|��}t|||	||
|�\}}d}|tvrL|�	d�rL|t
d�d�}|r�|�	d�r�d}|�d�dkrw|d	d��dd
�\}}|sld}d|vstd
|vrvd}nd}|r�t
�td�|��|}|�d||t�|�t�|
�t�|�f�|tvr�t|}|j}|j}|j}d}n|��r�t}nt}t}td�}d}d}||||
|f}|s�ddg}t
|�dkr�|�d�t�||d�}t�||d
�}t�||d�}|tkr�|||||||�S||��k�r|�td�|
|�|
|���|f�n	|�td�|�|�d|||f�|�rO|||||||��sO|�rM|���rFt
�d��|� ||�dSt!|||�}d
}z�|�"dd�}|�rht#||d�} n|} |tk�r�d}!| dk�rx|}!|dk�s�| dk�r�t$||||g|!d�t%|||||�}|�s�|dfW|�s�|du�r�|�&�SSSd|_'d|_'d|_'| dk�r�t$||||g|d�||||||||�\}"}}#|"�r�t(||||||�}|�r�|�r�|���r�t
�d��|� ||�t)|�||#fW|�s|du�r|�&�SSS|�s|du�r|�&�www)a�perform 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

    Returns whether the merge is complete, the return value of the merge, and
    a boolean indicating whether the file was deleted from disk.rN�	internal:sinternalrMF�:r��rT�\�/sinvalid 'python:' syntax: %ss?picked tool '%s' for %s (binary %s symlink %s changedelete %s)
smerging %s failed!
r�r�rrrsmerging %s and %s to %s
smerging %s
smy %s other %s ancestor %s
s0in-memory merge does not support merge conflictsr�rrsmergemarkerssbasicrd)*rr4rr�rFrDr>r�rNrOr��count�rsplitr	r�rr�rryrb�	onfailurer�r�rrA�	fullmerger�r�
MergeInputrcr�r�rhrQrr#rHr�r�r�_check�_onfilemergefailure)$r:�wctxr��origr�r�r�rJrr�r��fduipathrmrlrnrr�r��
invalidsyntax�script�funcrbrer��
isexternalr�r�r�r�r�r;�internalmarkerstyle�markerstyle�	labeltool�	needcheckr�r!r!r"�	filemerge�s
����
�	��
�

��$
��

�

�
�
�rucCstd�}t�|��)Ns0merge halted after failed merge (see hg resolve))rr	�InterventionRequired)r�r!r!r"�
_haltmerge_s
rwcCsH|�dd�}|dkrtd�}|�|d�dkrt�|dkr"t�dSdS)Nr\s
on-failurer�s,continue merge operation (yn)?$$ &Yes $$ &Norrshalt)rrr�rw)r�actionr�r!r!r"rids
�ricCstt�d|tj��S)Ns^([<>=+|-])\1{6}( .*)$)�bool�re�search�	MULTILINEr�r!r!r"�hasconflictmarkersos��r}c	Cs�|��}t�|�}|s!t||d�sdt||d�vr!t|���r!d}d}dt||d�vr;d}|�td�||�d�r;d}|sd|sdt||d	�sMd
t||d�vrd|durd|�	|�sd|�td�||�d�rdd}|durvt||d�rvt
t||�|�|S)
Nscheckconflictss	conflictsscheckrFr�Ts0was merge of '%s' successful (yn)?$$ &Yes $$ &NoscheckchangedschangedsJ output file %s appears unchanged
was merge successful (yn)?$$ &Yes $$ &Nosfixeol)r4rr�r&r(r}r9r�rrAr�r�)	r:r;rrr�r�r�r��checkedr!r!r"rh}sL

�����
����	rhcCs|�|���Sr*)�wjoinr4)r:r.r!r!r"r��sr�cCs�t�|j�D]6\}}d|}|t|<|td|<|t|<tdd�|j��D��}|r<dd�|�}|j	t�
d|�|_	qtd�td	�td
�dS)z4Load internal merge tool from specified registrarobjr_r^cSsg|]\}}|r|�qSr!r!)rsrYr�r!r!r"ru�r�z%loadinternalmerge.<locals>.<listcomp>s    (actual capabilities: %s)r�s

%ss*    (actual capabilities: binary, symlink)s!    (actual capabilities: binary)s"    (actual capabilities: symlink)N)r�	iteritems�_tablerN�internalsdocrr]r�r�rJ�sysstrr)r�extname�registrarobjrVro�fullnamer]�capdescr!r!r"�loadinternalmerge�s��r�r*)V�
__future__r�
contextlibr*rzr[�i18nrr-rrrrr�rr	r
rr
rrrrrrr�utilsrrr#r&r(rNr��
internalmerge�internaltoolrc�	mergeonlyrfr�r��objectr)rRrTrPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrArFrHr�rQ�contextmanagerr,rurwrir}rhr�r��values�
i18nfunctionsr!r!r!r"�<module>s�<��4	q

3



,��
	��
		��
		�

��
	


��
	

6q


1/

https://t.me/RX1948 - 2025