§
    	^µcàY  ã            
       óŽ  — d Z ddlZddlZddlZddlmZ ddlmZmZ ddl	m
Z
mZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZmZ d	d
lmZmZ ej        Z ej        ¦   «         Ze                      dddd ed¦  «        dfddd ed¦  «        fg ed¦  «        dd¬¦  «        d„ ¦   «         Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z&d„ Z'd„ Z(d„ Z)d.d „Z*d/d!„Z+d"„ Z,	 d0d#„Z-e                      d$d%d&g  ed'¦  «        fge
j.        z    ed(¦  «        ¦  «        d1d*„¦   «         Z/e                      d+g e
j.        z    ed,¦  «        ¦  «        d-„ ¦   «         Z0dS )2z=High-level command function for lfconvert, plus the cmdtable.é    N)Ú_)ÚbinÚhex)ÚcmdutilÚcontextÚerrorÚ	exthelperÚhgÚlockÚ
logcmdutilÚmatchÚpycompatÚscmutilÚutil)Úhashutilé   )ÚconvcmdÚfilemapé   )ÚlfutilÚstorefactorys	   lfconvertó   só   sizeó    s9   minimum size (MB) for files to be converted as largefiless   SIZEs	   to-normalFs/   convert from a largefiles repo to a normal repos#   hg lfconvert SOURCE DEST [FILE ...]T)ÚnorepoÚ	inferrepoc                 ó
  ‡‡‡— t          j        |¦  «        }|d         rd}n-d}t          j        | d|                     d¦  «        d¬¦  «        }t          j        |¦  «        s$t          j        t          d¦  «        |z  ¦  «        ‚t          j        |¦  «        s$t          j        t          d¦  «        |z  ¦  «        ‚t          j
        | |¦  «        Š|                      t          d¦  «        |z  ¦  «         t          j
        | |d¬	¦  «        }d}dx}	}
	 ˆfd
„‰j                             d‰                     ¦   «         ¦  «        d         D ¦   «         }‰j        |j        i}|�rB|                     ¦   «         }	|                     ¦   «         }
t%          ¦   «         }t%          ¦   «         }|s |                      t          j        d¦  «        }|r)t+          j        ‰j        dt1          |¦  «        ¦  «        }nd}i }|                      t          d¦  «        t          d¦  «        ‰d                              ¦   «         ¬¦  «        5 }|D ]@}|                     |                     ¦   «         ¦  «         t9          ‰||||||||¦	  «	         ŒA	 ddd¦  «         n# 1 swxY w Y   |j                             t          j        ¦  «        r$|j                              t          j        ¦  «         | !                    ¦   «         D ]y}|j         "                    |¦  «        r|j         #                    |¦  «         	 |j         $                    |j         %                    |¦  «        ¦  «         Œj# tL          $ r Y Œvw xY w|r.|j'         (                    d¦  «         tS          j*        |¦  «         nÀ G ˆˆfd„dtV          j,        ¦  «        Š G ˆˆfd„dtZ          j.        ¦  «        Št_          | ‰¦  «        \  }}|dk    r!t          j        t          d¦  «        ¦  «        ‚tZ          j.        }‰tZ          _.        	 t[          j0        | ||dd¬¦  «         |tZ          _.        n# |tZ          _.        w xY wd}|r)|j1         2                    ¦   «          tg          |
|	¦  «         |sti          j         |j        ¦  «         dS dS # |r)|j1         2                    ¦   «          tg          |
|	¦  «         |sti          j         |j        ¦  «         w w xY w)aM  convert a normal repository to a largefiles repository

    Convert repository SOURCE to a new repository DEST, identical to
    SOURCE except that certain files will be converted as largefiles:
    specifically, any file that matches any PATTERN *or* whose size is
    above the minimum size threshold is converted as a largefile. The
    size used to determine whether or not to track a file as a
    largefile is the size of the first version of the file. The
    minimum size can be specified either with --size or in
    configuration as ``largefiles.size``.

    After running this command you will need to make sure that
    largefiles is enabled anywhere you intend to push the new
    repository.

    Use --to-normal to convert largefiles back to normal files; after
    this, the DEST repository can be used without largefiles at all.s	   to_normalFTr   N)Údefaults    %s is not a local Mercurial repos   initializing destination %s
)Úcreatec              3   ó(   •K  — | ]}‰|         V — Œd S ©N© )Ú.0ÚctxÚrsrcs     €ú=/usr/lib/python3/dist-packages/hgext/largefiles/lfcommands.pyú	<genexpr>zlfconvert.<locals>.<genexpr>q   s;   øè è € ð 
ð 
àð �ŒIð
ð 
ð 
ð 
ð 
ð 
r   r   s   patternsr   s   converting revisionss	   revisionss   tip©ÚunitÚtotals
   largefilesc                   ó0   •‡ — e Zd Zˆ ˆfd„Zˆ ˆˆfd„Zˆ xZS )úlfconvert.<locals>.lfsourcec                 ó„   •— t          ‰| ¦  «                             ||d ¦  «         d| j        j        t          j        <   d S )Nó   .)ÚsuperÚ__init__Ú
filemapperÚrenamer   Ú	shortname)ÚselfÚuiÚsourceÚ	__class__Úlfsources      €€r&   r0   z$lfconvert.<locals>.lfsource.__init__­   s=   ø€ Ý˜( DÑ)Ô)×2Ò2°2°v¸tÑDÔDÐDØ?C�D”OÔ*­6Ô+;Ñ<Ð<Ð<r   c                 óŽ  •— |\  }}t          ‰	| ¦  «                             ||¦  «        }|                     t          j        ¦  «        r|d         €|S |d                              ¦   «         }t          j        ‰
|¦  «        }|€&t          j        t          d¦  «        ||fz  ¦  «        ‚t          j        |¦  «        |d         fS )Nr   s    missing largefile for '%s' in %sr   )r/   ÚgetfileÚ
startswithr   ÚshortnameslashÚstripÚfindfiler   ÚAbortr   r   Úreadfile)r4   ÚnameÚrevÚrealnameÚrealrevÚfÚhashÚpathr7   r8   r%   s           €€€r&   r:   z#lfconvert.<locals>.lfsource.getfile±   sÆ   ø€ Ø(+Ñ%�H˜gÝ˜h¨Ñ-Ô-×5Ò5°d¸CÑ@Ô@�Að %×/Ò/µÔ0EÑFÔFð!à˜Qœ4˜<à ˜ð ˜Qœ4Ÿ:š:™<œ<�DÝ!œ?¨4°Ñ6Ô6�Dà�|Ý#œkÝÐAÑBÔBØ'¨Ð1ñ2ñô ð õ  œ=¨Ñ.Ô.°°!´Ð4Ð4r   )Ú__name__Ú
__module__Ú__qualname__r0   r:   Ú__classcell__)r7   r8   r%   s   @€€r&   r8   r,   ¬   sg   øø€ € € € € ðDð Dð Dð Dð Dð Dð5ð 5ð 5ð 5ð 5ð 5ð 5ð 5ð 5ð 5ð 5r   r8   c                   ó$   •‡ — e Zd Zˆ ˆˆfd„Zˆ xZS )úlfconvert.<locals>.converterc                 ón   •—  ‰	||¦  «        }t          ‰| ¦  «                             |||||¦  «         d S r!   )r/   r0   )
r4   r5   r6   ÚdestÚ
revmapfileÚoptsÚsrcr7   Ú	converterr8   s
          €€€r&   r0   z%lfconvert.<locals>.converter.__init__Ç   sK   ø€ Ø"˜( 2 vÑ.Ô.�Cå˜) TÑ*Ô*×3Ò3Ø˜C  z°4ñô ð ð ð r   )rH   rI   rJ   r0   rK   )r7   rS   r8   s   @€€r&   rS   rM   Æ   sC   øø€ € € € € ðð ð ð ð ð ð ð ð ð ð r   rS   s&   all largefiles must be present locallys   hg)Úsource_typeÚ	dest_type)5r   Úbyteskwargsr   Ú
getminsizeÚgetr
   Úislocalr   r?   r   Ú
repositoryÚstatusÚ	changelogÚnodesbetweenÚheadsÚnullidÚwlockr   ÚsetÚ
configlistÚlongnameÚmatchmodr   ÚrootÚlistÚmakeprogressrB   ÚupdateÚ_lfconvert_addchangesetÚwvfsÚexistsr3   ÚrmtreeÚkeysÚisfileÚunlinkÚ
removedirsÚdirnameÚOSErrorÚrequirementsÚaddr   Úwritereporequirementsr   Úfilemap_sourcer   rS   ÚdownloadlfilesÚconvertÚdirstateÚclearÚreleaseÚshutil)r5   rR   rO   ÚpatsrQ   ÚtolfileÚsizeÚrdstÚsuccessÚdstwlockÚdstlockÚctxsÚrevmapÚlfilesÚnormalfilesÚmatcherÚlfiletohashÚprogressr$   rE   ÚfoundÚmissingÚorigrS   r8   r%   s                          @@@r&   Ú	lfconvertrŽ   2   sœ  øøø€ õP Ô Ñ%Ô%€DØˆLÔð LØˆˆàˆÝÔ   T¨4¯8ª8°GÑ+<Ô+<ÀdÐKÑKÔKˆåŒ:�c‰?Œ?ð HÝŒk�!Ð?Ñ@Ô@À3ÑFÑGÔGÐGÝŒ:�dÑÔð IÝŒk�!Ð?Ñ@Ô@À4ÑGÑHÔHÐHåŒ=˜˜SÑ!Ô!€DØ‡I‚I�aÐ0Ñ1Ô1°DÑ8Ñ9Ô9Ð9ÝŒ=˜˜T¨$Ð/Ñ/Ô/€Dà€GØÐ€Hˆwðv%ð

ð 
ð 
ð 
à”~×2Ò2°4¸¿º¹¼ÑFÔFÀqÔIð
ñ 
ô 
ˆð ”+˜tœ{Ð+ˆØñ d	)ð —z’z‘|”|ˆHØ—i’i‘k”kˆGå‘U”UˆFÝ™%œ%ˆKØð CØ—}’}¥V¤_°kÑBÔB�Øð Ý"œ.¨¬°C½¸d¹¼ÑDÔD��à�àˆKØ—’ÝÐ)Ñ*Ô*Ý�|‘_”_Ø˜6”l×&Ò&Ñ(Ô(ð !ñ ô ð ð Øð ð �CØ—O’O C§G¢G¡I¤IÑ.Ô.Ð.Ý+ØØØØØØ#ØØØ#ñ
ô 
ð 
ð 
ððð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð& Œy×Ò¥Ô 0Ñ1Ô1ð 3Ø”	× Ò ¥Ô!1Ñ2Ô2Ð2à ×%Ò%Ñ'Ô'ð ð �Ø”9×#Ò# AÑ&Ô&ð (Ø”I×$Ò$ QÑ'Ô'Ð'ðØ”I×(Ò(¨¬×):Ò):¸1Ñ)=Ô)=Ñ>Ô>Ð>Ð>øÝð ð ð Ø�Dðøøøð
 ð 4ØÔ!×%Ò% mÑ4Ô4Ð4ÝÔ-¨dÑ3Ô3Ð3øð5ð 5ð 5ð 5ð 5ð 5ð 5ð 5�7Ô1ñ 5ô 5ð 5ð4ð ð ð ð ð ð ð �GÔ-ñ ô ð õ ,¨B°Ñ5Ô5‰NˆE�7Ø˜!Š|ˆ|Ý”k¥!Ð$MÑ"NÔ"NÑOÔOÐOåÔ$ˆDØ )�GÔð)Ý”Ø˜˜T¨uÀðñ ô ð ð %)•Ô!Ð!ø D•Ô!Ð(Ð(Ð(Ð(Øˆàð 	'ØŒM×ÒÑ!Ô!Ð!Ý�G˜XÑ&Ô&Ð&Øð 	%åŒM˜$œ)Ñ$Ô$Ð$Ð$Ð$ð	%ð 	%øð ð 	'ØŒM×ÒÑ!Ô!Ð!Ý�G˜XÑ&Ô&Ð&Øð 	%åŒM˜$œ)Ñ$Ô$Ð$Ð$ð	%øøøsq   ÄD/R6 ÉAJÊR6 ÊJÊR6 ÊJÊ BR6 Ì62M)Í(R6 Í)
M6Í3R6 Í5M6Í6B<R6 Ð3Q ÑR6 ÑQ'Ñ'R6 Ò6A	S?c	                 ó¦  ‡‡‡— t          ‰‰¦  «        }	t          ‰|	¦  «        }
g }|
D �]Œ}||vrÏ||vrËt          |‰||¦  «        }|‰                     ¦   «         v rv‰                     |¦  «        }|                     ¦   «         }|€d}|o||v }||z  }d|                     ¦   «         v r(|r$t          j        t          d¦  «        |z  ¦  «        ‚d}|r| 
                    |¦  «         n| 
                    |¦  «         ||v �rœt          j        |¦  «        }|                     |¦  «         |‰                     ¦   «         v �rZ‰                     |¦  «        }d|                     ¦   «         v r>|                     ¦   «         }|r(||v r$t          j        t          d¦  «        |z  ¦  «        ‚t          j        d¦  «        }|                     ‰|                              ¦   «         ¦  «         t%          |                     ¦   «         ¦  «        }|‰vs‰|         |k    r|                     |‰|                              ¦   «         ‰|                              ¦   «         ¦  «         d‰|                              ¦   «         v }t          j        ||||¦  «         |‰|<   �Œw|                     |¦  «         �ŒŽˆˆˆfd„}t-          ||	‰||‰¦  «         d S )NFó   ls+   renamed/copied largefile %s becomes symlinks   largefile %s becomes symlinkr   ó   xc           
      ó˜  •— t          j        |¦  «        }|�¢	 ‰                     |¦  «        }n# t          j        $ r Y d S w xY w|                     ¦   «         }|rt          j        |¦  «        }t          j        | ||‰|         dz   d| 	                    ¦   «         v d| 	                    ¦   «         v |¦  «        S t          | ‰|‰¦  «        S )Nó   
r�   r‘   )r   ÚsplitstandinÚfilectxr   ÚLookupErrorÚ
copysourceÚstandinr   Ú
memfilectxÚflagsÚ_getnormalcontext)	ÚrepoÚmemctxrE   ÚsrcfnameÚfctxÚrenamedr$   r‰   r…   s	         €€€r&   Ú
getfilectxz+_lfconvert_addchangeset.<locals>.getfilectx#  sâ   ø€ ÝÔ& qÑ)Ô)ˆØÐðØ—{’{ 8Ñ,Ô,��øÝÔ$ð ð ð Ø�t�tðøøøà—o’oÑ'Ô'ˆGØð 2õ !œ.¨Ñ1Ô1�åÔ%ØØØØ˜HÔ%¨Ñ-Ø˜Ÿ
š
™œÐ$Ø˜Ÿ
š
™œÐ$Øñô ð õ % T¨3°°6Ñ:Ô:Ð:s   ™/ ¯AÁA)Ú_convertparentsÚ_getchangedfilesÚ_islfileÚmanifestr•   r—   rš   r   r?   r   rt   r   r˜   Úappendr   Úsha1rh   Údatar   ÚdigestÚwwriteÚwritestandinÚ_commitcontext)r%   r€   r$   r…   r†   r‡   rˆ   r   r‰   ÚparentsÚfilesÚdstfilesrE   ÚislfilerŸ   r    ÚrenamedlfileÚfstandinÚmrF   Ú
executabler¡   s     ``    `             r&   ri   ri   å   sí  øøø€ õ ˜c 6Ñ*Ô*€Gõ ˜S 'Ñ*Ô*€Eà€HØð 2ñ 2ˆØ�Fˆ?ˆ?˜q¨Ð3Ð3Ý˜q # w°Ñ5Ô5ˆGð �C—L’L‘N”NÐ"Ð"Ø—{’{ 1‘~”~�ØŸ/š/Ñ+Ô+�Ø�?ð $�GØ&Ð<¨7°fÐ+<�Ø˜<Ñ'�Ø˜4Ÿ:š:™<œ<Ð'Ð'Ø#ð Ý#œkÝÐLÑMÔMØñ ñô ð ð $�GØð #Ø—
’
˜1‘”��à—’ Ñ"Ô"Ð"à�ˆ;‰;Ý”~ aÑ(Ô(ˆHØ�OŠO˜HÑ%Ô%Ð%à�C—L’L‘N”NÐ"Ñ"Ø—{’{ 1‘~”~�Ø˜4Ÿ:š:™<œ<Ð'Ð'Ø"ŸošoÑ/Ô/�GØð  7¨fÐ#4Ð#4Ý#œkÝÐ=Ñ>Ô>ÀÑBñô ð õ
 ”M #Ñ&Ô&�Ø—’˜˜QœŸš™œÑ'Ô'Ð'Ý˜1Ÿ8š8™:œ:‘”�Ø˜KÐ'Ð'¨;°q¬>¸TÒ+AÐ+AØ—K’K  3 q¤6§;¢;¡=¤=°#°a´&·,²,±.´.ÑAÔAÐAØ!%¨¨Q¬¯ª©¬Ð!7�JÝÔ'¨¨h¸¸jÑIÔIÐIØ%)�K ‘Nùð �OŠO˜AÑÔÐÑð;ð ;ð ;ð ;ð ;ð ;ð ;õ8 �4˜ # x°¸VÑDÔDÐDÐDÐDr   c                 ó¦  — t          j        | ||                     ¦   «         |||                     ¦   «         |                     ¦   «         |                     ¦   «         ¦  «        }|                      |¦  «        }t          j        | |¦  «         |  	                    |¦  «         | j
                             ¦   «         ||                     ¦   «         <   d S r!   )r   r�   ÚdescriptionÚuserÚdateÚextraÚ	commitctxr   ÚcopyalltostoreÚ
setparentsr\   ÚtipÚnode)r€   r­   r$   r¯   r¡   r…   ÚmctxÚrets           r&   r¬   r¬   B  s«   € ÝŒ>ØØØ�ŠÑÔØØØ�Š‰
Œ
Ø�Š‰
Œ
Ø�	Š	‰Œñ	ô 	€Dð �.Š.˜Ñ
Ô
€CÝ
Ô˜$ Ñ$Ô$Ð$Ø‡O‚O�CÑÔÐØœ×+Ò+Ñ-Ô-€Fˆ3�8Š8‰:Œ:ÑÐÐr   c                 óR  — t          |                      ¦   «         ¦  «        }|                      ¦   «         j        |vrj|                      ¦   «         }|                      ¦   «         D ]A}|                     ¦   «                              |¦  «        D ]}|                     |¦  «         ŒŒB|S r!   )ra   r®   rœ   r_   r¥   r­   Údiffrt   )r$   r­   r®   ÚmcÚpctxÚfns         r&   r£   r£   T  s‘   € Ý�—	’	‘”ÑÔ€EØ
‡x‚x�z„zÔ Ð'Ð'Ø�\Š\‰^Œ^ˆØ—K’K‘M”Mð 	ð 	ˆDØ—m’m‘o”o×*Ò*¨2Ñ.Ô.ð ð �Ø—	’	˜"‘”��ðà€Lr   c                 ó6  — g }|                       ¦   «         D ]/}|                     ||                     ¦   «                  ¦  «         Œ0t          |¦  «        dk     r?|                     |                      ¦   «         j        ¦  «         t          |¦  «        dk     °?|S )Nr   )r­   r¦   r¾   Úlenrœ   r_   )r$   r…   r­   Úps       r&   r¢   r¢   _  s†   € Ø€GØ�[Š[‰]Œ]ð )ð )ˆØ�Š�v˜aŸfšf™hœhÔ'Ñ(Ô(Ð(Ð(Ý
ˆg‰,Œ,˜Ò
Ð
Ø�Š�s—x’x‘z”zÔ(Ñ)Ô)Ð)õ ˆg‰,Œ,˜Ò
Ð
à€Nr   c           
      óh  — 	 |                      |¦  «        }n# t          j        $ r Y d S w xY w|                     ¦   «         }|                     ¦   «         }|dk    rt          | j        ||¦  «        }t          j        | |||d| 	                    ¦   «         v d| 	                    ¦   «         v |¦  «        S )Nó   .hgtagsr�   r‘   )
r•   r   r–   r—   r¨   Ú_converttagsr5   r   r™   rš   )rœ   r$   rE   r…   rŸ   r    r¨   s          r&   r›   r›   i  s³   € ðØ�{Š{˜1‰~Œ~ˆˆøÝÔð ð ð Øˆtˆtðøøøà�oŠoÑÔ€Gà�9Š9‰;Œ;€DØˆJ‚€Ý˜DœG V¨TÑ2Ô2ˆÝÔØˆc�1�d˜D D§J¢J¡L¤LÐ0°$¸$¿*º*¹,¼,Ð2FÈñô ð s   ‚ ˜+ª+c                 ó\  — g }|                      ¦   «         D �] }	 |                     dd¦  «        \  }}n5# t          $ r( |                      t	          d¦  «        |z  ¦  «         Y ŒOw xY w	 t          |¦  «        }n:# t          j        $ r( |                      t	          d¦  «        |z  ¦  «         Y Œšw xY w	 |                     dt          ||         ¦  «        |fz  ¦  «         ŒÍ# t          $ r( |                      t	          d¦  «        |z  ¦  «         Y Œþw xY wd                     |¦  «        S )Nó    r   s&   skipping incorrectly formatted tag %s
s%   skipping incorrectly formatted id %s
s   %s %s
s   no mapping for id %s
r   )Ú
splitlinesÚsplitÚ
ValueErrorÚwarnr   r   ÚbinasciiÚErrorr¦   r   ÚKeyErrorÚjoin)r5   r…   r¨   ÚnewdataÚlineÚidrA   Únewids           r&   rË   rË   y  sV  € Ø€GØ—’Ñ!Ô!ð ñ ˆð	Ø—z’z $¨Ñ*Ô*‰HˆB��øÝð 	ð 	ð 	Ø�GŠG•AÐ@ÑAÔAÀDÑHÑIÔIÐIØˆHð	øøøð	Ý˜‘G”GˆEˆEøÝŒ~ð 	ð 	ð 	Ø�GŠG•AÐ?Ñ@Ô@À2ÑEÑFÔFÐFØˆHð	øøøð	Ø�NŠN˜:­¨V°E¬]Ñ);Ô);¸TÐ(BÑBÑCÔCÐCÐCøÝð 	ð 	ð 	Ø�GŠG•AÐ/Ñ0Ô0°2Ñ5Ñ6Ô6Ð6ØˆHð	øøøð �8Š8�GÑÔÐs3   ›5µ/A'Á&A'Á+A;Á;4B2Â1B2Â6-C$Ã$/DÄDc                 óØ   — | dk    s| dk    s| dk    rdS |r || ¦  «        rdS 	 |                      | ¦  «                             ¦   «         |dz  dz  k    S # t          j        $ r Y dS w xY w)zlReturn true if file should be considered a largefile, i.e.
    matcher matches it or it is larger than size.rÊ   s	   .hgignores   .hgsigsFTi   )r•   r   r   r–   )Úfiler$   rˆ   r   s       r&   r¤   r¤   Ž  sš   € ð ˆzÒÐ˜T \Ò1Ð1°T¸ZÒ5GÐ5GØˆuØð �7�7˜4‘=”=ð ØˆtðØ�{Š{˜4Ñ Ô ×%Ò%Ñ'Ô'¨4°$©;¸Ñ+=Ò=Ð=øÝÔð ð ð Øˆuˆuðøøøs   ¥0A ÁA)Á(A)c                 ó®  ‡	— |sdS t          j        ||d¬¦  «        }d}|                      dt          |¦  «        z  ¦  «         |                     |¦  «        Š	ˆ	fd„|D ¦   «         }|                      dt          |¦  «        z  ¦  «         |                      t          d¦  «        t          d	¦  «        t          |¦  «        ¬
¦  «        5 }|D ]m}|                     |¦  «         t          j	        ||¦  «        }|s$t          j        t          d¦  «        |z  ¦  «        ‚|                     ||¦  «         |dz  }Œn	 ddd¦  «         dS # 1 swxY w Y   dS )z&upload largefiles to the central storeNT)Úputr   s,   sending statlfile command for %d largefiles
c                 ó$   •— g | ]}‰|         °
|‘ŒS r"   r"   )r#   ÚhÚretvals     €r&   ú
<listcomp>z uploadlfiles.<locals>.<listcomp>§  s"   ø€ Ð/Ð/Ð/�1 V¨A¤YÐ/ˆQÐ/Ð/Ð/r   s"   %d largefiles need to be uploaded
s   uploading largefiless   filesr(   s6   largefile %s missing from store (needs to be uploaded)r   )r   Ú	openstoreÚdebugrÇ   rk   rg   r   rh   r   r>   r   r?   rÝ   )
r5   r%   r€   r®   ÚstoreÚatrŠ   rF   r6   rà   s
            @r&   Úuploadlfilesræ   œ  s»  ø€ ð ð ØˆåÔ" 4¨°4Ð8Ñ8Ô8€Eà	
€BØ‡H‚HÐ=ÅÀEÁ
Ä
ÑJÑKÔKÐKØ�\Š\˜%Ñ Ô €FØ/Ð/Ð/Ð/˜Ð/Ñ/Ô/€EØ‡H‚HÐ3µc¸%±j´jÑ@ÑAÔAÐAà	�ŠÝ	Ð
!Ñ"Ô"­¨8©¬½CÀ¹J¼Jð 
ñ 
ô 
ð à	Øð 	ð 	ˆDØ�OŠO˜BÑÔÐÝ”_ T¨4Ñ0Ô0ˆFØð Ý”kÝð3ñô ð ñ	ñô ð ð �IŠI�f˜dÑ#Ô#Ð#Ø�!‰GˆBˆBð	ðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s   ÃA1E
Å
EÅEc                 óŽ   — |r|                      d¦  «        }ndg}t          j        |¦  «        }|                     ||¬¦  «        S )a)  Verify that every largefile revision in the current changeset
    exists in the central store.  With --contents, also verify that
    the contents of each local largefile file revision are correct (SHA-1 hash
    matches the revision ID).  With --all, check every changeset in
    this repository.s   all()r.   )Úcontents)Úrevsr   râ   Úverify)r5   rœ   Úallrè   ré   rä   s         r&   Úverifylfilesrì   ½  sL   € ð ð Ø�yŠy˜Ñ"Ô"ˆˆàˆvˆåÔ" 4Ñ(Ô(€EØ�<Š<˜ xˆ<Ñ0Ô0Ð0r   c                 óÂ  — t          j        ||¦  «        }|rt          |¦  «        t          |¦  «        z  }g }||         }|D ]l}	 t          j        |t          j        |¦  «                 ¦  «        }n# t
          $ r Y Œ<w xY wt          j        ||¦  «        s|                     ||f¦  «         Œm|r+t          j	        |¦  «        }	|	 
                    |¦  «        }
|
S g g fS )a.  cachelfiles ensures that all largefiles needed by the specified revision
    are present in the repository's largefile cache.

    returns a tuple (cached, missing).  cached is the list of files downloaded
    by this operation; missing is the list of files that were needed but could
    not be found.)r   Ú
listlfilesra   Úreadasstandinr˜   ÚFileNotFoundErrorr>   r¦   r   râ   rX   )r5   rœ   r¾   Úfilelistr†   Útogetr$   ÚlfileÚexpectedhashrä   rÀ   s              r&   Úcachelfilesrõ   Ì  sú   € õ Ô˜t TÑ*Ô*€FØð -Ý�V‘”�s 8™}œ}Ñ,ˆØ€Eà
ˆtŒ*€CØð 0ð 0ˆð	Ý!Ô/°µF´NÀ5Ñ4IÔ4IÔ0JÑKÔKˆLˆLøÝ ð 	ð 	ð 	ØˆHð	øøøåŒ˜t \Ñ2Ô2ð 	0Ø�LŠL˜% Ð.Ñ/Ô/Ð/øàð ÝÔ& tÑ,Ô,ˆØ�iŠi˜ÑÔˆØˆ
à�ˆ8€Os   Á,A3Á3
B Á?B c                 ó˜  — |j         j        }d}d}|                     ddt          j        z   ¦  «        D ]C}t          | | ||¦  «        ¦  «        \  }}|t          |¦  «        z  }|t          |¦  «        z  }ŒD|                      t          d¦  «        |z  ¦  «         |dk    r%|                      t          d¦  «        |z  ¦  «         ||fS )Nr   s   file(%s)s   path:s    %d additional largefiles cached
s!   %d largefiles failed to download
)	r\   r¾   ré   r   r3   rõ   rÇ   r[   r   )r5   rœ   ÚtonodeÚtotalsuccessÚtotalmissingrB   r�   rŒ   s           r&   rw   rw   é  sÑ   € ØŒ^Ô €FØ€LØ€LØ�yŠy˜ hµÔ1AÑ&AÑBÔBð %ð %ˆÝ& r¨4°°¸±´Ñ=Ô=Ñˆ�Ø�˜G™œÑ$ˆØ�˜G™œÑ$ˆˆØ‡I‚I�aÐ4Ñ5Ô5¸ÑDÑEÔEÐEØ�aÒÐØ
�	Š	•!Ð9Ñ:Ô:¸\ÑIÑJÔJÐJØ˜Ð%Ð%r   c           
      óN
  ‡‡— t          j        | ||¦  «        }|                     ¦   «         5  t          j        | |¦  «        }t	          t          j        |¦  «        ¦  «        t	          |¦  «        z  }‰�t	          ‰¦  «        Šˆfd„|D ¦   «         }|                     ¦   «         5  i }t	          ¦   «         Šd\  }	}
|j        }|d         }|D �]ö}t          j	         
                    t          j        | ||¦  «        |j        ¬¦  «        }t          j        |¦  «        }t          j	         
                    t          j        | ||¦  «        |j        ¬¦  «        }|                     |¦  «        �r
|                     |¦  «        re|                     |¦  «        rPt!          j        |                     |¦  «        |                     |¦  «        ¦  «         |                     |¦  «         t          j        ||         ¦  «        }|dk    rn||vrL|j                             |¦  «        j        r|                     |d¬¦  «         n‰                     |¦  «         |                     |ddd¬¦  «         |||<   �Œ«|                     |¦  «        r6|j                             |¦  «        |vr|                     |¦  «         |
d	z  }
�Œø	 ddd¦  «         n# 1 swxY w Y   |                     |                     ¦   «         ¦  «         |rƒˆfd
„|D ¦   «         }‰D ]H}|j                             t          j        |¦  «        ¦  «         |j                             |¦  «         ŒI |t?          d¦  «        ¦  «         tA          | |d|¦  «         |                     ¦   «         5  |D �]}d}| !                    |¦  «        }|r1t          j"        |||¦  «        sŒ3|                     |dd¬¦  «         d	}t          j        |¦  «        }|                     |¦  «        rz| #                    |¦  «        j$        dz  }| #                    |¦  «        }|j$        }||dz  k    r8|dz  }|r||dz	  dz  tJ          j&         z  z  }| '                    ||¦  «         d	}|	|z  }	t          j(        ||||¦  «         �Œ	 ddd¦  «         n# 1 swxY w Y   |                     |                     ¦   «         ¦  «         |r |t?          d¦  «        |	|
fz  ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )z´Update largefiles according to standins in the working directory

    If ``printmessage`` is other than ``None``, it means "print (or
    ignore, for false) message forcibly".
    Nc                 ó   •— g | ]}|‰v ¯|‘Œ	S r"   r"   )r#   rE   rñ   s     €r&   rá   z updatelfiles.<locals>.<listcomp>  s   ø€ Ð9Ð9Ð9˜A¨1°¨=¨=�a¨=¨=¨=r   )r   r   )Ústartr   T)Úignoremissing)Ú
p1_trackedÚ
wc_trackedÚpossibly_dirtyr   c                 ó   •— g | ]}|‰v¯|‘Œ	S r"   r"   )r#   rE   Údroppeds     €r&   rá   z updatelfiles.<locals>.<listcomp><  s#   ø€ Ð<Ð<Ð<˜A¨1°GÐ+;Ð+;�aÐ+;Ð+;Ð+;r   s   getting changed largefiles
r   )rþ   rÿ   é@   i¶ÿÿÿr   éI   s"   %d largefiles updated, %d removed
))r   Úgetstatuswriterr`   Úopenlfdirstatera   rî   Úparentchangerj   ÚosrG   Úrelpathr   Ú
backuppathre   r˜   rk   r|   ÚcopyfilerÕ   Ú
unlinkpathrï   ry   Ú	get_entryÚany_trackedrt   Úupdate_fileÚ	normalizeÚwriteÚcurrenttransactionÚ_mapÚreset_stater   rõ   rX   ÚcopyfromcacheÚstatÚst_moder   ÚumaskÚchmodÚsynclfdirstate)r5   rœ   rñ   ÚprintmessageÚnormallookupÚstatuswriterÚ
lfdirstater†   rh   ÚupdatedÚremovedrj   Úwctxró   Ú	lfileorigr˜   ÚstandinorigÚ
expecthashrE   Úupdate1ÚstandinexecÚstÚmoder  s     `                    @r&   Úupdatelfilesr)  ÷  sW  øø€ õ Ô)¨"¨d°LÑAÔA€LØ	�Š‰Œð oð oÝÔ*¨2¨tÑ4Ô4ˆ
Ý•VÔ& tÑ,Ô,Ñ-Ô-µ°J±´Ñ?ˆàÐÝ˜8‘}”}ˆHØ9Ð9Ð9Ð9 Ð9Ñ9Ô9ˆFà×$Ò$Ñ&Ô&ð .	%ð .	%ØˆFÝ‘e”eˆGØ#ÑˆG�WØ”9ˆDØ˜”:ˆDØð (%ñ (%�ÝœGŸOšOÝÔ& r¨4°Ñ7Ô7¸t¼yð ,ñ ô �	õ !œ.¨Ñ/Ô/�Ý œgŸošoÝÔ& r¨4°Ñ9Ô9ÀÄð .ñ ô �ð —;’;˜wÑ'Ô'ñ  %Ø—{’{ ;Ñ/Ô/ð 5°D·K²KÀÑ4FÔ4Fð 5Ýœ¨¯	ª	°%Ñ(8Ô(8¸$¿)º)ÀIÑ:NÔ:NÑOÔOÐOØŸš¨Ñ4Ô4Ð4Ý!'Ô!5°d¸7´mÑ!DÔ!D�JØ! SÒ(Ð(Ø ¨Ð,Ð,Ø#œ}×6Ò6°wÑ?Ô?ÔKð 3Ø $§¢°ÀT Ñ JÔ JÐ JÐ Jà '§¢¨EÑ 2Ô 2Ð 2ð
 #×.Ò.Ø!Ø'+Ø'+Ø+/ð	 /ñ ô ð ð )3˜˜u™ùð Ÿš EÑ*Ô*ð%à œM×3Ò3°EÑ:Ô:À$ÐFÐFàŸš¨Ñ.Ô.Ð.Ø 1™˜ùðQ(%ð.	%ð .	%ð .	%ñ .	%ô .	%ð .	%ð .	%ð .	%ð .	%ð .	%ð .	%øøøð .	%ð .	%ð .	%ð .	%ðb 	×Ò˜×0Ò0Ñ2Ô2Ñ3Ô3Ð3àð 
	0Ø<Ð<Ð<Ð< Ð<Ñ<Ô<ˆFàð /ð /�Ø”	×$Ò$¥V¤^°AÑ%6Ô%6Ñ7Ô7Ð7ð ”×+Ò+¨AÑ.Ô.Ð.Ð.àˆL�Ð:Ñ;Ô;Ñ<Ô<Ð<Ý˜˜D $¨Ñ/Ô/Ð/à×$Ò$Ñ&Ô&ð "	Mð "	MØð !Mñ !M�Ø�à#ŸZšZ¨Ñ.Ô.�
Øð 	 Ý!Ô/°°jÀ%ÑHÔHð !à ð ×*Ò*Ø¨$¸4ð +ñ ô ð ð  �Gõ !œ.¨Ñ/Ô/�Ø—;’;˜wÑ'Ô'ð $à"&§)¢)¨GÑ"4Ô"4Ô"<¸uÑ"D�KØŸš 5Ñ)Ô)�BØœ:�DØ" d¨U¡lÒ2Ð2à ™˜Ø&ð FØ  T¨Q¡Y°%Ñ$7½4¼:¸+Ñ$EÑE˜DØŸ
š
 5¨$Ñ/Ô/Ð/Ø"#˜à˜7Ñ"�åÔ% d¨J¸¸|ÑLÔLÐLÑLðC!Mð"	Mð "	Mð "	Mñ "	Mô "	Mð "	Mð "	Mð "	Mð "	Mð "	Mð "	Møøøð "	Mð "	Mð "	Mð "	MðH 	×Ò˜×0Ò0Ñ2Ô2Ñ3Ô3Ð3Øð 	ØˆLÝÐ8Ñ9Ô9¸WÀgÐ<NÑNñô ð ð[oð oð oñ oô oð oð oð oð oð oð oð oøøøð oð oð oð oð oð os^   ­A:TÂ'HKËTËK	ËTËK	ËCTÎDR<Ò0TÒ<S 	Ó TÓS 	ÓA	TÔTÔ!Ts   lfpulló   rs   revs#   pull largefiles for these revisionss-   -r REV... [-e CMD] [--remotecmd CMD] [SOURCE]ó   defaultc                 óž  — ||_         |                     dg ¦  «        }|s!t          j        t	          d¦  «        ¦  «        ‚t          j        ||¦  «        }d}|D ]M}|                      t	          d¦  «        |z  ¦  «         t          | ||¦  «        \  }}|t          |¦  «        z  }ŒN|  
                    t	          d¦  «        |z  ¦  «         dS )a0  pull largefiles for the specified revisions from the specified source

    Pull largefiles that are referenced from local changesets but missing
    locally, pulling from a remote repository to the local cache.

    If SOURCE is omitted, the 'default' path will be used.
    See :hg:`help urls` for more information.

    .. container:: verbose

      Some examples:

      - pull largefiles for all branch heads::

          hg lfpull -r "head() and not closed()"

      - pull largefiles on the default branch::

          hg lfpull -r "branch(default)"
    rB   s   no revisions specifiedr   s#   pulling largefiles for revision %d
s   %d largefiles cached
N)ÚlfpullsourcerX   r   r?   r   r   ÚrevrangeÚnoterõ   rÇ   r[   )	r5   rœ   r6   rQ   ré   Ú	numcachedrB   ÚcachedrŒ   s	            r&   Úlfpullr2  r  sÔ   € ð6 €DÔà�8Š8�E˜2ÑÔ€DØð 8ÝŒk�!Ð5Ñ6Ô6Ñ7Ô7Ð7ÝÔ˜t TÑ*Ô*€Dà€IØð !ð !ˆØ
�Š•Ð9Ñ:Ô:¸SÑ@ÑAÔAÐAÝ'¨¨D°#Ñ6Ô6Ñˆ�Ø•S˜‘[”[Ñ ˆ	ˆ	Ø‡I‚I�aÐ)Ñ*Ô*¨YÑ6Ñ7Ô7Ð7Ð7Ð7r   s
   debuglfputs   FILEc                 ó®   — t          j        |¦  «        }t          j        |¦  «                             ||¦  «         |                      d|z  ¦  «         dS )Ns   %s
r   )r   Úhashfiler   râ   rÝ   r  )r5   rœ   ÚfilepathÚkwargsrF   s        r&   Ú
debuglfputr7  œ  sM   € åŒ?˜8Ñ$Ô$€DÝÔ˜4Ñ Ô ×$Ò$ X¨tÑ4Ô4Ð4Ø‡H‚HˆW�t‰^ÑÔÐØˆ1r   )FFr!   )NNF)r+  )1Ú__doc__rÒ   r  r|   Úmercurial.i18nr   Úmercurial.noder   r   Ú	mercurialr   r   r   r	   r
   r   r   r   rd   r   r   r   Úmercurial.utilsr   rx   r   r   Ú r   r   r{   ÚehÚcommandrŽ   ri   r¬   r£   r¢   r›   rË   r¤   ræ   rì   rõ   rw   r)  Ú
remoteoptsr2  r7  r"   r   r&   ú<module>rA     sk  ðð DÐ Cà €€€Ø 	€	€	€	Ø €€€à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð %Ð $Ð $Ð $Ð $Ð $ðð ð ð ð ð ð ð ð
 #Ð "Ð "Ð "Ð "Ð "Ð "Ð "à
Œ,€ð €YÔÑÔ€ð ‡‚Øð ØØØˆAÐJÑKÔKØð	
ð ØØØˆAÐ@ÑAÔAð		
ðð €AÐ,Ñ-Ô-ØØð' ñ ô ð*[%ð [%ñ+ô ð*[%ð|ZEð ZEð ZEðz.ð .ð .ð$ð ð ðð ð ðð ð ð ð ð ð*ð ð ðð ð ðB1ð 1ð 1ð 1ðð ð ð ð:&ð &ð &ð >Cðxð xð xð xðv ‡‚ØØ
ˆF�B˜˜Ð@ÑAÔAÐBÐCØÔñà€AÐ6Ñ7Ô7ñ	ô ð!8ð !8ð !8ñô ð!8ðH ‡‚ˆM˜2 Ô 2Ñ2°A°A°g±J´JÑ?Ô?ðð ñ @Ô?ðð ð r   