§
    	^µc2"  ã                   ó~   — d dl mZ d dlmZmZmZ ddlmZmZ  G d„ dej	        ¦  «        Z
d„ Zd„ Zd	„ ZeeegZd
„ ZdS )é   )Ú_)ÚerrorÚrequirementsÚscmutilé   )ÚactionsÚenginec                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )ÚAutoUpgradeOperationznA limited Upgrade Operation used to run simple auto upgrade task

    (Expand it as needed in the future)
    c                 óN   •— t          ¦   «                              |d¬¦  «         d S )NF)Únew_requirementsÚbackup_store)ÚsuperÚ__init__)ÚselfÚreqÚ	__class__s     €úF/usr/lib/python3/dist-packages/mercurial/upgrade_utils/auto_upgrade.pyr   zAutoUpgradeOperation.__init__   s4   ø€ Ý‰Œ×ÒØ Øð 	ñ 	
ô 	
ð 	
ð 	
ð 	
ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__)r   s   @r   r   r      sB   ø€ € € € € ðð ð

ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   r   c                 óp  ‡ ‡‡‡‡‡	— ‰ j         Š	‰ j        Š‰	                     dd¦  «        }‰	                     dd¦  «        Šd}|rqt          j        ‰vrc‰	                     dd¦  «        }t          j        ‰v }|r|st          d¦  «        ŠdŠˆˆˆˆ ˆˆ	fd„}n|r|st          d	¦  «        ŠdŠˆˆˆˆ ˆˆ	fd
„}|S )zîreturn an automatic-upgrade action for `share-safe` if applicable

    If no action is needed, return None, otherwise return a callback to upgrade
    or downgrade the repository according the configuration and repository
    format.
    ó   formats<   use-share-safe.automatic-upgrade-of-mismatching-repositoriessB   use-share-safe.automatic-upgrade-of-mismatching-repositories:quietNs   use-share-safes?   automatically upgrading repository to the `share-safe` feature
s9   (see `hg help config.format.use-share-safe` for details)
c                  óÖ   •— ‰j         s,‰ s*‰                     ‰¦  «         ‰                     ‰¦  «         ‰                     t          j        ¦  «         t          j        ‰‰¦  «         d S ©N)ÚquietÚ	write_errÚaddÚrequirementsmodÚSHARESAFE_REQUIREMENTr   Úwritereporequirements©Úauto_upgrade_quietÚhintÚmsgÚrepor   Úuis   €€€€€€r   Úactionz%get_share_safe_action.<locals>.actionC   si   ø€ Øœð 'Ð$6ð 'Ø—L’L Ñ%Ô%Ð%Ø—L’L Ñ&Ô&Ð&Ø× Ò ¥Ô!FÑGÔGÐGÝÔ-¨d°LÑAÔAÐAÐAÐAr   sC   automatically downgrading repository from the `share-safe` feature
c                  óÖ   •— ‰j         s,‰ s*‰                     ‰¦  «         ‰                     ‰¦  «         ‰                     t          j        ¦  «         t          j        ‰‰¦  «         d S r   )r   r    Údiscardr"   r#   r   r$   r%   s   €€€€€€r   r+   z%get_share_safe_action.<locals>.actionQ   si   ø€ Øœð 'Ð$6ð 'Ø—L’L Ñ%Ô%Ð%Ø—L’L Ñ&Ô&Ð&Ø×$Ò$¥_Ô%JÑKÔKÐKÝÔ-¨d°LÑAÔAÐAÐAÐAr   )r*   r   Ú
configboolr"   ÚSHARED_REQUIREMENTr#   r   )
r)   Úauto_upgrade_share_sourcer+   Ú	sf_configÚsf_localr&   r'   r(   r   r*   s
   `    @@@@@r   Úget_share_safe_actionr3   "   sq  øøøøøø€ ð 
Œ€BØÔ$€LØ "§¢ØØGñ!ô !Ðð ŸšØØMñô Ðð
 €Fð 	"ð BåÔ.°lÐBÐBà—M’M )Ð->Ñ?Ô?ˆ	Ý"Ô8¸LÐHˆØð 	B˜Xð 	BÝðñô ˆCð QˆDðBð Bð Bð Bð Bð Bð Bð Bð Bð Bð Bð ð 	B˜ið 	BÝðñô ˆCð QˆDðBð Bð Bð Bð Bð Bð Bð Bð Bð Bð €Mr   c                 ón  ‡ ‡‡‡‡‡	— ‰ j         Š	t          ‰ j        ¦  «        Š‰	                     dd¦  «        }‰	                     dd¦  «        Šd}|rc‰	                     dd¦  «        }t          j        ‰v }|r|st          d¦  «        ŠdŠˆˆˆˆ ˆˆ	fd„}n|r|st          d	¦  «        ŠdŠˆˆˆˆ ˆˆ	fd
„}|S )zðreturn an automatic-upgrade action for `tracked-hint` if applicable

    If no action is needed, return None, otherwise return a callback to upgrade
    or downgrade the repository according the configuration and repository
    format.
    r   sG   use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositoriessM   use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quietNs   use-dirstate-tracked-hintsA   automatically upgrading repository to the `tracked-hint` feature
sD   (see `hg help config.format.use-dirstate-tracked-hint` for details)
c                  óú   •— ‰j         s,‰s*‰                     ‰¦  «         ‰                     ‰¦  «         ‰                     t          j        ¦  «         t          ‰¦  «        } t          j        ‰‰| d¬¦  «         d S )NT©r!   )r   r    r!   r"   ÚDIRSTATE_TRACKED_HINT_V1r   r	   Úupgrade_tracked_hint©Úopr&   r'   r(   r)   r   r*   s    €€€€€€r   r+   z'get_tracked_hint_action.<locals>.actiony   s}   ø€ Øœð 'Ð$6ð 'Ø—L’L Ñ%Ô%Ð%Ø—L’L Ñ&Ô&Ð&Ø× Ò ¥Ô!IÑJÔJÐJÝ)¨,Ñ7Ô7�ÝÔ+¨B°°b¸dÐCÑCÔCÐCÐCÐCr   sE   automatically downgrading repository from the `tracked-hint` feature
c                  óú   •— ‰j         s,‰s*‰                     ‰¦  «         ‰                     ‰¦  «         ‰                     t          j        ¦  «         t          ‰¦  «        } t          j        ‰‰| d¬¦  «         d S )NFr6   )r   r    r-   r"   r7   r   r	   r8   r9   s    €€€€€€r   r+   z'get_tracked_hint_action.<locals>.actionˆ   s}   ø€ Øœð 'Ð$6ð 'Ø—L’L Ñ%Ô%Ð%Ø—L’L Ñ&Ô&Ð&Ø×$Ò$¥_Ô%MÑNÔNÐNÝ)¨,Ñ7Ô7�ÝÔ+¨B°°b¸eÐDÑDÔDÐDÐDÐDr   )r*   Úsetr   r.   r"   r7   r   )
r)   Úauto_upgrade_tracked_hintr+   Ú	th_configÚth_localr&   r'   r(   r   r*   s
   `    @@@@@r   Úget_tracked_hint_actionr@   [   si  øøøøøø€ ð 
Œ€BÝ�tÔ(Ñ)Ô)€LØ "§¢ØØRñ!ô !Ðð ŸšØØXñô Ðð
 €Fà ð EØ—M’M )Ð-IÑJÔJˆ	Ý"Ô;¸|ÐKˆØð 	E˜Xð 	EÝðñô ˆCð \ˆDðDð Dð Dð Dð Dð Dð Dð Dð Dð Dð Dð ð 	E˜ið 	EÝðñô ˆCð \ˆDðEð Eð Eð Eð Eð Eð Eð Eð Eð Eð €Mr   c                 ón  ‡ ‡‡‡‡‡	— ‰ j         Š	t          ‰ j        ¦  «        Š‰	                     dd¦  «        }‰	                     dd¦  «        Šd}|rc‰	                     dd¦  «        }t          j        ‰v }|r|st          d¦  «        ŠdŠˆˆˆˆ ˆˆ	fd„}n|r|st          d	¦  «        ŠdŠˆˆˆˆ ˆˆ	fd
„}|S )zïreturn an automatic-upgrade action for `dirstate-v2` if applicable

    If no action is needed, return None, otherwise return a callback to upgrade
    or downgrade the repository according the configuration and repository
    format.
    r   s=   use-dirstate-v2.automatic-upgrade-of-mismatching-repositoriessC   use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quietNs   use-dirstate-v2s@   automatically upgrading repository to the `dirstate-v2` feature
s:   (see `hg help config.format.use-dirstate-v2` for details)
c                  ó  •— ‰j         s,‰s*‰                     ‰¦  «         ‰                     ‰¦  «         ‰                     t          j        ¦  «         t          ‰¦  «        } t          j        ‰j        ‰| dd¦  «         d S )Nó   v1ó   v2)	r   r    r!   r"   ÚDIRSTATE_V2_REQUIREMENTr   r	   Úupgrade_dirstater*   ©Úfake_opÚauto_upgrade_dv2_quietr'   r(   r)   r   r*   s    €€€€€€r   r+   z&get_dirstate_v2_action.<locals>.action³   s~   ø€ Øœð 'Ð$:ð 'Ø—L’L Ñ%Ô%Ð%Ø—L’L Ñ&Ô&Ð&Ø× Ò ¥Ô!HÑIÔIÐIÝ.¨|Ñ<Ô<�ÝÔ'¨¬°°wÀÀuÑMÔMÐMÐMÐMr   sD   automatically downgrading repository from the `dirstate-v2` feature
c                  ó  •— ‰j         s,‰s*‰                     ‰¦  «         ‰                     ‰¦  «         ‰                     t          j        ¦  «         t          ‰¦  «        } t          j        ‰j        ‰| dd¦  «         d S )NrD   rC   )	r   r    r-   r"   rE   r   r	   rF   r*   rG   s    €€€€€€r   r+   z&get_dirstate_v2_action.<locals>.actionÄ   s~   ø€ Øœð 'Ð$:ð 'Ø—L’L Ñ%Ô%Ð%Ø—L’L Ñ&Ô&Ð&Ø×$Ò$¥_Ô%LÑMÔMÐMÝ.¨|Ñ<Ô<�ÝÔ'¨¬°°wÀÀuÑMÔMÐMÐMÐMr   )r*   r<   r   r.   r"   rE   r   )
r)   Úauto_upgrade_dv2r+   Ú	d2_configÚd2_localrI   r'   r(   r   r*   s
   `    @@@@@r   Úget_dirstate_v2_actionrN   “   so  øøøøøø€ ð 
Œ€BÝ�tÔ(Ñ)Ô)€LØ—}’}ØØHñô Ðð  Ÿ]š]ØØNñô Ðð
 €Fàð #NØ—M’M )Ð-?Ñ@Ô@ˆ	Ý"Ô:¸lÐJˆØð  	N˜Xð  	NÝðñô ˆCð
 Oð ðNð Nð Nð Nð Nð Nð Nð Nð Nð Nð Nð ð 	N˜ið 	NÝðñô ˆCð
 Oð ðNð Nð Nð Nð Nð Nð Nð Nð Nð Nð €Mr   c                 ó²  — d}d}	 |s¹|dz  }|dk    rt          j        d¦  «        ‚d}t          D ]Ž} || ¦  «        }|�d}|                      d¬¦  «        5  |                      d¬¦  «        5   || ¦  «        }|�
 |¦   «           |¦   «         } ddd¦  «         n# 1 swxY w Y   ddd¦  «         n# 1 swxY w Y   Œ�|¯¹n# t           j        $ r Y nw xY w| S )	a%  potentially perform auto-upgrade and return the final repository to use

    Auto-upgrade are "quick" repository upgrade that might automatically be run
    by "any" repository access. See `hg help config.format` for automatic
    upgrade documentation.

    note: each relevant upgrades are done one after the other for simplicity.
    This avoid having repository is partially inconsistent state while
    upgrading.

    repo: the current repository instance
    maker_func: a factory function that can recreate a repository after an upgrade
    Fé    r   éd   zToo many auto upgrade loopsTN)Úwait)r   ÚProgrammingErrorÚAUTO_UPGRADE_ACTIONSÚwlockÚlockÚ	LockError)r)   Ú
maker_funcÚclearÚloopÚ
get_actionr+   s         r   Úmay_auto_upgrader\   Ö   s¢  € ð €Eà€DðØð 	,Ø�A‰IˆDØ�cŠzˆzåÔ,Ð-JÑKÔKÐKØˆEÝ2ð ,ð ,�
Ø#˜ DÑ)Ô)�ØÐ%Ø!�EØŸš¨˜Ñ/Ô/ð ,ð ,°·²À°Ñ1FÔ1Fð ,ð ,Ø!+ ¨DÑ!1Ô!1˜Ø!Ð-Ø"˜F™HœH˜HØ)˜z™|œ|˜ð	,ð ,ð ,ñ ,ô ,ð ,ð ,ð ,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,ð ,ð ,ð ,ñ ,ô ,ð ,ð ,ð ,ð ,ð ,ð ,øøøð ,ð ,ð ,ð ,øð ð 	,øøõ Œ?ð ð ð ð 	ˆð	øøøð €KsZ   †AC ÁB3Á."BÂB3ÂB Â B3Â#B Â$B3Â'C Â3B7	Â7C Â:B7	Â;C ÃCÃCN)Úi18nr   Ú r   r   r"   r   r   r	   ÚBaseOperationr   r3   r@   rN   rT   r\   © r   r   ú<module>ra      sü   ðð Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð

ð 

ð 

ð 

ð 

˜7Ô0ñ 

ô 

ð 

ð6ð 6ð 6ðr5ð 5ð 5ðp9ð 9ð 9ðz ØØðÐ ð(ð (ð (ð (ð (r   