§
    	^µcl·  ã                   óX  — d dl Z d dlZddlmZ ddlmZ ddlmZm	Z	m
Z
mZ ddlmZ ddlmZmZ  e
j        d¦  «        Zd	„ Zd
„ Zd„ Zd(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„ Z#d„ Z$d„ Z%d„ Z&d)d„Z'd„ Z(d„ Z)d(d„Z*d„ Z+d„ Z,d „ Z- G d!„ d"¦  «        Z.d#„ Z/d$„ Z0d%„ Z1d&„ Z2d'„ Z3dS )*é    Né   )Ú_)Únullrev)ÚmatchÚpathutilÚpolicyÚutil)Ú
stringutil)ÚflagutilÚsidedataÚcopy_tracingc                 ó†   — t          |                     ¦   «         ¦  «        D ]\  }}||k    r||= Œ|| vr||= Œ||vr||= ŒdS )z)filters out invalid copies after chainingN)ÚlistÚitems)ÚsrcÚdstÚtÚkÚvs        ú2/usr/lib/python3/dist-packages/mercurial/copies.pyÚ_filterr   "   sd   € õ, �Q—W’W‘Y”Y‘”ð ð ‰ˆˆ1Ø�Š6ˆ6Ø�!��Ø�cˆ\ˆ\à�!��Ø�cˆ\ˆ\à�!�øðð ó    c                 ó”   — |                       ¦   «         }|                     ¦   «         D ]\  }}|                      ||¦  «        ||<   Œ|S )z.chain two sets of copies 'prefix' and 'suffix')Úcopyr   Úget)ÚprefixÚsuffixÚresultÚkeyÚvalues        r   Ú_chainr!   C   sH   € à�[Š[‰]Œ]€FØ—l’l‘n”nð /ð /‰
ˆˆUØ—j’j ¨Ñ.Ô.ˆˆs‰ˆØ€Mr   c                 ó   — |                       ¦   «         D ]x}|                     ¦   «         }|                     |d¦  «        |                     ¦   «         k    r|c S |r0|                     |d¦  «        |                     ¦   «         k    r|c S ŒydS )a	  return file context that is the ancestor of fctx present in ancestor
    manifest am

    Note: we used to try and stop after a given limit, however checking if that
    limit is reached turned out to be very expensive. we are better off
    disabling that feature.N)Ú	ancestorsÚpathr   Úfilenode)ÚfctxÚamÚbasemfÚfr$   s        r   Ú
_tracefiler*   K   s�   € ð �^Š^ÑÔð ð ˆØ�vŠv‰xŒxˆØ�6Š6�$˜ÑÔ §¢¡¤Ò-Ð-ØˆKˆKˆKØð 	�f—j’j  tÑ,Ô,°·
²
±´Ò<Ð<ØˆKˆKˆKøðð r   c                 óØ   — | j         }|                     ¦   «                              ¦   «         }t          |¦  «        D ],}|                     |¦  «        j        r|r ||¦  «        s||= Œ-|S ©N)ÚdirstateÚcopiesr   r   Ú	get_entryÚtracked)Úrepor   ÚdsÚcr   s        r   Ú_dirstatecopiesr4   [   so   € Ø	Œ€BØ
�	Š	‰Œ×ÒÑÔ€AÝ�!‰WŒWð ð ˆØ�|Š|˜A‰ŒÔ&ð 	¨5ð 	¸¸¸q¹¼ð 	Ø�!�øØ€Hr   c                 ó€   — |                       ¦   «         }|                      ¦   «         }|                     ||¬¦  «        S )z¬Computes which files are in b but not a.
    This is its own function so extensions can easily wrap this call to see what
    files _forwardcopies is about to process.
    ©r   )ÚmanifestÚ
filesnotin)ÚaÚbr   ÚmaÚmbs        r   Ú_computeforwardmissingr=   d   s4   € ð
 
�Š‰Œ€BØ	
�Š‰Œ€BØ�=Š=˜ 5ˆ=Ñ)Ô)Ð)r   c                 ó^   — | j         dk    rdS | j                             dd¦  «        }d}||v S )z9Checks if we should use changeset-centric copy algorithmsó   changeset-sidedataTó   experimentals   copies.read-from)s   changeset-onlys   compatibility)ÚfilecopiesmodeÚuiÚconfig)r1   ÚreadfromÚchangesetsources      r   ÚusechangesetcentricalgorF   n   s<   € àÔÐ3Ò3Ð3ØˆtØŒw�~Š~˜oÐ/BÑCÔC€HØ;€OØ�Ð&Ð&r   c                 óâ  — | j         }t          |¦  «        rt          | ||¦  «        S |j        j        o|j                             dd¦  «        }|j        j        }|r |d| |fz  ¦  «         |                      ¦   «         }|€dn|                     ¦   «         }i }	|}
|                     ¦   «         | k    rj| 	                    ¦   «          
                    ¦   «         t          k    r;t          j        |                     ¦   «         ¦  «        }t          j        ||¦  «        }
|j                             dd¦  «        r@t!          |                     |¦  «        ¦  «        }|r |dt%          |¦  «        z  ¦  «         n/t'          | ||
¬¦  «        }|r |dt%          |¦  «        z  ¦  «         | j         j                             | 
                    ¦   «         gd	¬
¦  «        }t-          |¦  «        D ]‚}|r |d|z  ¦  «         ||         }||_        |rt1          j        ¦   «         }t5          |||¦  «        }|r|r |d|z  ¦  «         ||	|<   |r" |dt1          j        ¦   «         |z
  z  ¦  «         Œƒ|	S )z@Like _forwardcopies(), but b.rev() cannot be None (working copy)ó   develó   debug.copiess3   debug.copies:    looking into rename from %s to %s
Ns   copy-tracing.trace-all-filess+   debug.copies:      searching all files: %d
r6   s/   debug.copies:      missing files to search: %d
T©Ú	inclusives&   debug.copies:        tracing file: %s
s%   debug.copies:          rename of: %s
s(   debug.copies:          time: %f seconds
)Ú_reporF   Ú_changesetforwardcopiesrB   Ú	debugflagÚ
configboolÚdebugr7   Úp1Úp2Úrevr   ÚmatchmodÚexactÚfilesÚintersectmatchersr   ÚwalkÚlenr=   Ú	changelogr#   ÚsortedÚ_ancestrycontextr	   Útimerr*   )r9   r:   Úbaser   r1   rP   Údbgr'   r(   ÚcmÚforwardmissingmatchÚfilesmatcherÚmissingÚancestrycontextr)   r&   ÚstartÚopaths                     r   Ú_committedforwardcopiesrg   w   s–  € ð Œ7€Då˜tÑ$Ô$ð 4Ý& q¨!¨UÑ3Ô3Ð3àŒGÔÐO $¤'×"4Ò"4°X¸Ñ"OÔ"O€EØ
Œ'Œ-€CØð NØˆÐCÀqÈ!ÀfÑLÑMÔMÐMØ	
�Š‰Œ€BØ�\ˆTˆT t§}¢}¡¤€Fð
 
€Bð  ÐØ‡t‚t�v„v�‚{€{�q—t’t‘v”v—z’z‘|”|¥wÒ.Ð.Ý”~ a§g¢g¡i¤iÑ0Ô0ˆÝ&Ô8¸ÀÑMÔMÐØ„w×Ò˜(Ð$CÑDÔDð Ý�q—v’v˜e‘}”}Ñ%Ô%ˆàð 	PØˆCÐ?Å#ÀgÁ,Ä,ÑNÑOÔOÐOøå(¨¨AÐ5HÐIÑIÔIˆØð 	ØˆCØCÝ�g‘,”,ññô ð ð
 ”gÔ'×1Ò1°1·5²5±7´7°)ÀtÐ1ÑLÔL€Oå�G‰_Œ_ð ð ˆØð 	@ØˆCÐ:¸QÑ>Ñ?Ô?Ð?Ø�ŒtˆØ /ˆÔàð 	!Ý”J‘L”LˆEÝ˜4  VÑ,Ô,ˆØð 	Øð GØ�Ð=ÀÑEÑFÔFÐFØˆBˆq‰EØð 	ØˆCØ<Ý”:‘<”< %Ñ'ñ)ñô ð øð €Ir   c                 óŽ   ‡‡‡‡— | j         }|j        Š|j        Št          j        Š|j        Št          �	ˆˆˆˆfd„}nˆˆˆˆfd„}|S )zÁreturns a function that returns the following data given a <rev>"

    * p1: revision number of first parent
    * p2: revision number of first parent
    * changes: a ChangingFiles object
    Nc                 ó¦   •—  ‰| ¦  «        \  }} ‰| ¦  «        ‰z  r. ‰| ¦  «        j                              t          j        ¦  «        }nd }|||fS r,   )Ú	_sidedatar   ÚsidedatamodÚSD_FILES)rS   rQ   rR   ÚrawÚHASCOPIESINFOÚchangelogrevisionÚflagsÚparentss       €€€€r   Úrevinfoz _revinfo_getter.<locals>.revinfoË   s`   ø€ Ø�W˜S‘\”\‰FˆB�Øˆu�S‰zŒz˜MÑ)ð Ø'Ð'¨Ñ,Ô,Ô6×:Ò:½;Ô;OÑPÔP��à�Ø˜˜C�=Ð r   c                 ól   •—  ‰| ¦  «        \  }} ‰| ¦  «        ‰z  r ‰| ¦  «        j         }nd }|||fS r,   )Úchanges)rS   rQ   rR   rt   rn   ro   rp   rq   s       €€€€r   rr   z _revinfo_getter.<locals>.revinfoÕ   sP   ø€ Ø�W˜S‘\”\‰FˆB�Øˆu�S‰zŒz˜MÑ)ð Ø+Ð+¨CÑ0Ô0Ô8��à�Ø˜˜GÐ$Ð$r   )rZ   Ú
parentrevsrp   r   ÚREVIDX_HASCOPIESINFOro   Úrustmod)r1   r   Úclrr   rn   ro   rp   rq   s       @@@@r   Ú_revinfo_getterry   º   s�   øøøø€ ð 
Œ€BØŒm€GØŒH€EåÔ1€MàÔ,ÐåÐð	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð 	!ð	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð 	%ð €Nr   c                 ó   ‡ ‡— i Šˆˆ fd„}|S )z&return a cached version of is_ancestorc                 ó€   •— | |k    rdS | |k    rdS | |f}‰                      |¦  «        }|€ ‰| |¦  «        x}‰|<   |S )NFT)r   )ÚancÚdescr   ÚretÚcacheÚis_ancestors       €€r   Ú_is_ancestorz(cached_is_ancestor.<locals>._is_ancestorä   s[   ø€ Ø�Š:ˆ:Ø�5Ø�DŠ[ˆ[Ø�4Ø�DˆkˆØ�iŠi˜‰nŒnˆØˆ;Ø*˜{¨3°Ñ5Ô5Ð5ˆC�%˜‘*Øˆ
r   © )r€   r�   r   s   ` @r   Úcached_is_ancestorrƒ   à   s/   øø€ à€Eð	ð 	ð 	ð 	ð 	ð 	ð Ðr   c           
      óJ  ‡— |                       ¦   «         t          |                      ¦   «         fv ri S |                      ¦   «                              ¦   «         }|j        }|j        }|j        }t          t          f}|                     |                       ¦   «         gd¬¦  «        }|                     |                       ¦   «         g|                      ¦   «         g¬¦  «        }	t          ¦   «         }
d}|j
                             dd¦  «        }|	D ]c} ||¦  «        }||k    rd}Œ|\  }}|t          k    r||v r|
                     |¦  «         |t          k    r||v r|
                     |¦  «         Œd|
si S |rit          |
¦  «        }
t          |
¦  «        }|                      ¦   «         g}|                     |||
d¬¦  «        Št          ‰¦  «        Šˆfd„|	D ¦   «         }	|j        d	k    rÅt#          d
„ |
D ¦   «         ¦  «        }|	D ]?}|                     |¦  «        D ]'}|t          k    rŒd||<   ||v r||xx         dz  cc<   Œ(Œ@t'          ||¦  «        }|j                             ¦   «         5  t+          |	||                      ¦   «         ||||¦  «        cd d d ¦  «         S # 1 swxY w Y   d S t#          d„ |
D ¦   «         ¦  «        }|	D ]J}|                     |¦  «        D ]2}|t          k    rŒg ||<   ||v r||                              |¦  «         Œ3ŒK|	                     ¦   «         }||                      ¦   «         k    sJ ‚|	                     |
¦  «         |	                     ¦   «          t5          |¦  «        }t7          |	||                      ¦   «         |||¦  «        S )NTrJ   )ÚcommonÚheadsFrH   s   copy-tracing.multi-thread)Úincludepathc                 ó   •— g | ]}|‰v ¯|‘Œ	S r‚   r‚   )Ú.0ÚrÚroots_to_heads     €r   ú
<listcomp>z+_changesetforwardcopies.<locals>.<listcomp>)  s#   ø€ Ð6Ð6Ð6�a 1¨Ð#5Ð#5�Ð#5Ð#5Ð#5r   r?   c              3   ó   K  — | ]}|d fV — Œ	dS )r   Nr‚   ©r‰   rŠ   s     r   ú	<genexpr>z*_changesetforwardcopies.<locals>.<genexpr>5  s&   è è € Ð4Ð4¨˜q !˜fÐ4Ð4Ð4Ð4Ð4Ð4r   r   r   c              3   ó   K  — | ]}|g fV — Œ	d S r,   r‚   rŽ   s     r   r�   z*_changesetforwardcopies.<locals>.<genexpr>K  s&   è è € Ð/Ð/ A˜˜B˜Ð/Ð/Ð/Ð/Ð/Ð/r   )rS   r   r1   Ú
unfilteredrZ   ÚisancestorrevÚ_uncheckedparentrevsr#   ÚfindmissingrevsÚsetrB   rO   Úaddr   ÚminÚreachablerootsrA   Údictru   ry   ÚreadingÚ_combine_changeset_copiesÚappendÚpopÚextendÚsortÚ_revinfo_getter_extraÚ_combine_changeset_copies_extra)r9   r:   r   r1   rx   Ú
isancestorrq   Úgraph_rootsr#   ÚrevsÚrootsÚhas_graph_rootsÚmulti_threadrŠ   ÚpsrQ   rR   ÚmÚhÚchildren_countÚprr   ÚchildrenÚxr‹   s                           @r   rM   rM   ò   s  ø€ Ø‡u‚u�w„w•7˜AŸEšE™GœGÐ$Ð$Ð$Øˆ	à�6Š6‰8Œ8×ÒÑ Ô €Dà	Œ€BØÔ!€Jð Ô%€GÝ�GÐ$€Kà—’˜aŸeše™gœg˜Y°$�Ñ7Ô7€IØ×Ò a§e¢e¡g¤g Y°q·u²u±w´w°iÐÑ@Ô@€DÝ‰EŒE€EØ€OØ”7×%Ò% hÐ0LÑMÔM€Lð ð ð ˆØˆW�Q‰ZŒZˆØ�ÒÐØ"ˆOˆOà‰FˆB�ð •WŠ}ˆ}  y  Ø—	’	˜"‘”�Ø•WŠ}ˆ}  y  Ø—	’	˜"‘”�øØð àˆ	Øð 7õ �U‘”ˆÝ�‰JŒJˆØ�UŠU‰WŒWˆIˆØ×)Ò)¨!¨Q°À4Ð)ÑHÔHˆÝ˜MÑ*Ô*ˆØ6Ð6Ð6Ð6˜4Ð6Ñ6Ô6ˆàÔÐ3Ò3Ð3õ Ð4Ð4¨eÐ4Ñ4Ô4Ñ4Ô4ˆØð 	+ð 	+ˆAØ—]’] 1Ñ%Ô%ð +ð +�Ø�’<�<ØØ$%�˜qÑ!Ø˜Ð&Ð&Ø" 1Ð%Ð%Ô%¨Ñ*Ð%Ð%Ñ%øð+õ " $¨Ñ.Ô.ˆØŒ^×#Ò#Ñ%Ô%ð 		ð 		Ý,ØØØ—’‘”ØØØØñô ð		ð 		ð 		ð 		ñ 		ô 		ð 		ð 		ð 		ð 		ð 		ð 		øøøð 		ð 		ð 		ð 		ð 		ð 		õ Ð/Ð/¨Ð/Ñ/Ô/Ñ/Ô/ˆØð 	*ð 	*ˆAØ—]’] 1Ñ%Ô%ð *ð *�Ø�’<�<ØØ �˜‘Ø˜�=�=Ø˜Q”K×&Ò& qÑ)Ô)Ð)øð*ð �HŠH‰JŒJˆØ�A—E’E‘G”GŠ|ˆ|ˆ|ˆ|Ø�Š�EÑÔÐØ�	Š	‰Œˆå'¨Ñ-Ô-ˆÝ.Ø�(˜AŸEšE™GœG W¨e°Zñ
ô 
ð 	
s   É2'J&Ê&J*Ê-J*c           	      óˆ  — |                      ¦   «         }t          �-t                               t          | ¦  «        ||||¦  «        }�nÅt	          |¦  «        }i }	| D �]~}
 ||
¦  «        \  }}}d}d|fd|ffD �][\  }}|t
          k    rŒ|                     |¦  «        }|€Œ*|dz  }|||<   |r|	                     |d¦  «        }n|	                     |d¦  «        }|€i x}}n|r|                     ¦   «         }n|}|�µi }|dk    r|j	        }n|dk    r|j
        }|rb|                     ¦   «         }|                     ¦   «         D ]3\  }}|                     |¦  «        }|�|d         �|d         }|
|f||<   Œ4||usJ ‚|j        r-|j        D ]%}||v r||u r|                     ¦   «         }|
df||<   Œ&|€|}�Œ@|dk    sJ ‚t          |||||
¦  «        }�Œ]||	|
<   �Œ€i }|	|         }|€J ‚|                     ¦   «         D ]\  }\  }}|�|||<   Œ|s2t          |                     ¦   «         ¦  «        D ]} ||¦  «        s||= Œ|S )a¢  combine the copies information for each item of iterrevs

    revs: sorted iterable of revision to visit
    children_count: a {parent: <number-of-relevant-children>} mapping.
    targetrev: the final copies destination revision (not in iterrevs)
    revinfo(rev): a function that return (p1, p2, p1copies, p2copies, removed)
    match: a matcher

    It returns the aggregated copies information for `targetrev`.
    Nr   é   )Úalwaysrw   Úcombine_changeset_copiesr   rƒ   r   r   r�   r   Úcopied_from_p1Úcopied_from_p2r   ÚremovedÚ_merge_copies_dictÚkeys)r¤   r«   Ú	targetrevrr   r   r¢   r§   ÚalwaysmatchÚfinal_copiesÚ
all_copiesÚcurrent_revrQ   rR   rt   Úcurrent_copiesÚparentÚ
parent_revÚremaining_childrenr.   Ú	newcopiesÚchildcopiesÚdestÚsourceÚprevr)   Útargetrev_itemsÚttÚfilenames                               r   r›   r›   ^  s(  € ð —,’,‘.”.€KåÐÝ×7Ò7Ý�‰JŒJ˜¨	°7¸Lñ
ô 
ˆ‰õ (¨
Ñ3Ô3ˆ
àˆ
àð F	5ñ F	5ˆKØ%˜g kÑ2Ô2‰OˆB��GØ!ˆNð )*¨2 w°°B°Ð&8ð @ñ @Ñ"�˜
Ø¥Ò(Ð(ØØ%3×%7Ò%7¸
Ñ%CÔ%CÐ"Ø%Ð-ØØ" aÑ'Ð"Ø-?�˜zÑ*Ø%ð >Ø'Ÿ^š^¨J¸Ñ=Ô=�F�Fà'Ÿ^š^¨J¸Ñ=Ô=�Fà�>à)+Ð+�I  Ø'ð 'Ø &§¢¡¤�I�Ià &�IàÐ&Ø"$�KØ ’{�{Ø&-Ô&<˜˜Ø 1š˜Ø&-Ô&<˜à"ð 7Ø$*§K¢K¡M¤M˜	Ø,7×,=Ò,=Ñ,?Ô,?ð Dð D™L˜D &Ø#)§:¢:¨fÑ#5Ô#5˜DØ#Ð/°D¸´GÐ4GØ)-¨a¬ Ø/:¸FÐ.C˜I d™O˜OØ(°Ð6Ð6Ð6Ð6Ø”ð CØ!(¤ð Cð C˜AØ  I˜~˜~Ø#,°Ð#6Ð#6ð 17·²±´ IØ0;¸TÐ/B 	¨!¡øð "Ð)Ø%.�N‘Nð " Qš;˜;˜;˜;Ý%7Ø!Ø&Ø"ØØ#ñ&ô &�N‘Nð '5ˆJ�{Ñ#Ñ#ð ˆà$ YÔ/ˆØÐ*Ð*Ð*à"1×"7Ò"7Ñ"9Ô"9ð 	,ð 	,ÑˆD‘,�2�vØÐ!Ø%+�˜TÑ"øØð +Ý˜\×.Ò.Ñ0Ô0Ñ1Ô1ð 	+ð 	+ˆHØ�5˜‘?”?ð +Ø  Ð*øØÐr   r°   c                 ó  — |                      ¦   «         D ]q\  }}|                      |¦  «        }|€|| |<   Œ"t          |||||¦  «        \  }}	|	r'|t          k    r||d         f| |<   ŒS||d         f| |<   Œa|t          k    r|| |<   Œr| S )aÊ  merge two copies-mapping together, minor and major

    In case of conflict, value from "major" will be picked.

    - `isancestors(low_rev, high_rev)`: callable return True if `low_rev` is an
                                        ancestors of `high_rev`,

    - `ismerged(path)`: callable return True if `path` have been merged in the
                        current revision,

    return the resulting dict (in practice, the "minor" object, updated)
    Nr   )r   r   Ú_compare_valuesÚ
PICK_MAJOR)
ÚminorÚmajorr¢   rt   Úcurrent_mergerÃ   r    ÚotherÚpickÚ	overwrites
             r   r¶   r¶   Õ  s³   € ð —{’{‘}”}ð $ð $‰ˆˆeØ—	’	˜$‘”ˆØˆ=ØˆE�$‰KˆKå-Ø˜ T¨5°%ñô ‰OˆD�)ð ð $Ø�:Ò%Ð%Ø#0°%¸´(Ð";�E˜$‘K�Kà#0°%¸´(Ð";�E˜$‘K�KØ�Ò#Ð#Ø#��d‘øØ€Lr   c                 ó†  — |\  }}|\  }}||k    r||k    sJ ‚t           dfS | �|�|€|| j        v r	t          dfS | �|�|€|| j        v r	t          dfS  |||¦  «        r| �|| j        v r	t          dfS t          dfS  |||¦  «        r| �|| j        v r	t          dfS t          dfS |€	t          dfS |€	t          dfS t          dfS )zïcompare two value within a _merge_copies_dict loop iteration

    return (pick, overwrite).

    - pick is one of PICK_MINOR, PICK_MAJOR or PICK_EITHER
    - overwrite is True if pick is a return of an ambiguity that needs resolution.
    FNT)ÚPICK_EITHERÚsalvagedÚ
PICK_MINORrË   Úmerged)	rt   r¢   rÃ   rÌ   rÍ   Úmajor_ttÚmajor_valueÚminor_ttÚminor_values	            r   rÊ   rÊ   ô  sD  € ð "Ñ€HˆkØ!Ñ€Hˆkà�8ÒÐà˜kÒ)Ð)Ð)Ð)Ý˜EÐ!Ð!àÐØÐ#ØÐØ�GÔ$Ð$Ð$õ ˜4ÐÐàÐØÐ#ØÐØ�GÔ$Ð$Ð$õ ˜4ÐÐØ	ˆ�H˜hÑ	'Ô	'ð  ØÐ 4¨7¬>Ð#9Ð#9õ ˜tÐ#Ð#å˜uÐ$Ð$Ø	ˆ�H˜hÑ	'Ô	'ð  ØÐ 4¨7¬>Ð#9Ð#9õ ˜tÐ#Ð#å˜uÐ$Ð$Ø	Ð	å˜4ÐÐØ	Ð	å˜4ÐÐõ ˜4ÐÐr   c                 ó@   ‡ ‡‡— ‰ j         }|j        Šˆ fd„Šˆˆˆ fd„}|S )aW  return a function that return multiple data given a <rev>"i

    * p1: revision number of first parent
    * p2: revision number of first parent
    * p1copies: mapping of copies from p1
    * p2copies: mapping of copies from p2
    * removed: a list of removed files
    * ismerged: a callback to know if file was merged in that revision
    c                 ó&   •‡— ‰|          Šˆˆfd„}|S )Nc                 ó¼   •— | ‰                      ¦   «         vrdS ‰|          }|j                             |j        ¦  «        }d}|D ]}|‰j        k    r|dz  }Œ|dk    S )NFr   r   r°   )rV   Ú_filelogrq   Ú	_filenodeÚnullid)r$   r&   rq   Ú
nb_parentsÚnÚctxr1   s        €€r   Úismergedz=_revinfo_getter_extra.<locals>.get_ismerged.<locals>.ismerged>  sp   ø€ Ø˜3Ÿ9š9™;œ;Ð&Ð&Ø�uØ�t”9ˆDØ”m×+Ò+¨D¬NÑ;Ô;ˆGØˆJØð $ð $�Ø˜œÒ#Ð#Ø !‘O�JøØ ’?Ð"r   r‚   )rS   rä   rã   r1   s     @€r   Úget_ismergedz+_revinfo_getter_extra.<locals>.get_ismerged;  s2   øø€ Ø�3Œiˆð		#ð 		#ð 		#ð 		#ð 		#ð 		#ð ˆr   c                 óŽ   •—  ‰| ¦  «        \  }}‰	|          }|j         \  }}|                     ¦   «         }||||| ‰| ¦  «        fS r,   )Ú_copiesÚfilesremoved)
rS   rQ   rR   rã   Úp1copiesÚp2copiesrµ   rå   rq   r1   s
          €€€r   rr   z&_revinfo_getter_extra.<locals>.revinfoK  sW   ø€ Ø�˜‘”‰ˆˆBØ�3ŒiˆØ œ[Ñˆ�(Ø×"Ò"Ñ$Ô$ˆØ�2�x ¨7°L°LÀÑ4EÔ4EÐEÐEr   )rZ   ru   )r1   rx   rr   rå   rq   s   `  @@r   r    r    .  s_   øøø€ ð 
Œ€BØŒm€Gðð ð ð ð ð Fð Fð Fð Fð Fð Fð Fð €Nr   c                 óV  ‡— i }‰                      ¦   «         }| D �]a}|                     |d¦  «        }	|	€i }	t          ||         ¦  «        D �]-\  }
} ||¦  «        \  }}}}}}||k    rd}|}n||k    sJ ‚d}|}|s ˆfd„|                     ¦   «         D ¦   «         }|	}|rb|	                     ¦   «         }|                     ¦   «         D ]3\  }}|	                     |¦  «        }|�|d         �|d         }||f||<   Œ4||	usJ ‚|D ]%}||v r||	u r|	                     ¦   «         }|df||<   Œ&|                     |¦  «        }|€|||<   Œü|dk    rt          ||||¦  «         �Œt          ||||¦  «         |||<   �Œ/�Œci }||                              ¦   «         D ]\  }\  }}|�|||<   Œ|S )zyversion of `_combine_changeset_copies` that works with the Google
    specific "extra" based storage for copy informationNr   r°   c                 ó2   •— i | ]\  }} ‰|¦  «        ¯||“ŒS r‚   r‚   )r‰   r   r   r   s      €r   ú
<dictcomp>z3_combine_changeset_copies_extra.<locals>.<dictcomp>k  s<   ø€ ð ð ð Ù!)  cÀEÀEÈ#ÁJÄJðØ˜ðð ð r   )r±   r�   Ú	enumerater   r   r   Ú_merge_copies_dict_extra)r¤   r­   r¸   rr   r   r¢   r»   r¹   rŠ   r.   Úir3   rQ   rR   ré   rê   rµ   rä   r¾   rÂ   rÁ   rÃ   rÄ   rÅ   r)   Úothercopiesrº   rÇ   s       `                       r   r¡   r¡   U  sm  ø€ ð
 €JØ—,’,‘.”.€KØð 6.ñ 6.ˆØ—’  4Ñ(Ô(ˆØˆ>àˆFÝ˜h qœkÑ*Ô*ð 1	.ñ 1	.‰DˆAˆqØ<C¸GÀA¹J¼JÑ9ˆB��H˜h¨°Ø�BŠwˆwØ�Ø&��à˜B’w�w�w�wØ�Ø&�Øð ðð ð ð Ø-8×->Ò->Ñ-@Ô-@ðñ ô �ð ˆIØð /Ø"ŸKšK™MœM�	Ø$/×$5Ò$5Ñ$7Ô$7ð 2ð 2‘L�D˜&Ø!Ÿ:š: fÑ-Ô-�DØÐ'¨D°¬GÐ,?Ø!% a¤˜Ø'(¨& k�I˜d‘O�OØ ¨Ð.Ð.Ð.Ð.Øð -ð -�Ø˜	�>�>Ø  FÐ*Ð*ð %+§K¢K¡M¤M˜	Ø$% t 9�I˜a‘LøØ$Ÿ.š.¨Ñ+Ô+ˆKØÐ"Ø )�
˜1‘�ð ˜Q’;�;Ý,Ø# Y°
¸Hñô ð ñ õ -Ø! ;°
¸Hñô ð ð %.�J˜q‘M‘Mñc1	.ðf €LØ(¨Ô3×9Ò9Ñ;Ô;ð (ð (Ñˆ‰lˆr�6ØÐØ!'ˆL˜ÑøØÐr   c                 óþ   — |                      ¦   «         D ]g\  }}|                      |¦  «        }|€|| |<   Œ"|d         }|d         }|d         |d         k    rŒE||k    s |||¦  «        r ||¦  «        r|| |<   ŒhdS )zrversion of `_merge_copies_dict` that works with the Google
    specific "extra" based storage for copy informationNr   r   )r   r   )	rÌ   rÍ   r¢   rä   rÃ   r    rÏ   Únew_ttÚother_tts	            r   rï   rï   ›  s­   € ð —{’{‘}”}ð $ð $‰ˆˆeØ—	’	˜$‘”ˆØˆ=ØˆE�$‰KˆKà˜1”XˆFØ˜Q”xˆHØ�QŒx˜5 œ8Ò#Ð#Øð ˜(Ò"Ð"Ø!�z &¨(Ñ3Ô3ð #à�8˜D‘>”>ð #ð $��d‘øð!$ð $r   c                 ó8  — |€| }|                       ¦   «                              |¦  «        }|                     ¦   «         €Ht          | |                     ¦   «         ||¦  «        }t          |t          |j        |¦  «        ¦  «        }nt          | |||¦  «        }|S )z<find {dst@b: src@a} copy mapping where a is an ancestor of b)r1   ÚnarrowmatchrS   rg   rQ   r!   r4   rL   )r9   r:   r^   r   r`   r.   s         r   Ú_forwardcopiesr÷   ±  s†   € ð €|ØˆØ�FŠF‰HŒH× Ò  Ñ'Ô'€Eà‡u‚u�w„w€Ý$ Q¨¯ª©¬°°eÑ<Ô<ˆå˜�O¨A¬G°UÑ;Ô;Ñ<Ô<ˆˆå(¨¨A¨t°UÑ;Ô;ˆØ€Mr   c                 ó�   — | j         j                             dd¦  «        dk    ri S t          || ¦  «        }t	          || |¦  «        S )zfind renames from a to br@   ó	   copytraces   off)rL   rB   rC   r÷   Ú_reverse_renames)r9   r:   r   r.   s       r   Ú_backwardrenamesrû   Á  sI   € à„w„z×Ò˜¨,Ñ7Ô7¸6ÒAÐAØˆ	õ
 ˜A˜qÑ!Ô!€FÝ˜F A uÑ-Ô-Ð-r   c                 óˆ   — i }t          |                      ¦   «         ¦  «        D ]\  }}|r ||¦  «        sŒ||v rŒ|||<   Œ|S )z>given copies to context 'dst', finds renames from that context)r[   r   )r.   r   r   rŠ   r   r   s         r   rú   rú   Í  sb   € ð
 	€AÝ�v—|’|‘~”~Ñ&Ô&ð ð ‰ˆˆ1Øð 	˜˜˜q™œð 	Øà�ˆ8ˆ8ØØˆˆ!‰ˆØ€Hr   c                 ó<  — | j         }|j        j        o|j                             dd¦  «        }|r|j                             d| |fz  ¦  «         | |k    s| r|si S |                     ¦   «         €D| |                     ¦   «         k    r,|r|j                             d¦  «         t          ||¦  «        S |                     | ¦  «        }|| k    r0|r|j                             d¦  «         t          | ||¬¦  «        }�n||k    r/|r|j                             d¦  «         t          | ||¬¦  «        }n×|r|j                             d	¦  «         d}|                     ¦   «         t          k    r| }t          || ¦  «        }t          ||||¬¦  «        }	t          |¦  «        t          |	¦  «        z  }
|
D ]4}|                     |¦  «        |	                     |¦  «        k    r||= |	|= Œ5t          || |¦  «        }t          ||	¦  «        }t!          | ||¦  «         |S )
z5find {dst@y: src@x} copy mapping for directed comparerH   rI   s-   debug.copies: searching copies from %s to %s
Ns$   debug.copies: search mode: dirstate
s#   debug.copies: search mode: forward
r6   s$   debug.copies: search mode: backward
s$   debug.copies: search mode: combined
)rL   rB   rN   rO   rP   rS   rQ   r4   Úancestorr÷   rû   r   r•   r   rú   r!   r   )r®   Úyr   r1   rP   r9   r.   r^   Úx_copiesÚy_copiesÚ	same_keysr   Úx_backward_renamess                r   Ú
pathcopiesr  Ý  s5  € àŒ7€DØŒGÔÐO $¤'×"4Ò"4°X¸Ñ"OÔ"O€EØð 
ØŒ�ŠØ=ÀÀAÀÑFñ	
ô 	
ð 	
ð 	ˆA‚v€v�Q€v˜a€vØˆ	Ø‡u‚u�w„w€˜1 §¢¡¤š;˜;Øð 	DØŒG�MŠMÐBÑCÔCÐCå˜t UÑ+Ô+Ð+Ø	�
Š
�1‰Œ€AØˆA‚v€vØð 	CØŒG�MŠMÐAÑBÔBÐBÝ  1¨EÐ2Ñ2Ô2ˆ‰Ø	
ˆaŠˆØð 	DØŒG�MŠMÐBÑCÔCÐCÝ! ! Q¨eÐ4Ñ4Ô4ˆˆàð 	DØŒG�MŠMÐBÑCÔCÐCØˆØ�5Š5‰7Œ7•gÒÐØˆDÝ! ! QÑ'Ô'ˆÝ! ! Q¨°EÐ:Ñ:Ô:ˆÝ˜‘M”M¥C¨¡M¤MÑ1ˆ	Øð 	 ð 	 ˆAØ�|Š|˜A‰Œ (§,¢,¨q¡/¤/Ò1Ð1Ø˜Q�KØ˜Q�KøÝ-¨h¸¸5ÑAÔAÐÝØØñ
ô 
ˆõ ˆAˆq�&ÑÔÐØ€Mr   c                 óò  — |r|r||k    rt          ¦   «         t          ¦   «         i fS |                     ¦   «                              ¦   «         }|                     ¦   «         €[|                     ¦   «         | j                             ¦   «         k    r,t          t          | |¦  «        ¦  «        t          ¦   «         i fS | j                             dd¦  «        }t          j
        |¦  «        du rt          ¦   «         t          ¦   «         i fS t          | ¦  «        rt          | |||¦  «        S |dk    r5t          | ||¦  «        rt          | |||¦  «        S t          | |||¦  «        S t          | |||¦  «        S )aÒ  
    Finds moves and copies between context c1 and c2 that are relevant for
    merging. 'base' will be used as the merge base.

    Copytracing is used in commands like rebase, merge, unshelve, etc to merge
    files that were moved/ copied in one merge parent and modified in another.
    For example:

    o          ---> 4 another commit
    |
    |   o      ---> 3 commit that modifies a.txt
    |  /
    o /        ---> 2 commit that moves a.txt to b.txt
    |/
    o          ---> 1 merge base

    If we try to rebase revision 3 on revision 4, since there is no a.txt in
    revision 4, and if user have copytrace disabled, we prints the following
    message:

    ```other changed <file> which local deleted```

    Returns a tuple where:

    "branch_copies" an instance of branch_copies.

    "diverge" is a mapping of source name -> list of destination names
    for divergent renames.

    This function calls different copytracing algorithms based on config.
    Nr@   rù   Fs
   heuristics)Úbranch_copiesr1   rö   Únoder-   rQ   r4   rB   rC   r
   Ú	parseboolrF   Ú_fullcopytracingÚ_isfullcopytraceableÚ_heuristicscopytracing)r1   Úc1Úc2r^   rö   Úcopytracings         r   Úmergecopiesr    sj  € ðB ð 4�Rð 4˜2 š8˜8Ý‰Œ¥¡¤°Ð3Ð3à—'’'‘)”)×'Ò'Ñ)Ô)€Kð 
‡w‚w�y„yÐ˜RŸWšW™YœY¨$¬-×*:Ò*:Ñ*<Ô*<Ò<Ð<å�/¨$°Ñ<Ô<Ñ=Ô=Ý‰OŒOØð
ð 	
ð ”'—.’. °,Ñ?Ô?€KÝÔ˜KÑ(Ô(¨EÐ1Ð1õ ‰Œ¥¡¤°Ð3Ð3å˜tÑ$Ô$ð 4å  b¨"¨dÑ3Ô3Ð3ð
 �mÒ#Ð#õ    b¨$Ñ/Ô/ð 	8Ý# D¨"¨b°$Ñ7Ô7Ð7Ý% d¨B°°DÑ9Ô9Ð9å  b¨"¨dÑ3Ô3Ð3r   c                 óx  — |                      ¦   «         €|                     ¦   «         }|                     ¦   «         r}|                     ¦   «         ri| j                             dd¦  «        }t          |                      d|                      ¦   «         |                      ¦   «         ¦  «        ¦  «        }||k     S dS )aœ  Checks that if base, source and destination are all no-public branches,
    if yes let's use the full copytrace algorithm for increased capabilities
    since it will be fast enough.

    `experimental.copytrace.sourcecommitlimit` can be used to set a limit for
    number of changesets from c1 to base such that if number of changesets are
    more than the limit, full copytracing algorithm won't be used.
    Nr@   s   copytrace.sourcecommitlimitó   %d::%dF)rS   rQ   ÚmutablerB   Ú	configintrY   r¤   )r1   r  r^   ÚsourcecommitlimitÚcommitss        r   r
  r
  Q  sœ   € ð 
‡v‚v�x„xÐØ�UŠU‰WŒWˆØ	‡z‚z�|„|ð +˜Ÿš™œð +Ø œG×-Ò-ØÐ;ñ
ô 
Ðõ �d—i’i 	¨4¯8ª8©:¬:°r·v²v±x´xÑ@Ô@ÑAÔAˆØÐ*Ò*Ð*Øˆ5r   c	                 ó(  — | |vr| |vr||| <   d S d S | |vrd S ||          ||          k    rt          ||          ||          ¦  «        sd S ||          ||          k    s,|                     | ¦  «        |                     | ¦  «        k    r
|D ]	}	| ||	<   Œd S d S r,   )Ú_relatedrp   )
r   Údsts1Úm1Úm2r<   r  r^   r   Úrenamedeleter   s
             r   Ú_checksinglesidecopiesr  e  sË   € ð �"€}€}à�bˆ=ˆ=à %ˆL˜ÑÐÐð ˆ=ð 
�Bˆˆð 	ˆØ	ˆCŒ�B�s”GÒ	Ð	¥H¨R°¬W°d¸3´iÑ$@Ô$@Ð	ØˆØ	ˆCŒ�B�s”GÒ	Ð	˜rŸxšx¨™}œ}°·²¸±´Ò=Ð=àð 	ð 	ˆCØˆD�‰IˆIð  >Ð=ð	ð 	r   c                   ó"   — e Zd ZdZ	 dd„Zd„ ZdS )r  a	  Information about copies made on one side of a merge/graft.

    "copy" is a mapping from destination name -> source name,
    where source is in c1 and destination is in c2 or vice-versa.

    "movewithdir" is a mapping from source name -> destination name,
    where the file at source present in one context but not the other
    needs to be moved to destination by the merge process, because the
    other context moved the directory it is in.

    "renamedelete" is a mapping of source name -> list of destination
    names for files deleted in c1 that were renamed in c2 or vice-versa.

    "dirmove" is a mapping of detected source dir -> destination dir renames.
    This is needed for handling changes to new files previously grafted into
    renamed directories.
    Nc                 ó^   — |€i n|| _         |€i n|| _        |€i n|| _        |€i n|| _        d S r,   ©r   r  ÚdirmoveÚmovewithdir)Úselfr   r  r   r!  s        r   Ú__init__zbranch_copies.__init__�  sJ   € ð ˜,�B�B¨DˆŒ	Ø".Ð"6˜B˜B¸LˆÔØ$˜_�r�r°'ˆŒØ!,Ð!4˜2˜2¸+ˆÔÐÐr   c           	      óH   — d| j         ›d| j        ›d| j        ›d| j        ›d�	S )Nz<branch_copies
  copy=z
  renamedelete=z
  dirmove=z
  movewithdir=z
>r  )r"  s    r   Ú__repr__zbranch_copies.__repr__•  s8   € € àŒIˆIˆIØÔÐÐØŒLˆLˆLØÔÐÐð	
ð 	
r   )NNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#  r%  r‚   r   r   r  r  z  sL   € € € € € ðð ð& GKðFð Fð Fð Fð
ð 
ð 
ð 
ð 
r   r  c                 ó	  ‡ ‡$‡%‡&‡'‡(— |                      ¦   «         Š&|                      ¦   «         Š'|                      ¦   «         Š(t          ||¦  «        }t          ||¦  «        }|s|st          ¦   «         t          ¦   «         i fS i }i }|                     ¦   «         D ].\  }}	|                     |	g ¦  «                             |¦  «         Œ/|                     ¦   «         D ].\  }}	|                     |	g ¦  «                             |¦  «         Œ/i }
i }i }i }i }t          |¦  «        t          |¦  «        z  }|D ]ð}	|                     |	¦  «        }|                     |	¦  «        }|r�|r�|	‰&vrP|	‰'vrLt          |¦  «        }t          |¦  «        }||z  r||z  D ]}|	|
|<   |	||<   ŒŒnt          ||z  ¦  «        ||	<   Œ„|	‰&v r4|	‰'v r0t          |¦  «        }t          |¦  «        }||z  D ]}|	|
|<   |	||<   ŒŒ½|rt          |	|‰&‰'‰(|||
|¦	  «	         Œ×|rt          |	|‰'‰&‰(||||¦	  «	         Œñg Š%ˆ%ˆ&ˆ'ˆ(ˆ fd„Š$ˆ$fd„}ˆ$fd„}‰ j
        j        �rÇ |¦   «         } |¦   «         }d}|r5‰ j
                             d|dz  d                     |¦  «        fz  ¦  «         |r5‰ j
                             d|dz  d                     |¦  «        fz  ¦  «         t          ¦   «         }t          ¦   «         }|                     ¦   «         D ]}|                     |¦  «         Œ|                     ¦   «         D ]}|                     |¦  «         Œ|                     ¦   «         D ]}|                     |¦  «         Œ‰ j
                             d	¦  «         d|fd
|ffD ]~\  }}|sŒ‰ j
                             d|z  ¦  «         t          |¦  «        D ]I}d}||
v s||v r|dz  }||v r|dz  }||v r|dz  }‰ j
                             d||         ||fz  ¦  «         ŒJŒ~~‰ j
                             d¦  «         t!          ‰ ||
||¦  «        \  }}t!          ‰ ||||¦  «        \  } }!t          |
|||!¦  «        }"t          ||| |¦  «        }#|"|#|fS )a'  The full copytracing algorithm which finds all the new files that were
    added from merge base up to the top commit and for each file it checks if
    this file was copied from another file.

    This is pretty slow when a lot of changesets are involved but will track all
    the copies.
    c                 ó.  •— ‰s‹‰                      ‰‰	                     ¦   «         ¦  «        }‰                      ‰‰	                     ¦   «         ¦  «        }t          ||z
  ¦  «        }t          ||z
  ¦  «        }‰                     ||f¦  «         ‰|          S r,   )r8   rö   r[   rž   )
ÚidxÚ	addedinm1Ú	addedinm2Úu1Úu2r   r  r  r<   r1   s
        €€€€€r   Ú_get_addedfilesz)_fullcopytracing.<locals>._get_addedfilesç  s�   ø€ Øð 	#ØŸš b¨$×*:Ò*:Ñ*<Ô*<Ñ=Ô=ˆIØŸš b¨$×*:Ò*:Ñ*<Ô*<Ñ=Ô=ˆIÝ˜	 IÑ-Ñ.Ô.ˆBÝ˜	 IÑ-Ñ.Ô.ˆBØ�LŠL˜"˜b˜Ñ"Ô"Ð"Ø�SŒzÐr   c                  ó   •—  ‰ d¦  «        S )Nr   r‚   ©r1  s   €r   ú<lambda>z"_fullcopytracing.<locals>.<lambda>ð  ó   ø€ �?�? 1Ñ%Ô%€ r   c                  ó   •—  ‰ d¦  «        S )Nr   r‚   r3  s   €r   r4  z"_fullcopytracing.<locals>.<lambda>ñ  r5  r   s     unmatched files in %ss
   %s:
   %s
s   locals   
   s   othersK     all copies found (* = to merge, ! = divergent, % = renamed and deleted):
s   remotes      on %s side:
r   ó   *ó   !ó   %s       src: '%s' -> dst: '%s' %s
s!     checking for directory renames
)r7   r  r  r   Ú
setdefaultrœ   r•   r   r[   r  rB   rN   rP   ÚjoinÚvaluesÚupdateÚ_dir_renames))r1   r  r  r^   Úcopies1Úcopies2Úinversecopies1Úinversecopies2r   r   Úcopy1Úcopy2ÚdivergeÚrenamedelete1Úrenamedelete2Ú
allsourcesr  Údsts2Úu1fnÚu2fnr/  r0  ÚheaderÚrenamedeletesetÚ
divergesetÚdstsÚsider.   r)   ÚnoteÚdirmove1Úmovewithdir2Údirmove2Úmovewithdir1Úbranch_copies1Úbranch_copies2r1  r   r  r  r<   s)   `                                   @@@@@r   r	  r	  ž  s¾  øøøøøø€ ð 
�Š‰Œ€BØ	�Š‰Œ€BØ	�Š‰Œ€Bå˜˜rÑ"Ô"€GÝ˜˜rÑ"Ô"€Gàð 4�wð 4Ý‰Œ¥¡¤°Ð3Ð3à€NØ€NØ—M’M‘O”Oð 7ð 7‰ˆˆSØ×!Ò! # rÑ*Ô*×1Ò1°#Ñ6Ô6Ð6Ð6Ø—M’M‘O”Oð 7ð 7‰ˆˆSØ×!Ò! # rÑ*Ô*×1Ò1°#Ñ6Ô6Ð6Ð6à€EØ€EØ€GØ€MØ€MÝ�^Ñ$Ô$¥s¨>Ñ':Ô':Ñ:€JØð %ð %ˆØ×"Ò" 3Ñ'Ô'ˆØ×"Ò" 3Ñ'Ô'ˆØð "	�Uð "	à˜"ˆ}ˆ} ¨B  å˜E™
œ
�Ý˜E™
œ
�ð
 ˜5‘=ð 9Ø$ u™}ð )ð )˜Ø%(˜˜c™
Ø%(˜˜c™
˜
ð)õ $*¨%°%©-Ñ#8Ô#8�G˜C‘L�LØ˜��˜s b˜y˜yå˜E™
œ
�Ý˜E™
œ
�Ø  5™=ð %ð %�CØ!$�E˜#‘JØ!$�E˜#‘J�Jøð ð 		å"Ø�U˜B  B¨¨D°%¸ñô ð ð ð ð 	å"Ø�U˜B  B¨¨D°%¸ñô ð øð
 €Eðð ð ð ð ð ð ð ð ð &Ð%Ð%Ð%€DØ%Ð%Ð%Ð%€DØ„wÔñ +ØˆT‰VŒVˆØˆT‰VŒVˆà+ˆØð 	ØŒG�MŠMØ 6¨HÑ#4°h·m²mÀBÑ6GÔ6GÐ"HÑHñô ð ð ð 	ØŒG�MŠMØ 6¨HÑ#4°h·m²mÀBÑ6GÔ6GÐ"HÑHñô ð õ ™%œ%ˆÝ‘U”Uˆ
Ø—N’NÑ$Ô$ð 	$ð 	$ˆDØ×Ò˜dÑ#Ô#Ð#Ð#Ø!×(Ò(Ñ*Ô*ð 	)ð 	)ˆDØ×"Ò" 4Ñ(Ô(Ð(Ð(Ø!×(Ò(Ñ*Ô*ð 	)ð 	)ˆDØ×"Ò" 4Ñ(Ô(Ð(Ð(àŒ�Šð+ñ	
ô 	
ð 	
ð '¨Ð0°9¸gÐ2FÐGð 	ð 	‰LˆD�&Øð ØØŒG�MŠMÐ-°Ñ4Ñ5Ô5Ð5Ý˜F‘^”^ð 
ð 
�Ø�Ø˜�:�:  e  Ø˜D‘L�DØ˜
�?�?Ø˜D‘L�DØ˜Ð'Ð'Ø˜D‘L�DØ”—’Ø6¸&À¼)ÀQÈÐ9MÑMñô ð ð ð
ð Øà„G‡M‚MÐ7Ñ8Ô8Ð8å)¨$°°E¸7ÀDÑIÔIÑ€HˆlÝ)¨$°°E¸7ÀDÑIÔIÑ€Hˆlå" 5¨-¸À<ÑPÔP€NÝ" 5¨-¸À<ÑPÔP€Nà˜>¨7Ð2Ð2r   c                 óT  — t          ¦   «         }i }|                     ¦   «         D ]�\  }}t          j        |¦  «        t          j        |¦  «        }
}	|	|v rŒ2|                     |	¦  «        r+|                     |
¦  «        r|                     |	¦  «         Œr|	|v r"||	         |
k    r|                     |	¦  «         Œ˜|
||	<   Œž|D ]	}||v r||= Œ
~|si i fS d„ |                     ¦   «         D ¦   «         }|D ]'}| j                             d|||         fz  ¦  «         Œ(t          |d¬¦  «        }i } |¦   «         D ]j}||vrd|D ]a}| 	                    |¦  «        rJ||         |t          |¦  «        d…         z   }||vr$|||<   | j                             d||fz  ¦  «          nŒbŒk||fS )a…  Finds moved directories and files that should move with them.

    ctx: the context for one of the sides
    copy: files copied on the same side (as ctx)
    fullcopy: files copied on the same side (as ctx), including those that
              merge.manifestmerge() won't care about
    addedfilesfn: function returning added files on the other side (compared to
                  ctx)
    c                 ó&   — i | ]\  }}|d z   |d z   “ŒS )ó   /r‚   )r‰   r   r   s      r   rí   z _dir_renames.<locals>.<dictcomp>Q  s&   € Ð>Ð>Ð>¡d a¨ˆq�4‰x˜˜T™Ð>Ð>Ð>r   s)      discovered dir src: '%s' -> dst: '%s'
T)ÚreverseNs'      pending file src: '%s' -> dst: '%s'
)r•   r   r   ÚdirnameÚhasdirr–   rB   rP   r[   Ú
startswithrY   )r1   rã   r   ÚfullcopyÚaddedfilesfnÚinvalidr   r   r   ÚdsrcÚddstrð   ÚdÚdirmove_children_firstr!  r)   Údfs                    r   r>  r>  *  s&  € õ ‰eŒe€GØ€Gð —N’NÑ$Ô$ð !ð !‰ˆˆSÝÔ% cÑ*Ô*­HÔ,<¸SÑ,AÔ,AˆdˆØ�7ˆ?ˆ?àØ�ZŠZ˜ÑÔð 	! #§*¢*¨TÑ"2Ô"2ð 	!à�KŠK˜ÑÔÐÐØ�Wˆ_ˆ_ ¨¤°$Ò!6Ð!6à�KŠK˜ÑÔÐÐð !ˆG�D‰MˆMàð ð ˆØ�ˆ<ˆ<Ø˜�
øØàð Ø�2ˆvˆà>Ð>¨g¯mªm©o¬oÐ>Ñ>Ô>€Gàð 
ð 
ˆØŒ�ŠØ9¸QÀÈÄ
¸OÑKñ	
ô 	
ð 	
ð 	
õ $ G°TÐ:Ñ:Ô:Ðà€Kàˆ\‰^Œ^ð ð ˆØ�HÐÐØ+ð 
ð 
�Ø—<’< ‘?”?ð 	à  œ a­¨A©¬¨¨¤kÑ1�BØ �~�~Ø)+˜ A™ØœŸšØGØ  "˜gñ&ñô ð ð �Eð	øð �KÐÐr   c                 óx  ‡‡‡‡— |                      ¦   «         €|                     ¦   «         }‰                      ¦   «         €‰                     ¦   «         Št          ¦   «         }|                     ¦   «         Š|                      d‰                      ¦   «         ‰                      ¦   «         ¦  «        s,| j                             d¦  «         t          | |‰‰¦  «        S ‰}|‰k    r’t          | 	                    ¦   «         ¦  «        dk    r,| j                             d¦  «         t          | |‰‰¦  «        S | 
                    |                     ¦   «         ¦  «         |                     ¦   «         }|‰k    °’i }t          ‰‰¦  «        }|                     ¦   «         D ]\  }}	|	‰v r|	||<   Œˆˆˆfd„Šˆfd„|D ¦   «         }
i }|
�rÖt          j        t           ¦  «        }t          j        t           ¦  «        }‰                     ‰                     ¦   «         ¦  «        D ]v}t$          j                             |¦  «        }t$          j                             |¦  «        }||                              |¦  «         ||                              |¦  «         Œw|
D �]}t$          j                             |¦  «        }t$          j                             |¦  «        }||         }||         }||z   }‰                     |¦  «        }| j                             dd	¦  «        }t          |¦  «        |k    r:| j                             t5          d
¦  «        |t          |¦  «        fz  ¦  «         ŒÓ|D ],}|                     |¦  «        }t7          ||¦  «        r|||<   Œ-�Œt9          |¦  «        t9          |¦  «        i fS )a}  Fast copytracing using filename heuristics

    Assumes that moves or renames are of following two types:

    1) Inside a directory only (same directory name but different filenames)
    2) Move from one directory to another
                    (same filenames but different directory names)

    Works only when there are no merge commits in the "source branch".
    Source branch is commits from base up to c2 not including base.

    If merge is involved it fallbacks to _fullcopytracing().

    Can be used by setting the following config:

        [experimental]
        copytrace = heuristics

    In some cases the copy/move candidates found by heuristics can be very large
    in number and that will make the algorithm slow. The number of possible
    candidates to check can be limited by using the config
    `experimental.copytrace.movecandidateslimit` which defaults to 100.
    Nr  s?   switching to full copytracing as base is not an ancestor of c2
r°   s0   switching to full copytracing because of merges
c                 ó   •— | ‰vo| ‰v o| ‰v S r,   r‚   )r)   r^   r  r  s    €€€r   r4  z(_heuristicscopytracing.<locals>.<lambda>¬  s   ø€ �Q˜b�[Ð: Q¨$ YÐ:°1¸°7€ r   c                 ó*   •— g | ]} ‰|¦  «        ¯|‘ŒS r‚   r‚   )r‰   r)   Úfilts     €r   rŒ   z*_heuristicscopytracing.<locals>.<listcomp>­  s&   ø€ Ð7Ð7Ð7˜!¨t¨t°A©w¬wÐ7�AÐ7Ð7Ð7r   r@   s   copytrace.movecandidateslimitsB   skipping copytracing for '%s', more candidates than the limit: %d
)rS   rQ   r•   r7   r¤   rB   rP   r	  rY   rq   r=  rV   r÷   r   ÚcollectionsÚdefaultdictr   r8   Úosr$   Úbasenamer\  rœ   Úfilectxr  Ústatusr   r  r  )r1   r  r  r^   Úchangedfilesrã   r@  Úcpr   r   Úmissingfilesr?  ÚbasenametofilenameÚdirnametofilenamer)   rn  r\  ÚsamebasenameÚsamedirnameÚmovecandidatesÚf2ÚmaxcandidatesÚ	candidateÚf1rj  r  s     ``                    @@r   r  r  q  sš  øøøø€ ð2 
‡v‚v�x„xÐØ�UŠU‰WŒWˆØ	‡v‚v�x„xÐØ�UŠU‰WŒWˆå‘5”5€LØ	�Š‰Œ€BØ�9Š9�Y §¢¡
¤
¨B¯FªF©H¬HÑ5Ô5ð 4àŒ�Šð#ñ	
ô 	
ð 	
õ    b¨"¨dÑ3Ô3Ð3à
€CØ
�Š+ˆ+Ýˆs�{Š{‰}Œ}ÑÔ Ò"Ð"àŒG�MŠMÐNÑOÔOÐOÝ# D¨"¨b°$Ñ7Ô7Ð7Ø×Ò˜CŸIšI™KœKÑ(Ô(Ð(Ø�fŠf‰hŒhˆð �Š+ˆ+ð €GÝ	˜˜bÑ	!Ô	!€BØ—H’H‘J”Jð ð ‰ˆˆSØ�"ˆ9ˆ9ØˆG�C‰Løð ;Ð:Ð:Ð:Ð:Ð:€DØ7Ð7Ð7Ð7˜|Ð7Ñ7Ô7€Là€GØñ )+Ý(Ô4µTÑ:Ô:ÐÝ'Ô3µDÑ9Ô9Ðà—’˜tŸ}š}™œÑ/Ô/ð 	1ð 	1ˆAÝ”w×'Ò'¨Ñ*Ô*ˆHÝ”g—o’o aÑ(Ô(ˆGØ˜xÔ(×/Ò/°Ñ2Ô2Ð2Ø˜gÔ&×-Ò-¨aÑ0Ô0Ð0Ð0àð 	+ñ 	+ˆAÝ”w×'Ò'¨Ñ*Ô*ˆHÝ”g—o’o aÑ(Ô(ˆGØ-¨hÔ7ˆLØ+¨GÔ4ˆKØ)¨KÑ7ˆNð —’˜A‘”ˆBð !œG×-Ò-ØÐ!Añô ˆMõ �>Ñ"Ô" ]Ò2Ð2Ø”—’Ýð;ñô ð �#˜nÑ-Ô-Ð.ñ	/ñô ð ð à+ð +ð +�	Ø—Z’Z 	Ñ*Ô*�Ý˜B Ñ#Ô#ð +ð *+�G˜IÑ&øñ+õ ˜Ñ!Ô!¥=°Ñ#9Ô#9¸2Ð=Ð=r   c                 óÒ  — | |k    rdS |                       ¦   «         |                      ¦   «         }}	 |                      ¦   «         |                     ¦   «         }}|€t          |¦  «        } |€t          |¦  «        }	 |                      ¦   «         |                     ¦   «         }}||k    rt          |¦  «        } n||k    rt          |¦  «        }n| |k    S Œ[# t          $ r Y dS w xY w)aF  return True if f1 and f2 filectx have a common ancestor

    Walk back to common ancestor to see if the two files originate
    from the same file. Since workingfilectx's rev() is None it messes
    up the integer comparison logic, hence the pre-step check for
    None (f1 and f2 can only be workingfilectx's initially).
    TNF)r#   ÚlinkrevÚnextÚStopIteration)r|  ry  Úg1Úg2Úf1rÚf2rs         r   r  r  Þ  så   € ð 
ˆR‚x€xØˆtà�\Š\‰^Œ^˜RŸ\š\™^œ^ˆ€BðØ—:’:‘<”< §¢¡¤ˆSˆàˆ;Ý�b‘”ˆBØˆ;Ý�b‘”ˆBð	 Ø—z’z‘|”| R§Z¢Z¡\¤\�ˆCØ�SŠyˆyÝ˜"‘X”X��Ø�s’�Ý˜"‘X”X��à˜R’x�ð	 øõ ð ð ð Øˆuˆuðøøøs   ²B$C ÃC Ã
C&Ã%C&c                 ó6  — t          ||¦  «        }|                      ¦   «         }t          || |¦  «         t          |                     ¦   «         ¦  «        D ]\  }}||v r||= Œ|                     ¦   «         D ] \  }}| |                              |¦  «         Œ!dS )a  reproduce copies between base and ctx in the wctx

    Unlike mergecopies(), this function will only consider copies between base
    and ctx; it will ignore copies between base and wctx. Also unlike
    mergecopies(), this function will apply copies to the working copy (instead
    of just returning information about the copies). That makes it cheaper
    (especially in the common case of base==ctx.p1()) and useful also when
    experimental.copytrace=off.

    merge.update() will have already marked most copies, but it will only
    mark copies if it thinks the source files are related (see
    merge._related()). It will also not mark copies if the file wasn't modified
    on the local side. This function adds the copies that were "missed"
    by merge.update().
    N)r  rQ   r   r   r   Ú
markcopied)	Úwctxrã   r^   Ú
new_copiesr¾   rÃ   Ú__r   r   s	            r   ÚgraftcopiesrŠ  ÿ  s±   € õ  ˜D #Ñ&Ô&€JØ�WŠW‰YŒY€FÝˆF�D˜*Ñ%Ô%Ð%õ ˜×)Ò)Ñ+Ô+Ñ,Ô,ð !ð !‰ˆˆbØ�6ˆ>ˆ>Ø˜4Ð øØ×$Ò$Ñ&Ô&ð "ð "‰ˆˆSØˆSŒ	×Ò˜SÑ!Ô!Ð!Ð!ð"ð "r   r,   )NN)4rk  rm  Úi18nr   r  r   Ú r   rT   r   r   r	   Úutilsr
   Úrevlogutilsr   r   rk   Ú
importrustrw   r   r!   r*   r4   r=   rF   rg   ry   rƒ   rM   r›   rÕ   rË   rÓ   r¶   rÊ   r    r¡   rï   r÷   rû   rú   r  r  r
  r  r  r	  r>  r  r  rŠ  r‚   r   r   ú<module>r�     sî  ðð Ð Ð Ð Ø 	€	€	€	à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð
 ˆ&Ô
˜NÑ
+Ô
+€ðð ð ðBð ð ðð ð ð ð ð ð ð*ð *ð *ð *ð'ð 'ð 'ð@ð @ð @ðF#ð #ð #ðLð ð ð$i
ð i
ð i
ðXnð nð nðd €
Ø€
Ø€ðð ð ð>7 ð 7 ð 7 ðt$ð $ð $ðNCð Cð CðL$ð $ð $ð,ð ð ð ð 	.ð 	.ð 	.ðð ð ð +ð +ð +ð +ð\C4ð C4ð C4ðLð ð ð(ð ð ð*!
ð !
ð !
ð !
ð !
ñ !
ô !
ð !
ðHI3ð I3ð I3ðXD ð D ð D ðNj>ð j>ð j>ðZð ð ðB"ð "ð "ð "ð "r   