§
    	^µcø�  ã                   óP  — d Z ddlZddlmZ ddlmZmZmZmZm	Z	 ddl
mZmZ ddlmZm
Z
mZmZmZmZ e
j        rCddlmZmZmZmZmZmZmZmZ dd	lmZmZ ee ee!         f         Z"eeej#        e"ge"f                  Z$ ej%        d
¦  «        Z& e'd¦  «        \  Z(Z)Z*dZ+dZ,e(e)e*e+e,fZ-e)e*e+e,fZ.g d¢Z/ e0 e1e/¦  «        ¦  «        Z2de2e+<   de2e,<   d„ e2 3                    ¦   «         D ¦   «         Z4e4 5                    ¦   «         Z6e6 7                    d„ e2D ¦   «         ¦  «         e6 7                    d„ e2D ¦   «         ¦  «         e)e*e+e,fZ8e*e+e,fZ9e,e+fZ:d„ Z;d„ Z<d,d„Z=d„ Z>d„ Z?d„ Z@d„ ZAd„ ZB G d„ d¦  «        ZCd-d„ZDd„ ZEd „ ZFd!„ ZGd"„ ZHd#„ ZId$„ ZJd%„ ZK G d&„ d'¦  «        ZLd(„ ZMd)„ ZNd*„ ZOd+„ ZPdS ).aä   Mercurial phases support code

    ---

    Copyright 2011 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
                   Logilab SA        <contact@logilab.fr>
                   Augie Fackler     <durin42@gmail.com>

    This software may be used and distributed according to the terms
    of the GNU General Public License version 2 or any later version.

    ---

This module implements most phase logic in mercurial.


Basic Concept
=============

A 'changeset phase' is an indicator that tells us how a changeset is
manipulated and communicated. The details of each phase is described
below, here we describe the properties they have in common.

Like bookmarks, phases are not stored in history and thus are not
permanent and leave no audit trail.

First, no changeset can be in two phases at once. Phases are ordered,
so they can be considered from lowest to highest. The default, lowest
phase is 'public' - this is the normal phase of existing changesets. A
child changeset can not be in a lower phase than its parents.

These phases share a hierarchy of traits:

            immutable shared
    public:     X        X
    draft:               X
    secret:

Local commits are draft by default.

Phase Movement and Exchange
===========================

Phase data is exchanged by pushkey on pull and push. Some servers have
a publish option set, we call such a server a "publishing server".
Pushing a draft changeset to a publishing server changes the phase to
public.

A small list of fact/rules define the exchange of phase:

* old client never changes server states
* pull never changes server states
* publish and old server changesets are seen as public by client
* any secret changeset seen in another repository is lowered to at
  least draft

Here is the final table summing up the 49 possible use cases of phase
exchange:

                           server
                  old     publish      non-publish
                 N   X    N   D   P    N   D   P
    old client
    pull
     N           -   X/X  -   X/D X/P  -   X/D X/P
     X           -   X/X  -   X/D X/P  -   X/D X/P
    push
     X           X/X X/X  X/P X/P X/P  X/D X/D X/P
    new client
    pull
     N           -   P/X  -   P/D P/P  -   D/D P/P
     D           -   P/X  -   P/D P/P  -   D/D P/P
     P           -   P/X  -   P/D P/P  -   P/D P/P
    push
     D           P/X P/X  P/P P/P P/P  D/D D/D P/P
     P           P/X P/X  P/P P/P P/P  P/P P/P P/P

Legend:

    A/B = final state on client / state on server

    * N = new/not present,
    * P = public,
    * D = draft,
    * X = not tracked (i.e., the old client or server has no internal
          way of recording the phase.)

    passive = only pushes


    A cell here can be read like this:

    "When a new client pushes a draft changeset (D) to a publishing
    server where it's not present (N), it's marked public on both
    sides (P/P)."

Note: old client behave as a publishing server with draft only content
- other people see it as public
- content is pushed as draft

é    Né   )Ú_)ÚbinÚhexÚnullrevÚshortÚwdirrev)ÚgetattrÚsetattr)ÚerrorÚpycompatÚrequirementsÚsmartsetÚtxnutilÚutil)ÚAnyÚCallableÚDictÚIterableÚListÚOptionalÚSetÚTuple)Ú	localrepoÚuis   >i20sé   é    é`   )s   publics   drafts   secrets   archiveds   internalc                 ó   — i | ]\  }}||“Œ	S © r    )Ú.0ÚphaseÚnames      ú2/usr/lib/python3/dist-packages/mercurial/phases.pyú
<dictcomp>r%   £   s   € ÐAÐAÐA™{˜u dˆt�UÐAÐAÐAó    c                 ó   — i | ]}||“ŒS r    r    ©r!   r"   s     r$   r%   r%   §   s   € Ð:Ð:Ð: e�U˜EÐ:Ð:Ð:r&   c                 ó   — i | ]}d |z  |“Œ	S )ó   %ir    r(   s     r$   r%   r%   ¨   s   € ÐBÐBÐB¨e�U˜U‘] EÐBÐBÐBr&   c                 ó(   — t           j        | j         v S )z6True if the internal phase can be used on a repository)r   ÚINTERNAL_PHASE_REQUIREMENT©Úrepos    r$   Úsupportinternalr/   ¯   ó   € õ Ô2°dÔ6GÐGÐGr&   c                 ó(   — t           j        | j         v S )z6True if the archived phase can be used on a repository)r   ÚARCHIVED_PHASE_REQUIREMENTr-   s    r$   Úsupportarchivedr3   µ   r0   r&   c                 óî  — |                       ¦   «         } d}d„ t          D ¦   «         }	 t          j        | j        | j        d¦  «        \  }}	 |D ]N}|                     ¦   «         \  }}|t          |¦  «                                      t          |¦  «        ¦  «         ŒO	 | 
                    ¦   «          n# | 
                    ¦   «          w xY wn%# t          $ r |r|D ]} || |¦  «        }Œd}Y nw xY w||fS )aŽ  Read phase roots from disk

    phasedefaults is a list of fn(repo, roots) callable, which are
    executed if the phase roots file does not exist. When phases are
    being initialized on an existing repository, this could be used to
    set selected changesets phase to something else than public.

    Return (roots, dirty) where dirty is true if roots differ from
    what is being stored.
    Fc                 ó,   — i | ]}|t          ¦   «         “ŒS r    ©Úset©r!   Úis     r$   r%   z_readroots.<locals>.<dictcomp>É   s   € Ð)Ð)Ð)˜!ˆQ•‘”Ð)Ð)Ð)r&   ó
   phaserootsT)Ú
unfilteredÚ	allphasesr   Ú
trypendingÚrootÚsvfsÚsplitÚintÚaddr   ÚcloseÚFileNotFoundError)	r.   ÚphasedefaultsÚdirtyÚrootsÚfÚpendingÚliner"   Únhs	            r$   Ú
_readrootsrL   »   s  € ð �?Š?ÑÔ€DØ€EØ)Ð)�yÐ)Ñ)Ô)€EðÝÔ'¨¬	°4´9¸mÑLÔL‰
ˆˆ7ð	Øð /ð /�Ø ŸJšJ™LœL‘	��rØ•c˜%‘j”jÔ!×%Ò%¥c¨"¡g¤gÑ.Ô.Ð.Ð.ð/ð �GŠG‰IŒIˆIˆIøˆA�GŠG‰IŒIˆIˆIøøøˆIøÝð ð ð Øð 	'Ø"ð 'ð '�Ø˜˜$ ™œ��Øˆˆˆð	øøøð
 �%ˆ<Ðs*   ©#C ÁAB4 ÂC Â4C
Ã
C ÃC0Ã/C0c                 óÊ   — g }|                       ¦   «         D ]8\  }}|D ]0}|                     t                               ||¦  «        ¦  «         Œ1Œ9d                     |¦  «        S )zwencode a 'phase -> nodes' mapping into a binary stream

    The revision lists are encoded as (phase, root) pairs.
    r&   )ÚitemsÚappendÚ_fphasesentryÚpackÚjoin)ÚphasemappingÚ
binarydatar"   ÚnodesÚheads        r$   ÚbinaryencoderW   Ú   su   € ð €JØ$×*Ò*Ñ,Ô,ð ?ð ?‰ˆˆuØð 	?ð 	?ˆDØ×Ò�m×0Ò0°¸Ñ=Ô=Ñ>Ô>Ð>Ð>ð	?à�8Š8�JÑÔÐr&   c                 óL  — d„ t           D ¦   «         }t          j        }	 |                      |¦  «        }t	          |¦  «        |k     r$|r!t          j        t          d¦  «        ¦  «        ‚n9t                               |¦  «        \  }}||          	                    |¦  «         Œ…|S )zÂdecode a binary stream into a 'phase -> nodes' mapping

    The (phase, root) pairs are turned back into a dictionary with
    the phase as index and the aggregated roots of that phase as value.c                 ó   — i | ]}|g “ŒS r    r    r8   s     r$   r%   z binarydecode.<locals>.<dictcomp>í   ó   € Ð-Ð-Ð-˜a�A�rÐ-Ð-Ð-r&   Ts   bad phase-heads stream)
r<   rP   ÚsizeÚreadÚlenr   ÚAbortr   ÚunpackrO   )ÚstreamÚheadsbyphaseÚ	entrysizeÚentryr"   Únodes         r$   Úbinarydecodere   ç   s¨   € ð .Ð-¥9Ð-Ñ-Ô-€LÝÔ"€Ið)Ø—’˜IÑ&Ô&ˆÝˆu‰:Œ:˜	Ò!Ð!Øð @Ý”k¥!Ð$=Ñ">Ô">Ñ?Ô?Ð?ØÝ#×*Ò*¨5Ñ1Ô1‰ˆˆtØ�UÔ×"Ò" 4Ñ(Ô(Ð(ð)ð Ðr&   c                 ó"  — d}|r#| |dz
           \  }}|d         dz   |k    o||k    }d}|t          | ¦  «        k     r | |         \  }}	|d         |dz   k    o|	|k    }|r@|r>t          |d         |d         dz   ¦  «        |f| |dz
  <   |                      |¦  «         d S |r#t          |d         |dz   ¦  «        |f| |dz
  <   d S |r t          ||d         dz   ¦  «        |f| |<   d S |                      |t          ||dz   ¦  «        |f¦  «         d S )NFr   éÿÿÿÿr   )r]   ÚrangeÚpopÚinsert)
ÚdataÚidxÚrevÚtÚmerge_beforeÚr1Út1Úmerge_afterÚr2Út2s
             r$   Ú_sortedrange_insertru   ú   sJ  € Ø€LØ
ð 5Ø�c˜A‘g”‰ˆˆBØ˜"”v ‘z SÒ(Ð4¨R°1ªWˆØ€KØ
�S�‰YŒY‚€Ø�c”‰ˆˆBØ˜”e˜s Q™wÒ&Ð2¨2°ª7ˆàð 3˜ð 3Ý˜r !œu b¨¤f¨q¡jÑ1Ô1°1Ð5ˆˆS�1‰W‰Ø�Š�‰ŒˆˆˆØ	ð 3Ý˜r !œu c¨A¡gÑ.Ô.°Ð2ˆˆS�1‰W‰ˆˆØ	ð 3Ý˜3  2¤¨¡
Ñ+Ô+¨QÐ/ˆˆS‰	ˆ	ˆ	à�Š�C�%  S¨1¡WÑ-Ô-¨qÐ1Ñ2Ô2Ð2Ð2Ð2r&   c                 óf  — | |         \  }}||k    rd S |d         |d         f}t          |¦  «        dk    r)|                      |¦  «         t          | |||¦  «         d S |d         |k    r5t          |dz   |d         dz   ¦  «        |f| |<   t          | |||¦  «         d S |d         |k    r2t          |d         |¦  «        |f| |<   t          | |dz   ||¦  «         d S t          |d         |¦  «        |ft          ||dz   ¦  «        |ft          |dz   |d         dz   ¦  «        |fg| ||dz   …<   d S )Nr   r   rg   )r]   ri   ru   rh   )rk   rl   rm   rn   rp   rq   s         r$   Ú_sortedrange_splitrw     s^  € Ø�#ŒY�F€BˆØˆB‚w€wØˆØ	ˆAŒ��!”ˆ€AÝ
ˆ2�w„w�!‚|€|Ø�Š�‰ŒˆÝ˜D # s¨AÑ.Ô.Ð.Ð.Ð.Ø	ˆAŒ�#ŠˆÝ˜3 ™7 B r¤F¨Q¡JÑ/Ô/°Ð4ˆˆS‰	Ý˜D # s¨AÑ.Ô.Ð.Ð.Ð.Ø	ˆBŒ�3ŠˆÝ˜2˜aœ5 #Ñ&Ô&¨Ð+ˆˆS‰	Ý˜D #¨¡'¨3°Ñ2Ô2Ð2Ð2Ð2õ �2�a”5˜#ÑÔ Ð#Ý�3˜˜a™Ñ Ô  !Ð$Ý�3˜‘7˜B˜rœF Q™JÑ'Ô'¨Ð,ð
ˆˆS�3˜‘7ˆ]ÑÐÐr&   c                 ó  — | €dS | s-|                       dt          ||dz   ¦  «        ||ff¦  «         dS d}t          | ¦  «        }||f}||k     �r||z   dz  }| |         d         }|d         }	|d         }
||	k    r||
k    rt          | |||¦  «         dS |	|dz   k    rG|r1| |dz
           d         d         |k    rt          | |dz
  ||¦  «         nt	          | |||¦  «         dS |
|dz
  k    r^|dz   t          | ¦  «        k     r1| |dz            d         d         |k    rt          | |dz   ||¦  «         nt	          | |dz   ||¦  «         dS |	|k    r|}n|dz   }||k     �°|t          | ¦  «        k    r*|                      t          ||dz   ¦  «        |f¦  «         dS | |         \  }}|d         |k    r+|                       |t          ||dz   ¦  «        |f¦  «         dS |                       |dz   t          ||dz   ¦  «        |f¦  «         dS )zYadd a phase move to the <data> list of ranges

    If data is None, nothing happens.
    Nr   r   é   rg   )rj   rh   r]   rw   ru   rO   )rk   rm   ÚoldÚnewÚlowÚhighrn   ÚmidÚrevsÚrevs_lowÚ	revs_highrp   rq   s                r$   Ú_trackphasechanger‚   %  s{  € ð
 €|Øˆð ð Ø�Š�A�˜c 3¨¡7Ñ+Ô+¨c°3¨ZÐ8Ñ9Ô9Ð9Øˆà
€CÝˆt‰9Œ9€DØ	ˆcˆ
€AØ
�Š*‰*Ø�T‰z˜aÑˆØ�CŒy˜Œ|ˆØ˜”7ˆØ˜”Hˆ	à�(Š?ˆ?˜s iÒ/Ð/Ý˜t S¨#¨qÑ1Ô1Ð1ØˆFà�s˜Q‘wÒÐØð 7�t˜C !™G”} QÔ'¨Ô+¨sÒ2Ð2Ý" 4¨¨q©°#°qÑ9Ô9Ð9Ð9å# D¨#¨s°AÑ6Ô6Ð6ØˆFà˜˜a™ÒÐØ�Q‰w�˜T™œÒ"Ð" t¨C°!©G¤}°QÔ'7¸Ô':¸cÒ'AÐ'AÝ" 4¨¨q©°#°qÑ9Ô9Ð9Ð9å# D¨#°©'°3¸Ñ:Ô:Ð:ØˆFà�cŠ>ˆ>ØˆDˆDà˜‘'ˆCð7 �Š*‰*ð: �c�$‰iŒiÒÐØ�Š•U˜3  a¡Ñ(Ô(¨!Ð,Ñ-Ô-Ð-Øˆà�#ŒY�F€BˆØ	ˆ!„uˆs‚{€{Ø�Š�C�%  S¨1¡WÑ-Ô-¨qÐ1Ñ2Ô2Ð2Ð2Ð2à�Š�C˜!‘G�e C¨¨q©Ñ1Ô1°1Ð5Ñ6Ô6Ð6Ð6Ð6r&   c                   óŠ   — e Zd Zdd„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„ Z	 dd„Zd„ Zdd„Zd„ ZdS )Ú
phasecacheTc                 ó¦   — |rNt          ||¦  «        \  | _        | _        d| _        d | _        |                      |¦  «         |j        | _        d S d S ©Nr   )rL   Ú
phaserootsrF   Ú_loadedrevslenÚ
_phasesetsÚfilterunknownr?   Úopener)Úselfr.   rE   Ú_loads       r$   Ú__init__zphasecache.__init__^  s\   € àð 	$å*4°T¸=Ñ*IÔ*IÑ'ˆDŒO˜TœZØ"#ˆDÔØ"ˆDŒOØ×Ò˜tÑ$Ô$Ð$Øœ)ˆDŒKˆKˆKð	$ð 	$r&   c                 ó  — |                      ¦   «         }|j        }t          |¦  «        | j        k    r)|                      ¦   «          |                      |¦  «         t          d„ | j                             ¦   «         D ¦   «         ¦  «        S )z3detect if there are revisions with non-public phasec              3   ó6   K  — | ]\  }}|t           k    ¯|V — Œd S ©N©Úpublic©r!   r"   r   s      r$   ú	<genexpr>z0phasecache.hasnonpublicphases.<locals>.<genexpr>p  s3   è è € ð 
ð 
Ù �U˜D¸uÍº¸ˆD¸¸¸¸ð
ð 
r&   )	r;   Ú	changelogr]   rˆ   Ú
invalidateÚloadphaserevsÚanyr‡   rN   ©rŒ   r.   Úcls      r$   Úhasnonpublicphaseszphasecache.hasnonpublicphasesh  sŽ   € ð �ŠÑ Ô ˆØŒ^ˆÝˆr‰7Œ7�dÔ)Ò)Ð)Ø�OŠOÑÔÐØ×Ò˜tÑ$Ô$Ð$Ýð 
ð 
Ø$(¤O×$9Ò$9Ñ$;Ô$;ð
ñ 
ô 
ñ 
ô 
ð 	
r&   c                 ó(  — |                      ¦   «         }|j        }t          |¦  «        | j        k    r)|                      ¦   «          |                      |¦  «          t          ¦   «         j        d„ | j         	                    ¦   «         D ¦   «         Ž S )zÃreturns the roots of all non-public phases

        The roots are not minimized, so if the secret revisions are
        descendants of draft revisions, their roots will still be present.
        c                 ó.   — g | ]\  }}|t           k    ¯|‘ŒS r    r’   r”   s      r$   ú
<listcomp>z2phasecache.nonpublicphaseroots.<locals>.<listcomp>�  s-   € ð ð ð á�E˜4Ø�F’?�?ð à"�?�?r&   )
r;   r–   r]   rˆ   r—   r˜   r7   Úunionr‡   rN   rš   s      r$   Únonpublicphaserootszphasecache.nonpublicphaserootst  s‘   € ð �ŠÑ Ô ˆØŒ^ˆÝˆr‰7Œ7�dÔ)Ò)Ð)Ø�OŠOÑÔÐØ×Ò˜tÑ$Ô$Ð$Ø�s‰uŒuŒ{ðð à#'¤?×#8Ò#8Ñ#:Ô#:ðñ ô ð
ð 	
r&   Nc                 ó   ‡ ‡‡‡‡— ‰                       ‰¦  «         t          ‰¦  «        Št          ‰v }|r=t          t          ¦  «                             ‰¦  «        Š‰st          j        ‰¦  «        S dŠt          ‰¦  «        dk    r‰\  }‰ j        |         ŠdŠnt          j	        ˆ fd„‰D ¦   «         Ž Šˆˆˆfd„}|sT‰j
        j        r‰‰j
        j        z
  Š|€t          j        ‰¦  «        S  ||‰¦  «        Š|t          j        ‰¦  «        z  S |€t          j        ‰¦  «        } ||‰¦  «        Š‰s|S |                     ˆfd„¦  «        S )z&return a smartset for the given phasesFr   Tc                 ó*   •— g | ]}‰j         |         ‘ŒS r    )r‰   )r!   ÚprŒ   s     €r$   rŸ   z(phasecache.getrevset.<locals>.<listcomp>Ÿ  s    ø€ ÐBÐBÐB°a˜tœ¨qÔ1ÐBÐBÐBr&   c                 ó²   •— t           | v rL‰d                               ¦   «         ‰v r0‰r|                     ¦   «         }|                     t           ¦  «         |S r‘   )r	   r"   ÚcopyrB   )Ú
wdirsubsetÚwdirrevsÚphasesr.   Úrevsneedscopys     €€€r$   Ú_addwdirz&phasecache.getrevset.<locals>._addwdir¡  sV   ø€ Ý˜*Ð$Ð$¨¨d¬×)9Ò)9Ñ);Ô);¸vÐ)EÐ)EØ ð /Ø'Ÿ}š}™œ�Hð
 —’�WÑ%Ô%Ð%ØˆOr&   Nc                 ó   •— | ‰vS r‘   r    )Úrr   s    €r$   ú<lambda>z&phasecache.getrevset.<locals>.<lambda>½  s   ø€ ¨1°D¨=€ r&   )r˜   r7   r“   r<   Ú
differencer   Úfullreposetr]   r‰   r    r–   ÚfilteredrevsÚbasesetÚfilter)	rŒ   r.   r©   ÚsubsetÚpublicphaser¤   r«   r   rª   s	   ```    @@r$   Ú	getrevsetzphasecache.getrevsetˆ  s–  øøøøø€ ð 	×Ò˜4Ñ Ô Ð Ý�V‘”ˆÝ Ð&ˆàð 	2å�‘^”^×.Ò.¨vÑ6Ô6ˆFØð 2ÝÔ+¨DÑ1Ô1Ð1ð ˆÝˆv‰;Œ;˜!ÒÐØ‰CˆQØ”? 1Ô%ˆDØ ˆMˆMõ ”9ÐBÐBÐBÐB¸6ÐBÑBÔBÐCˆDð		ð 		ð 		ð 		ð 		ð 		ð 		ð ð 	:ØŒ~Ô*ð :Ø˜dœnÔ9Ñ9�àˆ~ÝÔ'¨Ñ-Ô-Ð-à�x ¨Ñ-Ô-�Ø¥Ô 0°Ñ 6Ô 6Ñ6Ð6àˆ~Ý!Ô-¨dÑ3Ô3�à�8˜F DÑ)Ô)ˆDàð Ø�Ø—=’=Ð!8Ð!8Ð!8Ð!8Ñ9Ô9Ð9r&   c                 óÒ   — |                       d d d¬¦  «        }| j                             ¦   «         |_        | j        |_        | j        |_        | j        |_        | j        |_        |S )NF)r�   )Ú	__class__r‡   r¦   rF   r‹   rˆ   r‰   )rŒ   Úphs     r$   r¦   zphasecache.copy¿  s[   € ð �^Š^˜D $¨eˆ^Ñ4Ô4ˆØœ×,Ò,Ñ.Ô.ˆŒØ”:ˆŒØ”KˆŒ	Ø Ô/ˆÔØœˆŒØˆ	r&   c           	      óN   — dD ]!}t          | |t          ||¦  «        ¦  «         Œ"dS )z4replace all values in 'self' with content of phcache)r:   s   dirtys   openers   _loadedrevslens
   _phasesetsN)r   r
   )rŒ   ÚphcacheÚas      r$   Úreplacezphasecache.replaceÊ  s>   € ð
ð 	2ð 	2ˆAõ �D˜!�W W¨aÑ0Ô0Ñ1Ô1Ð1Ð1ð	2ð 	2r&   c                 óh   — |                      ¦   «         }|j                             | j        ¦  «        S r‘   )r;   r–   Úcomputephasesr‡   )rŒ   r.   s     r$   Ú_getphaserevsnativezphasecache._getphaserevsnativeÕ  s)   € Ø�ŠÑ Ô ˆØŒ~×+Ò+¨D¬OÑ<Ô<Ð<r&   c                 ó  — |                      ¦   «         }|j        }d„ t          D ¦   «         | _        t	          ¦   «         }t          t          ¦  «        D ]™}t          j        |j	        | j
        |         ¦  «        }|rpt	          |                     |¦  «        ¦  «        }|D ]}|                     |¦  «         Œ|                     |¦  «         |                     |¦  «         || j        |<   Œšt          |¦  «        | _        d S )Nc                 ó,   — i | ]}|t          ¦   «         “ŒS r    r6   r(   s     r$   r%   z4phasecache._computephaserevspure.<locals>.<dictcomp>Ü  s   € Ð?Ð?Ð?¨E˜5¥#¡%¤%Ð?Ð?Ð?r&   )r;   r–   r<   r‰   r7   ÚreversedÚtrackedphasesr   Úmaplistrm   r‡   ÚdescendantsrB   Údifference_updateÚupdater]   rˆ   )rŒ   r.   r›   Ú
lowerrootsr"   rG   Úpsr>   s           r$   Ú_computephaserevspurez phasecache._computephaserevspureÙ  sò   € Ø�ŠÑ Ô ˆØŒ^ˆØ?Ð?µYÐ?Ñ?Ô?ˆŒÝ‘U”Uˆ
Ý�mÑ,Ô,ð 	,ð 	,ˆEÝÔ$ R¤V¨T¬_¸UÔ-CÑDÔDˆEØð ,Ý˜Ÿš¨Ñ.Ô.Ñ/Ô/�Ø!ð !ð !�DØ—F’F˜4‘L”L�L�LØ×$Ò$ ZÑ0Ô0Ð0Ø×!Ò! "Ñ%Ô%Ð%Ø)+�” Ñ&øÝ! "™gœgˆÔÐÐr&   c                 ó®   — | j         €M	 |                      |¦  «        }|\  | _        | _         dS # t          $ r |                      |¦  «         Y dS w xY wdS )z0ensure phase information is loaded in the objectN)r‰   rÀ   rˆ   ÚAttributeErrorrË   )rŒ   r.   Úress      r$   r˜   zphasecache.loadphaserevsé  sw   € ð Œ?Ð"ð1Ø×.Ò.¨tÑ4Ô4�Ø7:Ñ4�Ô# T¤_ _ _øÝ!ð 1ð 1ð 1Ø×*Ò*¨4Ñ0Ô0Ð0Ð0Ð0Ð0ð1øøøð	 #Ð"s   ‰$/ ¯AÁAc                 ó"   — d| _         d | _        d S r†   )rˆ   r‰   )rŒ   s    r$   r—   zphasecache.invalidateó  s   € ØˆÔØˆŒˆˆr&   c                 ó$  — |t           k    rt          S |t           k     rt          t          d¦  «        ¦  «        ‚|| j        k    r)|                      ¦   «          |                      |¦  «         t          D ]}|| j        |         v r|c S Œt          S )Ns   cannot lookup negative revision)	r   r“   Ú
ValueErrorr   rˆ   r—   r˜   rÄ   r‰   )rŒ   r.   rm   r"   s       r$   r"   zphasecache.phase÷  s˜   € ð •'Š>ˆ>ÝˆMØ•Š=ˆ=Ý�QÐAÑBÔBÑCÔCÐCØ�$Ô%Ò%Ð%Ø�OŠOÑÔÐØ×Ò˜tÑ$Ô$Ð$Ý"ð 	ð 	ˆEØ�d”o eÔ,Ð,Ð,Ø���ð -åˆr&   c                 óÐ   — | j         sd S |                      dddd¬¦  «        }	 |                      |¦  «         |                     ¦   «          d S # |                     ¦   «          w xY w)Nr:   ó   wT)Ú
atomictempÚ
checkambig)rF   r‹   Ú_writerC   )rŒ   rH   s     r$   Úwritezphasecache.write
  sa   € ØŒzð 	ØˆFØ�KŠK˜ t¸ÈˆKÑNÔNˆð	Ø�KŠK˜‰NŒNˆNà�GŠG‰IŒIˆIˆIˆIøˆA�GŠG‰IŒIˆIˆIøøøs   ¤A ÁA%c           	      óÄ   — | j                              ¦   «         D ]>\  }}t          |¦  «        D ])}|                     d|t	          |¦  «        fz  ¦  «         Œ*Œ?d| _        d S )Ns   %i %s
F)r‡   rN   Úsortedr×   r   rF   )rŒ   Úfpr"   rG   Úhs        r$   rÖ   zphasecache._write  sl   € Ø œO×1Ò1Ñ3Ô3ð 	7ð 	7‰LˆE�5Ý˜E‘]”]ð 7ð 7�Ø—’˜ u­c°!©f¬f oÑ5Ñ6Ô6Ð6Ð6ð7àˆŒ
ˆ
ˆ
r&   c                 óœ   — || j         |<   |                      ¦   «          d| _        |                     dd| j        ¦  «         d|j        d<   d S )NTó   phase)r:   ó   1s   phases_moved)r‡   r—   rF   ÚaddfilegeneratorrÖ   Úhookargs)rŒ   r"   ÚnewrootsÚtrs       r$   Ú_updaterootszphasecache._updateroots  sR   € Ø!)ˆŒ˜ÑØ�ŠÑÔÐØˆŒ
à
×Ò˜HÐ&6¸¼ÑDÔDÐDØ'+ˆŒ�OÑ$Ð$Ð$r&   c                 ó(  — |                      ¦   «         }|                      |||g |¬¦  «         |�Md|j        v rD|j        d         }| j        }t	          |¦  «        D ] } |||¦  «        }t          ||d |¦  «         Œ!|                     ¦   «          d S )N)r   ó   phases)r;   Ú_retractboundaryÚchangesr"   rÙ   r‚   Úinvalidatevolatilesets)	rŒ   r.   râ   Útargetphaser   Úphasetrackingr"   rm   Úrevphases	            r$   Úregisternewzphasecache.registernew!  s«   € Ø�ŠÑ Ô ˆØ×Ò˜d B¨°R¸dÐÑCÔCÐCØˆ>˜i¨2¬:Ð5Ð5ØœJ yÔ1ˆMØ”JˆEÝ˜d‘|”|ð Fð F�Ø ˜5  sÑ+Ô+�Ý! -°°d¸HÑEÔEÐEÐEØ×#Ò#Ñ%Ô%Ð%Ð%Ð%r&   c           
      ó  ‡ ‡‡‡— |€g }|€d}n|j                              d¦  «        }‰                     ¦   «         Šˆfd„|D ¦   «         d„ |D ¦   «         z   }t          ¦   «         }g }	ˆfd„t          D ¦   «         D ]ÓŠˆˆˆ fd„|D ¦   «         }|s n¾‰ j        ‰         }
‰                     d|
|¦  «        }|                     |¦  «         |rŒR|D ](}t          ||‰  	                    ‰|¦  «        ‰¦  «         Œ)d„ ‰                     d	|
|¦  «        D ¦   «         }|
|k    r/‰  
                    ‰||¦  «         |	                     |
|z
  ¦  «         ŒÔ|s2‰d
k    r‰                      ‰|‰|	¦  «         ‰                     ¦   «          |S )zúSet all 'nodes' to phase 'targetphase'

        Nodes with a phase lower than 'targetphase' are not affected.

        If dryrun is True, no actions will be performed

        Returns a set of revs whose phase is changed or should be changed
        Nrå   c                 óD   •— g | ]}‰|                               ¦   «         ‘ŒS r    )rm   )r!   Únr.   s     €r$   rŸ   z.phasecache.advanceboundary.<locals>.<listcomp>A  s%   ø€ Ð-Ð-Ð- !��Q”—’‘”Ð-Ð-Ð-r&   c                 ó   — g | ]}|‘ŒS r    r    ©r!   r­   s     r$   rŸ   z.phasecache.advanceboundary.<locals>.<listcomp>A  s   € Ð0AÐ0AÐ0A°q°Ð0AÐ0AÐ0Ar&   c              3   ó(   •K  — | ]}|‰k    ¯|V — Œd S r‘   r    )r!   r"   ré   s     €r$   r•   z-phasecache.advanceboundary.<locals>.<genexpr>E  s-   øè è € ÐJÐJ °e¸kÒ6IÐ6I�eÐ6IÐ6IÐ6IÐ6IÐJÐJr&   c                 óH   •— g | ]}‰                      ‰|¦  «        ‰k    ¯|‘ŒS r    ©r"   )r!   rm   r"   r.   rŒ   s     €€€r$   rŸ   z.phasecache.advanceboundary.<locals>.<listcomp>G  s1   ø€ ÐJÐJÐJ˜C¨4¯:ª:°d¸CÑ+@Ô+@ÀEÒ+IÐ+I�CÐ+IÐ+IÐ+Ir&   ó   %ln::%ldc                 ó6   — h | ]}|                      ¦   «         ’ŒS r    ©rd   )r!   Úctxs     r$   ú	<setcomp>z-phasecache.advanceboundary.<locals>.<setcomp>V  s0   € ð ð ð àð —’‘
”
ðð ð r&   s   roots((%ln::) - %ld)r   )rç   Úgetr;   r7   r<   r‡   r   rÈ   r‚   r"   rã   Úextendræ   rè   )rŒ   r.   râ   ré   rU   r   Údryrunrê   rç   ÚdelrootsÚoldsÚaffectedr­   rG   r"   s   `` `          @r$   Úadvanceboundaryzphasecache.advanceboundary,  sò  øøøø€ ð ˆ<ØˆDØˆ:Ø ˆMˆMàœJŸNšN¨9Ñ5Ô5ˆMà�ŠÑ Ô ˆØ-Ð-Ð-Ð- uÐ-Ñ-Ô-Ð0AÐ0A¸DÐ0AÑ0AÔ0AÑAˆå‘%”%ˆØˆØJÐJÐJÐJ­ÐJÑJÔJð 	.ð 	.ˆEàJÐJÐJÐJÐJÐJ 4ÐJÑJÔJˆDØð Ø�à”? 5Ô)ˆDà—y’y ¨d°DÑ9Ô9ˆHØ�NŠN˜8Ñ$Ô$Ð$Øð ØØð ð �Ý!Ø! 1 d§j¢j°°qÑ&9Ô&9¸;ñô ð ð ðð àŸ8š8Ð$;¸TÀ8ÑLÔLðñ ô ˆEð �uŠ}ˆ}Ø×!Ò! %¨°Ñ3Ô3Ð3à—’  u¡Ñ-Ô-Ð-øØð 	*à˜aÒÐØ×%Ò% d¨B°¸XÑFÔFÐFØ×'Ò'Ñ)Ô)Ð)Øˆr&   c                 ó~  ‡— ˆfd„| j                              ¦   «         D ¦   «         }|€d }n|j                             d¦  «        }|                     ¦   «         }|                      ||‰|¦  «        r·|�µ| j         ‰         }|‰         }t          |                     d||¦  «        ¦  «        }	t          ‰dd¦  «        D ]j}
|
r@|                     |
g ¦  «        }t          |                     d||	¦  «        ¦  «        }|	|z  }	n|	}t          |¦  «        D ]}t          |||
‰¦  «         ŒŒk|                     ¦   «          d S )Nc                 ó(   •— i | ]\  }}|‰k    ¯||“ŒS r    r    )r!   r"   r   ré   s      €r$   r%   z.phasecache.retractboundary.<locals>.<dictcomp>f  s4   ø€ ð 
ð 
ð 
á��tØ˜Ò#Ð#ð �4à#Ð#Ð#r&   rå   s   (%ln::) - (%ln::)rg   rõ   )r‡   rN   rç   rú   r;   ræ   r7   r   rh   rÙ   r‚   rè   )rŒ   r.   râ   ré   rU   Úoldrootsrê   r{   rz   rÿ   r"   rG   r   r­   s      `          r$   Úretractboundaryzphasecache.retractboundarye  sv  ø€ ð
ð 
ð 
ð 
à#œ×4Ò4Ñ6Ô6ð
ñ 
ô 
ˆð
 ˆ:Ø ˆMˆMàœJŸNšN¨9Ñ5Ô5ˆMØ�ŠÑ Ô ˆà×!Ò! $¨¨K¸Ñ?Ô?ð	LàÐ)ð ”/ +Ô.ˆCØ˜;Ô'ˆCÝ˜4Ÿ9š9Ð%9¸3ÀÑDÔDÑEÔEˆHõ ˜{¨B°Ñ3Ô3ð Lð L�Øð $Ø$ŸLšL¨°Ñ3Ô3�EÝ˜tŸyšy¨°e¸XÑFÔFÑGÔG�DØ Ñ$�H�Hà#�DÝ ™œð Lð L�AÝ% m°Q¸¸{ÑKÔKÐKÐKðLà×#Ò#Ñ%Ô%Ð%Ð%Ð%r&   c                 óT  ‡ ‡‡‡‡‡— |€g }‰t           k    rt          ‰¦  «        r‰t          k    r5t          ‰¦  «        s&t          ‰         }d|z  }t          j        |¦  «        ‚‰                     ¦   «         Š‰j        j	        Š‰j        j
        Šˆfd„‰ j        ‰         D ¦   «         }t          |¦  «        x}	}
ˆfd„|D ¦   «         d„ |D ¦   «         z   }ˆˆ ˆfd„|D ¦   «         }|r•t          |v r!t          j        t          d¦  «        ¦  «        ‚|                     |¦  «         t#          |¦  «        Šˆfd„|D ¦   «         }‰                     d|¦  «        }ˆfd	„|D ¦   «         }	|	                     |¦  «         |	|
k    r%‰                      ‰ˆfd
„|	D ¦   «         |¦  «         dS dS )Ns-   this repository does not support the %s phasec                 ó&   •— h | ]} ‰|¦  «        ’ŒS r    r    ©r!   rd   Útorevs     €r$   rù   z.phasecache._retractboundary.<locals>.<setcomp>˜  s!   ø€ ÐMÐMÐM¨˜˜˜d™œÐMÐMÐMr&   c                 ó&   •— g | ]} ‰|¦  «        ‘ŒS r    r    r  s     €r$   rŸ   z/phasecache._retractboundary.<locals>.<listcomp>š  s!   ø€ Ð2Ð2Ð2 D�E�E˜$‘K”KÐ2Ð2Ð2r&   c                 ó   — g | ]}|‘ŒS r    r    rñ   s     r$   rŸ   z/phasecache._retractboundary.<locals>.<listcomp>š  s   € Ð5FÐ5FÐ5F¸A°aÐ5FÐ5FÐ5Fr&   c                 óH   •— g | ]}‰                      ‰|¦  «        ‰k     ¯|‘ŒS r    rô   )r!   rm   r.   rŒ   ré   s     €€€r$   rŸ   z/phasecache._retractboundary.<locals>.<listcomp>›  s8   ø€ ð 
ð 
ð 
Ø t§z¢z°$¸Ñ'<Ô'<¸{Ò'JÐ'JˆCÐ'JÐ'JÐ'Jr&   s!   cannot change null revision phasec                 ó    •— g | ]
}|‰k    ¯|‘ŒS r    r    ©r!   rm   Ú
minnewroots     €r$   rŸ   z/phasecache._retractboundary.<locals>.<listcomp>§  s#   ø€ ÐKÐKÐK #¸À
Ò9JÐ9J˜#Ð9JÐ9JÐ9Jr&   s   roots(%ld::)c                 ó    •— h | ]
}|‰k     ¯|’ŒS r    r    r  s     €r$   rù   z.phasecache._retractboundary.<locals>.<setcomp>ª  s#   ø€ ÐJÐJÐJ #¸¸zÒ9IÐ9I˜#Ð9IÐ9IÐ9Ir&   c                 ó&   •— h | ]} ‰|¦  «        ’ŒS r    r    )r!   rm   Útonodes     €r$   rù   z.phasecache._retractboundary.<locals>.<setcomp>®  s!   ø€ Ð@Ð@Ð@¨c˜f˜f S™kœkÐ@Ð@Ð@r&   TF)Úinternalr/   Úarchivedr3   Ú
phasenamesr   ÚProgrammingErrorr;   r–   rm   rd   r‡   r7   r   r^   r   rÈ   Úminr   rã   )rŒ   r.   râ   ré   rU   r   r#   ÚmsgÚcurrentrootsÚ
finalrootsr  rá   Ú
aboverootsÚupdatedrootsr  r  r  s   `` `          @@@r$   ræ   zphasecache._retractboundary†  s  øøøøøø€ ð ˆ<ØˆDà�8Ò#Ð#Ý# DÑ)Ô)ð $à�hÒ&Ð&Ý# DÑ)Ô)ð 'õ ˜kÔ*ˆDØBÀTÑIˆCÝÔ(¨Ñ-Ô-Ð-à�ŠÑ Ô ˆØ”Ô"ˆØ”Ô$ˆØMÐMÐMÐM°´ÀÔ0LÐMÑMÔMˆÝ # LÑ 1Ô 1Ð1ˆ
�XØ2Ð2Ð2Ð2¨EÐ2Ñ2Ô2Ð5FÐ5FÀÐ5FÑ5FÔ5FÑFˆð
ð 
ð 
ð 
ð 
ð 
Ø#ð
ñ 
ô 
ˆð ð 	,Ý˜(Ð"Ð"Ý”k¥!Ð$HÑ"IÔ"IÑJÔJÐJØ×Ò Ñ)Ô)Ð)õ ˜X™œˆJØKÐKÐKÐK¨ÐKÑKÔKˆJØŸ9š9 _°jÑAÔAˆLàJÐJÐJÐJ¨ÐJÑJÔJˆJØ×Ò˜lÑ+Ô+Ð+Ø˜Ò!Ð!Ø×ÒØÐ@Ð@Ð@Ð@°ZÐ@Ñ@Ô@À"ñô ð ð �4Øˆur&   c                 óp  ‡— d}|j         j        j        Š| j                             ¦   «         D ]j\  }}t          ˆfd„|D ¦   «         ¦  «        }|rH|D ].}|j                             dt          |¦  «        |fz  ¦  «         Œ/| 	                    |¦  «         d}Œk|rd| _
        |                      ¦   «          dS )z…remove unknown nodes from the phase boundary

        Nothing is lost as unknown nodes only hold data for their descendants.
        Fc              3   ó2   •K  — | ]} ‰|¦  «        °|V — Œd S r‘   r    )r!   rd   Úhas_nodes     €r$   r•   z+phasecache.filterunknown.<locals>.<genexpr>¼  s0   øè è € ÐJÐJ d¸8¸8ÀD¹>¼>ÐJ˜TÐJÐJÐJÐJÐJÐJr&   s0   removing unknown node %s from %i-phase boundary
TN)r–   Úindexr  r‡   rN   rÙ   r   Údebugr   Úsymmetric_difference_updaterF   r—   )rŒ   r.   Úfilteredr"   rU   ÚmissingÚmnoder  s          @r$   rŠ   zphasecache.filterunknown³  sç   ø€ ð ˆØ”>Ô'Ô0ˆØ œO×1Ò1Ñ3Ô3ð 		 ð 		 ‰LˆE�5ÝÐJÐJÐJÐJ¨eÐJÑJÔJÑJÔJˆGØð  Ø$ð ð �EØ”G—M’MØLÝ  ™<œ<¨Ð/ñ0ñô ð ð ð ×1Ò1°'Ñ:Ô:Ð:Ø�øØð 	ØˆDŒJð 	�ŠÑÔÐÐÐr&   )Tr‘   ©NN)Ú__name__Ú
__module__Ú__qualname__rŽ   rœ   r¡   r¶   r¦   r½   rÀ   rË   r˜   r—   r"   r×   rÖ   rã   rì   r   r  ræ   rŠ   r    r&   r$   r„   r„   ]  sO  € € € € € ð$ð $ð $ð $ð

ð 

ð 

ð
ð 
ð 
ð(5:ð 5:ð 5:ð 5:ðn	ð 	ð 	ð	2ð 	2ð 	2ð=ð =ð =ð&ð &ð &ð 1ð 1ð 1ðð ð ðð ð ð&ð ð ðð ð ð,ð ,ð ,ð	&ð 	&ð 	&ð ?Cð7ð 7ð 7ð 7ðr&ð &ð &ðB+ð +ð +ð +ðZð ð ð ð r&   r„   c                 ó®   — |€g }| j                              ¦   «         }|                     | |||||¬¦  «        }|s| j                              |¦  «         |S )au  Add nodes to a phase changing other nodes phases if necessary.

    This function move boundary *forward* this means that all nodes
    are set in the target phase or kept in a *lower* phase.

    Simplify boundary to contains phase roots only.

    If dryrun is True, no actions will be performed

    Returns a set of revs whose phase is changed or should be changed
    N)r   rü   )Ú_phasecacher¦   r   r½   )r.   râ   ré   rU   r   rü   r»   rç   s           r$   r   r   Ò  so   € ð €|ØˆØÔ×#Ò#Ñ%Ô%€GØ×%Ò%Øˆb�+˜u¨4¸ð &ñ ô €Gð ð *ØÔ× Ò  Ñ)Ô)Ð)Ø€Nr&   c                 óœ   — | j                              ¦   «         }|                     | |||¦  «         | j                              |¦  «         dS )zÿSet nodes back to a phase changing other nodes phases if
    necessary.

    This function move boundary *backward* this means that all nodes
    are set in the target phase or kept in a *higher* phase.

    Simplify boundary to contains phase roots only.N)r*  r¦   r  r½   )r.   râ   ré   rU   r»   s        r$   r  r  é  sO   € ð Ô×#Ò#Ñ%Ô%€GØ×Ò˜D " k°5Ñ9Ô9Ð9ØÔ×Ò˜WÑ%Ô%Ð%Ð%Ð%r&   c                 óœ   — | j                              ¦   «         }|                     | |||¦  «         | j                              |¦  «         dS )z¬register a new revision and its phase

    Code adding revisions to the repository should use this function to
    set new changeset in their target phase (or higher).
    N)r*  r¦   rì   r½   )r.   râ   ré   r   r»   s        r$   rì   rì   ö  sO   € ð Ô×#Ò#Ñ%Ô%€GØ×Ò˜˜b +¨tÑ4Ô4Ð4ØÔ×Ò˜WÑ%Ô%Ð%Ð%Ð%r&   c                 ój  — t          j        ¦   «         }dt          z  }|                      ¦   «         j        }| j        j        t                   D ]K}| j                             | |                     |¦  «        ¦  «        t          k    r||t          |¦  «        <   ŒL|  
                    ¦   «         rd|d<   |S )ú/List phases root for serialization over pushkeyr*   s   Trueó
   publishing)r   ÚsortdictÚdraftr;   r–   r*  r‡   r"   rm   r   Ú
publishing)r.   ÚkeysÚvaluer›   r>   s        r$   Ú
listphasesr5    sŸ   € õ Œ=‰?Œ?€DØ•E‰M€EØ	�ŠÑ	Ô	Ô	$€BØÔ Ô+­EÔ2ð $ð $ˆØÔ×!Ò! $¨¯ª¨t©¬Ñ5Ô5½Ò>Ð>Ø#ˆD•�T‘”‰Oøà‡‚ÑÔð &ð" &ˆˆ]ÑØ€Kr&   c           
      ó$  — |                       ¦   «         } |                      ¦   «         5  | |                              ¦   «         }t          t	          |¦  «        ¦  «        }t          t	          |¦  «        ¦  «        }||k    ra||k     r[|                      d¦  «        5 }t          | ||t          |¦  «        g¦  «         ddd¦  «         n# 1 swxY w Y   	 ddd¦  «         dS ||k    r	 ddd¦  «         dS 	 ddd¦  «         dS # 1 swxY w Y   dS )r.  s   pushkey-phaseNTF)r;   Úlockr"   ÚabsrA   Útransactionr   r   )r.   ÚnhexÚoldphasestrÚnewphasestrÚcurrentphaseÚnewphaseÚoldphaserâ   s           r$   Ú	pushphaser@  !  sÔ  € ð �?Š?ÑÔ€DØ	�Š‰Œð ð Ø˜D”z×'Ò'Ñ)Ô)ˆÝ•s˜;Ñ'Ô'Ñ(Ô(ˆÝ•s˜;Ñ'Ô'Ñ(Ô(ˆØ˜8Ò#Ð#¨°8Ò(;Ð(;Ø×!Ò!Ð"2Ñ3Ô3ð A°rÝ  b¨(µS¸±Y´Y°KÑ@Ô@Ð@ðAð Að Añ Aô Að Að Að Að Að Að Aøøøð Að Að Að Aàðð ð ñ ô ð ð ð ð ˜XÒ%Ð%àðð ð ñ ô ð ð ð ð ðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð sB   ©A4DÂ!C
Â>DÃ
C	ÃDÃC	ÃDÃ#DÃ7DÄD	ÄD	c                 óÐ   ‡— | j         Šd„ t          D ¦   «         }t          dt          …         D ]7}dt          |         z  }ˆfd„|                      ||¦  «        D ¦   «         ||<   Œ8|S )z“Finds the phase heads for a subset of a history

    Returns a list indexed by phase number where each item is a list of phase
    head nodes.
    c                 ó   — i | ]}|g “ŒS r    r    r8   s     r$   r%   z$subsetphaseheads.<locals>.<dictcomp><  rZ   r&   Ns   heads(%%ln & %s())c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r    r÷   )r!   r­   r›   s     €r$   rŸ   z$subsetphaseheads.<locals>.<listcomp>A  s#   ø€ ÐMÐMÐM¨a˜rŸwšw q™zœzÐMÐMÐMr&   )r–   r<   Úsecretr  r   )r.   r´   ra   r"   Úrevsetr›   s        @r$   ÚsubsetphaseheadsrF  4  s   ø€ ð 
Œ€Bà-Ð-¥9Ð-Ñ-Ô-€Lõ ˜7�F˜7Ô#ð Nð NˆØ&­°EÔ):Ñ:ˆØMÐMÐMÐM°4·9²9¸VÀVÑ3LÔ3LÐMÑMÔMˆ�UÑÐØÐr&   c                 ó¤   — t           D ]G}d}d„ |                      |||         |¦  «        D ¦   «         }|rt          |  |¦   «         ||¦  «         ŒHdS )z+Updates the repo with the given phase headss   %ln - _phase(%s)c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r    r÷   ©r!   Úcs     r$   rŸ   z updatephases.<locals>.<listcomp>N  s    € ÐPÐPÐP˜a�—’‘”ÐPÐPÐPr&   N)r<   r7   r   )r.   Útrgetterra   r"   rE  Úheadss         r$   ÚupdatephasesrM  E  sm   € õ ð <ð <ˆØ$ˆØPÐP 4§8¢8¨F°LÀÔ4GÈÑ#OÔ#OÐPÑPÔPˆØð 	<Ý˜D ( (¡*¤*¨e°UÑ;Ô;Ð;øð	<ð <r&   c                 ó*  — |                       ¦   «         } g }| j        j        j        }|                     ¦   «         D ]Ã\  }}|dk    rŒt          |¦  «        }t          |¦  «        }|t          k    r6|| j        k    r*| j	         
                    t          d¦  «        |z  ¦  «         Œk|t          k    r! ||¦  «        r|                     |¦  «         Œ—| j	         
                    t          d¦  «        ||fz  ¦  «         ŒÄt          | ||¦  «        }||fS )zÒCompute phases heads and root in a subset of node from root dict

    * subset is heads of the subset
    * roots is {<nodeid> => phase} mapping. key and value are string.

    Accept unknown element input
    r/  s2   ignoring inconsistent public root from remote: %s
s,   ignoring unexpected root from remote: %i %s
)r;   r–   r  r  rN   r   rA   r“   Únullidr   Úwarnr   r1  rO   Únewheads)	r.   r´   rG   Ú
draftrootsr  r:  r"   rd   Úpublicheadss	            r$   ÚanalyzeremotephasesrT  S  s2  € ð �?Š?ÑÔ€Dà€JØŒ~Ô#Ô,€HØ—{’{‘}”}ð ð ‰ˆˆeØ�=Ò Ð ØÝ�4‰yŒyˆÝ�E‘
”
ˆØ•FŠ?ˆ?Ø�t”{Ò"Ð"Ø”—’Ýð.ñô ð ñ	ñô ð øð •eŠ^ˆ^Øˆx˜‰~Œ~ð (Ø×!Ò! $Ñ'Ô'Ð'øàŒG�LŠLÝÐBÑCÔCØ˜$�-ñ ñô ð ð õ
 ˜4 ¨Ñ4Ô4€KØ˜
Ð"Ð"r&   c                   ó   — e Zd ZdZd„ ZdS )Úremotephasessummarya  summarize phase information on the remote side

    :publishing: True is the remote is publishing
    :publicheads: list of remote public phase heads (nodes)
    :draftheads: list of remote draft phase heads (nodes)
    :draftroots: list of remote draft phase root (nodes)
    c                 ó  — |                      ¦   «         }|| _        |                     dd¦  «        | _        t	          |||¦  «        }|\  | _        | _        |                     d| j        |¦  «        }d„ |D ¦   «         | _        d S )Nr/  Fs   heads(%ln::%ln)c                 ó6   — g | ]}|                      ¦   «         ‘ŒS r    r÷   rI  s     r$   rŸ   z0remotephasessummary.__init__.<locals>.<listcomp>�  s    € Ð4Ð4Ð4¨˜1Ÿ6š6™8œ8Ð4Ð4Ð4r&   )	r;   Ú_allremoterootsrú   r2  rT  rS  rR  r7   Ú
draftheads)rŒ   r.   ÚremotesubsetÚremoterootsÚunfiÚanaÚdheadss          r$   rŽ   zremotephasessummary.__init__ƒ  s   € Ø�ŠÑ Ô ˆØ*ˆÔà%Ÿ/š/¨-¸Ñ?Ô?ˆŒå! $¨°kÑBÔBˆØ,/Ñ)ˆÔ˜$œ/à—’Ð,¨d¬o¸|ÑLÔLˆØ4Ð4¨VÐ4Ñ4Ô4ˆŒˆˆr&   N)r&  r'  r(  Ú__doc__rŽ   r    r&   r$   rV  rV  z  s-   € € € € € ðð ð
5ð 
5ð 
5ð 
5ð 
5r&   rV  c                 óV  ‡ ‡
— ddl m} ‰                      ¦   «         Š ‰ j        }|j        j        Š
|s|S |r|‰ j        gk    rg S ˆ ˆ
fd„|D ¦   «         }ˆ
fd„|D ¦   «         }‰                      d||¦  «        }|                     |¦  «         ‰                      d||¦  «        }||z  }|s|rW| 	                    |¦  «         ‰                      d|¦  «        }| 
                    ‰ ||¦  «        }	|                     |	¦  «         t          j        |j        t          |¦  «        ¦  «        S )zŽcompute new head of a subset minus another

    * `heads`: define the first subset
    * `roots`: define the second we subtract from the firstr   )Údagopc                 ó<   •— h | ]}|‰j         k    ¯ ‰|¦  «        ’ŒS r    )rO  )r!   rï   r.   rm   s     €€r$   rù   znewheads.<locals>.<setcomp>¡  s-   ø€ Ð;Ð;Ð;˜A¨!¨t¬{Ò*:Ð*:���Q‘”Ð*:Ð*:Ð*:r&   c                 ó&   •— g | ]} ‰|¦  «        ‘ŒS r    r    )r!   rï   rm   s     €r$   rŸ   znewheads.<locals>.<listcomp>¢  s!   ø€ Ð#Ð#Ð#˜ˆSˆS�‰VŒVÐ#Ð#Ð#r&   s
   (%ld::%ld)s-   parents(%ld + (%ld and merge())) and not nulls   parents(%ld) and not null)Ú rb  r;   r–   r  Úget_revrO  r   rÇ   rÈ   Úreachablerootsr   rÅ   rd   rÙ   )r.   rL  rG   rb  r›   Ú	new_headsÚaffected_zoneÚ
candidatesÚ
prunestartÚprunedrm   s   `         @r$   rQ  rQ  �  se  øø€ ð ÐÐÐÐÐà�?Š?ÑÔ€DØ	Œ€BØ
Œ(Ô
€CØð ØˆØð �E˜dœk˜]Ò*Ð*Øˆ	à;Ð;Ð;Ð;Ð; Ð;Ñ;Ô;€IØ#Ð#Ð#Ð#˜UÐ#Ñ#Ô#€Eà—I’I˜m¨U°IÑ>Ô>€Mà×Ò Ñ.Ô.Ð.ð —’Ø8¸%Àñô €Jð �-Ñ€JØð ,�Jð ,à×Ò˜Ñ$Ô$Ð$Ø—Y’YÐ;¸YÑGÔGˆ
Ø×%Ò% d¨J¸
ÑCÔCˆØ×#Ò# FÑ+Ô+Ð+åÔ˜BœG¥V¨IÑ%6Ô%6Ñ7Ô7Ð7r&   c                 ó®   — |                       dd¦  «        }	 t          |         S # t          $ r% t          j        t          d¦  «        |z  ¦  «        ‚w xY w)zuhelper to get the target phase of new commit

    Handle all possible values for the phases.new-commit options.

    rå   s
   new-commits0   phases.new-commit: not a valid phase name ('%s'))ÚconfigÚphasenumber2ÚKeyErrorr   ÚConfigErrorr   )r   Úvs     r$   Únewcommitphasers  ·  sg   € ð 	�	Š	�)˜]Ñ+Ô+€Að
Ý˜AŒÐøÝð 
ð 
ð 
ÝÔÝÐAÑBÔBÀQÑFñ
ô 
ð 	
ð
øøøs	   ˜% ¥/Ac                 óJ   — t          | j        j        t                   ¦  «        S )z@utility function that check if a repo have any secret changeset.)Úboolr*  r‡   rD  r-   s    r$   Ú	hassecretrv  Ç  s   € õ �Ô Ô+­FÔ3Ñ4Ô4Ð4r&   c                 óH   — |€d}nt           |         }| |t           |         dœS )Nr&   )s   nodes   oldphaserÝ   )r  )rd   rz   r{   s      r$   Úpreparehookargsrx  Í  s+   € à
€{Øˆˆå˜ŒoˆØ¨µzÀ#´ÐGÐGÐGr&   r‘   r%  )Qr`  ÚstructÚi18nr   rd   r   r   r   r   r	   r   r
   r   re  r   r   r   r   r   ÚTYPE_CHECKINGÚtypingr   r   r   r   r   r   r   r   r   r   ÚuimodrA   ÚbytesÚ
PhaserootsÚlocalrepositoryÚPhasedefaultsÚStructrP   rh   r“   r1  rD  r  r  r<   rÄ   ÚcmdphasenamesÚdictÚ	enumerater  rN   Úphasenumberr¦   ro  rÈ   ÚmutablephasesÚremotehiddenphasesÚlocalhiddenphasesr/   r3   rL   rW   re   ru   rw   r‚   r„   r   r  rì   r5  r@  rF  rM  rT  rV  rQ  rs  rv  rx  r    r&   r$   ú<module>rŠ     sˆ  ððdð dðN €€€à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð Ôð ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ðð ð ð ð ð ð ð ð
 �c˜3˜uœ:�oÔ&€JØØ�)Ô+¨ZÐ8¸*ÐDÔEô€Mð
 �”˜hÑ'Ô'€ð ˜˜a™œÑ €ˆˆvØ€Ø€Ø�U˜F H¨hÐ7€	Ø˜ ¨(Ð3€à0Ð0Ð0€ØˆT�)�)˜MÑ*Ô*Ñ+Ô+€
Ø"€
ˆ8Ñ Ø"€
ˆ8Ñ àAÐA¨j×.>Ò.>Ñ.@Ô.@ÐAÑAÔA€ð ×ÒÑ!Ô!€Ø × Ò Ð:Ð:¨zÐ:Ñ:Ô:Ñ ;Ô ;Ð ;Ø × Ò ÐBÐB°zÐBÑBÔBÑ CÔ CÐ Cà˜ ¨(Ð3€Ø˜h¨Ð1Ð Ø˜xÐ(Ð ðHð Hð HðHð Hð Hðð ð ð ð>
 ð 
 ð 
 ðð ð ð&3ð 3ð 3ð*
ð 
ð 
ð,57ð 57ð 57ðprð rð rð rð rñ rô rð rðjð ð ð ð.
&ð 
&ð 
&ð&ð &ð &ðð ð ð@ð ð ð&ð ð ð"<ð <ð <ð$#ð $#ð $#ðN5ð 5ð 5ð 5ð 5ñ 5ô 5ð 5ð,$8ð $8ð $8ðN
ð 
ð 
ð 5ð 5ð 5ðHð Hð Hð Hð Hr&   