§
    	^µc­¨  ã                   ó  — d dl Z d dlZd dlZd dlZddlmZ ddlmZmZ ddl	m
Z
 ddlmZmZmZmZm	Z	mZmZmZmZmZmZmZmZ ddlmZmZ d„ Zd	„ Zd
„ Zi Zi Z ej         ¦   «         Z!e!j"        Z"e!j#        Z#e!j$        Z$ ed¦  «        Z% ed¦  «        Z& G d„ d¦  «        Z'd„ Z(d„ Z)d„ Z*d„ Z+d„ Z,d„ Z- e!de"¦  «        d„ ¦   «         Z. e!de"¦  «        d„ ¦   «         Z/ e!de"¦  «        d„ ¦   «         Z0 e!de"¦  «        d„ ¦   «         Z1d„ Z2d„ Z3d„ Z4d „ Z5d!„ Z6 e!d"e$ ed#¦  «        e5¬$¦  «        d%„ ¦   «         Z7 e!d&e$ ed#¦  «        e5¬$¦  «        d'„ ¦   «         Z8 e!d(e$ ed#¦  «        e5¬$¦  «        d)„ ¦   «         Z9 e!d*e$d+e5¬$¦  «        d,„ ¦   «         Z: e!d-e$ ed#¦  «        e5¬$¦  «        d.„ ¦   «         Z; e!d/e#e5¬$¦  «        d0„ ¦   «         Z< e!d1e#e5¬$¦  «        d2„ ¦   «         Z= e!d3e# ed4¦  «        ¦  «        d5„ ¦   «         Z> e!d6e$d7d7¬8¦  «        d9„ ¦   «         Z? e!d:e#d7d7¬8¦  «        d;„ ¦   «         Z@d<„ ZAd=„ ZBd>„ ZCd?„ ZDdLd@„ZEdA„ ZFdB„ ZGe jH        dC„ ¦   «         ZIdLdD„ZJdE„ ZKdF„ ZLdG„ ZMdH„ ZNdI„ ZOdJ„ ZPdK„ ZQ eQdde!¦  «         e R                    ¦   «         ZSdS )Mé    Né   )Ú_)ÚhexÚshort)Úgetattr)ÚencodingÚerrorÚ	formatterÚmatchÚpycompatÚ	registrarÚscmutilÚsimplemergeÚtagmergeÚ
templatekwÚ	templaterÚtemplateutilÚutil)ÚprocutilÚ
stringutilc                 ó,   —  | j         d|dz   |z   g|¢R Ž S ©Nó   merge-toolsó   .)Úconfig©ÚuiÚtoolÚpartÚargss       ú5/usr/lib/python3/dist-packages/mercurial/filemerge.pyÚ_toolstrr"   -   s'   € Øˆ2Œ9�^ T¨D¡[°4Ñ%7Ð?¸$Ð?Ð?Ð?Ð?ó    c                 ó,   —  | j         d|dz   |z   g|¢R Ž S r   )Ú
configboolr   s       r!   Ú	_toolboolr&   1   s'   € Øˆ2Œ=˜¨°©°tÑ);ÐC¸dÐCÐCÐCÐCr#   c                 ó:   — |                       d|dz   |z   ¦  «        S r   )Ú
configlist)r   r   r   s      r!   Ú	_toollistr)   5   s   € Ø�=Š=˜¨°©°tÑ);Ñ<Ô<Ð<r#   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                   óX   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	dZ
d	„ Zd
„ Zd„ Zd„ Zd„ ZdS )Ú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.c                 ó"   — || _         || _        d S ©N)Ú_ctxÚ_f)ÚselfÚctxÚfs      r!   Ú__init__zabsentfilectx.__init__^   s   € ØˆŒ	ØˆŒˆˆr#   c                 ó$   — d| j         | j        fz  S )Ns   absent file %s@%s)r/   r.   ©r0   s    r!   Ú	__bytes__zabsentfilectx.__bytes__b   s   € Ø# t¤w°´	Ð&:Ñ:Ð:r#   c                 ó   — | j         S r-   )r/   r5   s    r!   Úpathzabsentfilectx.pathe   s	   € ØŒwˆr#   c                 ó   — d S r-   © r5   s    r!   Úsizezabsentfilectx.sizeh   ó   € Øˆtr#   c                 ó   — d S r-   r:   r5   s    r!   Údatazabsentfilectx.datak   r<   r#   c                 ó>   — | j                              ¦   «         j        S r-   )r.   ÚrepoÚnullidr5   s    r!   Úfilenodezabsentfilectx.filenoden   s   € ØŒy�~Š~ÑÔÔ&Ð&r#   Tc                 óÔ   — |                      ¦   «         oS|                     ¦   «         |                      ¦   «         k    o)|                     ¦   «         |                      ¦   «         k     S )zVcompare with other file context

        returns True if different from fctx.
        ©ÚisabsentÚ	changectxr8   )r0   Úfctxs     r!   Úcmpzabsentfilectx.cmps   sW   € ð �MŠM‰OŒOð +Ø—’Ñ Ô  D§N¢NÑ$4Ô$4Ò4ð+à—	’	‘”˜tŸyšy™{œ{Ò*ð
ð 	
r#   c                 ó   — dS )Nr#   r:   r5   s    r!   Úflagszabsentfilectx.flags~   s   € Øˆsr#   c                 ó   — | j         S r-   )r.   r5   s    r!   rF   zabsentfilectx.changectx�   s
   € ØŒyÐr#   c                 ó   — dS ©NFr:   r5   s    r!   Úisbinaryzabsentfilectx.isbinary„   s   € Øˆur#   c                 ó   — dS )NTr:   r5   s    r!   rE   zabsentfilectx.isabsent‡   r<   r#   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r3   r6   r8   r;   r>   rB   Ú
_customcmprH   rJ   rF   rN   rE   r:   r#   r!   r+   r+   W   sÌ   € € € € € ðIð Iðð ð ð;ð ;ð ;ðð ð ðð ð ðð ð ð'ð 'ð 'ð €Jð	
ð 	
ð 	
ðð ð ðð ð ðð ð ðð ð ð ð r#   r+   c                 óŠ   — |t           v r|S t          | |d|¦  «        }|                     d¦  «        r|S t          | |¦  «        S )Nó
   executableó   python:)Ú	internalsr"   Ú
startswithÚfindexternaltool)r   r   Úcmds      r!   Ú	_findtoolr\   ‹   sN   € Ø�yÐÐØˆÝ
�2�t˜]¨DÑ
1Ô
1€CØ
‡~‚~�jÑ!Ô!ð Øˆ
Ý˜B Ñ%Ô%Ð%r#   c                 óX   — |                       d¦  «        r| S t          j        | ¦  «        S )NrW   )rY   r   Ú
shellquote)r[   s    r!   Ú_quotetoolpathr_   ”   s,   € Ø
‡~‚~�jÑ!Ô!ð Øˆ
ÝÔ˜sÑ#Ô#Ð#r#   c           
      óJ  — dD ]i}t          | ||¦  «        }|sŒt          j        |t          | |d¦  «        ¦  «        }|r-t          j        |t          | |dd¦  «        z   ¦  «        }|r|c S Œjt          | |d|¦  «        }t          j        t          j        |¦  «        ¦  «        S )N)s   regkeys	   regkeyalts   regnames	   regappendr#   rV   )r"   r   Ú	lookupregr   ÚfindexeÚ
expandpath)r   r   ÚknÚkÚpÚexes         r!   rZ   rZ   š   sµ   € Ø'ð ð ˆÝ�R˜˜rÑ"Ô"ˆØð 	ØÝŒN˜1�h r¨4°Ñ<Ô<Ñ=Ô=ˆØð 	ÝÔ  ¥X¨b°$¸ÀcÑ%JÔ%JÑ!JÑKÔKˆAØð Ø���øÝ
�2�t˜]¨DÑ
1Ô
1€CÝÔ�DœO¨CÑ0Ô0Ñ1Ô1Ð1r#   c                 óX  ‡‡‡‡‡— ‰                      dd¦  «        Šdˆfd„	Šd„ Šˆˆˆˆfd„}‰                     dd¦  «        }|r6t          ‰|¦  «        }|r ‰|¦  «        sd	S |r|t          |¦  «        fS ||fS t          j                             d
¦  «        }	|	r|r ‰|	¦  «        sd	S |	|	fS |o‰}
‰                     d¦  «        D ]¹\  }}t          j        | j	        d|g¦  «        } ||¦  «        r� |||||
|¦  «        r~|rY ‰|dd¬¦  «        sK‰ 
                    t          d¦  «        t          j        |¦  «        t          j        |¦  «        fz  ¦  «         t          ‰|¦  «        }|t          |¦  «        fc S Œºi }t          ¦   «         Š‰                     d¦  «        D ]k\  }}|                     d¦  «        d         }||vr!t!          t#          ‰|d¦  «        ¦  «        ||<   t%          ‰|d¦  «        r‰                     |¦  «         Œl|                     ¦   «         }t+          ˆfd„|                     ¦   «         D ¦   «         ¦  «        }‰                     dd¦  «        }|r1 ||||||¦  «        r"||vr|s||fS |                     dd |f¦  «         |                     d¦  «         |D ]7\  }} ||d |||¦  «        r#t          ‰|¦  «        }|t          |¦  «        fc S Œ8|s|s|r8|s4t3          |¦  «        r%‰ 
                    t          d¦  «        |z  ¦  «         d	S dS )Nó   merges   strict-capability-checkFc                 ó†   •— | t           v r'|o$t           |          j                             |¦  «        S t          ‰| |¦  «        S r-   )rX   ÚcapabilitiesÚgetr&   )r   Ú
capabilityÚstrictr   s      €r!   Úhascapabilityz _picktool.<locals>.hascapability«   s@   ø€ Ø•9ÐÐØÐJ�i¨œoÔ:×>Ò>¸zÑJÔJÐJÝ˜˜T :Ñ.Ô.Ð.r#   c                 óJ   — | t           v ot           |          j        t          k    S r-   )rX   Ú	mergetypeÚnomerge©r   s    r!   Ú
supportscdz_picktool.<locals>.supportscd°   s   € Ø•yÐ ÐI¥Y¨t¤_Ô%>Å'Ò%IÐIr#   c                 ó|  •— | }|rt          d¦  «        | |fz  }t          ‰	| ¦  «        sN|r&‰	                     t          d¦  «        |z  ¦  «         nê‰	                     t          d¦  «        |z  ¦  «         nÄ|r3 ‰| d‰¦  «        s&‰	                     t          d¦  «        |z  ¦  «         n�|r3 ‰| d‰¦  «        s&‰	                     t          d¦  «        |z  ¦  «         nZ|r ‰| ¦  «        snLt	          j        ¦   «         s7t          ‰	| d¦  «        r&‰	                     t          d¦  «        |z  ¦  «         nd	S d
S )Ns   %s (for pattern %s)s   couldn't find merge tool %s
s   symlinks   tool %s can't handle symlinks
ó   binarys   tool %s can't handle binary
ó   guis   tool %s requires a GUI
TF)r   r\   ÚwarnÚnoter   Úguir&   )
r   ÚpatÚsymlinkÚbinaryÚchangedeleteÚtmsgro   Ústrictcheckrt   r   s
         €€€€r!   Úcheckz_picktool.<locals>.check³   st  ø€ ØˆØð 	;ÝÐ+Ñ,Ô,°°c¨{Ñ:ˆDÝ˜˜TÑ"Ô"ð 	Øð DØ—’�Ð:Ñ;Ô;¸dÑBÑCÔCÐCÐCà—’�Ð:Ñ;Ô;¸dÑBÑCÔCÐCÐCØð 	˜]˜]¨4°¸[ÑIÔIð 	Ø�GŠG•AÐ8Ñ9Ô9¸DÑ@ÑAÔAÐAÐAØð 		˜M˜M¨$°	¸;ÑGÔGð 		Ø�GŠG•AÐ6Ñ7Ô7¸$Ñ>Ñ?Ô?Ð?Ð?Øð 	 * *¨TÑ"2Ô"2ð 	ð Ý”‘”ð 	¥I¨b°$¸Ñ$?Ô$?ð 	Ø�GŠG•AÐ1Ñ2Ô2°TÑ9Ñ:Ô:Ð:Ð:à�4Øˆur#   ó   uis
   forcemerge)s   :promptNs   HGMERGEs   merge-patternsr#   rv   T)rn   s�   warning: check merge-patterns configurations, if %r for binary file %r is unintentional
(see 'hg help merge-tools' for binary files capability)
r   r   r   s   prioritys   disabledc                 ó(   •— g | ]\  }}|‰v¯	| |f‘ŒS r:   r:   )Ú.0r   rf   Údisableds      €r!   ú
<listcomp>z_picktool.<locals>.<listcomp>   s-   ø€ ÐIÐIÐI™˜˜a°DÀÐ4HÐ4Hˆ1ˆ"ˆdˆÐ4HÐ4HÐ4Hr#   )Ns   hgmerges   no tool found to merge %s
)s   :mergeN)F)r%   r   r\   r_   r   Úenvironrl   Úconfigitemsr   Úrootrx   r   r   ÚbytestrÚsetÚsplitÚintr"   r&   ÚaddÚkeysÚsortedÚitemsÚinsertÚappendÚlen)r@   r   r8   r}   r|   r~   r�   ÚforceÚtoolpathÚhgmergeÚ	binarycapr{   r   ÚmfÚtoolsre   ÚvÚtÚnamesÚuimergerf   r…   ro   r€   rt   s    `                   @@@@r!   Ú	_picktoolrŸ   ¨   s-  øøøøø€ Ø—-’- Ð*DÑEÔE€Kð/ð /ð /ð /ð /ð /ð
Jð Jð Jðð ð ð ð ð ð ð ð2 �IŠI�e˜]Ñ+Ô+€EØð 	&Ý˜R Ñ'Ô'ˆØð 	& 
 
¨8Ñ 4Ô 4ð 	&Ø#Ð#àð &Ø�~¨hÑ7Ô7Ð8Ð8ð ˜u�~Ð%õ Ô×"Ò" :Ñ.Ô.€GØð &Øð 	& 
 
¨7Ñ 3Ô 3ð 	&Ø#Ð#à˜WÐ%Ð%ð
 Ð&˜;€Ià—^’^Ð$5Ñ6Ô6ð 4ð 4‰	ˆˆTÝŒ[˜œ C¨#¨Ñ/Ô/ˆØˆ2ˆd‰8Œ8ð 	4˜˜˜d C¨°)¸\ÑJÔJð 	4Øð 	˜m˜m¨D°)ÀDÐIÑIÔIð 	Ø—’Ýð;ñô õ  Ô'¨Ñ-Ô-­xÔ/?ÀÑ/EÔ/EÐFñGñô ð õ !  TÑ*Ô*ˆHØ�.¨Ñ2Ô2Ð3Ð3Ð3Ð3øð €EÝ‰uŒu€HØ—’˜~Ñ.Ô.ð ð ‰ˆˆ1Ø�GŠG�D‰MŒM˜!ÔˆØ�Eˆ>ˆ>Ý�8 B¨¨;Ñ7Ô7Ñ8Ô8ˆE�!‰HÝ�R˜˜KÑ(Ô(ð 	Ø�LŠL˜‰OŒOˆOøØ�JŠJ‰LŒL€EÝØIÐIÐIÐI 5§;¢;¡=¤=ÐIÑIÔIñô €Eð �iŠi˜˜xÑ(Ô(€GØð -ð ˆ5�˜$ ¨°Ñ>Ô>ð 	-Ø˜eÐ#Ð#¨LÐ#Ø Ð)Ð)Ø�LŠL˜˜T 7˜OÑ,Ô,Ð,Ø	‡L‚LÐ#Ñ$Ô$Ð$Øð 1ð 1‰ˆˆ1Øˆ5��D˜' 6¨<Ñ8Ô8ð 	1Ý   QÑ'Ô'ˆHØ•~ hÑ/Ô/Ð0Ð0Ð0Ð0ð	1ð
 ð  �&ð  ˜Lð  Øð 	>¥ E¡
¤
ð 	>à�GŠG•AÐ4Ñ5Ô5¸Ñ<Ñ=Ô=Ð=ØÐØˆ?r#   c                 ó6   — d| v rdS d| v rdS d| v rdS d| v rdS dS )zGuess the EOL type of a fileó    Ns   
ó   ó   
r:   ©r>   s    r!   Ú_eoltyper¥     s?   € à�€}€}ØˆtØ�$€€ØˆwØ�€}€}ØˆuØ�€}€}ØˆuØˆ4r#   c                 ó  — t          |                     ¦   «         ¦  «        }|rXt          j        | ¦  «        }t          |¦  «        }|r5|                     ||¦  «        }||k    rt          j        | |¦  «         dS dS dS dS )z/Convert EOL markers in a file to match origfileN)r¥   r>   r   ÚreadfileÚreplaceÚ	writefile)ÚfileÚbackupÚtostyler>   ÚstyleÚnewdatas         r!   Ú	_matcheolr¯   &  sŽ   € å�v—{’{‘}”}Ñ%Ô%€GØð .ÝŒ}˜TÑ"Ô"ˆÝ˜‘”ˆØð 	.Ø—l’l 5¨'Ñ2Ô2ˆGØ˜$ŠˆÝ”˜t WÑ-Ô-Ð-Ð-Ð-ð.ð .ð	.ð 	.àˆr#   ó   promptc           	      óÀ  — | j         }|j                             ¦   «         }t          j        | ¦  «        }|j                             ¦   «                              ¦   «         rt          j        d¦  «        ‚t          |j
        |j
        g¦  «        }	 ||¦  «        |	d<   	 |j                             ¦   «         r)|                     t          |	z  d¦  «        }
g d¢|
         }nr|j                             ¦   «         r)|                     t          |	z  d¦  «        }
g d¢|
         }n0|                     t          d¦  «        |	z  d¦  «        }
g d¢|
         }|dk    rt!          | |||||¦  «        S |dk    rt#          | |||||¦  «        S |d	k    rt%          | |||||¦  «        S dS # t          j        $ r, |                     d
¦  «         t%          | |||||¦  «        cY S w xY w)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 conflictss   fdé   )ó   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)r   rG   r8   r   ÚgetuipathfnrF   Ú
isinmemoryr	   ÚInMemoryMergeConflictsErrorÚ
partextrasÚlabelrE   ÚpromptchoiceÚ_localchangedotherdeletedmsgÚ_otherchangedlocaldeletedmsgr   Ú_iotherÚ_ilocalÚ_ifailÚResponseExpectedÚwrite)r@   ÚmynodeÚlocalÚotherÚbaseÚtoolconfr   ÚfdÚuipathfnÚpromptsÚindexÚchoices               r!   Ú_ipromptrÍ   2  s#  € ð 
Œ€BØ	Œ�ŠÑ	Ô	€BÝÔ" 4Ñ(Ô(€Hð „z×ÒÑÔ×(Ò(Ñ*Ô*ð 
ÝÔ/Ø>ñ
ô 
ð 	
õ ˜%œ+ u¤{Ð3Ñ4Ô4€GØ�X˜b‘\”\€GˆE�Nð BØŒ:×ÒÑ Ô ð 	@Ø—O’OÕ$@À7Ñ$JÈAÑNÔNˆEØ8Ð8Ð8¸Ô?ˆFˆFØŒZ× Ò Ñ"Ô"ð 	@Ø—O’OÕ$@À7Ñ$JÈAÑNÔNˆEØ8Ð8Ð8¸Ô?ˆFˆFð
 —O’OÝð:ñô ð ñð ñ
ô 
ˆEð 9Ð8Ð8¸Ô?ˆFà�XÒÐÝ˜4 ¨°°t¸XÑFÔFÐFØ�xÒÐÝ˜4 ¨°°t¸XÑFÔFÐFØ�}Ò$Ð$Ý˜$ ¨¨u°d¸HÑEÔEÐEð %Ð$øåÔ!ð Bð Bð BØ
�Š�‰ŒˆÝ�d˜F E¨5°$¸ÑAÔAÐAÐAÐAðBøøøs   ÂCF" Å,F" ÆF" Æ"8GÇGr³   c                 ó8   — d|j                              ¦   «         fS )z=Uses the local `p1()` version of files as the merged version.r   )rG   rE   ©r@   rÃ   rÄ   rÅ   rÆ   rÇ   s         r!   r¿   r¿   f  s   € ð ˆeŒj×!Ò!Ñ#Ô#Ð#Ð#r#   r´   c                 ó>  — |j                              ¦   «         r)t          |j         ¦  «                             ¦   «          d}nXt          |j         ¦  «                             |j                              ¦   «         |j                              ¦   «         ¦  «         d}d|fS )z=Uses the other `p2()` version of files as the merged version.TFr   )rG   rE   Ú_underlyingfctxifabsentÚremoverÂ   r>   rJ   )r@   rÃ   rÄ   rÅ   rÆ   rÇ   Údeleteds          r!   r¾   r¾   l  s�   € ð „z×ÒÑÔð å ¤
Ñ+Ô+×2Ò2Ñ4Ô4Ð4Øˆˆå ¤
Ñ+Ô+×1Ò1ØŒJ�OŠOÑÔ˜uœz×/Ò/Ñ1Ô1ñ	
ô 	
ð 	
ð ˆØˆgˆ:Ðr#   s   failc                 óä   — |j                              ¦   «         rVt          |j         ¦  «                             |j                              ¦   «         |j                              ¦   «         ¦  «         dS )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.©r   F)rG   rE   rÑ   rÂ   r>   rJ   rÏ   s         r!   rÀ   rÀ   {  sb   € ð „z×ÒÑÔð 
Ý ¤
Ñ+Ô+×1Ò1ØŒJ�OŠOÑÔ˜uœz×/Ò/Ñ1Ô1ñ	
ô 	
ð 	
ð ˆ8r#   c                 ó†   — |                       ¦   «         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.
    rD   )Úfilectxs    r!   rÑ   rÑ   ‰  s<   € ð
 ×ÒÑÔð Ø× Ò Ñ"Ô" 7§<¢<¡>¤>Ô2Ð2àˆr#   c                 ó  — t          j        |                      ¦   «         ¦  «        rbt          d¦  «        | j                             ¦   «         z  }|                     t          d¦  «        |z  ¦  «         t          j        |¦  «        ‚dS )z verifies that text is non-binarys   %s looks like a binary file.s   warning: %s
N)	r   r}   Útextr   rG   r8   rx   r	   ÚAbort)Úinputr   Úmsgs      r!   Ú_verifytextrÝ   ”  sv   € åÔ˜Ÿš™œÑ&Ô&ð ÝÐ/Ñ0Ô0°5´:·?²?Ñ3DÔ3DÑDˆØ
�Š•Ð"Ñ#Ô# cÑ)Ñ*Ô*Ð*ÝŒk˜#ÑÔÐðð r#   c                 ó  — |\  }}}}}	|s2|j                              ¦   «         s|j                              ¦   «         rdS | j        }
g d¢}	 t          |
|d| ¦  «        }nƒ# t          j        $ rq t          |
|dd¦  «                             ¦   «         }||vrFd                     d„ |D ¦   «         ¦  «        }t	          j        t          d¦  «        |||fz  ¦  «        ‚Y nw xY w|r�d}|d	k    rd
}n|dk    rd}t          d„ |||fD ¦   «         ¦  «        rdS t          j        ||||¬¦  «        \  }}|r||v r2|j                              ||j                              ¦   «         ¦  «         |s|
                     d¦  «         dS dS )Nr   )s   keepó   keep-merge3ó   keep-mergediffs   premerger#   ó   , c                 ó   — g | ]
}d |z   d z   ‘ŒS )ó   'r:   )r„   r›   s     r!   r†   z_premerge.<locals>.<listcomp>«  s    € Ð DÐ DÐ D°Q ¨¡¨D¡Ð DÐ DÐ Dr#   s6   %s.premerge not valid ('%s' is neither boolean nor %s)ri   rà   ó	   mergediffrß   ó   merge3c              3   ób   K  — | ]*}t          j        |                     ¦   «         ¦  «        V — Œ+d S r-   )r   r}   rÙ   )r„   rÛ   s     r!   ú	<genexpr>z_premerge.<locals>.<genexpr>·  sF   è è € ð 
ð 
Ø05�JÔ˜eŸjšj™lœlÑ+Ô+ð
ð 
ð 
ð 
ð 
ð 
r#   ©Úmodes    premerge successful
r   )rG   rE   r   r&   r	   ÚConfigErrorr"   ÚlowerÚjoinr   Úanyr   rÂ   rJ   Údebug)r@   rÄ   rÅ   rÆ   rÇ   r   r–   r}   r|   Úscriptfnr   Ú	validkeepÚpremergeÚ_validré   Úmerged_textÚ	conflictss                    r!   Ú	_premergerõ   œ  s  € Ø08Ñ-€Dˆ(�F˜G XØð �%”*×%Ò%Ñ'Ô'ð ¨5¬:×+>Ò+>Ñ+@Ô+@ð Øˆqà	Œ€Bà<Ð<Ð<€Ið	Ý˜R  {¸°JÑ?Ô?ˆˆøÝÔð ð ð Ý˜B  k°3Ñ7Ô7×=Ò=Ñ?Ô?ˆØ˜9Ð$Ð$Ø—Z’ZÐ DÐ D¸)Ð DÑ DÔ DÑEÔEˆFÝÔ#ÝÐKÑLÔLØ˜ 6Ð*ñ+ñô ð ð %Ð$ðøøøð ð ØˆØÐ(Ò(Ð(ØˆDˆDØ˜Ò'Ð'ØˆDÝð 
ð 
Ø:?ÀÀuÐ9Mð
ñ 
ô 
ñ 
ô 
ð 	ð �1Ý!,Ô!8Ø�4˜ Tð"
ñ "
ô "
Ñˆ�Yð ð 	>˜H¨	Ð1Ð1ð ŒJ×Ò˜[¨%¬*×*:Ò*:Ñ*<Ô*<Ñ=Ô=Ð=Øð 	Ø�HŠHÐ.Ñ/Ô/Ð/Ø�1Øˆ1s   ÁA ÁA=CÃCc                 ó¶  — |\  }}}}	}
t          j        | ¦  «        }|	rI| j                             t	          d¦  «        | ||                     ¦   «         ¦  «        fz  ¦  «         dS |                     ¦   «         s|                     ¦   «         rI| j                             t	          d¦  «        | ||                     ¦   «         ¦  «        fz  ¦  «         dS dS )Ns2   warning: internal %s cannot merge symlinks for %s
Fs@   warning: internal %s cannot merge change/delete conflict for %s
T)r   r¶   r   rx   r   r8   rE   )r@   rÃ   ÚfcdÚfcoÚfcarÇ   r   r–   r}   r|   rï   rÉ   s               r!   Ú_mergecheckrú   È  sê   € Ø08Ñ-€Dˆ(�F˜G XÝÔ" 4Ñ(Ô(€HØð ØŒ�ŠÝÐDÑEÔEØ�X�X˜cŸhšh™jœjÑ)Ô)Ð*ñ+ñ	
ô 	
ð 	
ð ˆuØ
‡|‚|�~„~ð ˜Ÿš™œð ØŒ�ŠÝð%ñô ð �X�X˜cŸhšh™jœjÑ)Ô)Ð*ñ	+ñ	
ô 	
ð 	
ð ˆuØˆ4r#   c                 óB  — | j         }	 t          ||¦  «         t          ||¦  «         t          ||¦  «         t          j        ||||¬¦  «        \  }}|j                             ||j                             ¦   «         ¦  «         d|dfS # t          j        $ r Y dS w xY w)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.rè   TF)TTF)r   rÝ   r   rG   rÂ   rJ   r	   rÚ   )r@   rÄ   rÅ   rÆ   ré   r   ró   rô   s           r!   Ú_mergerü   Ý  sÄ   € ð 
Œ€Bð&Ý�E˜2ÑÔÐÝ�D˜"ÑÔÐÝ�E˜2ÑÔÐõ "-Ô!8Ø�4˜ Tð"
ñ "
ô "
Ñˆ�Yð
 	Œ
×Ò˜ e¤j×&6Ò&6Ñ&8Ô&8Ñ9Ô9Ð9Ø�Y Ð%Ð%øõ Œ;ð !ð !ð !Ø Ð Ð ð!øøøs   ‰0B ÂBÂBó   unionsJ   warning: conflicts while merging %s! (edit, then use 'hg resolve --mark')
)Úprecheckc                 ó(   — 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«   s          r!   Ú_iunionr  õ  s   € õ �$˜˜u d¨HÑ5Ô5Ð5r#   ri   c                 ó(   — t          | |||d¦  «        S )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.ri   r   r  s          r!   Ú_imerger    s   € õ �$˜˜u d¨HÑ5Ô5Ð5r#   rå   c                 ó(   — t          | |||d¦  «        S )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  s          r!   Ú_imerge3r    s   € õ �$˜˜u d¨IÑ6Ô6Ð6r#   s   merge3-lie-about-conflictsr#   c                  ó,   — t          | i |¤Ž\  }}}|d|fS rM   )r  )r    ÚkwargsÚb1ÚjunkÚb2s        r!   Ú_imerge3alwaysgoodr  *  s*   € õ ˜TÐ, VÐ,Ð,�L€Bˆˆbð ˆu�bˆ=Ðr#   rä   c                 ó(   — t          | |||d¦  «        S )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  s          r!   Ú_imerge_diffr  =  s   € õ  �$˜˜u d¨LÑ9Ô9Ð9r#   s   merge-localc                 ó(   — t          | |||d¦  «        S )zg
    Like :merge, but resolve all conflicts non-interactively in favor
    of the local `p1()` changes.r³   r   r  s          r!   Ú_imergelocalr  P  ó   € õ
 �$˜˜u d¨HÑ5Ô5Ð5r#   s   merge-otherc                 ó(   — t          | |||d¦  «        S )zg
    Like :merge, but resolve all conflicts non-interactively in favor
    of the other `p2()` changes.r´   r   r  s          r!   Ú_imergeotherr  X  r  r#   s   tagmergesj   automatic tag merging of %s failed! (use 'hg resolve --tool :merge' or another merge tool of your choice)
c                 ó^   — t          j        | |j        |j        |j        ¦  «        \  }}||dfS )z?
    Uses the internal tag merge algorithm (experimental).
    F)r   ÚmergerG   )	r@   rÃ   rÄ   rÅ   rÆ   rÇ   r«   ÚsuccessÚstatuss	            r!   Ú
_itagmerger  `  s0   € õ ”n T¨5¬:°u´zÀ4Ä9ÑMÔM�O€GˆVØ�F˜EÐ!Ð!r#   s   dumpT)r}   r|   c                 óH  — t          | |j        ¦  «        }|j                             ¦   «         }ddlm}	 t          |j        |	j        ¦  «        rt          j        d¦  «        ‚t          j
        |dz   |j                             ¦   «         ¦  «         |                      |dz   |j                             ¦   «         |j                             ¦   «         ¦  «         |                      |dz   |j                             ¦   «         |j                             ¦   «         ¦  «         dS )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   ©Úcontexts0   in-memory merge does not support the :dump tool.s   .locals   .others   .base)Fr   F)Ú_workingpathrG   r8   Ú r  Ú
isinstanceÚoverlayworkingfilectxr	   r¸   r   r©   ÚdecodeddataÚwwriter>   rJ   )
r@   rÃ   rÄ   rÅ   rÆ   rÇ   r«   ÚarÈ   r  s
             r!   Ú_idumpr#  q  sø   € õ 	�T˜5œ:Ñ&Ô&€AØ	Œ�ŠÑ	Ô	€BàÐÐÐÐÐå�%”*˜gÔ;Ñ<Ô<ð 
ÝÔ/Ø?ñ
ô 
ð 	
õ 	„N�1�y‘= %¤*×"8Ò"8Ñ":Ô":Ñ;Ô;Ð;Ø‡K‚K��Y‘ ¤
§¢Ñ 1Ô 1°5´:×3CÒ3CÑ3EÔ3EÑFÔFÐFØ‡K‚K��X‘˜tœyŸ~š~Ñ/Ô/°´·²Ñ1BÔ1BÑCÔCÐCØˆ?r#   s	   forcedumpc           	      ó,   — t          | ||||||¦  «        S )zS
    Creates three versions of the files as same as :dump, but omits premerge.
    )r#  r  s          r!   Ú
_forcedumpr%  Ž  s   € õ
 �$˜  u¨d°H¸fÑEÔEÐEr#   c                 ó*   — t          j        d¦  «        ‚)Ns5   in-memory merge does not support external merge tools)r	   r¸   r  s          r!   Ú
_xmergeimmr'  –  s   € õ Ô
+Ø@ñô ð r#   c	                 ó|  — |                       dd¦  «        }	|	sd S t          j        }
|                     ¦   «         t	          |¦  «        |                     ¦   «          |
|                     ¦   «         |t	          |¦  «        t          d¦  «        d|                     ¦   «         v |d         dœ¦  «         |
|                     ¦   «         |t          d¦  «        d|                     ¦   «         v |d         d	œ¦  «         |
|                     ¦   «         |t          d
¦  «        d|                     ¦   «         v |d         d	œ¦  «        ||dœ}t          j	        |	¦  «        }	t          j        | |¦  «        }t          j        | |	t          j        |¬¦  «        }|                      |                     |¦  «        ¦  «         d S )Nó   command-templatess   pre-merge-tool-outputr³   ó   ló   HG_MY_LABEL)ó   ctxó   fctxó   nodeó   nameó   islinkó   labeló   baseó   HG_BASE_LABEL)r,  r-  r/  r0  r1  r´   ó   HG_OTHER_LABEL)r,  r.  s   pathr³   r2  r´   s   toolpaths   toolargs©ÚdefaultsÚ	resources)r   r   ÚmappingdictrF   r   r8   r   rJ   r   Úunquotestringr
   ÚtemplateresourcesÚmaketemplaterr   Úkeywordsr  Úrenderdefault)r   r@   rÃ   ÚfclÚfcbrø   Úenvr–   r    Útmplr8  ÚpropsÚtresrœ   s                 r!   Ú_describemergerD  ¤  s·  € Ø�9Š9Ð)Ð+CÑDÔD€DØð ØˆåÔ*€Kà—’‘”Ý�V‘”Ø—’‘”Ø�+àŸš™œØÝ˜V™œÝ˜8™œØ 3§9¢9¡;¤;Ð.Ø˜nÔ-ðð ñ	
ô 	
ð �àŸš™œØÝ˜7™œØ 3§9¢9¡;¤;Ð.ØÐ.Ô/ðð ñ
ô 
ð �+àŸš™œØÝ˜8™œØ 3§9¢9¡;¤;Ð.ØÐ/Ô0ðð ñ
ô 
ð ØðC"ð "€EõJ Ô" 4Ñ(Ô(€Dõ Ô& r¨4Ñ0Ô0€DÝÔØ
ˆD�:Ô.¸$ð	ñ 	ô 	€Að ‡I‚Iˆa�oŠo˜eÑ$Ô$Ñ%Ô%Ð%Ð%Ð%r#   c                 ó®	  — |j         }|j         }|j         }	|\  }
}}}}t          j        | ¦  «        }|                     ¦   «         s|                     ¦   «         rI| j                             t          d¦  «        |
 ||                     ¦   «         ¦  «        fz  ¦  «         dS t          | |¦  «        }t          | j        |
d¦  «        }d|	                     ¦   «         |	 
                    ¦   «         fd|                     ¦   «         | 
                    ¦   «         fg}d}d|v rw|}|                     ¦   «         }|                     d¦  «        r"t          j                             |¦  «        \  }}|                     d	||                     ¦   «         f¦  «         t!          |¦  «        5 }|d d
…         \  }}t#          |¦  «        dk    r|d
         }d„ }|                     ¦   «         t%          |¦  «        t%          |                     ¦   «                              ¦   «         ¦  «        t%          |	                     ¦   «                              ¦   «         ¦  «        d|                     ¦   «         v d|                     ¦   «         v d|	                     ¦   «         v  ||¦  «         ||¦  «         ||¦  «        dœ
}| j        }|||| ||¦  «         ||¦  «         ||¦  «        dœ}t-          j        d||d„ ¦  «        }t1          ||
d¦  «        rG| j                             t          d¦  «        |
 ||                     ¦   «         ¦  «        fz  ¦  «         |€[|dz   |z   }| j                             d|z  ¦  «         t7          || |||	||||¦	  «	         |                     || j        |d¬¦  «        }në| j                             d||fz  ¦  «         d}	 ddlm} |                      |d|
z  ¦  «        } n2# tB          $ r% tE          j#        t          d¦  «        |z  ¦  «        ‚w xY wtI          | |d ¦  «        }!|!€&tE          j#        t          d¦  «        ||fz  ¦  «        ‚tK          j&        |¦  «        }"ddlm'}# |# (                    || d ||!d|"id!¦  «        \  }$}%|%rd}| j                             d"|z  ¦  «         d!|d#fcd d d ¦  «         S # 1 swxY w Y   d S )$Ns7   warning: %s cannot merge change/delete conflict for %s
)Fr   Ns   argsr2  r´   r#   s   $outputs   .origr³   r²   é   c                 ó@   — | j         rd| j        | j         fz  S | j        S )Ns   %s: %s)Úlabel_detailrº   )rÛ   s    r!   Úformat_labelz_xmerge.<locals>.format_labelü  s*   € ØÔ!ð #Ø  E¤K°Ô1CÐ#DÑDÐDà”{Ð"r#   r*  )
s   HG_FILEs
   HG_MY_NODEs   HG_OTHER_NODEs   HG_BASE_NODEs   HG_MY_ISLINKs   HG_OTHER_ISLINKs   HG_BASE_ISLINKr+  r4  r3  )r³   r2  r´   s   outputs
   labellocals
   labelothers	   labelbaseó   \$c                 óN   — t          j        t          j        | ¦  «        ¦  «        S r-   ©r   r^   r   Ú	localpath©Úss    r!   ú<lambda>z_xmerge.<locals>.<lambda>  s   € •hÔ)­$¬.¸Ñ*;Ô*;Ñ<Ô<€ r#   rw   s"   running merge tool %s for file %s
ó    s   launching merge tool: %s
s	   mergetool)Úcwdr‡   Ú
blockedtags%   launching python merge script: %s:%s
r   r   )Ú
extensionss
   hgmerge.%ss&   loading python merge script failed: %ss   %s does not have function: %s)Úhookri   Ts   merge tool returned: %d
F))rG   r   r¶   rE   r   rx   r   r8   r  r"   r   ÚendswithÚosÚsplitextr“   r>   Ú_maketempfilesr”   r   rF   ÚnoderJ   r   Úinterpolater&   r  rî   rD  Úsystemr‰   r  rT  ÚloadpathÚ	Exceptionr	   rÚ   r   r   Ú
shellsplitrU  Ú
pythonhook)&r@   rÃ   rÄ   rÅ   rÆ   rÇ   r«   r÷   rø   rù   r   r–   r}   r|   rï   rÉ   rM  r    ÚfilesÚoutpathÚlocaloutputpathÚextÚ	temppathsÚbasepathÚ	otherpathrI  r@  r   r¨   r[   ÚrrT  ÚmodÚmergefnÚargslistrU  ÚretÚraiseds&                                         r!   Ú_xmergern  Ú  s‹  € Ø
Œ*€CØ
Œ*€CØ
Œ)€CØ08Ñ-€Dˆ(�F˜G XÝÔ" 4Ñ(Ô(€HØ
‡|‚|�~„~ð ˜Ÿš™œð ØŒ�ŠÝÐIÑJÔJØ�X�X˜cŸhšh™jœjÑ)Ô)Ð*ñ+ñ	
ô 	
ð 	
ð ˆ~Ý˜T 3Ñ'Ô'€IÝ�D”G˜T 7Ñ+Ô+€Dð 
�#—(’(‘*”*˜cŸošoÑ/Ô/Ð0Ø	�3—8’8‘:”:˜sŸšÑ0Ô0Ð1ð€Eð €GØ�TÐÐàˆØ Ÿ+š+™-œ-ˆà×#Ò# HÑ-Ô-ð 	EÝ#%¤7×#3Ò#3°OÑ#DÔ#DÑ ˆO˜SØ�Š�h °·²±´Ð?Ñ@Ô@Ð@å	˜Ñ	Ô	ð Q )Ø'¨¨¨œmÑˆ�)Ýˆy‰>Œ>˜QÒÐØ! !œˆIð	#ð 	#ð 	#ð Ÿš™
œ
Ý  ™=œ=Ý# C§M¢M¡O¤O×$8Ò$8Ñ$:Ô$:Ñ;Ô;Ý" 3§=¢=¡?¤?×#7Ò#7Ñ#9Ô#9Ñ:Ô:Ø! S§Y¢Y¡[¤[Ð0Ø $¨¯	ª	©¬Ð 3Ø# s§y¢y¡{¤{Ð2Ø(˜L¨Ñ/Ô/Ø+˜|¨EÑ2Ô2Ø*˜l¨4Ñ0Ô0ð
ð 
ˆð ŒWˆð  ØØØØ'˜<¨Ñ.Ô.Ø'˜<¨Ñ.Ô.Ø&˜, tÑ,Ô,ð
ð 
ˆõ ÔØØØØ<Ð<ñ	
ô 
ˆõ �R˜˜vÑ&Ô&ð 	ØŒG�NŠNÝÐ8Ñ9Ô9Ø˜˜ #§(¢(¡*¤*Ñ-Ô-Ð.ñ/ñô ð ð ÐØ˜T‘/ DÑ(ˆCØŒG�MŠMÐ7¸#Ñ=Ñ>Ô>Ð>Ý˜2˜t V¨S°#°s¸CÀÈ4ÑPÔPÐPØ—	’	Ø˜œ¨C¸Lð ñ ô ˆAˆAð ŒG�MŠMØ9¸XÀxÐ<PÑPñô ð ð ˆAðà(Ð(Ð(Ð(Ð(Ð(à ×)Ò)¨(°MÀDÑ4HÑIÔI��øÝð ð ð Ý”kÝÐ?Ñ@Ô@À8ÑKñô ð ðøøøõ ˜c 8¨TÑ2Ô2ˆGØˆÝ”kÝÐ6Ñ7Ô7¸8ÀXÐ:NÑNñô ð õ  Ô*¨4Ñ0Ô0ˆHàÐÐÐÐÐàŸ/š/Ø�D˜( H¨g¸ÀÐ7JÈDñô ‰KˆC�ð ð Ø�ØŒ�ŠÐ2°QÑ6Ñ7Ô7Ð7Ø�Q˜ˆ~ðcQð Qð Qð Qñ Qô Qð Qð Qð Qð Qð Qð Qøøøð Qð Qð Qð Qð Qð Qs,   Æ'H+S
ÏO3Ï2S
Ï3/P"Ð"BS
Ó
SÓSc                 óì   — | j                              ¦   «         }|                     ¦   «         €|                     ¦   «         }d|i}|                     |¦  «        }t          j        |¦  «        | _        dS )zAApplies the given template to the ctx and stores it in the input.Nr,  )rG   rF   rZ  Úp1r=  r   Ú	firstlinerH  )rÛ   Útemplater1   rB  Útemplateresults        r!   Ú_populate_label_detailrt  K  se   € à
Œ*×
Ò
Ñ
 Ô
 €CØ
‡x‚x�z„zÐØ�fŠf‰hŒhˆà�SˆM€EØ×+Ò+¨EÑ2Ô2€NÝ#Ô-¨nÑ=Ô=€EÔÐÐr#   c                 ó(  — | j         }|                     dd¦  «        }|�t          ||d|¦  «        }t          j        |¦  «        }t          j        || ¦  «        }t          j        ||t          j	        |¬¦  «        }|D ]}t          ||¦  «         ŒdS )z?Populates the label details using the conflict marker template.r)  s   mergemarkerNs   mergemarkertemplater5  )r   r   r"   r   r9  r
   r:  r;  r   r<  rt  )r@   Úinputsr   r   rr  rC  rA  rÛ   s           r!   Ú_populate_label_detailsrw  V  sª   € à	Œ€BØ�yŠyÐ-¨~Ñ>Ô>€HØÐÝ˜B Ð&<¸hÑGÔGˆÝÔ& xÑ0Ô0€HÝÔ& r¨4Ñ0Ô0€DÝÔ"Ø
ˆH�zÔ2¸dðñ ô €Dð ð ,ð ,ˆÝ˜u dÑ+Ô+Ð+Ð+ð,ð ,r#   c                 ó>   — | €dddœS d| d         z  d| d         z  dœ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".
    Nr#   )r*  ó   os    [%s]r   r   r:   )Úlabelss    r!   r¹   r¹   f  sG   € ð
 €~àØð
ð 
ð 	
ð ˜ œÑ"Ø˜ œÑ"ðð ð r#   c                 ó  — |                      ¦   «         rdS ddlm} t          ||j        ¦  «        rlt          j        d¦  «        \  }}t          j        |d¦  «        5 }| 	                    | 
                    ¦   «         ¦  «         ddd¦  «         n# 1 swxY w Y   nMt          j        || |                     ¦   «         ¦  «        }t          | |¦  «        }t          j        ||¦  «         |                     || ¬¦  «        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.
    Nr   r  s   hg-merge-backupÚwb)r@   )rE   r  r  r  r  r   ÚmkstemprW  ÚfdopenrÂ   r>   r   Ú
backuppathr8   r  r   ÚcopyfileÚarbitraryfilectx)r@   r   r÷   r  rÈ   r«   r2   r"  s           r!   Ú_makebackupr‚  w  s.  € ð ‡|‚|�~„~ð Øˆtð ÐÐÐÐÐå�#�wÔ4Ñ5Ô5ð !åÔ%Ð&8Ñ9Ô9‰
ˆˆFÝŒY�r˜4Ñ Ô ð 	  AØ�GŠG�C—H’H‘J”JÑÔÐð	 ð 	 ð 	 ñ 	 ô 	 ð 	 ð 	 ð 	 ð 	 ð 	 ð 	 øøøð 	 ð 	 ð 	 ð 	 øõ Ô# B¨¨c¯hªh©j¬jÑ9Ô9ˆÝ˜˜sÑ#Ô#ˆÝŒ�a˜Ñ Ô Ð à×#Ò# F°Ð#Ñ6Ô6Ð6s   Á(BÂBÂBc              #   óú   ‡K  — t          j        d¬¦  «        Šˆfd„}g }| D ]&\  }}}|                      ||||¦  «        ¦  «         Œ'	 |V — t          j        ‰¦  «         dS # t          j        ‰¦  «         w xY w)zyCreates a temporary file for each (prefix, path, data) tuple in `files`,
    so an external merge tool may use them.
    s   hgmerge-)Úprefixc                 ó  •— t           j                             |¦  «        \  }}dt           j                             |¦  «        | fz  }t           j                             ‰|¦  «        }|r||z  }t          j        ||¦  «         |S )Ns   %s~%s)rW  r8   rX  Úbasenamerì   r   r©   )r„  r8   r>   Úfullbaserd  ÚpreÚnameÚtmproots          €r!   Úmaketempfrompathz(_maketempfiles.<locals>.maketempfrompathœ  sx   ø€ Ýœ×(Ò(¨Ñ.Ô.‰ˆ�#Ø�"œ'×*Ò*¨8Ñ4Ô4°fÐ=Ñ=ˆÝŒw�|Š|˜G SÑ)Ô)ˆØð 	Ø�C‰KˆDÝŒ�t˜TÑ"Ô"Ð"Øˆr#   N)r   Úmkdtempr“   ÚshutilÚrmtree)ra  r‹  Ú
temp_filesr„  r8   r>   rŠ  s         @r!   rY  rY  •  s¸   øè è € õ
 Ô kÐ2Ñ2Ô2€Gðð ð ð ð ð €JØ#ð @ð @Ñˆ��dØ×ÒÐ*Ð*¨6°4¸Ñ>Ô>Ñ?Ô?Ð?Ð?ðØÐÐÐåŒ�gÑÔÐÐÐø�Œ�gÑÔÐÐøøøs   Á
A$ Á$A:c           
      óH  — | j         }|                     ¦   «         }	t          j        | ¦  «        }
 |
|	¦  «        }|                     ¦   «         p'|                     ¦   «         p|                     ¦   «         }d|                     ¦   «         |                     ¦   «         z   v }|                     ¦   «         p|                     ¦   «         }t          | ||	|||¦  «        \  }}d}|t          v r,| 	                    d¦  «        r|t          d¦  «        d…         }|rŠ| 	                    d¦  «        rud}|                     d¦  «        dk    r0|d	d…                              dd
¦  «        \  }}|sd}d|v sd|v rd}nd}|r$t          j        t          d¦  «        |z  ¦  «        ‚|}|                     d||t#          j        |¦  «        t#          j        |¦  «        t#          j        |¦  «        fz  ¦  «         |t          v r%t          |         }|j        }|j        }|j        }d}n=|                     ¦   «         rt.          }nt0          }t2          }t          d¦  «        }d}d}|||||f}|sddg}t          |¦  «        dk     r|                     d¦  «         t7          j        ||d         ¦  «        }t7          j        ||d
         ¦  «        }t7          j        ||d         ¦  «        }|t:          k    r || |||||¦  «        S ||                     ¦   «         k    rM|                     t          d¦  «         |
|¦  «         |
|                     ¦   «         ¦  «        |fz  ¦  «         n%|                     t          d¦  «        |z  ¦  «         |                     d|||fz  ¦  «         |rT || |||||¦  «        sD|r@|                     ¦   «         rt          j        d¦  «        ‚|                      ||z  ¦  «         dS tC          | ||¦  «        }d
}	 | "                    dd¦  «        }|rtG          ||d¦  «        } n|} |t2          k    r…tI          | |||¦  «         d}!| dk    r|}!|dk    s| dk    rtK          | |||g|!¬¦  «         tM          | ||||¦  «        }|s|df|s|�| '                    ¦   «          S S S d|_(        d|_(        d|_(        | dk    rtK          | |||g|¬¦  «          || ||||||¦  «        \  }"}}#|"rtS          | |||||¦  «        }|rQ|r@|                     ¦   «         rt          j        d¦  «        ‚|                      ||z  ¦  «         tU          |¦  «         ||#f|s|�| '                    ¦   «          S S S # |s|�| '                    ¦   «          w w w xY w)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.r*  Nó	   internal:s   internalrW   Fó   :r²   é   r   Tó   \ó   /s   invalid 'python:' syntax: %ss?   picked tool '%s' for %s (binary %s symlink %s changedelete %s)
s   merging %s failed!
r³   r´   rF  r2  r   s   merging %s and %s to %s
s   merging %s
s   my %s other %s ancestor %s
s0   in-memory merge does not support merge conflictsrÕ   r‚   s   mergemarkerss   basicrs   )+r   r8   r   r¶   rN   rJ   rE   rŸ   rX   rY   r”   ÚcountÚrsplitr	   rÚ   r   rî   r   rŠ   rq   Ú	onfailurerþ   r·   r'  rn  Ú	fullmerger“   r   Ú
MergeInputrr   r  r¸   rx   r‚  r   r"   Ú_run_partial_resolution_toolsrw  rõ   rÒ   rH  Ú_checkÚ_onfilemergefailure)$r@   ÚwctxrÃ   Úorigr÷   rø   rù   rz  r   rÈ   rÉ   Úfduipathr}   r|   r~   r   r–   rï   ÚinvalidsyntaxÚscriptÚfuncrq   r˜  rþ   Ú
isexternalrÇ   rÄ   rÅ   rÆ   r«   rh  ÚinternalmarkerstyleÚmarkerstyleÚ	labeltoolÚ	needcheckrÓ   s$                                       r!   Ú	filemerger©  ®  s‰  € ð 
Œ€BØ	�Š‰Œ€BÝÔ" 4Ñ(Ô(€HØˆx˜‰|Œ|€HØ�\Š\‰^Œ^Ð?˜sŸ|š|™~œ~Ð?°·²±´€FØ�c—i’i‘k”k C§I¢I¡K¤KÑ/Ð/€GØ—<’<‘>”>Ð3 S§\¢\¡^¤^€LÝ˜t R¨¨V°W¸lÑKÔK�N€Dˆ(Ø€HØ�yÐÐ˜TŸ_š_¨\Ñ:Ô:Ðà•C˜Ñ$Ô$Ð&Ð&Ô'ˆØð �H×'Ò'¨
Ñ3Ô3ð ØˆØ�>Š>˜$ÑÔ 1Ò$Ð$Ø'¨¨¨œ|×2Ò2°4¸Ñ;Ô;ÑˆF�HØð %Ø $�à˜Ð Ð  D¨HÐ$4Ð$4Ø $�øà ˆMØð 	MÝ”+�aÐ ?Ñ@Ô@À8ÑKÑLÔLÐLØˆØ‡H‚HØKàØÝÔ˜VÑ$Ô$ÝÔ˜WÑ%Ô%ÝÔ˜\Ñ*Ô*ð
ñ	
ñ	ô 	ð 	ð �yÐÐÝ˜ŒˆØ”Nˆ	Ø”Nˆ	Ø”=ˆØˆ
ˆ
à�?Š?ÑÔð 	ÝˆDˆDåˆDÝˆ	ÝÐ-Ñ.Ô.ˆ	ØˆØˆ
à�X˜v w°Ð8€Hàð &Ø˜HÐ%ˆÝ
ˆ6�{„{�Q‚€Ø�Š�gÑÔÐÝÔ" 3¨¨q¬	Ñ2Ô2€EÝÔ" 3¨¨q¬	Ñ2Ô2€EÝÔ! # v¨a¤yÑ1Ô1€DØ•GÒÐØˆtØØØØØØñ
ô 
ð 	
ð ˆs�xŠx‰zŒzÒÐØ
�	Š	ÝÐ*Ñ+Ô+Øˆx˜‰~Œ~˜x˜x¨¯ª©
¬
Ñ3Ô3°XÐ>ñ?ñ	
ô 	
ð 	
ð 	
ð
 	�	Š	•!�OÑ$Ô$ xÑ/Ñ0Ô0Ð0à‡H‚HÐ,°°S¸#¨Ñ>Ñ?Ô?Ð?àð ˜˜  v¨s°C¸¸hÑGÔGð Øð 	*Ø�ŠÑ Ô ð ÝÔ7ØGñô ð ð �GŠG�I Ñ(Ñ)Ô)Ð)Øˆxå˜˜r 3Ñ'Ô'€FØ	€AðFØ Ÿiši¨¨Ñ?Ô?ÐØð 	.Ý" 2 t¨_Ñ=Ô=ˆKˆKà-ˆKà�	Ò!Ð!Ý)¨$°°u¸dÑCÔCÐCð ˆIØ˜hÒ&Ð&ð !�	Ø" hÒ.Ð.°+ÀÒ2IÐ2IÝ'Ø˜5 %¨Ð.°Yðñ ô ð õ ØØØØØñô ˆAð ð  Ø˜%�xðH ð 	�VÐ'Ø�MŠM‰OŒOˆOˆOð	Ð'ðC "&ˆEÔØ!%ˆEÔØ $ˆDÔà˜(Ò"Ð"Ý# D¨5°%¸Ð*>ÀTÐJÑJÔJÐJà $ ØØØØØØØñ!
ô !
Ñˆ	�1�gð ð 	7Ý�t˜Q  D¨#¨vÑ6Ô6ˆAàð 		$Øð .Ø—?’?Ñ$Ô$ð ÝÔ;ð+ñô ð ð
 —’˜	 HÑ,Ñ-Ô-Ð-Ý Ñ#Ô#Ð#à�'ˆzàð 	�VÐ'Ø�MŠM‰OŒOˆOˆOð	Ð'øˆqð 	�VÐ'Ø�MŠM‰OŒOˆOˆOð	Ð'øøøs   ÐBV Ò9B1V ÖV!c                 ód  — | j         }|                     dd¦  «        rdS g }t          ¦   «         }d}|                     |¦  «        D �]\  }}	|                     d¦  «        d         }
|
|v rŒ&|                     |d|
z  g ¦  «        }d}|rVt          j        | j        d	||j         	                    ¦   «         ¬
¦  «        } ||j         
                    ¦   «         ¦  «        }|r€|                     |d|
z  ¦  «        rŒ¶|                     |d|
z  d¦  «        }|                     |d|
z  |
¦  «        }|                     |d|
z  ¦  «        }|                     ||
||f¦  «         �Œ|sdS |                     ¦   «          d|j         
                    ¦   «         |                     ¦   «         fd|j         
                    ¦   «         |                     ¦   «         fd|j         
                    ¦   «         |                     ¦   «         fg}t!          |¦  «        5 }|\  }}}|D ]¨\  }}
}}t#          j        |¦  «        }|||dœ}t'          j        d||d„ ¦  «        }d||fz  }|                     || j        d¬¦  «        }|rt-          j        d|
|fz  ¦  «        ‚t'          j        |¦  «        }t'          j        |¦  «        }||k    r nŒ©|                     |¦  «         |                     t'          j        |¦  «        ¦  «         |                     |¦  «         ddd¦  «         dS # 1 swxY w Y   dS )zCRuns partial-resolution tools on the three inputs and updates them.ri   s   disable-partial-toolsNs   partial-merge-toolsr   r   s   %s.patternsTr#   )r1   s
   %s.disables   %s.orders   %s.executables   %s.argsr³   r2  r´   )r³   r2  r´   rJ  c                 óN   — t          j        t          j        | ¦  «        ¦  «        S r-   rL  rN  s    r!   rP  z/_run_partial_resolution_tools.<locals>.<lambda>”  s   € �(Ô-­d¬n¸QÑ.?Ô.?Ñ@Ô@€ r#   s   %s %ss   partial-mergetool)rR  rS  s)   partial merge tool %s exited with code %d)r   r%   r‹   rˆ   rŒ   r(   r   r‰   rG   rF   r8   Ú	configintr   r“   ÚsortrÙ   rY  r   r^   r   r[  r\  r	   Ú
StateErrorr§   Úset_text)r@   rÄ   rÅ   rÆ   r   rš   ÚseenÚsectionre   r›   r‰  ÚpatternsÚis_matchÚmÚorderÚ
executabler    ra  re  rM  rf  rg  r[   r¨   rh  Ú
local_textÚ
other_texts                              r!   r›  r›  _  s�  € à	Œ€BØ	‡}‚}�XÐ7Ñ8Ô8ð Øˆà€EÝ‰5Œ5€DØ$€GØ—’˜wÑ'Ô'ð :ñ :‰ˆˆ1Ø�wŠw�t‰}Œ}˜QÔˆØ�4ˆ<ˆ<ØØ—=’= ¨.¸4Ñ*?ÀÑDÔDˆØˆØð 	,Ý”Ø”	˜3 ¨e¬j×.BÒ.BÑ.DÔ.Dðñ ô ˆAð �q˜œŸšÑ*Ô*Ñ+Ô+ˆHØð 	:Ø�}Š}˜W m°dÑ&:Ñ;Ô;ð ØØ—L’L ¨+¸Ñ*<¸aÑ@Ô@ˆEØŸš 7Ð,<¸tÑ,CÀTÑJÔJˆJØ—9’9˜W j°4Ñ&7Ñ8Ô8ˆDØ�LŠL˜%  z°4Ð8Ñ9Ô9Ð9ùàð Øˆà	‡J‚J�L„L€Lð 
�5”:—?’?Ñ$Ô$ e§j¢j¡l¤lÐ3Ø	�$”)—.’.Ñ"Ô" D§I¢I¡K¤KÐ0Ø	�5”:—?’?Ñ$Ô$ e§j¢j¡l¤lÐ3ð€Eõ 
˜Ñ	Ô	ð # )Ø)2Ñ&ˆ	�8˜Yà-2ð 	ð 	Ñ)ˆE�4˜ TÝÔ% jÑ1Ô1ˆCà#Ø!Ø#ðð ˆGõ
 Ô#ØØØØ@Ð@ñ	ô ˆDð ˜c 4˜[Ñ(ˆCØ—	’	˜# 4¤9Ð9M�	ÑNÔNˆAØð ÝÔ&Ø@ÀDÈ!À9ÑLñô ð õ œ yÑ1Ô1ˆJÝœ yÑ1Ô1ˆJØ˜ZÒ'Ð'à�ð (ð 	�Š�zÑ"Ô"Ð"Ø�Š•d”m HÑ-Ô-Ñ.Ô.Ð.Ø�Š�zÑ"Ô"Ð"ð?#ð #ð #ñ #ô #ð #ð #ð #ð #ð #ð #ð #øøøð #ð #ð #ð #ð #ð #s   ÈDL%Ì%L)Ì,L)c                  óH   — t          d¦  «        } t          j        | ¦  «        ‚)Ns0   merge halted after failed merge (see hg resolve))r   r	   ÚInterventionRequired)rÜ   s    r!   Ú
_haltmerger»  ¨  s!   € Ý
Ð?Ñ
@Ô
@€CÝ
Ô
$ SÑ
)Ô
)Ð)r#   c                 óØ   — |                       dd¦  «        }|dk    r7t          d¦  «        }|                      |d¦  «        dk    rt          ¦   «          |dk    rt          ¦   «          d S d S )Nri   s
   on-failurer°   s,   continue merge operation (yn)?$$ &Yes $$ &Nor   r   s   halt)r   r   r»   r»  )r   ÚactionrÜ   s      r!   r�  r�  ­  sp   € Ø�YŠY�x Ñ/Ô/€FØ�ÒÐÝÐ?Ñ@Ô@ˆØ�?Š?˜3 Ñ"Ô" aÒ'Ð'Ý‰LŒLˆLØ�ÒÐÝ‰Œˆˆˆð Ðr#   c                 ó\   — t          t          j        d| t          j        ¦  «        ¦  «        S )Ns   ^([<>=+|-])\1{6}( .*)$)ÚboolÚreÚsearchÚ	MULTILINEr¤   s    r!   ÚhasconflictmarkersrÃ  ¸  s0   € õ
 Ý
Œ	Ø&ØÝŒLñ	
ô 	
ñô ð r#   c                 óº  — |                      ¦   «         }t          j        | ¦  «        }|sGt          ||d¦  «        sdt	          ||d¦  «        v r#t          |                     ¦   «         ¦  «        rd}d}dt	          ||d¦  «        v r3d}|                     t          d¦  «         ||¦  «        z  d¦  «        rd}|sn|slt          ||d	¦  «        sd
t	          ||d¦  «        v rH|�F| 	                    |¦  «        s1|                     t          d¦  «         ||¦  «        z  d¦  «        rd}|�/t          ||d¦  «        rt          t          | |¦  «        |¦  «         |S )Ns   checkconflictss	   conflictss   checkr   Fr°   Ts0   was merge of '%s' successful (yn)?$$ &Yes $$ &Nos   checkchangeds   changedsJ    output file %s appears unchanged
was merge successful (yn)?$$ &Yes $$ &Nos   fixeol)r8   r   r¶   r&   r)   rÃ  r>   r»   r   rH   r¯   r  )	r@   rh  r   r   r÷   r«   rÈ   rÉ   Úcheckeds	            r!   rœ  rœ  Æ  s¡  € Ø	�Š‰Œ€BÝÔ" 4Ñ(Ô(€Hàð Ý�"�dÐ-Ñ.Ô.ðà�9 R¨¨xÑ8Ô8Ð8Ð8å˜cŸhšh™jœjÑ)Ô)ð 	ØˆAà€GØ•I˜b $¨Ñ1Ô1Ð1Ð1ØˆØ�?Š?ÝÐAÑBÔBØˆh�r‰lŒlñàñ
ô 
ð 	ð
 ˆAð ðàðõ �b˜$ Ñ0Ô0ð	ð
 �Y r¨4°Ñ:Ô:Ð:Ð:ð Ð c§g¢g¨f¡o¤oÐØ�ŠÝð&ñô ð
 �(˜2‘,”,ñð ñô ð 	ð �àÐ�i¨¨D°)Ñ<Ô<ÐÝ•,˜t SÑ)Ô)¨6Ñ2Ô2Ð2à€Hr#   c                 óP   — |                       |                     ¦   «         ¦  «        S r-   )Úwjoinr8   )r@   r1   s     r!   r  r  õ  s   € Ø�:Š:�c—h’h‘j”jÑ!Ô!Ð!r#   c                 óÆ  — |j                              ¦   «         D ]™\  }}d|z   }|t          |<   |t          d|z   <   |t          |<   t	          d„ |j                             ¦   «         D ¦   «         ¦  «        }|r<dd                     |¦  «        z  }|j        t          j	        d|z  ¦  «        z   |_        Œšt          d¦  «         t          d¦  «         t          d	¦  «         d
S )z4Load internal merge tool from specified registrarobjr’  r‘  c                 ó   — g | ]	\  }}|¯|‘Œ
S r:   r:   )r„   re   r›   s      r!   r†   z%loadinternalmerge.<locals>.<listcomp>  s!   € ÐLÐLÐL¡T Q¨È!ÐL˜qÐLÐLÐLr#   s       (actual capabilities: %s)rá   s   

%ss*       (actual capabilities: binary, symlink)s!       (actual capabilities: binary)s"       (actual capabilities: symlink)N)Ú_tabler‘   rX   Úinternalsdocr�   rk   rì   rS   r   Úsysstrr   )r   ÚextnameÚregistrarobjr‰  r£  Úfullnamerk   Úcapdescs           r!   ÚloadinternalmergerÑ  ù  sü   € à"Ô)×/Ò/Ñ1Ô1ð Oð O‰
ˆˆdØ˜$‘;ˆØ"�	�(ÑØ)-�	�, Ñ%Ñ&Ø!%��XÑåÐLÐL¨TÔ->×-DÒ-DÑ-FÔ-FÐLÑLÔLÑMÔMˆØð 	OØ6¸¿ºØñ:ô :ñ ˆGð  œ<­(¬/¸)ÀgÑ:MÑ*NÔ*NÑNˆDŒLøõ Ð3Ñ4Ô4Ð4õ Ð*Ñ+Ô+Ð+õ Ð+Ñ,Ô,Ð,Ð,Ð,r#   r-   )TÚ
contextlibrW  rÀ  r�  Úi18nr   rZ  r   r   r   r   r  r   r	   r
   r   r   r   r   r   r   r   r   r   Úutilsr   r   r"   r&   r)   rX   rË  ÚinternalmergeÚinternaltoolrr   Ú	mergeonlyr™  r¼   r½   r+   r\   r_   rZ   rŸ   r¥   r¯   rÍ   r¿   r¾   rÀ   rÑ   rÝ   rõ   rú   rü   r  r  r  r  r  r  r  r  r#  r%  r'  rD  rn  rt  rw  r¹   r‚  ÚcontextmanagerrY  r©  r›  r»  r�  rÃ  rœ  r  rÑ  ÚvaluesÚi18nfunctionsr:   r#   r!   ú<module>rÛ     s  ðð Ð Ð Ð Ø 	€	€	€	Ø 	€	€	€	Ø €€€à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð@ð @ð @ðDð Dð Dð=ð =ð =ð €	à€à&ˆyÔ&Ñ(Ô(€ð Ô
€ØÔ"€	ØÔ"€	ð  !˜qð-ñ ô  Ð ð  !˜qð.ñ ô  Ð ð1ð 1ð 1ð 1ð 1ñ 1ô 1ð 1ðh&ð &ð &ð$ð $ð $ð2ð 2ð 2ðnð nð nðb
ð 
ð 
ð	.ð 	.ð 	.ð €ˆi˜Ñ!Ô!ð0Bð 0Bñ "Ô!ð0Bðf €ˆh˜Ñ Ô ð$ð $ñ !Ô ð$ð
 €ˆh˜Ñ Ô ðð ñ !Ô ðð €ˆg�wÑÔð
ð 
ñ  Ôð
ðð ð ðð ð ð)ð )ð )ðXð ð ð*&ð &ð &ð0 €ØØØ€Að	2ñô ð ðñ ô ð6ð 6ñô ð6ð €ØØØ€Að	2ñô ð ðñ ô ð6ð 6ñô ð6ð €ØØØ€Að	2ñô ð ðñ ô ð7ð 7ñô ð7ð €Ø!ØØØð	ñ ô ð
ð 
ñô ð
ð €ØØØ€Að	2ñô ð ðñ ô ð:ð :ñô ð:ð €ˆn˜i°+Ð>Ñ>Ô>ð6ð 6ñ ?Ô>ð6ð €ˆn˜i°+Ð>Ñ>Ô>ð6ð 6ñ ?Ô>ð6ð €ØØØ€Að	"ñô ñô ð"ð "ñô ð"ð €ˆg�y¨°tÐ<Ñ<Ô<ðð ñ =Ô<ðð8 €ˆl˜I¨d¸DÐAÑAÔAðFð Fñ BÔAðFðð ð ð3&ð 3&ð 3&ðlnð nð nðb>ð >ð >ð,ð ,ð ,ð ,ð ð ð ð"7ð 7ð 7ð< Ôðð ñ Ôðð0nð nð nð nðbF#ð F#ð F#ðR*ð *ð *ð
ð ð ðð ð ð,ð ,ð ,ð^"ð "ð "ð-ð -ð -ð: Ð �$˜˜lÑ +Ô +Ð +ð × Ò Ñ"Ô"€€€r#   