§
    cÌc,-  ã                   ó  — d dl Z d dlZd dlZddlmZ  e e¦   «         d¦  «         ddlmZmZmZm	Z	m
Z
mZ  G d„ dej        ¦  «        Z e
j        eef         ¦   «         Ze                     ddd	¦  «         e                     d
d
d¦  «         e                     ddd¦  «         e                     ddd¦  «         d
e_         G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z	 	 dd„Zd„ Z G d„ d¦  «        Z G d„ d¦  «        ZdS )é    Né   )Úlazy_importzX

from breezy import (
    workingtree,
    )
from breezy.i18n import gettext, ngettext
)ÚerrorsÚcommandsÚoptionÚosutilsÚregistryÚtracec                   óJ   — e Zd ZdZd ej        dd¬¦  «        gZddgZdd
„ZdS )Úcmd_conflictsa>  List files with conflicts.

    Merge will do its best to combine the changes in two branches, but there
    are some kinds of problems only a human can fix.  When it encounters those,
    it will mark a conflict.  A conflict means that you need to fix something,
    before you can commit.

    Conflicts normally are listed as short, human-readable messages.  If --text
    is supplied, the pathnames of files with text conflicts are listed,
    instead.  (This is useful for editing all files with text conflicts.)

    Use brz resolve when you have fixed a problem.
    Ú	directoryÚtextz(List paths of files with text conflicts.©ÚhelpÚresolvezconflict-typesFú.c                 ó4  — t           j                             |¦  «        d         }|                     ¦   «         D ]]}|r/|j        dk    rŒ| j                             |j        dz   ¦  «         Œ3| j                             t          |¦  «        dz   ¦  «         Œ^d S )Nr   ztext conflictú
)	ÚworkingtreeÚWorkingTreeÚopen_containingÚ	conflictsÚ
typestringÚoutfÚwriteÚpathÚstr)Úselfr   r   ÚwtÚconflicts        ú2/usr/lib/python3/dist-packages/breezy/conflicts.pyÚrunzcmd_conflicts.run?   s—   € ÝÔ$×4Ò4°YÑ?Ô?ÀÔBˆØŸš™œð 	6ð 	6ˆHØð 6ØÔ&¨/Ò9Ð9ØØ”	—’ ¤°Ñ 4Ñ5Ô5Ð5Ð5à”	—’¥ H¡¤°Ñ 4Ñ5Ô5Ð5Ð5ð	6ð 	6ó    N)Fr   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚOptionÚtakes_optionsÚ	_see_alsor"   © r#   r!   r   r   *   sf   € € € € € ð€Gð 	ØˆŒ�fØEð	Gñ 	Gô 	Gð
€Mð
 Ð,Ð-€Ið6ð 6ð 6ð 6ð 6ð 6r#   r   Úautoz2Detect whether conflict has been resolved by user.ÚdonezMarks the conflict as resolved.z	take-thisÚ	take_thisz@Resolve the conflict preserving the version in the working tree.z
take-otherÚ
take_otherz<Resolve the conflict taking the merged version into account.c                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )ÚResolveActionOptionc                 ó\   •— t          ¦   «                              dddt          ¬¦  «         d S )NÚactionzHow to resolve the conflict.T)Úvalue_switchesr	   )ÚsuperÚ__init__Úresolve_action_registry)r   Ú	__class__s    €r!   r6   zResolveActionOption.__init__\   s:   ø€ Ý‰Œ×ÒØÐ4ØÝ,ð 	ñ 	.ô 	.ð 	.ð 	.ð 	.r#   )r$   r%   r&   r6   Ú__classcell__)r8   s   @r!   r1   r1   Z   s8   ø€ € € € € ð.ð .ð .ð .ð .ð .ð .ð .ð .r#   r1   c                   óf   — e Zd ZdZdgZdgZd ej        dd¬¦  «         e¦   «         gZ	dgZ
dd„Zd	S )Úcmd_resolvea  Mark a conflict as resolved.

    Merge will do its best to combine the changes in two branches, but there
    are some kinds of problems only a human can fix.  When it encounters those,
    it will mark a conflict.  A conflict means that you need to fix something,
    before you can commit.

    Once you have fixed a problem, use "brz resolve" to automatically mark
    text conflicts as fixed, "brz resolve FILE" to mark a specific conflict as
    resolved, or "brz resolve --all" to mark all conflicts as resolved.
    Úresolvedzfile*r   Úallz#Resolve all conflicts in this tree.r   r   NFc                 ó  — |rQ|r!t          j        t          d¦  «        ¦  «        ‚|€d}t          j                             |¦  «        d         }|€d}n,t          j                             ||¦  «        \  }}|€|€d}nd}t          |||¬¦  «        \  }}|dk    r°|€®|dk    r…t          j	        t          dd||z
  ¦  «        ||z
  ¦  «         t          j	        t          d	¦  «        ¦  «         |                     ¦   «         D ]#}t          j	        t          |¦  «        ¦  «         Œ$d
S t          j	        t          d¦  «        ¦  «         dS t          j	        t          dd||z
  ¦  «                             ||z
  |¦  «        ¦  «         d S )Nz.If --all is specified, no FILE may be providedr   r   r-   r,   )r3   z%d conflict auto-resolved.z%d conflicts auto-resolved.zRemaining conflicts:r   zAll conflicts resolved.z${0} conflict resolved, {1} remainingz%{0} conflicts resolved, {1} remaining)r   ÚCommandErrorÚgettextr   r   r   Úopen_containing_pathsr   r
   ÚnoteÚngettextr   r   Úformat)	r   Ú	file_listr=   r3   r   ÚtreeÚbeforeÚafterr    s	            r!   r"   zcmd_resolve.runx   sÎ  € Øð 	$Øð OÝÔ)­'ð 3Mñ +Nô +Nñ Oô Oð OàÐ Ø�	ÝÔ*×:Ò:¸9ÑEÔEÀaÔHˆDØˆ~Ø�øå)Ô5×KÒKØ˜9ñ&ô &‰OˆD�)àˆ~ØÐ$Ø#�F�Fà#�FÝ  i¸Ð?Ñ?Ô?‰ˆ�à�VÒÐ 	Ð 1Ø�qŠyˆyÝ”
ÝÐ9Ø:¸FÀU¹NñLô Là˜U‘Nñ$ô $ð $õ ”
�7Ð#9Ñ:Ô:Ñ;Ô;Ð;Ø $§¢Ñ 0Ô 0ð .ð .�HÝ”J�s 8™}œ}Ñ-Ô-Ð-Ð-Ø�qå”
�7Ð#<Ñ=Ô=Ñ>Ô>Ð>Ø�qåŒJ•xÐ FØ GØ &¨¡ñ0ô 0ç06²°vÀ±~ÀuÑ0MÔ0MñOô Oð Oð Oð Or#   )NFNN)r$   r%   r&   r'   ÚaliasesÚ
takes_argsr   r(   r1   r)   r*   r"   r+   r#   r!   r;   r;   c   sy   € € € € € ð
€Gð ˆl€GØ�€JàØˆŒ�eÐ"GÐHÑHÔHØÐÑÔð
€Mð
 �€Ið$Oð $Oð $Oð $Oð $Oð $Or#   r;   Fc                 ó  — d}|                       ¦   «         5  |                      ¦   «         }t          |¦  «        }|€g }|}	n|                     | |||¦  «        \  }}	|	D ]S}
	 |
                     || ¦  «         |
                     | ¦  «         Œ/# t          $ r |                     |
¦  «         Y ŒPw xY w	 t          |¦  «        }|                      |¦  «         n# t          j
        $ r Y nw xY wddd¦  «         n# 1 swxY w Y   |€|}||fS )aœ  Resolve some or all of the conflicts in a working tree.

    :param paths: If None, resolve all conflicts.  Otherwise, select only
        specified conflicts.
    :param recursive: If True, then elements of paths which are directories
        have all their children resolved, etc.  When invoked as part of
        recursive commands like revert, this should be True.  For commands
        or applications wishing finer-grained control, like the resolve
        command, this should be False.
    :param ignore_misses: If False, warnings will be printed if the supplied
        paths do not have conflicts.
    :param action: How the conflict should be resolved,
    N)Úlock_tree_writer   ÚlenÚselect_conflictsÚdoÚcleanupÚNotImplementedErrorÚappendÚset_conflictsr   ÚUnsupportedOperation)rF   ÚpathsÚignore_missesÚ	recursiver3   Únb_conflicts_afterÚtree_conflictsÚnb_conflicts_beforeÚnew_conflictsÚ
to_processr    s              r!   r   r   Ÿ   s�  € ð ÐØ	×	Ò	Ñ	Ô	ð ð ØŸšÑ)Ô)ˆÝ! .Ñ1Ô1ÐØˆ=ØˆMØ'ˆJˆJà(6×(GÒ(GØ�e˜]¨Iñ)7ô )7Ñ%ˆM˜:à"ð 	/ð 	/ˆHð/Ø—’˜F DÑ)Ô)Ð)Ø× Ò  Ñ&Ô&Ð&Ð&øÝ&ð /ð /ð /Ø×$Ò$ XÑ.Ô.Ð.Ð.Ð.ð/øøøð	Ý!$ ]Ñ!3Ô!3ÐØ×Ò˜}Ñ-Ô-Ð-Ð-øÝÔ*ð 	ð 	ð 	ØˆDð	øøøð%ð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð( Ð!Ø0ÐØÐ 2Ð2Ð2sZ   —A
C:Á"+BÂC:ÂB0Â-C:Â/B0Â0C:Â4$CÃC:ÃC+Ã(C:Ã*C+Ã+C:Ã:C>ÄC>c                 óè  — d}	 t          j        | dz   | ¦  «         d}n-# t          $ r }|j        t          j        k    r‚ Y d}~nd}~ww xY w	 t          j        | dz   ¦  «         d}n-# t          $ r }|j        t          j        k    r‚ Y d}~nd}~ww xY w	 t          j        | dz   ¦  «         d}n-# t          $ r }|j        t          j        k    r‚ Y d}~nd}~ww xY w|st          j        | ¦  «        ‚dS )zyRestore a conflicted file to the state it was in before merging.

    Only text restoration is supported at present.
    Fz.THISTNz.BASEz.OTHER)	r   ÚrenameÚOSErrorÚerrnoÚENOENTÚosÚunlinkr   ÚNotConflicted)ÚfilenameÚ
conflictedÚes      r!   Úrestorerh   È   sY  € ð
 €JðÝŒ�x 'Ñ)¨8Ñ4Ô4Ð4Øˆ
ˆ
øÝð ð ð ØŒ7•e”lÒ"Ð"Øð #Ð"Ð"Ð"Ð"øøøøðøøøðÝ
Œ	�(˜WÑ$Ñ%Ô%Ð%Øˆ
ˆ
øÝð ð ð ØŒ7•e”lÒ"Ð"Øð #Ð"Ð"Ð"Ð"øøøøðøøøðÝ
Œ	�(˜XÑ%Ñ&Ô&Ð&Øˆ
ˆ
øÝð ð ð ØŒ7•e”lÒ"Ð"Øð #Ð"Ð"Ð"Ð"øøøøðøøøð ð -ÝÔ" 8Ñ,Ô,Ð,ð-ð -sD   „ Ÿ
A	©AÁA	ÁA' Á'
BÁ1BÂBÂB/ Â/
CÂ9CÃCc                   ób   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Z	 	 dd„ZdS )ÚConflictListzLList of conflicts.

    Typically obtained from WorkingTree.conflicts()
    Nc                 ó^   — t                                | ¦  «         |€	g | _        d S || _        d S ©N)Úobjectr6   Ú_ConflictList__list)r   r   s     r!   r6   zConflictList.__init__ê   s0   € Ý�Š˜ÑÔÐØÐØˆDŒKˆKˆKà#ˆDŒKˆKˆKr#   c                 ó2   — t          | j        ¦  «        dk    S )Nr   ©rM   rn   ©r   s    r!   Úis_emptyzConflictList.is_emptyñ   s   € Ý�4”;ÑÔ 1Ò$Ð$r#   c                 ó*   — t          | j        ¦  «        S rl   rp   rq   s    r!   Ú__len__zConflictList.__len__ô   s   € Ý�4”;ÑÔÐr#   c                 ó*   — t          | j        ¦  «        S rl   )Úiterrn   rq   s    r!   Ú__iter__zConflictList.__iter__÷   s   € Ý�D”KÑ Ô Ð r#   c                 ó   — | j         |         S rl   ©rn   )r   Úkeys     r!   Ú__getitem__zConflictList.__getitem__ú   s   € ØŒ{˜3ÔÐr#   c                 ó6   — | j                              |¦  «        S rl   )rn   rR   ©r   r    s     r!   rR   zConflictList.appendý   s   € ØŒ{×!Ò! (Ñ+Ô+Ð+r#   c                 óB   — t          | ¦  «        t          |¦  «        k    S rl   )Úlist©r   Ú
other_lists     r!   Ú__eq__zConflictList.__eq__   s   € Ý�D‰zŒz�T *Ñ-Ô-Ò-Ð-r#   c                 ó   — | |k     S rl   r+   r€   s     r!   Ú__ne__zConflictList.__ne__  s   € Ø˜JÒ&Ð'Ð'r#   c                 ó   — d| j         z  S )NzConflictList(%r)ry   rq   s    r!   Ú__repr__zConflictList.__repr__  s   € Ø! D¤KÑ/Ð/r#   c              #   ó6   K  — | D ]}t          |¦  «        V — ŒdS )z+Generate strings for the provided conflictsN)r   r}   s     r!   Ú
to_stringszConflictList.to_strings	  s4   è è € àð 	 ð 	 ˆHÝ�h‘-”-ÐÐÐÐð	 ð 	 r#   c                 óJ   — | D ]}|j         sŒ
|                     |¦  «         Œ dS )z:Remove the THIS, BASE and OTHER files for listed conflictsN)Ú	has_filesrP   )r   rF   r    s      r!   Úremove_fileszConflictList.remove_files  s@   € àð 	#ð 	#ˆHØÔ%ð ØØ×Ò˜TÑ"Ô"Ð"Ð"ð	#ð 	#r#   Fc                 óx  ‡— t          |¦  «        }t          ¦   «         Št          ¦   «         }t          ¦   «         }| D ]Ž}d}	|j        |v rd}	‰                     |j        ¦  «         |r6t	          j        ||j        ¦  «        rd}	‰                     |j        ¦  «         |	r|                     |¦  «         Œy|                     |¦  «         Œ�|durhˆfd„|D ¦   «         D ]Y}
t          j                             | 	                    |
¦  «        ¦  «        st          d|
z  ¦  «         ŒGt          d|
z  ¦  «         ŒZ||fS )z‚Select the conflicts associated with paths in a tree.

        :return: a pair of ConflictLists: (not_selected, selected)
        FTc                 ó   •— g | ]}|‰v¯|‘Œ	S r+   r+   )Ú.0ÚpÚselected_pathss     €r!   ú
<listcomp>z1ConflictList.select_conflicts.<locals>.<listcomp>/  s#   ø€ ÐEÐEÐE˜q¨Q°nÐ-DÐ-D˜Ð-DÐ-DÐ-Dr#   z%s does not existz%s is not conflicted)Úsetrj   r   Úaddr   Úis_inside_anyrR   rb   ÚexistsÚabspathÚprint)r   rF   rU   rV   ÚrecurseÚpath_setr[   Úselected_conflictsr    Úselectedr   r�   s              @r!   rN   zConflictList.select_conflicts  sb  ø€ õ �u‘:”:ˆÝ™œˆÝ$™œˆÝ)™^œ^Ðàð 	/ð 	/ˆHØˆHØŒ} Ð(Ð(Ø�Ø×"Ò" 8¤=Ñ1Ô1Ð1Øð 6ÝÔ(¨°8´=ÑAÔAð 6Ø#�HØ"×&Ò& x¤}Ñ5Ô5Ð5àð /Ø"×)Ò)¨(Ñ3Ô3Ð3Ð3à×$Ò$ XÑ.Ô.Ð.Ð.Ø Ð$Ð$ØEÐEÐEÐE EÐEÑEÔEð 9ð 9�Ý”w—~’~ d§l¢l°4Ñ&8Ô&8Ñ9Ô9ð 9ÝÐ-°Ñ4Ñ5Ô5Ð5Ð5åÐ0°4Ñ7Ñ8Ô8Ð8Ð8ØÐ0Ð0Ð0r#   rl   )FF)r$   r%   r&   r'   r6   rr   rt   rw   r{   rR   r‚   r„   r†   rˆ   r‹   rN   r+   r#   r!   rj   rj   ä   så   € € € € € ðð ð
$ð $ð $ð $ð%ð %ð %ð ð  ð  ð!ð !ð !ð ð  ð  ð,ð ,ð ,ð.ð .ð .ð(ð (ð (ð0ð 0ð 0ð ð  ð  ð
#ð #ð #ð ;@Ø!&ð1ð 1ð 1ð 1ð 1ð 1r#   rj   c                   ó<   — e Zd ZU dZeed<   d„ Zd„ Zd„ Zd„ Z	d„ Z
dS )	ÚConflictzBase class for conflicts.r   c                 ó   — || _         d S rl   )r   )r   r   s     r!   r6   zConflict.__init__<  s   € ØˆŒ	ˆ	ˆ	r#   c                 ó*   — t          | j        ¦  «        ‚)z>The names of the files generated to help resolve the conflict.)rQ   Úassociated_filenamesrq   s    r!   r    zConflict.associated_filenames?  s   € å! $Ô";Ñ<Ô<Ð<r#   c                 óÞ   — |                       ¦   «         D ]W}	 t          j        |                     |¦  «        ¦  «         Œ+# t          $ r }|j        t
          j        k    r‚ Y d }~ŒPd }~ww xY wd S rl   )r    r   Ú
delete_anyr–   r_   r`   ra   )r   rF   Úfnamerg   s       r!   rP   zConflict.cleanupC  sŽ   € Ø×.Ò.Ñ0Ô0ð 	ð 	ˆEðÝÔ" 4§<¢<°Ñ#6Ô#6Ñ7Ô7Ð7Ð7øÝð ð ð Ø”7�eœlÒ*Ð*Øð +Ð*Ð*Ð*Ð*øøøøðøøøð	ð 	s   ˜'A Á 
A*Á
A%Á%A*c                 ó*   — t          | j        ¦  «        ‚)z©Apply the specified action to the conflict.

        :param action: The method name to call.

        :param tree: The tree passed as a parameter to the method.
        )rQ   rO   )r   r3   rF   s      r!   rO   zConflict.doK  s   € õ " $¤'Ñ*Ô*Ð*r#   c                 ó*   — t          | j        ¦  «        ‚)z-Return a string description of this conflict.)rQ   Údescriberq   s    r!   r¦   zConflict.describeT  s   € å! $¤-Ñ0Ô0Ð0r#   N)r$   r%   r&   r'   r   Ú__annotations__r6   r    rP   rO   r¦   r+   r#   r!   r�   r�   7  sp   € € € € € € Ø#Ð#à€O€O�Oðð ð ð=ð =ð =ðð ð ð+ð +ð +ð1ð 1ð 1ð 1ð 1r#   r�   )NFFr-   )r`   rb   Úrer   ÚglobalsÚ r   r   r   r   r	   r
   ÚCommandr   ÚRegistryr   r7   ÚregisterÚdefault_keyÚRegistryOptionr1   r;   r   rh   rj   r�   r+   r#   r!   ú<module>r°      sz  ðð( €€€Ø 	€	€	€	Ø 	€	€	€	à $Ð $Ð $Ð $Ð $Ð $Ø €ˆGˆG‰IŒIð ñ ô ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð6ð 6ð 6ð 6ð 6�HÔ$ñ 6ô 6ð 6ð@ 6˜(Ô+¨C°¨HÔ5Ñ7Ô7Ð ð ×  Ò  Ø
ˆFÐHñJô Jð Jà ×  Ò  Ø
ˆFÐ5ñ7ô 7ð 7à ×  Ò  Ø�ØFñHô Hð Hð ×  Ò  Ø�,ØBñDô Dð Dð '-Ð Ô #ð.ð .ð .ð .ð .˜&Ô/ñ .ô .ð .ð9Oð 9Oð 9Oð 9Oð 9O�(Ô"ñ 9Oô 9Oð 9Oðx >CØð&3ð &3ð &3ð &3ðR-ð -ð -ð8P1ð P1ð P1ð P1ð P1ñ P1ô P1ð P1ðf1ð 1ð 1ð 1ð 1ñ 1ô 1ð 1ð 1ð 1r#   