§
    	^µcR{  ã                   ó’  — d dl Z d dlZd dlZd dlZddlmZ ddlmZ ddl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 ddlmZ ddlmZ d	„ Zd
„ Zd)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Z'dZ(dZ)d„ Z*d„ Z+e j,        d„ ¦   «         Z-d„ Z.d„ Z/d „ Z0d!„ Z1d"„ Z2d#„ Z3e j,        d$„ ¦   «         Z4d%„ Z5d&„ Z6d'„ Z7d(„ Z8dS ),é    Né   )Ú_)Úopen)Ú
repository)
Ú	bookmarksÚ	cacheutilÚerrorÚ
narrowspecÚphasesÚpycompatÚrequirementsÚscmutilÚstoreÚutil)Únodemap)Ú
stringutilc                 ól   — t          | ¦  «        }|t          j        z  }|                     |¦  «         |S )a	  determine the final set of requirement for a new stream clone

    this method combine the "default" requirements that a new repository would
    use with the constaint we get from the stream clone content. We keep local
    configuration choice when possible.
    )ÚsetÚrequirementsmodÚSTREAM_FIXED_REQUIREMENTSÚupdate)Údefault_requirementsÚstreamed_requirementsr   s      ú7/usr/lib/python3/dist-packages/mercurial/streamclone.pyÚnew_stream_clone_requirementsr   %   s:   € õ Ð+Ñ,Ô,€LØ•OÔ=Ñ=€LØ×ÒÐ-Ñ.Ô.Ð.ØÐó    c                 ó.   — | j         t          j        z  }|S )z�the set of requirement the new clone will have to support

    This is used for advertising the stream options and to generate the actual
    stream content.)r   r   r   )ÚrepoÚrequiredformatss     r   r   r   2   s   € ð 	Ô�OÔEÑEð ð Ðr   Fc                 óp  — | j         }| j        }d}| j        rd| j                             dg ¦  «        v rd}|r|sdS |r|sdS t          |¦  «        rdS | j        rdS | j        }|€|                     d¦  «        }|sdS t          ¦   «         }|                     d¦  «        r | 
                    t          j        ¦  «         nò|                     d¦  «        }|s.| j         j                             t          d	¦  «        ¦  «         dS t          |                     d
¦  «        ¦  «        }||j        z
  }|r}| j         j                             t          d¦  «        d                     t'          |¦  «        ¦  «        z  ¦  «         | j         j                             t          d¦  «        ¦  «         dS |}d|fS )a°  Whether it is possible to perform a streaming clone as part of pull.

    ``bundle2`` will cause the function to consider stream clone through
    bundle2 and only through bundle2.

    Returns a tuple of (supported, requirements). ``supported`` is True if
    streaming clone is supported and False otherwise. ``requirements`` is
    a set of repo requirements from the remote, or ``None`` if stream clone
    isn't supported.
    Fs   v2s   streamT)FNNs   stream-preferreds
   streamreqss=   warning: stream clone requested but server has them disabled
ó   ,sG   warning: stream clone requested but client is missing requirements: %s
ó   , sQ   (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
)r   ÚremoteÚcanusebundle2Úremotebundle2capsÚgetÚlenÚheadsÚstreamclonerequestedÚcapabler   Úaddr   ÚREVLOGV1_REQUIREMENTÚuiÚwarnr   ÚsplitÚ	supportedÚjoinÚsorted)	ÚpullopÚbundle2r   r#   Úbundle2supportedÚstreamrequestedr   Ú
streamreqsÚmissingreqss	            r   Úcanperformstreamcloner9   =   s  € ð Œ;€DØŒ]€FàÐØÔð $Ø�FÔ,×0Ò0°¸BÑ?Ô?Ð?Ð?Ø#Ðð ð  ð Øˆ{à	ð Ð)ð Øˆ{õ ˆ4�y„yð Øˆ{ð „|ð Øˆ{àÔ1€Oð Ðà Ÿ.š.Ð)<Ñ=Ô=ˆàð Øˆ{õ ‘5”5€LØ‡~‚~�iÑ Ô ð  "Ø×Ò�Ô=Ñ>Ô>Ð>Ð>à—^’^ MÑ2Ô2ˆ
àð 	ØŒKŒN×ÒÝð"ñô ñô ð ð �;å˜×)Ò)¨$Ñ/Ô/Ñ0Ô0ˆ
à  4¤>Ñ1ˆØð 	ØŒKŒN×ÒÝð*ñô ð —*’*�V KÑ0Ô0Ñ1Ô1ñ	2ñô ð ð ŒKŒN×ÒÝð/ñô ñô ð ð �;Ø!ˆà�ÐÐr   c                 óp  — ddl m} t          | ¦  «        \  }}|sdS | j        }| j        }d}|                     d¦  «        rT|                     ¦   «         5 }|                     di ¦  «                             ¦   «         }ddd¦  «         n# 1 swxY w Y   |j	         
                    t          d¦  «        ¦  «         |                     ¦   «         5 }|                     di ¦  «                             ¦   «         }ddd¦  «         n# 1 swxY w Y   |                     ¦   «         }		 t          |	¦  «        }
n0# t          $ r# t          j        t          d¦  «        |	¦  «        ‚w xY w|
dk    r!t          j        t          d¦  «        ¦  «        ‚|
d	k    r!t          j        t          d
¦  «        ¦  «        ‚|
dk    r!t          j        t          d¦  «        ¦  «        ‚|                     ¦   «         }		 t%          t          |	                     dd¦  «        ¦  «        \  }}n7# t          t(          f$ r# t          j        t          d¦  «        |	¦  «        ‚w xY w|                     ¦   «         5  t-          ||||¦  «         t/          |j        |¦  «        |_        |                     |j	        |j        |j        ¦  «        |j        _        t;          j        |¦  «         t?          j         |¦  «         |r|j!         "                    ||¦  «         | #                    ¦   «          ddd¦  «         dS # 1 swxY w Y   dS )zðPossibly perform a legacy stream clone operation.

    Legacy stream clones are performed as part of pull but before all other
    operations.

    A legacy stream clone will not be performed if a bundle2 stream clone is
    supported.
    r   ©Ú	localrepoNs	   branchmaps   streaming all changes
s
   stream_outó'   unexpected response from remote server:s   operation forbidden by serveré   s$   locking the remote repository failedr   s%   the server sent an unknown error codeó    )$Ú r<   r9   r   r#   r*   ÚcommandexecutorÚcallcommandÚresultr-   Ústatusr   ÚreadlineÚintÚ
ValueErrorr	   ÚResponseErrorÚAbortÚmapr/   Ú	TypeErrorÚlockÚ	consumev1r   r   ÚresolvestorevfsoptionsÚfeaturesÚsvfsÚoptionsr   Úwritereporequirementsr   Úpost_stream_cleanupÚ_branchcachesÚreplaceÚ
invalidate)r3   r<   r0   r   r   r#   Ú
rbranchmapÚeÚfpÚlÚrespÚ	filecountÚ	bytecounts                r   Úmaybeperformlegacystreamcloner^   š   sö  € ð ÐÐÐÐÐå3°FÑ;Ô;Ñ€Iˆ|àð ØˆàŒ;€DØŒ]€Fð €JØ‡~‚~�lÑ#Ô#ð BØ×#Ò#Ñ%Ô%ð 	B¨ØŸš |°RÑ8Ô8×?Ò?ÑAÔAˆJð	Bð 	Bð 	Bñ 	Bô 	Bð 	Bð 	Bð 	Bð 	Bð 	Bð 	Bøøøð 	Bð 	Bð 	Bð 	Bð 	„G‡N‚N•1Ð/Ñ0Ô0Ñ1Ô1Ð1à	×	Ò	Ñ	!Ô	!ð 7 QØ�]Š]˜=¨"Ñ-Ô-×4Ò4Ñ6Ô6ˆð7ð 7ð 7ñ 7ô 7ð 7ð 7ð 7ð 7ð 7ð 7øøøð 7ð 7ð 7ð 7ð 	�Š‰Œ€Að
Ý�1‰vŒvˆˆøÝð 
ð 
ð 
ÝÔ!ÝÐ8Ñ9Ô9¸1ñ
ô 
ð 	
ð
øøøð ˆq‚y€yÝŒk�!Ð<Ñ=Ô=Ñ>Ô>Ð>Ø	�ŠˆÝŒk�!ÐCÑDÔDÑEÔEÐEØ	�ŠˆÝŒk�!ÐDÑEÔEÑFÔFÐFà
�Š‰Œ€Að
Ý"¥3¨¯ª°°aÑ(8Ô(8Ñ9Ô9Ñˆ	�9�9øÝ�	Ð"ð 
ð 
ð 
ÝÔ!ÝÐ8Ñ9Ô9¸1ñ
ô 
ð 	
ð
øøøð
 
�Š‰Œð ð Ý�$˜˜I yÑ1Ô1Ð1Ý9ØÔØñ
ô 
ˆÔð &×<Ò<ØŒG�TÔ&¨¬ñ
ô 
ˆŒ	Ôõ 	Ô% dÑ+Ô+Ð+ÝÔ# DÑ)Ô)Ð)àð 	9ØÔ×&Ò& t¨ZÑ8Ô8Ð8à�ŠÑÔÐðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð sO   Á)BÂBÂBÃ)DÄD
ÄD
Ä&D6 Ä6-E#Ç0,H È4IÉ(B6L+Ì+L/Ì2L/c                 óÐ   — t           j        | j        vrdS | j                             ddd¬¦  «        sdS t          j        | ¦  «        }|r| j                             dd¦  «        S dS )z5Whether streaming clones are allowed from the server.Fs   servers   uncompressedT)Ú	untrusteds   uncompressedallowsecret)r   ÚREPO_FEATURE_STREAM_CLONErO   r-   Ú
configboolr   Ú	hassecret)r   Úsecrets     r   Úallowservergenerationre   å   st   € åÔ+°4´=Ð@Ð@ØˆuàŒ7×Ò˜i¨ÀDÐÑIÔIð Øˆuõ Ô˜dÑ#Ô#€FØð IØŒw×!Ò! )Ð-GÑHÔHÐHàˆ4r   c                 ó6   — | j                              |¦  «        S ©N)r   Úwalk)r   Úmatchers     r   Ú_walkstreamfilesrj   ÷   s   € ØŒ:�?Š?˜7Ñ#Ô#Ð#r   c                 ó  ‡ ‡‡‡— g Šd}‰                       ¦   «         5  ‰ j                             d¦  «         t          ‰ ¦  «        D ]$\  }}}|r‰                     ||f¦  «         ||z  }Œ%t          ‰ ¦  «         ddd¦  «         n# 1 swxY w Y   t          ‰ ¦  «         ‰ j                             dt          ‰¦  «        |fz  ¦  «         ‰ j        Š‰ j        j	        Šˆˆˆ ˆfd„}t          ‰¦  «        | |¦   «         fS )aË  Emit content for version 1 of a streaming clone.

    This returns a 3-tuple of (file count, byte size, data iterator).

    The data iterator consists of N entries for each file being transferred.
    Each file entry starts as a line with the file name and integer size
    delimited by a null byte.

    The raw file data follows. Following the raw file data is the next file
    entry, or EOF.

    When used on the wire protocol, an additional line indicating protocol
    success will be prepended to the stream. This function is not responsible
    for adding it.

    This function will obtain a repository lock to ensure a consistent view of
    the store is captured. It therefore may raise LockError.
    r   ó	   scanning
Ns   %d files, %d bytes to transfer
c               3   óV  •K  — ‰D ]¢\  } }‰r‰j                              d| |fz  ¦  «         dt          j        | ¦  «        |fz  V —  ‰| dd¬¦  «        5 }|dk    r|                     |¦  «        V — nt          j        ||¬¦  «        D ]}|V — Œd d d ¦  «         n# 1 swxY w Y   Œ£d S )Ns   sending %s (%d bytes)
s   %s %d
ó   rbF)Ú	auditpathé   ©Úlimit)r-   Údebugr   Ú	encodedirÚreadr   Úfilechunkiter)ÚnameÚsizerY   ÚchunkÚ	debugflagÚentriesr   rP   s       €€€€r   Úemitrevlogdataz"generatev1.<locals>.emitrevlogdata!  s#  øè è € Ø!ð 	$ð 	$‰JˆD�$Øð IØ”—’Ð8¸DÀ$¸<ÑGÑHÔHÐHà¥¤°Ñ!6Ô!6¸Ð =Ñ=Ð=Ð=Ð=ð ��d˜E¨UÐ3Ñ3Ô3ð $°rØ˜5’=�=ØŸ'š' $™-œ-Ð'Ð'Ð'Ð'å!%Ô!3°B¸dÐ!CÑ!CÔ!Cð $ð $˜Ø#˜˜˜˜ð$ð $ð $ñ $ô $ð $ð $ð $ð $ð $ð $øøøð $ð $ð $ð $øð	$ð 	$s   Á<BÂB!	Â$B!	)
rL   r-   rs   rj   ÚappendÚ_test_sync_point_walk_1Ú_test_sync_point_walk_2r'   rP   rz   )	r   Útotal_bytesÚ	file_typerw   rx   r|   rz   r{   rP   s	   `     @@@r   Ú
generatev1r‚   û   sq  øøøø€ ð& €GØ€Kà	�Š‰Œð &ð &ØŒ�Š�mÑ$Ô$Ð$Ý%5°dÑ%;Ô%;ð 	$ð 	$Ñ!ˆI�t˜TØð $Ø—’  d˜|Ñ,Ô,Ð,Ø˜tÑ#�øÝ Ñ%Ô%Ð%ð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &õ ˜DÑ!Ô!Ð!à„G‡M‚MØ+­s°7©|¬|¸[Ð.IÑIñô ð ð Œ9€DØ”Ô!€Ið$ð $ð $ð $ð $ð $ð $ð $õ ˆw‰<Œ<˜ n nÑ&6Ô&6Ð6Ð6s   �ABÂBÂBc              #   ó¾   K  — t          | ¦  «        sdV — dS 	 t          | ¦  «        \  }}}n# t          j        $ r dV — Y dS w xY wdV — d||fz  V — |D ]}|V — ŒdS )aÇ  Emit content for version 1 of streaming clone suitable for the wire.

    This is the data output from ``generatev1()`` with 2 header lines. The
    first line indicates overall success. The 2nd contains the file count and
    byte size of payload.

    The success line contains "0" for success, "1" for stream generation not
    allowed, and "2" for error locking the repository (possibly indicating
    a permissions error for the server process).
    s   1
Ns   2
s   0
s   %d %d
)re   r‚   r	   Ú	LockError)r   r\   r]   Úitry   s        r   Úgeneratev1wireprotor†   3  s³   è è € õ ! Ñ&Ô&ð ØˆˆˆØˆðÝ#-¨dÑ#3Ô#3Ñ ˆ	�9˜b˜bøÝŒ?ð ð ð ØˆˆˆØˆˆðøøøð
 €L€L€LØ
˜	 9Ð-Ñ
-Ð-Ð-Ð-Øð ð ˆØˆˆˆˆðð s   ™- ­AÁAó   UNc                 óº   ‡ ‡‡— ‰dk    rt          d¦  «        ‚t          ‰ ¦  «        }d                     t          |¦  «        ¦  «        Šˆˆ ˆfd„}| |¦   «         fS )a@  Emit content for version 1 of a stream clone bundle.

    The first 4 bytes of the output ("HGS1") denote this as stream clone
    bundle version 1.

    The next 2 bytes indicate the compression type. Only "UN" is currently
    supported.

    The next 16 bytes are two 64-bit big endian unsigned integers indicating
    file count and byte count, respectively.

    The next 2 bytes is a 16-bit big endian unsigned short declaring the length
    of the requirements string, including a trailing  . The following N bytes
    are the requirements string, which is ASCII containing a comma-delimited
    list of repo requirements that are needed to support the data.

    The remaining content is the output of ``generatev1()`` (which may be
    compressed in the future).

    Returns a tuple of (requirements, data generator).
    r‡   s.   we do not support the compression argument yetr!   c               3   óN  •K  — dV — ‰V — t          ‰¦  «        \  } }}‰j                             t          d¦  «        || fz  ¦  «         t	          j        d| |¦  «        V — t	          j        dt          ‰¦  «        dz   ¦  «        V — ‰dz   V — ‰dk    sJ ‚‰j                             t          d¦  «        |t          d	¦  «        ¬
¦  «        }|                     d¦  «         |D ])}| 	                    t          |¦  «        ¬¦  «         |V — Œ*| 
                    ¦   «          d S )Ns   HGS1s   writing %d bytes for %d files
ó   >QQó   >Hr   ó    r‡   ó   bundleó   bytes©ÚtotalÚunitr   ©Ústep)r‚   r-   rD   r   ÚstructÚpackr'   Úmakeprogressr   Ú	incrementÚcomplete)r\   r]   r…   Úprogressry   Úcompressionr   Úrequiress        €€€r   Úgenzgeneratebundlev1.<locals>.genk  sS  øè è € ØˆˆˆØÐÐÐå#-¨dÑ#3Ô#3Ñ ˆ	�9˜bØŒ�ŠÝÐ0Ñ1Ô1°YÀ	Ð4JÑJñ	
ô 	
ð 	
õ Œk˜& )¨YÑ7Ô7Ð7Ð7Ð7ÝŒk˜%¥ X¡¤°Ñ!2Ñ3Ô3Ð3Ð3Ð3Ø˜ÑÐÐÐð ˜eÒ#Ð#Ð#Ð#à”7×'Ò'Ýˆi‰LŒL 	µ°(±´ð (ñ 
ô 
ˆð 	�Š˜ÑÔÐàð 	ð 	ˆEØ×Ò¥C¨¡J¤JÐÑ/Ô/Ð/ØˆKˆKˆKˆKà×ÒÑÔÐÐÐr   )rG   r   r1   r2   )r   rš   r   rœ   r›   s   ``  @r   Úgeneratebundlev1r�   O  s}   øøø€ ð, �eÒÐÝÐJÑKÔKÐKå(¨Ñ.Ô.€LØ�yŠy� Ñ-Ô-Ñ.Ô.€Hðð ð ð ð ð ð ð6 ˜˜™œÐÐr   c                 óX  — |                       ¦   «         5  | j                             t          d¦  «        |t	          j        |¦  «        fz  ¦  «         | j                             t          d¦  «        |t          d¦  «        ¬¦  «        }|                     d¦  «         t	          j        ¦   «         }|  	                    d¦  «        5  | j
                             | j        |¬¦  «        5  t          |¦  «        D �]K}|                     ¦   «         }	 |                     dd¦  «        \  }}	t          |	¦  «        }	n7# t           t"          f$ r# t%          j        t          d	¦  «        |¦  «        ‚w xY w| j        j        r1| j                             d
|t	          j        |	¦  «        fz  ¦  «         t-          j        |¦  «        }
|  
                    |
dd¬¦  «        5 }t	          j        ||	¬¦  «        D ]:}|                     t5          |¦  «        ¬¦  «         |                     |¦  «         Œ;	 ddd¦  «         n# 1 swxY w Y   �ŒM	 ddd¦  «         n# 1 swxY w Y   |                      d¬¦  «         ddd¦  «         n# 1 swxY w Y   t	          j        ¦   «         |z
  }|dk    rd}|                     ¦   «          | j                             t          d¦  «        t	          j        |¦  «        |t	          j        ||z  ¦  «        fz  ¦  «         ddd¦  «         dS # 1 swxY w Y   dS )a  Apply the contents from version 1 of a streaming clone file handle.

    This takes the output from "stream_out" and applies it to the specified
    repository.

    Like "stream_out," the status line added by the wire protocol is not
    handled by this function.
    ó!   %d files to transfer, %s of data
ó   clonerŽ   r�   r   )ÚexpectedcountrŒ   r   r=   s   adding %s (%s)
ó   wT)Úbackgroundcloserq   r’   N©Úclearfilecacheçü©ñÒMbP?ó(   transferred %s in %.1f seconds (%s/sec)
)rL   r-   rD   r   r   r]   r–   r   ÚtimerÚtransactionrP   ÚbackgroundclosingÚrangerE   r/   rF   rG   rK   r	   rH   rz   rs   r   Ú	decodedirrv   r—   r'   ÚwriterV   r˜   )r   rY   r\   r]   r™   ÚstartÚirZ   rw   rx   ÚpathÚofpry   Úelapseds                 r   rM   rM   ‰  s  € ð 
�Š‰Œð ?
ð ?
ØŒ�ŠÝÐ3Ñ4Ô4Ø�$œ.¨Ñ3Ô3Ð4ñ5ñ	
ô 	
ð 	
ð ”7×'Ò'Ýˆh‰KŒK˜y­q°©{¬{ð (ñ 
ô 
ˆð 	�Š˜ÑÔÐÝ”
‘”ˆð  ×Ò˜hÑ'Ô'ð 	1ð 	1Ø”×,Ò,¨T¬WÀIÐ,ÑNÔNð -ð -Ý˜yÑ)Ô)ð -ñ -�AàŸš™œ�AðØ%&§W¢W¨U°AÑ%6Ô%6™
˜˜dÝ" 4™yœy˜˜øÝ&­	Ð2ð ð ð Ý#Ô1ÝÐHÑIÔIÈ1ñô ð ðøøøð ”wÔ(ð ØœŸšØ/°4½¼ÈÑ9MÔ9MÐ2NÑNñô ð õ !œ?¨4Ñ0Ô0�DØŸš 4¨¸t˜ÑDÔDð -ÈÝ%)Ô%7¸À$Ð%GÑ%GÔ%Gð -ð -˜EØ$×.Ò.µC¸±J´JÐ.Ñ?Ô?Ð?ØŸIšI eÑ,Ô,Ð,Ð,ð-ð-ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ùð!-ð-ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ð0 �OŠO¨4ˆOÑ0Ô0Ð0ð3	1ð 	1ð 	1ñ 	1ô 	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1øøøð 	1ð 	1ð 	1ð 	1õ6 ”*‘,”, Ñ&ˆØ�aŠ<ˆ<ØˆGØ×ÒÑÔÐØŒ�ŠÝÐ:Ñ;Ô;å”˜yÑ)Ô)ØÝ”˜y¨7Ñ2Ñ3Ô3ðññ	
ô 	
ð 	
ðq?
ð ?
ð ?
ñ ?
ô ?
ð ?
ð ?
ð ?
ð ?
ð ?
ð ?
ð ?
øøøð ?
ð ?
ð ?
ð ?
ð ?
ð ?
s™   •B3LÃ"JÃ*'IÄ(D;Ä:IÄ;4E/Å/A,IÇAH:È.IÈ:H>È>IÉH>ÉIÉJÉIÉJÉIÉJÉ5LÊJ	ÊLÊJ	Ê	B	LÌL#Ì&L#c                 ó<  — |                       d¦  «        }|dk    r$t          j        t          d¦  «        |z  ¦  «        ‚t	          j        d|                       d¦  «        ¦  «        \  }}t	          j        d|                       d¦  «        ¦  «        d         }|                       |¦  «        }|                     d¦  «        s!t          j        t          d	¦  «        ¦  «        ‚t          |                     d¦  «         	                    d
¦  «        ¦  «        }|||fS )Nr>   r‡   s<   only uncompressed stream clone bundles are supported; got %srŠ   é   r‹   r   rŒ   s@   malformed stream clone bundle: requirements not properly encodedr!   )
ru   r	   rI   r   r”   ÚunpackÚendswithr   Úrstripr/   )rY   rš   r\   r]   Úrequireslenr›   r   s          r   Úreadbundle1headerr¹   Ô  s  € Ø—'’'˜!‘*”*€KØ�eÒÐÝŒkÝð%ñô ð ñ	ñ
ô 
ð 	
õ "œ=¨°·²¸±´Ñ=Ô=Ñ€IˆyÝ”-  r§w¢w¨q¡z¤zÑ2Ô2°1Ô5€KØ�wŠw�{Ñ#Ô#€Hà×Ò˜UÑ#Ô#ð 
ÝŒkÝð5ñô ñ
ô 
ð 	
õ �x—’ uÑ-Ô-×3Ò3°DÑ9Ô9Ñ:Ô:€Là�i Ð-Ð-r   c                 óx  — t          | ¦  «        r!t          j        t          d¦  «        ¦  «        ‚t	          |¦  «        \  }}}|| j        z
  }|rDt          j        t          d¦  «        d                     t          |¦  «        ¦  «        z  ¦  «        ‚t          | |||¦  «         t          j
        | ¦  «         dS )zºApply the content from a stream clone bundle version 1.

    We assume the 4 byte header has been read and validated and the file handle
    is at the 2 byte compression identifier.
    s2   cannot apply stream clone bundle on non-empty repoó4   unable to apply stream clone: unsupported format: %sr"   N)r'   r	   rI   r   r¹   r0   r1   r2   rM   r   rS   )r   rY   r\   r]   r   r8   s         r   Úapplybundlev1r¼   ð  sÅ   € õ ˆ4�y„yð 
ÝŒkÝÐCÑDÔDñ
ô 
ð 	
õ *;¸2Ñ)>Ô)>Ñ&€Iˆy˜,Ø ¤Ñ/€KØð 
ÝŒkÝÐEÑFÔFØ�jŠj� Ñ,Ô,Ñ-Ô-ñ.ñ
ô 
ð 	
õ
 ˆd�B˜	 9Ñ-Ô-Ð-ÝÔ Ñ%Ô%Ð%Ð%Ð%r   c                   ó   — e Zd ZdZd„ Zd„ ZdS )Ústreamcloneapplierz¿Class to manage applying streaming clone bundles.

    We need to wrap ``applybundlev1()`` in a dedicated type to enable bundle
    readers to perform bundle type-specific functionality.
    c                 ó   — || _         d S rg   )Ú_fh)ÚselfÚfhs     r   Ú__init__zstreamcloneapplier.__init__  s   € ØˆŒˆˆr   c                 ó,   — t          || j        ¦  «        S rg   )r¼   rÀ   )rÁ   r   s     r   Úapplyzstreamcloneapplier.apply  s   € Ý˜T 4¤8Ñ,Ô,Ð,r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rÃ   rÅ   © r   r   r¾   r¾     s<   € € € € € ðð ðð ð ð-ð -ð -ð -ð -r   r¾   ó   só   cc                 ó\   — g }|                       ¦   «         s|                     d¦  «         |S )z!list snapshot file from the stores
   phaseroots)Ú
publishingr}   )r   Úfnamess     r   Ú_walkstreamfullstorefilesrÐ     s0   € à€FØ�?Š?ÑÔð %Ø�Š�mÑ$Ô$Ð$Ø€Mr   c                 óz   — | \  }}}}|t           k    r| S ||| |||                              |¦  «        ¦  «        fS )z actually copy the snapshot files)Ú	_filefullr1   )ÚentryÚcopyÚvfsmapÚsrcrw   ÚftypeÚdatas          r   Ú_filterfullrÙ   &  sK   € à"Ñ€Cˆˆu�dØ•	ÒÐØˆØ��u˜d˜d 6¨#¤;×#3Ò#3°DÑ#9Ô#9Ñ:Ô:Ð;Ð;r   c               #   ó  ‡‡K  — g Št          j        d¬¦  «        Š	 ˆˆfd„} | V — ‰D ]}t          j        |¦  «         Œt          j        ‰¦  «         dS # ‰D ]}t          j        |¦  «         Œt          j        ‰¦  «         w xY w)z(return a function to temporary copy files	   hg-clone-)Úprefixc                 óô   •— t          j        t          j                             | ¦  «        ‰¬¦  «        \  }}t          j        |¦  «         ‰                     |¦  «         t          j        | |d¬¦  «         |S )N)rÛ   ÚdirT)Úhardlink)	r   ÚmkstempÚosr°   ÚbasenameÚcloser}   r   Ú	copyfiles)rÖ   ÚfdÚdstÚdst_dirÚfiless      €€r   rÔ   zmaketempcopies.<locals>.copy6  sp   ø€ ÝÔ&Ý”w×'Ò'¨Ñ,Ô,°'ðñ ô ‰GˆB�õ ŒH�R‰LŒLˆLØ�LŠL˜ÑÔÐÝŒN˜3 ¨dÐ3Ñ3Ô3Ð3ØˆJr   N)r   Úmkdtempr   Ú	tryunlinkÚtryrmdir)rÔ   Útmpræ   rç   s     @@r   Úmaketempcopiesrì   .  sÃ   øøè è € ð €EÝÔ lÐ3Ñ3Ô3€Gðð	ð 	ð 	ð 	ð 	ð 	ð ˆ
ˆ
ˆ
àð 	 ð 	 ˆCÝŒN˜3ÑÔÐÐÝŒ�gÑÔÐÐÐøð ð 	 ð 	 ˆCÝŒN˜3ÑÔÐÐÝŒ�gÑÔÐÐøøøs   �
A Á/Bc                 ót   — t           | j        t          | j        i}| j        |                     ¦   «         vsJ ‚|S )z$make a (src -> vfs) map for the repo)Ú	_srcstorerP   Ú	_srccacheÚcachevfsÚvfsÚvalues)r   rÕ   s     r   Ú_makemapró   F  s;   € õ 	�4”9Ý�4”=ð€Fð Œ8˜6Ÿ=š=™?œ?Ð*Ð*Ð*Ð*à€Mr   c           	   #   óº  ‡‡K  — t          | ¦  «        Š| j        ‰                     ¦   «         v rt          j        d¦  «        ‚| j                             t          d¦  «        |t          d¦  «        ¬¦  «        }|                     d¦  «         t          ¦   «         5 Š|5  ˆˆfd„|D ¦   «         }dV — d}|D �]q\  }}}}‰|         }	|V — t          j        t          |¦  «        ¦  «        V — |t          k    r |	|¦  «        }
|}n4|t          k    r)t          |d¦  «        }
t          j        |
¦  «        j        }d}	 t          j        |¦  «        V — |V — |d	k    r|
                     |¦  «        f}nt          j        |
|¬
¦  «        }|D ]?}|t          |¦  «        z  }|t          |¦  «        z  }|                     |¦  «         |V — Œ@||k    r't          j        t          d¦  «        |||fz  ¦  «        ‚	 |
                     ¦   «          �ŒZ# |
                     ¦   «          w xY w	 ddd¦  «         n# 1 swxY w Y   ddd¦  «         dS # 1 swxY w Y   dS )zactually emit the stream bundleó9   repo.vfs must not be added to vfsmap for security reasonsr�   rŽ   r�   r   c                 ó2   •— g | ]}t          |‰‰¦  «        ‘ŒS rÊ   )rÙ   )Ú.0rX   rÔ   rÕ   s     €€r   ú
<listcomp>z_emit2.<locals>.<listcomp>f  s%   ø€ ÐAÐAÐA°A•;˜q $¨Ñ/Ô/ÐAÐAÐAr   Nrn   rp   rq   s=   clone could only read %d bytes from %s, but expected %d bytes)ró   rñ   rò   r	   ÚProgrammingErrorr-   r–   r   r   rì   r   Úuvarintencoder'   Ú_fileappendrÒ   r   ÚfstatÚst_sizeru   rv   rI   râ   )r   r{   Útotalfilesizer™   ÚtotalbytecountrÖ   rw   r×   rØ   rñ   rY   rx   r]   Úchunksry   rÔ   rÕ   s                  @@r   Ú_emit2r  S  s"  øøè è € å�d‰^Œ^€Fð „x�6—=’=‘?”?Ð"Ð"ÝÔ$ØHñ
ô 
ð 	
ð Œw×#Ò#Ý	ˆ)‰Œ˜Mµ°(±´ð $ñ ô €Hð ‡O‚O�AÑÔÐÝ	Ñ	Ô	ð (˜T 8ð (ð (àAÐAÐAÐAÐA¸ÐAÑAÔAˆØˆ
ˆ
ˆ
Øˆà&-ð "	ñ "	Ñ"ˆC��u˜dØ˜”+ˆCØˆIˆIˆIÝÔ$¥S¨¡Y¤YÑ/Ô/Ð/Ð/Ð/Ø�Ò#Ð#Ø�S˜‘Y”Y�Ø��Ø�)Ò#Ð#Ý˜$ Ñ&Ô&�Ý”z "‘~”~Ô-�ØˆIðÝÔ(¨Ñ.Ô.Ð.Ð.Ð.Ø�
�
�
Ø˜5’=�=Ø Ÿgšg d™mœmÐ-�F�Få!Ô/°¸$Ð?Ñ?Ô?�FØ#ð  ð  �EØ¥ U¡¤Ñ+�IØ"¥c¨%¡j¤jÑ0�NØ—O’O NÑ3Ô3Ð3Ø�K�K�K�KØ Ò$Ð$õ  œ+Ýð1ñô ð % d¨DÐ1ñ	2ñô ð ð %ð —’‘
”
�
‘
ø�—’‘
”
�
�
øøøðE"	ð(ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (ð (ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (ð (ð (sP   ÂIÂ BH8Ä?B<HÇ<H8ÈH(	È(H8È,IÈ8H<	È<IÈ?H<	É IÉIÉIc                 ó   — dS ©z+a function for synchronisation during testsNrÊ   ©r   s    r   r~   r~   �  ó   € € € r   c                 ó   — dS r  rÊ   r  s    r   r   r   “  r  r   c                 óÎ  — |                       | j        ¦  «        €J ‚g }d}d}|s|rt          j        | j        ||¦  «        }t          | |¦  «        D ]H\  }}}	|	r@t          }
|t          j        z  rt          }
| 
                    t          ||
|	f¦  «         ||	z  }ŒIt          | ¦  «        D ]a}| j                             |¦  «        rE|| j                             |¦  «        j        z  }| 
                    t          |t          df¦  «         Œb|r_| j                             d¦  «        rE|| j                             d¦  «        j        z  }| 
                    t          dt          df¦  «         t#          j        | ¦  «        D ]a}| j                             |¦  «        rE|| j                             |¦  «        j        z  }| 
                    t(          |t          df¦  «         Œb||fS )a°  emit a seris of files information useful to clone a repo

    return (entries, totalfilesize)

    entries is a list of tuple (vfs-key, file-path, file-type, size)

    - `vfs-key`: is a key to the right vfs to write the file (see _makemap)
    - `name`: file path of the file to copy (to be feed to the vfss)
    - `file-type`: do this file need to be copied with the source lock ?
    - `size`: the size of the file (or None)
    Nr   s   obsstore)Ú_currentlockÚ_lockrefr
   ÚmatchÚrootrj   rû   r   ÚFILEFLAGS_VOLATILErÒ   r}   rî   rÐ   rP   ÚexistsÚlstatrý   r   Úcachetocopyrð   rï   )r   ÚincludesÚexcludesÚincludeobsmarkersr{   rþ   ri   Úrl_typerw   rx   Úfts              r   Ú_v2_walkr  —  sñ  € ð ×Ò˜Tœ]Ñ+Ô+Ð7Ð7Ð7Ø€GØ€Mà€GØð B�8ð BÝÔ" 4¤9¨h¸ÑAÔAˆå/°°gÑ>Ô>ð "ð "Ñˆ��tØð 	"ÝˆBØ�Ô1Ñ1ð Ý�Ø�NŠN�I t¨R°Ð6Ñ7Ô7Ð7Ø˜TÑ!ˆMøÝ)¨$Ñ/Ô/ð ?ð ?ˆØŒ9×Ò˜DÑ!Ô!ð 	?Ø˜TœYŸ_š_¨TÑ2Ô2Ô:Ñ:ˆMØ�NŠN�I t­Y¸Ð=Ñ>Ô>Ð>øØð B˜TœY×-Ò-¨kÑ:Ô:ð BØ˜œŸš¨Ñ5Ô5Ô=Ñ=ˆØ�Š�	 ;µ	¸4Ð@ÑAÔAÐAÝÔ% dÑ+Ô+ð ?ð ?ˆØŒ=×Ò Ñ%Ô%ð 	?Ø˜Tœ]×0Ò0°Ñ6Ô6Ô>Ñ>ˆMØ�NŠN�I t­Y¸Ð=Ñ>Ô>Ð>øØ�MÐ!Ð!r   c                 ób  — |                       ¦   «         5  | j                             d¦  «         t          | |||¬¦  «        \  }}t	          | ||¦  «        }t          |¦  «        }|�J ‚t          | ¦  «         ddd¦  «         n# 1 swxY w Y   t          | ¦  «         t          |¦  «        ||fS )aÍ  Emit content for version 2 of a streaming clone.

    the data stream consists the following entries:
    1) A char representing the file destination (eg: store or cache)
    2) A varint containing the length of the filename
    3) A varint containing the length of file data
    4) N bytes containing the filename (the internal, store-agnostic form)
    5) N bytes containing the file data

    Returns a 3-tuple of (file count, file size, data iterator).
    rl   ©r  r  r  N)	rL   r-   rs   r  r  Únextr~   r   r'   )r   r  r  r  r{   rþ   r   Úfirsts           r   Ú
generatev2r  À  sø   € ð 
�Š‰Œð &ð &àŒ�Š�mÑ$Ô$Ð$å!)ØØØØ/ð	"
ñ "
ô "
Ñˆ�õ ˜˜g }Ñ5Ô5ˆÝ�V‘”ˆØˆ}ˆ}ˆ}Ý Ñ%Ô%Ð%ð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &õ ˜DÑ!Ô!Ð!åˆw‰<Œ<˜¨Ð.Ð.s   •A$BÂB	ÂB	c               '   ó¼   K  — | d         }| dd …         }|5  |r&t          |Ž 5  d V — d d d ¦  «         n# 1 swxY w Y   nd V — d d d ¦  «         d S # 1 swxY w Y   d S )Nr   r   )Únested)ÚctxsÚthisÚrests      r   r  r  á  s  è è € à�Œ7€DØ���Œ8€DØ	ð ð Øð 	Ý˜�ð ð Ø���ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð øð ˆEˆEˆEðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð s,   —A£4¨A´8	¸A»8	¼AÁAÁAc                 ó†  ‡ — ‰                       ¦   «         5  ‰ j                             t          d¦  «        |t	          j        |¦  «        fz  ¦  «         t	          j        ¦   «         }‰ j                             t          d¦  «        |t          d¦  «        ¬¦  «        }|                     d¦  «         t          ‰ ¦  «        }‰ j
        |                     ¦   «         v rt          j        d¦  «        ‚‰                      d¦  «        5  ˆ fd„|                     ¦   «         D ¦   «         }t          |Ž 5  t!          |¦  «        D �]}t	          j        |d¦  «        }	||	         }
t	          j        |¦  «        }t	          j        |¦  «        }t	          j        ||¦  «        }‰ j        j        r2‰ j                             d	|	|t	          j        |¦  «        fz  ¦  «          |
|d
¦  «        5 }t	          j        ||¬¦  «        D ]:}|                     t/          |¦  «        ¬¦  «         |                     |¦  «         Œ;	 ddd¦  «         n# 1 swxY w Y   �Œ	 ddd¦  «         n# 1 swxY w Y   ‰                      d¬¦  «         ddd¦  «         n# 1 swxY w Y   t	          j        ¦   «         |z
  }|dk    rd}‰ j                             t          d¦  «        t	          j        |j        ¦  «        |t	          j        |j        |z  ¦  «        fz  ¦  «         |                     ¦   «          ddd¦  «         dS # 1 swxY w Y   dS )z’Apply the contents from a version 2 streaming clone.

    Data is read from an object that only needs to provide a ``read(size)``
    method.
    rŸ   r    rŽ   r�   r   rõ   c              3   óL   •K  — | ]}|                      ‰j        ¦  «        V — Œd S rg   )rª   r-   )r÷   rñ   r   s     €r   ú	<genexpr>zconsumev2.<locals>.<genexpr>  s3   øè è € ÐNÐN°s�C×)Ò)¨$¬'Ñ2Ô2ÐNÐNÐNÐNÐNÐNr   r   s   adding [%s] %s (%s)
r¢   rq   r’   NTr¤   r¦   r§   )rL   r-   rD   r   r   r]   r¨   r–   r   ró   rñ   rò   r	   rù   r©   r  r«   ÚreadexactlyÚuvarintdecodestreamrz   rs   rv   r—   r'   r­   rV   Úposr˜   )r   rY   r\   Úfilesizer®   r™   rÕ   r  r¯   rÖ   rñ   ÚnamelenÚdatalenrw   r±   ry   r²   s   `                r   Ú	consumev2r)  í  s,  ø€ ð 
�Š‰Œð <ð <ØŒ�ŠÝÐ3Ñ4Ô4Ø�$œ.¨Ñ2Ô2Ð3ñ4ñ	
ô 	
ð 	
õ
 ”
‘”ˆØ”7×'Ò'Ýˆh‰KŒK˜x­a°©k¬kð (ñ 
ô 
ˆð 	�Š˜ÑÔÐå˜$‘”ˆð Œ8�v—}’}‘”Ð&Ð&ÝÔ(ØLñô ð ð ×Ò˜hÑ'Ô'ð 	1ð 	1ØNÐNÐNÐN¸f¿mºm¹o¼oÐNÑNÔNˆDÝ˜�ð -ð -Ý˜yÑ)Ô)ð -ñ -�AÝÔ*¨2¨qÑ1Ô1�CØ  œ+�CÝ"Ô6°rÑ:Ô:�GÝ"Ô6°rÑ:Ô:�GåÔ+¨B°Ñ8Ô8�Dà”wÔ(ð ØœŸšØ4Ø" D­$¬.¸Ñ*AÔ*AÐBñCñô ð ð
 ˜˜T 4™œð -¨CÝ%)Ô%7¸À'Ð%JÑ%JÔ%Jð -ð -˜EØ$×.Ò.µC¸±J´JÐ.Ñ?Ô?Ð?ØŸIšI eÑ,Ô,Ð,Ð,ð-ð-ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ùð-ð-ð -ð -ñ -ô -ð -ð -ð -ð -ð -ð -øøøð -ð -ð -ð -ð, �OŠO¨4ˆOÑ0Ô0Ð0ð1	1ð 	1ð 	1ñ 	1ô 	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1øøøð 	1ð 	1ð 	1ð 	1õ4 ”*‘,”, Ñ&ˆØ�aŠ<ˆ<ØˆGØŒ�ŠÝÐ:Ñ;Ô;å”˜xœ|Ñ,Ô,ØÝ”˜xœ|¨gÑ5Ñ6Ô6ðññ	
ô 	
ð 	
ð 	×ÒÑÔÐðy<ð <ð <ñ <ô <ð <ð <ð <ð <ð <ð <ð <øøøð <ð <ð <ð <ð <ð <s�   –C1L6Ä*JÄ1B7I!Ç(AIÈ;I!ÉIÉI!ÉIÉI!ÉJÉ!I%É%JÉ(I%É)JÊL6ÊJ	ÊL6ÊJ	ÊBL6Ì6L:Ì=L:c                 óÄ  ‡ — ddl m} ˆ fd„|D ¦   «         }|rDt          j        t	          d¦  «        d                     t          |¦  «        ¦  «        z  ¦  «        ‚t          ‰ |||¦  «         t          ‰ j	        |¦  «        ‰ _	        | 
                    ‰ j        ‰ j	        ‰ j        ¦  «        ‰ j        _        t          j        ‰ ¦  «         t#          j        ‰ ¦  «         d S )Nr   r;   c                 ó&   •— g | ]}|‰j         v¯|‘ŒS rÊ   )r0   )r÷   Úrr   s     €r   rø   z!applybundlev2.<locals>.<listcomp>5  s%   ø€ ÐFÐFÐF˜¨a°t´~Ð.EÐ.E�1Ð.EÐ.EÐ.Er   r»   r"   )r@   r<   r	   rI   r   r1   r2   r)  r   r   rN   r-   rO   rP   rQ   r   rR   r   rS   )r   rY   r\   r&  r   r<   r8   s   `      r   Úapplybundlev2r-  2  s÷   ø€ ØÐÐÐÐÐàFÐFÐFÐF˜lÐFÑFÔF€KØð 
ÝŒkÝÐEÑFÔFØ�jŠj� Ñ,Ô,Ñ-Ô-ñ.ñ
ô 
ð 	
õ
 ˆd�B˜	 8Ñ,Ô,Ð,å5ØÔØñô €DÔð "×8Ò8ØŒ�Ô" D¤Mñô €D„IÔõ Ô! $Ñ'Ô'Ð'ÝÔ Ñ%Ô%Ð%Ð%Ð%r   c                 óâ  ‡‡— dgŠˆˆfd„}|D ]Ú\  }}}| |         }||         }	|                      |¦  «        }
|	                      |¦  «        }t          j                             |¦  «        }t          j                             |¦  «        st          j        |¦  «         |	                     |¦  «         t          j        |
|‰d         |d¬¦  «         ‰ 	                    ¦   «          ŒÛ‰d         S )NTc                  ó:   •— d‰ d<   t          d¦  «        ‰_        d S )NFr   s   copying)r   Útopic)rÞ   r™   s   €€r   Ú	copy_usedz_copy_files.<locals>.copy_usedL  s   ø€ Øˆ�‰Ý˜:™œˆŒˆˆr   r   F)rÞ   Úno_hardlink_cbÚcheck_fs_hardlink)
r1   rà   r°   Údirnamer  r   ÚmakedirsÚregister_fileÚcopyfiler—   )Úsrc_vfs_mapÚdst_vfs_mapr{   r™   r1  Úkr°   rx   Úsrc_vfsÚdst_vfsÚsrc_pathÚdst_pathr4  rÞ   s      `         @r   Ú_copy_filesr?  I  s  øø€ Øˆv€Hð'ð 'ð 'ð 'ð 'ð 'ð !ð ð ‰ˆˆ4�Ø˜a”.ˆØ˜a”.ˆØ—<’< Ñ%Ô%ˆØ—<’< Ñ%Ô%ˆõ ”'—/’/ (Ñ+Ô+ˆÝŒw�~Š~˜gÑ&Ô&ð 	#ÝŒM˜'Ñ"Ô"Ð"Ø×Ò˜dÑ#Ô#Ð#åŒØØØ˜a”[Ø$Ø#ð	
ñ 	
ô 	
ð 	
ð 	×ÒÑÔÐÐØ�AŒ;Ðr   c           	      ó  — d„ | j         D ¦   «         }d„ |j         D ¦   «         }||k    sJ ‚|                     ¦   «         5  |                      ¦   «         5  t          j        | ¦  «        }|                     d¦  «        }d}t
          j                             |¦  «        rd}t          | ddd¬¦  «        \  }}t          | ¦  «        }	t          |¦  «        }
| j
                             t          d	¦  «        t          |¦  «        |z   t          d
¦  «        ¬¦  «        }d„ |D ¦   «         }t          |	|
||¦  «        }|r>t          j        |¦  «        }|                     d¦  «        }t          j        ||¦  «         ddd¦  «         n# 1 swxY w Y   |                     ¦   «          |rd}nd}| j
                             |t          |¦  «        |z   z  ¦  «         |                     d¦  «        5 }|j                             |¦  «         ddd¦  «         n# 1 swxY w Y   |j        dfg}|                     |                     ¦   «         ¦  «         |D ] \  }}	 |                     |¦  «         Œ# t4          $ rx}|j        t6          j        k    rYt          d¦  «        }|                     |¦  «        }t;          j        |¦  «        }|||fz  }|j
                             |¦  «         Y d}~Œ™d}~ww xY w	 ddd¦  «         dS # 1 swxY w Y   dS )zYcopy all content from one local repository to another

    This is useful for local clonec                 ó.   — h | ]}|t           j        v¯|’ŒS rÊ   ©r   ÚWORKING_DIR_REQUIREMENTS©r÷   r,  s     r   ú	<setcomp>zlocal_copy.<locals>.<setcomp>k  s0   € ð ð ð àØ•OÔ<Ð<Ð<ð 	
à<Ð<Ð<r   c                 ó.   — h | ]}|t           j        v¯|’ŒS rÊ   rB  rD  s     r   rE  zlocal_copy.<locals>.<setcomp>p  s0   € ð ð ð àØ•OÔ<Ð<Ð<ð 	
à<Ð<Ð<r   s	   bookmarksr   r   NTr  s   linkings   files)r0  r�   r‘   c              3   ó*   K  — | ]\  }}}}|||fV — Œd S rg   rÊ   )r÷   r:  r°   r×   rx   s        r   r"  zlocal_copy.<locals>.<genexpr>—  s1   è è € ÐIÐIÑ)=¨¨D°%¸�a˜˜t�_ÐIÐIÐIÐIÐIÐIr   s   linked %d files
s   copied %d files
s
   localclones   undo.backupfiless   error removing %s: %s
) r   rL   r   Úbookmarksvfsr1   rà   r°   r  r  ró   r-   r–   r   r'   r?  r   r7  r˜   rs   r©   r   r­   rP   ÚextendÚ	undofilesÚunlinkÚOSErrorÚerrnoÚENOENTr   Úforcebytestrr.   )Úsrc_repoÚ	dest_repoÚsrc_store_requirementsÚdest_store_requirementsÚsrc_book_vfsÚsrcbookmarksÚbm_countr{   rþ   r8  Údest_vfs_mapr™   rç   rÞ   Údst_book_vfsÚdstbookmarksÚmsgÚtrÚ
undo_filesÚundovfsÚundofilerX   r°   Úe_msgs                           r   Ú
local_copyr`  g  s  € ðð àÔ&ðñ ô Ðð
ð àÔ'ðñ ô Ðð
 "Ð%<Ò<Ð<Ð<Ð<à	�ŠÑ	Ô	ð >+ð >+Ø�]Š]‰_Œ_ð &	:ð &	:õ
 %Ô1°(Ñ;Ô;ˆLØ'×,Ò,¨\Ñ:Ô:ˆLØˆHÝŒw�~Š~˜lÑ+Ô+ð Ø�å%-ØØØØ"&ð	&ñ &ô &Ñ"ˆG�]õ # 8Ñ,Ô,ˆKÝ# IÑ.Ô.ˆLØ”{×/Ò/Ý˜
‘m”mÝ˜'‘l”l XÑ-Ý�x‘[”[ð 0ñ ô ˆHð JÐIÀÐIÑIÔIˆEÝ" ;°¸eÀXÑNÔNˆHð ð :Ý(Ô5°iÑ@Ô@�Ø+×0Ò0°Ñ>Ô>�Ý”˜l¨LÑ9Ô9Ð9ðM&	:ð &	:ð &	:ñ &	:ô &	:ð &	:ð &	:ð &	:ð &	:ð &	:ð &	:øøøð &	:ð &	:ð &	:ð &	:ðN 	×ÒÑÔÐØð 	'Ø&ˆCˆCà&ˆCØŒ×Ò˜#¥ W¡¤°Ñ!8Ñ9Ñ:Ô:Ð:à×"Ò" =Ñ1Ô1ð 	&°RØŒO×!Ò! "Ñ%Ô%Ð%ð	&ð 	&ð 	&ñ 	&ô 	&ð 	&ð 	&ð 	&ð 	&ð 	&ð 	&øøøð 	&ð 	&ð 	&ð 	&ð !”~Ð':Ð;Ð<ˆ
Ø×Ò˜)×-Ò-Ñ/Ô/Ñ0Ô0Ð0Ø!+ð 		+ð 		+ÑˆG�Xð+Ø—’˜xÑ(Ô(Ð(Ð(øÝð +ð +ð +Ø”7�eœlÒ*Ð*ÝÐ6Ñ7Ô7�CØ"Ÿ<š<¨Ñ1Ô1�DÝ&Ô3°AÑ6Ô6�EØ˜D %˜=Ñ(�CØ”L×%Ò% cÑ*Ô*Ð*øøøøøøøøøð+øøøð		+ðk>+ð >+ð >+ñ >+ô >+ð >+ð >+ð >+ð >+ð >+ð >+ð >+øøøð >+ð >+ð >+ð >+ð >+ð >+s†   ¿LÁD&FÅ:LÆF
	Æ
LÆF
	ÆA LÇ.HÈ	LÈH	ÈLÈH	È;LÉI/É.LÉ/
K1É9A.K,Ë'LË,K1Ë1LÌLÌ	L)Frg   )r‡   )9Ú
contextlibrM  rà   r”   Úi18nr   r   r   Ú
interfacesr   r@   r   r   r	   r
   r   r   r   r   r   r   Úrevlogutilsr   Úutilsr   r   r   r9   r^   re   rj   r‚   r†   r�   rM   r¹   r¼   r¾   rû   rÒ   rî   rï   rÐ   rÙ   Úcontextmanagerrì   ró   r  r~   r   r  r  r  r)  r-  r?  r`  rÊ   r   r   ú<module>rg     s2  ðð Ð Ð Ð Ø €€€Ø 	€	€	€	Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ðð ð ð ð ð ð

ð 
ð 
ðð ð ðZð Zð Zð ZðzHð Hð HðVð ð ð$$ð $ð $ð $ð57ð 57ð 57ðpð ð ð87ð 7ð 7ð 7ðtH
ð H
ð H
ðV.ð .ð .ð8&ð &ð &ð.-ð -ð -ð -ð -ñ -ô -ð -ð €Ø€	ð €	Ø€	ðð ð ð<ð <ð <ð Ôðð ñ Ôðð.
ð 
ð 
ð9ð 9ð 9ðx6ð 6ð 6ð6ð 6ð 6ð&"ð &"ð &"ðR/ð /ð /ðB Ôðð ñ ÔððBð Bð BðJ&ð &ð &ð.ð ð ð<N+ð N+ð N+ð N+ð N+r   