§
    	^µcŒZ ã                   ó”  — d Z ddlZddlZddlZ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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mZmZmZ ddlmZmZ ddlm Z  ej!        Z!ej"        Z"ej#        Z$ej%        Z&d	Z'd	Z(d
Z)dZ*d	Z+dZ,dZ- ej.        d¦  «        Z/d„ Z0d„ Z1d„ Z2d„ Z3i Z4d›d„Z5 G d„ d¦  «        Z6 G d„ d¦  «        Z7 G d„ de8¦  «        Z9d„ Z:dœd„Z; G d„ d¦  «        Z<d�d „Z=d!„ Z>d"„ Z?d#„ Z@d$„ ZAd%„ ZBd&„ ZCd'dd(d)d*d+œZDg d,¢ZE G d-„ d.¦  «        ZF G d/„ d0¦  «        ZGdœd1„ZH G d2„ d3eG¦  «        ZId4eIiZJi ZKd5„ ZL eLd6¦  «        d7„ ¦   «         ZM G d8„ d9¦  «        ZNd:ZO G d;„ d<eG¦  «        ZP G d=„ d>¦  «        ZQd?„ ZR G d@„ dAeG¦  «        ZS G dB„ dCeS¦  «        ZTdddDdd eU eVejW         X                    ¦   «         ¦  «        ¦  «        dEddFdGdHœ
ZYdždJ„ZZdK„ Z[dL„ Z\	 	 	 dŸdM„Z]dN„ Z^dO„ Z_dP„ Z`dQ„ ZadR„ ZbdS„ ZcdT„ ZddU„ ZedV„ Zfd dX„Zg	 dŸdY„ZhdZ„ Zi e5d[d\¦  «        d]„ ¦   «         Zj eUg d^¢d_„ ejW         X                    ¦   «         D ¦   «         z   ¦  «        Zk e5d`ek¦  «        da„ ¦   «         Zl e5dbdc¦  «        dd„ ¦   «         Zm e5de¦  «        df„ ¦   «         Zn e5dg¦  «        dh„ ¦   «         Zo e5di¦  «        dj„ ¦   «         Zp e5dk¦  «        dl„ ¦   «         Zq e5dm¦  «        dn„ ¦   «         Zr e5do¦  «        dp„ ¦   «         Zs G dq„ drejt        ¦  «        Zu e5dsdt¦  «        du„ ¦   «         Zv e5dvdw¦  «        dx„ ¦   «         Zw e5dydz¦  «        d{„ ¦   «         Zx e5d|d}¦  «        d~„ ¦   «         Zy e5dd€¦  «        d�„ ¦   «         Zz e5d‚dƒ¦  «        d„„ ¦   «         Z{ e5d…¦  «        d†„ ¦   «         Z| e5d‡¦  «        dˆ„ ¦   «         Z} e5d‰dc¦  «        dŠ„ ¦   «         Z~ e5d‹¦  «        dŒ„ ¦   «         Z e5d�dŽ¦  «        d�„ ¦   «         Z€ e5d�¦  «        d‘„ ¦   «         Z� ej‚        d’¦  «        Zƒ e5d“¦  «        d”„ ¦   «         Z„ e5d•¦  «        d–„ ¦   «         Z… e5d—d˜¦  «        d™„ ¦   «         Z†dš„ Z‡dS )¡aî  Handling of the new bundle2 format

The goal of bundle2 is to act as an atomically packet to transmit a set of
payloads in an application agnostic way. It consist in a sequence of "parts"
that will be handed to and processed by the application layer.


General format architecture
===========================

The format is architectured as follow

 - magic string
 - stream level parameters
 - payload parts (any number)
 - end of stream marker.

the Binary format
============================

All numbers are unsigned and big-endian.

stream level parameters
------------------------

Binary format is as follow

:params size: int32

  The total number of Bytes used by the parameters

:params value: arbitrary number of Bytes

  A blob of `params size` containing the serialized version of all stream level
  parameters.

  The blob contains a space separated list of parameters. Parameters with value
  are stored in the form `<name>=<value>`. Both name and value are urlquoted.

  Empty name are obviously forbidden.

  Name MUST start with a letter. If this first letter is lower case, the
  parameter is advisory and can be safely ignored. However when the first
  letter is capital, the parameter is mandatory and the bundling process MUST
  stop if he is not able to proceed it.

  Stream parameters use a simple textual format for two main reasons:

  - Stream level parameters should remain simple and we want to discourage any
    crazy usage.
  - Textual data allow easy human inspection of a bundle2 header in case of
    troubles.

  Any Applicative level options MUST go into a bundle2 part instead.

Payload part
------------------------

Binary format is as follow

:header size: int32

  The total number of Bytes used by the part header. When the header is empty
  (size = 0) this is interpreted as the end of stream marker.

:header:

    The header defines how to interpret the part. It contains two piece of
    data: the part type, and the part parameters.

    The part type is used to route an application level handler, that can
    interpret payload.

    Part parameters are passed to the application level handler.  They are
    meant to convey information that will help the application level object to
    interpret the part payload.

    The binary format of the header is has follow

    :typesize: (one byte)

    :parttype: alphanumerical part name (restricted to [a-zA-Z0-9_:-]*)

    :partid: A 32bits integer (unique in the bundle) that can be used to refer
             to this part.

    :parameters:

        Part's parameter may have arbitrary content, the binary structure is::

            <mandatory-count><advisory-count><param-sizes><param-data>

        :mandatory-count: 1 byte, number of mandatory parameters

        :advisory-count:  1 byte, number of advisory parameters

        :param-sizes:

            N couple of bytes, where N is the total number of parameters. Each
            couple contains (<size-of-key>, <size-of-value) for one parameter.

        :param-data:

            A blob of bytes from which each parameter key and value can be
            retrieved using the list of size couples stored in the previous
            field.

            Mandatory parameters comes first, then the advisory ones.

            Each parameter's key MUST be unique within the part.

:payload:

    payload is a series of `<chunksize><chunkdata>`.

    `chunksize` is an int32, `chunkdata` are plain bytes (as much as
    `chunksize` says)` The payload part is concluded by a zero size chunk.

    The current implementation always produces either zero or one chunk.
    This is an implementation limitation that will ultimately be lifted.

    `chunksize` can be negative to trigger special case processing. No such
    processing is in place yet.

Bundle processing
============================

Each part is processed in order using a "part handler". Handler are registered
for a certain part type.

The matching of a part to its handler is case insensitive. The case of the
part type is used to know if a part is mandatory or advisory. If the Part type
contains any uppercase char it is considered mandatory. When no handler is
known for a Mandatory part, the process is aborted and an exception is raised.
If the part is advisory and no handler is known, the part is ignored. When the
process is aborted, the full bundle is still read from the stream to keep the
channel usable. But none of the part read from an abort are processed. In the
future, dropping the stream may become an option for channel we do not care to
preserve.
é    Né   )Ú_)ÚhexÚshort)Ú	bookmarksÚchangegroupÚencodingÚerrorÚobsoleteÚphasesÚpushkeyÚpycompatÚrequirementsÚscmutilÚstreamcloneÚtagsÚurlÚutil)Ú
stringutilÚurlutil)Ú
repositorys   >is   >Bs   >Is   >BBé €  s   [^a-zA-Z0-9_:-]c                 óf   — |                       dd¦  «        r|                      d|z  ¦  «         dS dS )z(debug regarding output stream (bundling)ó   develó   bundle2.debugs   bundle2-output: %s
N©Ú
configboolÚdebug©ÚuiÚmessages     ú3/usr/lib/python3/dist-packages/mercurial/bundle2.pyÚoutdebugr#   Ê   sA   € à	‡}‚}�XÐ/Ñ0Ô0ð 4Ø
�ŠÐ(¨7Ñ2Ñ3Ô3Ð3Ð3Ð3ð4ð 4ó    c                 óf   — |                       dd¦  «        r|                      d|z  ¦  «         dS dS )z"debug on input stream (unbundling)r   r   s   bundle2-input: %s
Nr   r   s     r"   Úindebugr&   Ð   sA   € à	‡}‚}�XÐ/Ñ0Ô0ð 3Ø
�ŠÐ'¨'Ñ1Ñ2Ô2Ð2Ð2Ð2ð3ð 3r$   c                 óX   — t                                | ¦  «        rt          | ¦  «        ‚dS )z9raise ValueError if a parttype contains invalid characterN)Ú_parttypeforbiddenÚsearchÚ
ValueError©Úparttypes    r"   Úvalidateparttyper-   Ö   s0   € å× Ò  Ñ*Ô*ð #Ý˜Ñ"Ô"Ð"ð#ð #r$   c                 ó   — dd| z  z   S )z�return a struct format to read part parameter sizes

    The number parameters is variable so we need to build that format
    dynamically.
    ó   >s   BB© )Únbparamss    r"   Ú_makefpartparamsizesr2   Ü   s   € ð �5˜8Ñ#Ñ$Ð$r$   r0   c                 ó4   ‡ ‡— t          ‰ ¦  «         ˆˆ fd„}|S )zúdecorator that register a function as a bundle2 part handler

    eg::

        @parthandler('myparttype', ('mandatory', 'param', 'handled'))
        def myparttypehandler(...):
            '''process a part of type "my part".'''
            ...
    c                 ó‚   •— ‰                      ¦   «         }|t          vsJ ‚| t          |<   t          ‰¦  «        | _        | S ©N)ÚlowerÚparthandlermappingÚ	frozensetÚparams)ÚfuncÚ	lparttyper9   r,   s     €€r"   Ú
_decoratorzparthandler.<locals>._decoratorô   sC   ø€ Ø—N’NÑ$Ô$ˆ	ØÕ 2Ð2Ð2Ð2Ð2Ø(,Õ˜9Ñ%Ý Ñ'Ô'ˆŒØˆr$   )r-   )r,   r9   r<   s   `` r"   Úparthandlerr=   è   s:   øø€ õ �XÑÔÐðð ð ð ð ð ð Ðr$   c                   óB   — e Zd ZdZd„ Zd
d„Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
e
ZdS )Úunbundlerecordsa‘  keep record of what happens during and unbundle

    New records are added using `records.add('cat', obj)`. Where 'cat' is a
    category of record and obj is an arbitrary object.

    `records['cat']` will return all entries of this category 'cat'.

    Iterating on the object itself will yield `('category', obj)` tuples
    for all entries.

    All iterations happens in chronological order.
    c                 ó0   — i | _         g | _        i | _        d S r5   )Ú_categoriesÚ
_sequencesÚ_replies©Úselfs    r"   Ú__init__zunbundlerecords.__init__  s   € ØˆÔØˆŒØˆŒˆˆr$   Nc                 óô   — | j                              |g ¦  «                             |¦  «         | j                             ||f¦  «         |�+|                      |¦  «                             ||¦  «         dS dS )z€add a new record of a given category.

        The entry can then be retrieved in the list returned by
        self['category'].N)rA   Ú
setdefaultÚappendrB   Ú
getrepliesÚadd)rE   ÚcategoryÚentryÚ	inreplytos       r"   rK   zunbundlerecords.add  s|   € ð
 	Ô×#Ò# H¨bÑ1Ô1×8Ò8¸Ñ?Ô?Ð?ØŒ×Ò ¨%Ð0Ñ1Ô1Ð1ØÐ Ø�OŠO˜IÑ&Ô&×*Ò*¨8°UÑ;Ô;Ð;Ð;Ð;ð !Ð r$   c                 óP   — | j                              |t          ¦   «         ¦  «        S )z3get the records that are replies to a specific part)rC   rH   r?   )rE   Úpartids     r"   rJ   zunbundlerecords.getreplies  s    € àŒ}×'Ò'¨µÑ0AÔ0AÑBÔBÐBr$   c                 óR   — t          | j                             |d¦  «        ¦  «        S )Nr0   )ÚtuplerA   Úget)rE   Úcats     r"   Ú__getitem__zunbundlerecords.__getitem__  s#   € Ý�TÔ%×)Ò)¨#¨rÑ2Ô2Ñ3Ô3Ð3r$   c                 ó*   — t          | j        ¦  «        S r5   )ÚiterrB   rD   s    r"   Ú__iter__zunbundlerecords.__iter__"  ó   € Ý�D”OÑ$Ô$Ð$r$   c                 ó*   — t          | j        ¦  «        S r5   )ÚlenrB   rD   s    r"   Ú__len__zunbundlerecords.__len__%  s   € Ý�4”?Ñ#Ô#Ð#r$   c                 ó*   — t          | j        ¦  «        S r5   )ÚboolrB   rD   s    r"   Ú__nonzero__zunbundlerecords.__nonzero__(  rY   r$   r5   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__rF   rK   rJ   rU   rX   r\   r_   Ú__bool__r0   r$   r"   r?   r?   þ   s�   € € € € € ðð ðð ð ð
<ð <ð <ð <ðCð Cð Cð4ð 4ð 4ð%ð %ð %ð$ð $ð $ð%ð %ð %ð €H€H€Hr$   r?   c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )	ÚbundleoperationaP  an object that represents a single bundling process

    Its purpose is to carry unbundle-related objects and states.

    A new object should be created at the beginning of each bundle processing.
    The object is to be returned by the processing function.

    The object has very little content now it will ultimately contain:
    * an access to the repo the bundle is applied to,
    * a ui object,
    * a way to retrieve a transaction to add changes to the repo,
    * a way to record the result of processing each part,
    * a way to construct a bundle response when applicable.
    Tr$   c                 ó¦   — || _         |j        | _        t          ¦   «         | _        d | _        || _        i | _        || _        i | _        || _	        d S r5   )
Úrepor    r?   ÚrecordsÚreplyÚcaptureoutputÚhookargsÚ_gettransactionÚmodesÚsource)rE   rh   Útransactiongetterrk   ro   s        r"   rF   zbundleoperation.__init__>  sO   € ØˆŒ	Ø”'ˆŒÝ&Ñ(Ô(ˆŒØˆŒ
Ø*ˆÔØˆŒØ0ˆÔàˆŒ
ØˆŒˆˆr$   c                 ó    — |                       ¦   «         }| j        r+| j                             |j        ¦  «         | j        |_        d | _        |S r5   )rm   rl   Úupdate)rE   Útransactions     r"   Úgettransactionzbundleoperation.gettransactionJ  sQ   € Ø×*Ò*Ñ,Ô,ˆàŒ=ð 	1ð ŒM× Ò  Ô!5Ñ6Ô6Ð6Ø#'¤=ˆKÔ ð ˆŒàÐr$   c                 óp   — | j         €t          j        d¦  «        ‚| j                              |¦  «         d S )Ns@   attempted to add hookargs to operation after transaction started)rl   r
   ÚProgrammingErrorrr   )rE   rl   s     r"   Úaddhookargszbundleoperation.addhookargsY  sB   € ØŒ=Ð ÝÔ(ð7ñô ð ð 	Œ×Ò˜XÑ&Ô&Ð&Ð&Ð&r$   N)Tr$   )r`   ra   rb   rc   rF   rt   rw   r0   r$   r"   rf   rf   .  sP   € € € € € ðð ð
ð 
ð 
ð 
ðð ð ð'ð 'ð 'ð 'ð 'r$   rf   c                   ó   — e Zd ZdS )ÚTransactionUnavailableN)r`   ra   rb   r0   r$   r"   ry   ry   b  s   € € € € € Ø€Dr$   ry   c                  ó   — t          ¦   «         ‚)zždefault method to get a transaction while processing a bundle

    Raise an exception to highlight the fact that no transaction was expected
    to be created©ry   r0   r$   r"   Ú_notransactionr|   f  s   € õ
 !Ñ
"Ô
"Ð"r$   c                 ó  ‡— t          |t          ¦  «        rJd‰j        d<   |�d‰j        vr
|‰j        d<   |�d‰j        vr
|‰j        d<   t          | |ˆfd„|¬¦  «        S t	          | ˆfd„|¬¦  «        }t          ||‰||fi |¤Ž |S )Nó   1ó   bundle2s   sourceó   urlc                  ó   •— ‰ S r5   r0   ©Útrs   €r"   ú<lambda>zapplybundle.<locals>.<lambda>v  s   ø€ °b€ r$   ©ro   c                  ó   •— ‰ S r5   r0   r‚   s   €r"   r„   zapplybundle.<locals>.<lambda>y  s   ø€ ¨2€ r$   )Ú
isinstanceÚ
unbundle20rl   Úprocessbundlerf   Ú_processchangegroup)rh   Ú	unbundlerrƒ   ro   r   ÚkwargsÚops     `    r"   ÚapplybundlerŽ   n  s¸   ø€ å�)�ZÑ(Ô(ð Ø"&ˆŒ�JÑØÐ )°2´;Ð">Ð">Ø%+ˆBŒK˜	Ñ"Øˆ?˜v¨R¬[Ð8Ð8Ø"%ˆBŒK˜ÑÝ˜T 9¨j¨j¨j¨jÀÐHÑHÔHÐHõ ˜T : : : :°fÐ=Ñ=Ô=ˆÝ˜B 	¨2¨v°sÐEÐE¸fÐEÐEÐEØˆ	r$   c                   ó    — e Zd Zd„ Zd„ Zd„ ZdS )Úpartiteratorc                 óZ   — || _         || _        || _        d | _        d| _        d | _        d S )Nr   )rh   r�   r‹   ÚiteratorÚcountÚcurrent)rE   rh   r�   r‹   s       r"   rF   zpartiterator.__init__  s0   € ØˆŒ	ØˆŒØ"ˆŒØˆŒØˆŒ
ØˆŒˆˆr$   c                 ó:   ‡ — ˆ fd„} |¦   «         ‰ _         ‰ j         S )Nc               3   óÄ   •K  — t          ‰j                             ¦   «         d¦  «        } | D ]2\  }}|‰_        |‰_        |V — |                     ¦   «          d ‰_        Œ3d S )Nr   )Ú	enumerater‹   Ú	iterpartsr“   r”   Úconsume)Úitrr“   ÚprE   s      €r"   r:   z$partiterator.__enter__.<locals>.funcˆ  sn   øè è € Ý˜DœN×4Ò4Ñ6Ô6¸Ñ:Ô:ˆCØð $ð $‘��qØ"�”
Ø �”Ø���Ø—	’	‘”�Ø#�”�ð$ð $r$   )r’   )rE   r:   s   ` r"   Ú	__enter__zpartiterator.__enter__‡  s3   ø€ ð	$ð 	$ð 	$ð 	$ð 	$ð ˜™œˆŒØŒ}Ðr$   c                 óè  — | j         sd S t          |t          ¦  «        r¬d}	 | j        r| j                             ¦   «          | j         D ]}|                     ¦   «          Œn# t          $ r d}Y nw xY wd|_        g }d }| j        j        �/| j        j                             ¦   «         }| j        j        j	        }||_
        ||_        |r|‚| j        j                             d| j        z  ¦  «         d S )NFTs%   bundle2-input-bundle: %i parts total
)r’   r‡   Ú	Exceptionr”   r™   Úduringunbundle2r�   rj   ÚsalvageoutputÚcapabilitiesÚ
_replycapsÚ_bundle2salvagedoutputrh   r    r   r“   )rE   ÚtypeÚexcÚtbÚ	seekerrorÚpartÚsalvagedÚ	replycapss           r"   Ú__exit__zpartiterator.__exit__”  s'  € ØŒ}ð 	ØˆFõ
 �c�9Ñ%Ô%ð #	ð ˆIð	!Ø”<ð +à”L×(Ò(Ñ*Ô*Ð*à œMð #ð #�Dà—L’L‘N”N�N�Nð#øõ ð !ð !ð !Ø �	�	�	ð!øøøð #'ˆCÔØˆHØˆIØŒwŒ}Ð(Øœ7œ=×6Ò6Ñ8Ô8�Ø œGœMÔ6�	Ø&ˆCŒNØ)1ˆCÔ&ð ð Ø�	àŒ	Œ×ÒØ5¸¼
ÑBñ	
ô 	
ð 	
ð 	
ð 	
s   ¢>A! Á!A0Á/A0N)r`   ra   rb   rF   rœ   r«   r0   r$   r"   r�   r�   ~  sA   € € € € € ðð ð ðð ð ð.
ð .
ð .
ð .
ð .
r$   r�   r$   c                 óô  — |€|€t           }t          | ||¬¦  «        }|j         | j        j        r¶dg}|j        r*|                     dt          |j        ¦  «        z  ¦  «         |j        �|j        t           u r|                     d¦  «         n|                     d¦  «         |                     d¦  «         | j                             d 	                    |¦  «        ¦  «         t          | ||¦  «         |S )	a,  This function process a bundle, apply effect to/from a repo

    It iterates over each part then searches for and uses the proper handling
    code to process the part. Parts are processed in order.

    Unknown Mandatory part will abort the process.

    It is temporarily possible to provide a prebuilt bundleoperation to the
    function. This is used to ensure output is properly propagated in case of
    an error during the unbundling. This output capturing part will likely be
    reworked and this ability will probably go away in the process.
    Nr…   s   bundle2-input-bundle:s
    %i paramss    no-transactions    with-transactionó   
r$   )r|   rf   r9   r    Ú	debugflagrI   r[   rm   r   ÚjoinÚprocessparts)rh   r‹   rp   r�   ro   Úmsgs         r"   r‰   r‰   Å  sý   € ð 
€zØÐ$Ý .ÐÝ˜TÐ#4¸VÐDÑDÔDˆð ÔÐØ„wÔð 	%Ø'Ð(ˆØÔð 	>Ø�JŠJ�}¥s¨9Ô+;Ñ'<Ô'<Ñ<Ñ=Ô=Ð=ØÔÐ%¨Ô);½~Ð)MÐ)MØ�JŠJÐ)Ñ*Ô*Ð*Ð*à�JŠJÐ+Ñ,Ô,Ð,Ø�
Š
�5ÑÔÐØŒ�Š�c—h’h˜s‘m”mÑ$Ô$Ð$å��r˜9Ñ%Ô%Ð%à€Ir$   c                 ó†   — t          | ||¦  «        5 }|D ]}t          ||¦  «         Œ	 d d d ¦  «         d S # 1 swxY w Y   d S r5   )r�   Ú_processpart)rh   r�   r‹   Úpartsr¨   s        r"   r°   r°   ê  sœ   € Ý	�d˜B 	Ñ	*Ô	*ð #¨eØð 	#ð 	#ˆDÝ˜˜TÑ"Ô"Ð"Ð"ð	#ð#ð #ð #ñ #ô #ð #ð #ð #ð #ð #ð #ð #øøøð #ð #ð #ð #ð #ð #s   ’6¶:½:c                 ól   —  |j         | j        |||fi |¤Ž}| j                             dd|i¦  «         |S )Nó   changegroupó   return)Úapplyrh   ri   rK   )r�   Úcgrƒ   ro   r   rŒ   Úrets          r"   rŠ   rŠ   ð  sO   € Ø
ˆ"Œ(�2”7˜B ¨Ð
6Ð
6¨vÐ
6Ð
6€CØ„J‡N‚NØà�sð	
ñô ð ð €Jr$   c                 óF  — d}	 t                                |j        ¦  «        }|€d}t          j        |j        ¬¦  «        ‚t          | j        d|j        z  ¦  «         |j        |j        z
  }|rVt          |¦  «        }| 
                    ¦   «          dd                     |¦  «        z  }t          j        |j        |¬¦  «        ‚d}�nE# t          j        $ �r2}|j        r‚ t          | j        d	|z  ¦  «         Y d }~| j        j        rûd
|j        z  g}|j        s|                     d¦  «         t          |j        ¦  «        }t          |j        ¦  «        |z
  }|s|r^|                     d¦  «         |r|                     d|z  ¦  «         |r|                     d|z  ¦  «         |                     d¦  «         |                     d|z  ¦  «         | j                             d                     |¦  «        ¦  «         d S d S d }~ww xY w	 | j        j        rùd
|j        z  g}|j        s|                     d¦  «         t          |j        ¦  «        }t          |j        ¦  «        |z
  }|s|r^|                     d¦  «         |r|                     d|z  ¦  «         |r|                     d|z  ¦  «         |                     d¦  «         |                     d|z  ¦  «         | j                             d                     |¦  «        ¦  «         �n# | j        j        rúd
|j        z  g}|j        s|                     d¦  «         t          |j        ¦  «        }t          |j        ¦  «        |z
  }|s|r^|                     d¦  «         |r|                     d|z  ¦  «         |r|                     d|z  ¦  «         |                     d¦  «         |                     d|z  ¦  «         | j                             d                     |¦  «        ¦  «         w w xY w|S )Ns   unknowns   unsupported-typer+   s   found a handler for part %ss   unsupported-params (%s)s   , )r,   r9   s	   supporteds%   ignoring unsupported advisory part %ss   bundle2-input-part: "%s"ó    (advisory)ó	    (params:ó    %i mandatoryó    %i advisoryó   )s    %s
r$   )r7   rS   r¤   r
   ÚBundleUnknownFeatureErrorr&   r    Úmandatorykeysr9   ÚlistÚsortr¯   Ú	mandatoryr®   rI   r[   r   )	r�   r¨   ÚstatusÚhandlerÚunknownparamsr¥   r±   ÚnbmpÚnbaps	            r"   Ú_gethandlerrË   û  sT  € Ø€Fð#'Ý$×(Ò(¨¬Ñ3Ô3ˆØˆ?Ø(ˆFÝÔ1¸4¼9ÐEÑEÔEÐEÝ�”Ð5¸¼	ÑAÑBÔBÐBØÔ*¨W¬^Ñ;ˆØð 	Ý  Ñ/Ô/ˆMØ×ÒÑ Ô Ð Ø/°%·*²*¸]Ñ2KÔ2KÑKˆFÝÔ1Øœ¨=ðñ ô ð ð ˆ‰øÝÔ*ð ñ ð ØŒ>ð 	ØÝ�”Ð?À#ÑEÑFÔFÐFØˆˆˆàŒ5Œ?ð 	'Ø.°´Ñ:Ð;ˆCØ”>ð +Ø—
’
˜>Ñ*Ô*Ð*Ý�tÔ)Ñ*Ô*ˆDÝ�t”{Ñ#Ô# dÑ*ˆDØð !�tð !Ø—
’
˜<Ñ(Ô(Ð(Øð 8Ø—J’JÐ/°$Ñ6Ñ7Ô7Ð7Øð 7Ø—J’J˜°Ñ5Ñ6Ô6Ð6Ø—
’
˜4Ñ Ô Ð Ø�JŠJ�x &Ñ(Ñ)Ô)Ð)ØŒE�KŠK˜Ÿš ™œÑ&Ô&Ð&Ð&Ð&ð	'ð 	'øøøøðøøøð 	ð Œ5Œ?ð 	'Ø.°´Ñ:Ð;ˆCØ”>ð +Ø—
’
˜>Ñ*Ô*Ð*Ý�tÔ)Ñ*Ô*ˆDÝ�t”{Ñ#Ô# dÑ*ˆDØð !�tð !Ø—
’
˜<Ñ(Ô(Ð(Øð 8Ø—J’JÐ/°$Ñ6Ñ7Ô7Ð7Øð 7Ø—J’J˜°Ñ5Ñ6Ô6Ð6Ø—
’
˜4Ñ Ô Ð Ø�JŠJ�x &Ñ(Ñ)Ô)Ð)ØŒE�KŠK˜Ÿš ™œÑ&Ô&Ð&ùøð Œ5Œ?ð 	'Ø.°´Ñ:Ð;ˆCØ”>ð +Ø—
’
˜>Ñ*Ô*Ð*Ý�tÔ)Ñ*Ô*ˆDÝ�t”{Ñ#Ô# dÑ*ˆDØð !�tð !Ø—
’
˜<Ñ(Ô(Ð(Øð 8Ø—J’JÐ/°$Ñ6Ñ7Ô7Ð7Øð 7Ø—J’J˜°Ñ5Ñ6Ô6Ð6Ø—
’
˜4Ñ Ô Ð Ø�JŠJ�x &Ñ(Ñ)Ô)Ð)ØŒE�KŠK˜Ÿš ™œÑ&Ô&Ð&Ð&ð	'øøøð  €Ns1   „CC	 ÃL Ã	HÃ HÃ9L ÈHÈL ÌDPc                 óX  — t          | |¦  «        }|€dS d}| j        r%| j        �| j                             dd¬¦  «         d}	  || |¦  «         |�| j                             ¦   «         }|rN| j                             d|d¬¦  «        }|                     dt          j	        |j
        ¦  «        d¬	¦  «         dS dS # |�| j                             ¦   «         }|rM| j                             d|d¬¦  «        }|                     dt          j	        |j
        ¦  «        d¬	¦  «         w w xY w)
z™process a single part from a bundle

    The part is guaranteed to have been fully consumed when the function exits
    (even if an exception is raised).NT)r
   Úsubprocr$   ó   outputF©ÚdatarÅ   ó   in-reply-to©rÅ   )rË   rk   rj   r    Ú
pushbufferÚ	popbufferÚnewpartÚaddparamr   ÚbytestrÚid)r�   r¨   rÇ   ÚoutputÚoutparts        r"   r³   r³   %  si  € õ
 ˜"˜dÑ#Ô#€GØ€Øˆð €FØ	Ôð ˜BœHÐ0Ø
Œ×Ò˜t¨TÐÑ2Ô2Ð2Øˆð	Øˆ��DÑÔÐàÐØ”U—_’_Ñ&Ô&ˆFØð 	Ø”h×&Ò& y°vÈÐ&ÑOÔOˆGØ×ÒØ¥Ô 0°´Ñ 9Ô 9ÀUð ñ ô ð ð ð ð	ð 	øð ÐØ”U—_’_Ñ&Ô&ˆFØð 	Ø”h×&Ò& y°vÈÐ&ÑOÔOˆGØ×ÒØ¥Ô 0°´Ñ 9Ô 9ÀUð ñ ô ð ð ð	øøøs   ÁB= Â=A,D)c                 ó  — i }|                       ¦   «         D ]g}|sŒd|vr|d}}n.|                     dd¦  «        \  }}|                     d¦  «        }t                               |¦  «        }d„ |D ¦   «         }|||<   Œh|S )zñdecode a bundle2 caps bytes blob into a dictionary

    The blob is a list of capabilities (one per line)
    Capabilities may have values using a line of the form::

        capability=value1,value2,value3

    The values are always a list.ó   =r0   r   ó   ,c                 óB   — g | ]}t                                |¦  «        ‘ŒS r0   ©ÚurlreqÚunquote©Ú.0Úvs     r"   ú
<listcomp>zdecodecaps.<locals>.<listcomp>U  s$   € Ð0Ð0Ð0 a•—’˜qÑ!Ô!Ð0Ð0Ð0r$   )Ú
splitlinesÚsplitrà   rá   )ÚblobÚcapsÚlineÚkeyÚvalss        r"   Ú
decodecapsrí   B  sŸ   € ð €DØ—’Ñ!Ô!ð 
ð 
ˆØð 	ØØ�tÐÐØ˜b�ˆCˆCàŸ
š
 4¨Ñ+Ô+‰IˆC�Ø—:’:˜dÑ#Ô#ˆDÝ�nŠn˜SÑ!Ô!ˆØ0Ð0¨4Ð0Ñ0Ô0ˆØˆˆS‰	ˆ	Ø€Kr$   c                 ó  — g }t          | ¦  «        D ]a}| |         }t                               |¦  «        }d„ |D ¦   «         }|rd|d                     |¦  «        fz  }|                     |¦  «         Œbd                     |¦  «        S )z2encode a bundle2 caps dictionary into a bytes blobc                 óB   — g | ]}t                                |¦  «        ‘ŒS r0   )rà   Úquoterâ   s     r"   rå   zencodecaps.<locals>.<listcomp>`  s"   € Ð.Ð.Ð. A•—’˜Q‘”Ð.Ð.Ð.r$   ó   %s=%srÝ   r­   )Úsortedrà   rð   r¯   rI   )ré   ÚchunksÚcarì   s       r"   Ú
encodecapsrõ   Z  s‘   € à€FÝ�T‰lŒlð ð ˆØ�BŒxˆÝ�\Š\˜"ÑÔˆØ.Ð.¨Ð.Ñ.Ô.ˆØð 	2Ø˜R §¢¨4¡¤Ð1Ñ1ˆBØ�Š�bÑÔÐÐØ�:Š:�fÑÔÐr$   )r$   ó   UN)ó   HG10UNrö   )ó   HG10s   BZ)ó   HG10GZs   GZ)r$   ó   HG20r÷   ó   HG10BZrù   )rù   rû   r÷   c                   óh   — e Zd ZdZdZdd„Zdd„Zed„ ¦   «         Zdd„Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Zd„ ZdS )Úbundle20zïrepresent an outgoing bundle2 container

    Use the `addparam` method to add stream level parameter. and `newpart` to
    populate it. Then call `getchunks` to retrieve all the binary chunks of
    data that compose the bundle2 container.rú   r0   c                 ó¼   — || _         g | _        g | _        t          |¦  «        | _        t
          j                             d¦  «        | _        d | _	        d| _
        d S )Nrö   T)r    Ú_paramsÚ_partsÚdictr¡   r   ÚcompenginesÚforbundletypeÚ_compengineÚ	_compoptsÚprefercompressed)rE   r    r¡   s      r"   rF   zbundle20.__init__~  sW   € ØˆŒØˆŒØˆŒÝ  Ñ.Ô.ˆÔÝÔ+×9Ò9¸%Ñ@Ô@ˆÔØˆŒð !%ˆÔÐÐr$   Nc                 óÔ   — |dv rdS t          d„ | j        D ¦   «         ¦  «        rJ ‚|                      d|¦  «         t          j                             |¦  «        | _        || _        dS )z$setup core part compression to <alg>)Nrö   Nc              3   óL   K  — | ]\  }}|                      ¦   «         d k    V — Œ dS )ó   compressionN)r6   )rã   Únrä   s      r"   ú	<genexpr>z*bundle20.setcompression.<locals>.<genexpr>Ž  s3   è è € ÐLÐL±t°q¸!�q—w’w‘y”y NÒ2ÐLÐLÐLÐLÐLÐLr$   s   Compression)Úanyrÿ   rÖ   r   r  r  r  r  )rE   ÚalgÚcompoptss      r"   Úsetcompressionzbundle20.setcompressionŠ  so   € à�-ÐÐØˆFÝÐLÐL¸t¼|ÐLÑLÔLÑLÔLÐLÐLÐLØ�Š�n cÑ*Ô*Ð*ÝÔ+×9Ò9¸#Ñ>Ô>ˆÔØ!ˆŒˆˆr$   c                 ó*   — t          | j        ¦  «        S )z*total number of parts added to the bundler)r[   r   rD   s    r"   Únbpartszbundle20.nbparts“  s   € õ �4”;ÑÔÐr$   c                 óè   — |st          j        d¦  «        ‚|dd…         t          j        t          j        ¦  «        vrt          j        d|z  ¦  «        ‚| j                             ||f¦  «         dS )zadd a stream level parameters   empty parameter namer   r   s   non letter first character: %sN)r
   rv   r   r×   ÚstringÚascii_lettersrÿ   rI   )rE   ÚnameÚvalues      r"   rÖ   zbundle20.addparam™  sˆ   € àð 	BÝÔ(Ð)@ÑAÔAÐAØ��!�Œ9�HÔ,ÝÔ ñ
ô 
ð 
ð 
õ Ô(Ø1°DÑ8ñô ð ð 	Œ×Ò˜T 5˜MÑ*Ô*Ð*Ð*Ð*r$   c                 ó~   — |j         �J ‚t          | j        ¦  «        |_         | j                             |¦  «         dS )z_add a new part to the bundle2 container

        Parts contains the actual applicative payload.N)rØ   r[   r   rI   )rE   r¨   s     r"   Úaddpartzbundle20.addpart¥  s<   € ð ŒwˆˆˆÝ�d”kÑ"Ô"ˆŒØŒ×Ò˜4Ñ Ô Ð Ð Ð r$   c                 óP   — t          |g|¢R i |¤Ž}|                      |¦  «         |S )aq  create a new part and add it to the containers

        As the part is directly added to the containers. For now, this means
        that any failure to properly initialize the part after calling
        ``newpart`` should result in a failure of the whole bundling process.

        You can still fall back to manually create and add if you need better
        control.)Ú
bundlepartr  )rE   ÚtypeidÚargsrŒ   r¨   s        r"   rÕ   zbundle20.newpart­  s8   € õ ˜&Ð2 4Ð2Ð2Ð2¨6Ð2Ð2ˆØ�Š�TÑÔÐØˆr$   c              #   ó²  K  — | j         j        r“d| j        z  g}| j        r*|                     dt          | j        ¦  «        z  ¦  «         |                     dt          | j        ¦  «        z  ¦  «         | j                              d                     |¦  «        ¦  «         t          | j         d| j        z  ¦  «         | j        V — |  
                    ¦   «         }t          | j         d|z  ¦  «         t          t          t          |¦  «        ¦  «        V — |r|V — | j                             |                      ¦   «         | j        ¦  «        D ]}|V — Œd S )Ns   bundle2-output-bundle: "%s",s    (%i params)s    %i parts total
r$   s   start emission of %s streams   bundle parameter: %s)r    r®   Ú_magicstringrÿ   rI   r[   r   r   r¯   r#   Ú_paramchunkÚ_packÚ_fstreamparamsizer  ÚcompressstreamÚ_getcorechunkr  )rE   r±   ÚparamÚchunks       r"   Ú	getchunkszbundle20.getchunks»  s\  è è € ØŒ7Ôð 	)Ø2°TÔ5FÑFÐGˆCØŒ|ð @Ø—
’
˜?­S°´Ñ->Ô->Ñ>Ñ?Ô?Ð?Ø�JŠJÐ+­c°$´+Ñ.>Ô.>Ñ>Ñ?Ô?Ð?ØŒG�MŠM˜#Ÿ(š( 3™-œ-Ñ(Ô(Ð(Ý�”Ð8¸4Ô;LÑLÑMÔMÐMØÔÐÐÐØ× Ò Ñ"Ô"ˆÝ�”Ð1°EÑ9Ñ:Ô:Ð:ÝÕ%¥s¨5¡z¤zÑ2Ô2Ð2Ð2Ð2Øð 	ØˆKˆKˆKØÔ%×4Ò4Ø×ÒÑ Ô  $¤.ñ
ô 
ð 	ð 	ˆEð ˆKˆKˆKˆKð	ð 	r$   c                 óî   — g }| j         D ]W\  }}t                               |¦  «        }|�!t                               |¦  «        }d||fz  }|                     |¦  «         ŒXd                     |¦  «        S )z1return a encoded version of all stream parametersNrñ   ó    )rÿ   rà   rð   rI   r¯   )rE   ÚblocksÚparr  s       r"   r  zbundle20._paramchunkÎ  sy   € àˆØœ,ð 	ð 	‰JˆC�Ý—,’,˜sÑ#Ô#ˆCØÐ ÝŸš UÑ+Ô+�Ø # u Ñ-�Ø�MŠM˜#ÑÔÐÐØ�yŠy˜Ñ Ô Ð r$   c              #   ó  K  — t          | j        d¦  «         | j        D ]A}t          | j        d|j        z  ¦  «         |                     | j        ¬¦  «        D ]}|V — ŒŒBt          | j        d¦  «         t          t          d¦  «        V — dS )zUyield chunk for the core part of the bundle

        (all but headers and parameters)s   start of partss   bundle part: "%s"©r    s   end of bundler   N)r#   r    r   r¤   r&  r   Ú_fpartheadersize)rE   r¨   r%  s      r"   r#  zbundle20._getcorechunkÙ  s¥   è è € õ 	�”Ð+Ñ,Ô,Ð,Ø”Kð 	ð 	ˆDÝ�T”WÐ2°T´YÑ>Ñ?Ô?Ð?ØŸš¨4¬7˜Ñ3Ô3ð ð �Ø����ðå�”Ð*Ñ+Ô+Ð+ÝÕ$ aÑ(Ô(Ð(Ð(Ð(Ð(Ð(r$   c                 ó    — g }| j         D ]C}|j                             d¦  «        r'|                     |                     ¦   «         ¦  «         ŒD|S )z¢return a list with a copy of all output parts in the bundle

        This is meant to be used during error handling to make sure we preserve
        server outputrÎ   )r   r¤   Ú
startswithrI   Úcopy)rE   r©   r¨   s      r"   r    zbundle20.salvageoutputå  sR   € ð
 ˆØ”Kð 	-ð 	-ˆDØŒy×#Ò# IÑ.Ô.ð -Ø—’ §	¢	¡¤Ñ,Ô,Ð,øØˆr$   ©r0   r5   )r`   ra   rb   rc   r  rF   r  Úpropertyr  rÖ   r  rÕ   r&  r  r#  r    r0   r$   r"   rý   rý   u  sÖ   € € € € € ð0ð 0ð €Lð
%ð 
%ð 
%ð 
%ð"ð "ð "ð "ð ð ð  ñ „Xð ð

+ð 
+ð 
+ð 
+ð!ð !ð !ðð ð ðð ð ð&	!ð 	!ð 	!ð
)ð 
)ð 
)ð	ð 	ð 	ð 	ð 	r$   rý   c                   ó$   — e Zd ZdZd„ Zd„ Zd„ ZdS )Úunpackermixinz6A mixin to extract bytes and struct data from a streamc                 ó   — || _         d S r5   )Ú_fp)rE   Úfps     r"   rF   zunpackermixin.__init__ô  s   € ØˆŒˆˆr$   c                 óp   — |                       t          j        |¦  «        ¦  «        }t          ||¦  «        S )a  unpack this struct format from the stream

        This method is meant for internal usage by the bundle2 protocol only.
        They directly manipulate the low level stream including bundle2 level
        instruction.

        Do not use it to implement higher-level logic or methods.)Ú
_readexactÚstructÚcalcsizeÚ_unpack©rE   ÚformatrÐ   s      r"   r<  zunpackermixin._unpack÷  s/   € ð �Š�vœ¨vÑ6Ô6Ñ7Ô7ˆÝ�v˜tÑ$Ô$Ð$r$   c                 ó6   — t          j        | j        |¦  «        S )a  read exactly <size> bytes from the stream

        This method is meant for internal usage by the bundle2 protocol only.
        They directly manipulate the low level stream including bundle2 level
        instruction.

        Do not use it to implement higher-level logic or methods.)r   Úreadexactlyr6  )rE   Úsizes     r"   r9  zunpackermixin._readexact  s   € õ Ô& t¤x°Ñ6Ô6Ð6r$   N)r`   ra   rb   rc   rF   r<  r9  r0   r$   r"   r4  r4  ñ  sG   € € € € € Ø@Ð@ðð ð ð	%ð 	%ð 	%ð7ð 7ð 7ð 7ð 7r$   r4  c                 óœ  — |€t          j        |d¦  «        }|dd…         |dd…         }}|dk    r;|                      d||fz  ¦  «         t          j        t          d¦  «        ¦  «        ‚t                               |¦  «        }|€$t          j        t          d¦  «        |z  ¦  «        ‚ || |¦  «        }t          | d	|z  ¦  «         |S )
z7return a valid unbundler object for a given magicstringNé   r   é   s   HGs6   error: invalid magic: %r (version %r), should be 'HG'
s   not a Mercurial bundles   unknown bundle version %ss   start processing of %s stream)	r   r@  r   r
   ÚAbortr   Ú	formatmaprS   r&   )r    r7  ÚmagicstringÚmagicÚversionÚunbundlerclassr‹   s          r"   ÚgetunbundlerrK    sá   € àÐÝ!Ô-¨b°!Ñ4Ô4ˆØ   1 Ô% {°1°Q°3Ô'7ˆ7€EØ�‚~€~Ø
�ŠØFØ�gÐññ	
ô 	
ð 	
õ Œk�!Ð5Ñ6Ô6Ñ7Ô7Ð7Ý—]’] 7Ñ+Ô+€NØÐÝŒk�!Ð8Ñ9Ô9¸GÑCÑDÔDÐDØ�˜r 2Ñ&Ô&€IÝˆBÐ0°;Ñ>Ñ?Ô?Ð?ØÐr$   c                   ór   ‡ — e Zd ZdZdZˆ fd„Zej        d„ ¦   «         Zd„ Z	d„ Z
d„ Zdd	„Zd
„ Zd„ Zd„ Zˆ xZS )rˆ   z|interpret a bundle2 stream

    This class is fed with a binary stream and yields parts through its
    `iterparts` methods.rú   c                 ó¼   •— || _         t          j                             d¦  «        | _        d| _        t          t          | ¦  «                             |¦  «         dS )z<If header is specified, we do not read it out of the stream.rö   N)	r    r   r  r  r  Ú_compressedÚsuperrˆ   rF   ©rE   r    r7  Ú	__class__s      €r"   rF   zunbundle20.__init__(  sO   ø€ àˆŒÝÔ+×9Ò9¸%Ñ@Ô@ˆÔØˆÔÝ�j˜$ÑÔ×(Ò(¨Ñ,Ô,Ð,Ð,Ð,r$   c                 ó  — t          | j        d¦  «         i }|                      t          ¦  «        d         }|dk     rt	          j        d|z  ¦  «        ‚|r*|                      |¦  «        }|                      |¦  «        }|S )z%dictionary of stream level parameterss!   reading bundle2 stream parametersr   ó   negative bundle param size: %i)r&   r    r<  r!  r
   ÚBundleValueErrorr9  Ú_processallparams)rE   r9   Ú
paramssizes      r"   r9   zunbundle20.params/  sŒ   € õ 	�”Ð=Ñ>Ô>Ð>ØˆØ—\’\Õ"3Ñ4Ô4°QÔ7ˆ
Ø˜Š>ˆ>ÝÔ(Ø1°JÑ>ñô ð ð ð 	4Ø—_’_ ZÑ0Ô0ˆFØ×+Ò+¨FÑ3Ô3ˆFØˆr$   c                 ó&  — t          j        ¦   «         }|                     d¦  «        D ]g}|                     dd¦  «        }d„ |D ¦   «         }t          |¦  «        dk     r|                     d¦  «          | j        |Ž  |d         ||d         <   Œh|S )ú r(  rÜ   r   c                 óB   — g | ]}t                                |¦  «        ‘ŒS r0   rß   )rã   Úis     r"   rå   z0unbundle20._processallparams.<locals>.<listcomp>C  s$   € Ð.Ð.Ð. q•—’ Ñ"Ô"Ð.Ð.Ð.r$   rD  Nr   )r   Úsortdictrç   r[   rI   Ú_processparam)rE   Úparamsblockr9   r›   s       r"   rU  zunbundle20._processallparams>  s–   € å”‘”ˆØ×"Ò" 4Ñ(Ô(ð 	 ð 	 ˆAØ—’˜˜aÑ Ô ˆAØ.Ð.¨AÐ.Ñ.Ô.ˆAÝ�1‰vŒv˜ŠzˆzØ—’˜‘”�ØˆDÔ Ð"Ð"Ø˜Qœ4ˆF�1�Q”4‰LˆLØˆr$   c                 ó¬  — |st          d¦  «        ‚|dd…         t          j        t          j        ¦  «        vrt          d|z  ¦  «        ‚	 t
          |                     ¦   «                  } || ||¦  «         dS # t          $ rN |dd…                              ¦   «         rt          | j
        d|z  ¦  «         Y dS t          j        |f¬¦  «        ‚w xY w)a�  process a parameter, applying its effect if needed

        Parameter starting with a lower case letter are advisory and will be
        ignored when unknown.  Those starting with an upper case letter are
        mandatory and will this function will raise a KeyError when unknown.

        Note: no option are currently supported. Any input will be either
              ignored or failing.
        zempty parameter namer   r   znon letter first character: %ss   ignoring unknown parameter %s)r9   N)r*   r   r×   r  r  Úb2streamparamsmapr6   ÚKeyErrorÚislowerr&   r    r
   rÁ   )rE   r  r  rÇ   s       r"   r\  zunbundle20._processparamJ  s  € ð ð 	5ÝÐ3Ñ4Ô4Ð4Ø��!�Œ9�HÔ,ÝÔ ñ
ô 
ð 
ð 
õ Ð=ÀÑDÑEÔEÐEð	'Ý'¨¯
ª
©¬Ô5ˆGð ˆG�D˜$ Ñ&Ô&Ð&Ð&Ð&øõ ð 	Fð 	Fð 	FØ�A�a�CŒy× Ò Ñ"Ô"ð FÝ˜œÐ!AÀDÑ!HÑIÔIÐIÐIÐIÐIåÔ5¸d¸WÐEÑEÔEÐEð		Føøøs   ÁA; Á;>CÂ<Cc              #   ó  K  — | j         V — dt          | ¦  «        vsJ ‚|                      t          ¦  «        d         }|dk     rt	          j        d|z  ¦  «        ‚|rÈ|                      |¦  «        }|                      |¦  «         g }|                     d¦  «        D ]H}|                     dd¦  «        \  }}| 	                    ¦   «         dk    r| 
                    |¦  «         ŒId                     |¦  «        }t          t          t          |¦  «        ¦  «        V — |V — nt          t          |¦  «        V — | j                             | j        ¦  «        | _        d}|dk     r™t"          t$          k    sJ ‚|                      t"          ¦  «        d         }t          t"          |¦  «        V — |rd}n|dz  }ŒZ|t&          k    rŒf|dk     rt	          j        d	¦  «        ‚|                      |¦  «        V — |dk     °—d
S d
S )aW  utility to transfer a bundle2 as binary

        This is made necessary by the fact the 'getbundle' command over 'ssh'
        have no way to know then the reply end, relying on the bundle to be
        interpreted to know its end. This is terrible and we are sorry, but we
        needed to move forward to get general delta enabled.
        r9   r   rS  r(  rÜ   r   r	  rD  s   negative chunk size: %iN)r  Úvarsr<  r!  r
   rT  r9  rU  rç   r6   rI   r¯   r   r[   r  Údecompressorreaderr6  r-  Ú_fpayloadsizeÚflaginterrupt)	rE   rV  r9   Ú	outparamsr›   Úkrä   Ú
emptycountrA  s	            r"   Ú_forwardchunkszunbundle20._forwardchunksd  s!  è è € ð ÔÐÐÐØ�t D™zœzÐ)Ð)Ð)Ð)Ø—\’\Õ"3Ñ4Ô4°QÔ7ˆ
Ø˜Š>ˆ>ÝÔ(Ø1°JÑ>ñô ð ð ð 	7Ø—_’_ ZÑ0Ô0ˆFØ×"Ò" 6Ñ*Ô*Ð*ð ˆIØ—\’\ $Ñ'Ô'ð (ð (�Ø—w’w˜t QÑ'Ô'‘��1Ø—7’7‘9”9 Ò.Ð.Ø×$Ò$ QÑ'Ô'Ð'øØŸ	š	 )Ñ,Ô,ˆIÝÕ)­3¨y©>¬>Ñ:Ô:Ð:Ð:Ð:ØˆOˆOˆOˆOåÕ)¨:Ñ6Ô6Ð6Ð6Ð6àÔ#×6Ò6°t´xÑ@Ô@ˆŒØˆ
Ø˜1Šnˆnå#¥}Ò4Ð4Ð4Ð4Ø—<’<Õ 0Ñ1Ô1°!Ô4ˆDÝÕ(¨$Ñ/Ô/Ð/Ð/Ð/Øð Ø�
�
à˜a‘�
ØØ•}Ò$Ð$ØØ˜’�ÝÔ,Ð-GÑHÔHÐHØ—/’/ $Ñ'Ô'Ð'Ð'Ð'ð ˜1Šnˆnˆnˆnˆnˆnr$   Fc              #   óŠ  K  — |rt           nt          }| j         | j                             | j        ¦  «        | _        t          | j        d¦  «         |                      ¦   «         }|�E || j        || j        ¦  «        }|V — | 	                    ¦   «          |                      ¦   «         }|­Et          | j        d¦  «         dS )z'yield all parts contained in the streams!   start extraction of bundle2 partsNs   end of bundle2 stream)
ÚseekableunbundlepartÚunbundlepartr9   r  rd  r6  r&   r    Ú_readpartheaderr™   )rE   ÚseekableÚclsÚheaderblockr¨   s        r"   r˜   zunbundle20.iterparts•  sÄ   è è € à&.Ð@Õ"Ð"µLˆàŒˆàÔ#×6Ò6°t´xÑ@Ô@ˆŒÝ�”Ð=Ñ>Ô>Ð>Ø×*Ò*Ñ,Ô,ˆØÐ%Ø�3�t”w ¨T¬XÑ6Ô6ˆDØˆJˆJˆJð �LŠL‰NŒNˆNà×.Ò.Ñ0Ô0ˆKð Ð%õ 	�”Ð1Ñ2Ô2Ð2Ð2Ð2r$   c                 óÞ   — |                       t          ¦  «        d         }|dk     rt          j        d|z  ¦  «        ‚t	          | j        d|z  ¦  «         |r|                      |¦  «        S dS )úQreads a part header size and return the bytes blob

        returns None if emptyr   ó   negative part header size: %is   part header size: %iN©r<  r-  r
   rT  r&   r    r9  ©rE   Ú
headersizes     r"   rn  zunbundle20._readpartheader¨  sz   € ð —\’\Õ"2Ñ3Ô3°AÔ6ˆ
Ø˜Š>ˆ>ÝÔ(Ø0°:Ñ=ñô ð õ 	�”Ð0°:Ñ=Ñ>Ô>Ð>Øð 	/Ø—?’? :Ñ.Ô.Ð.Øˆtr$   c                 ó   — | j          | j        S r5   )r9   rN  rD   s    r"   Ú
compressedzunbundle20.compressed¶  s   € ØŒˆØÔÐr$   c                 ól   — t          j        | j        d¦  «        r| j                             ¦   «         S dS )zclose underlying fileÚcloseN)r   Úsafehasattrr6  r{  rD   s    r"   r{  zunbundle20.closeº  s5   € åÔ˜DœH gÑ.Ô.ð 	$Ø”8—>’>Ñ#Ô#Ð#ð	$ð 	$r$   )F)r`   ra   rb   rc   r  rF   r   Úpropertycacher9   rU  r\  rj  r˜   rn  ry  r{  Ú__classcell__©rQ  s   @r"   rˆ   rˆ      s×   ø€ € € € € ðð ð
 €Lð-ð -ð -ð -ð -ð 
Ôðð ñ Ôðð
ð 
ð 
ð'ð 'ð 'ð4/(ð /(ð /(ðb3ð 3ð 3ð 3ð&ð ð ð ð  ð  ð$ð $ð $ð $ð $ð $ð $r$   rˆ   s   20c                 ó   ‡ — ˆ fd„}|S )z/register a handler for a stream level parameterc                 ó2   •— ‰t           vsJ ‚| t          ‰<   | S r5   )rF  r_  )r:   r  s    €r"   Ú	decoratorz'b2streamparamhandler.<locals>.decoratorÈ  s$   ø€ Ø�9Ð$Ð$Ð$Ð$Ø"&Õ˜$ÑØˆr$   r0   )r  r‚  s   ` r"   Úb2streamparamhandlerrƒ  Å  s$   ø€ ðð ð ð ð ð
 Ðr$   r	  c                 óº   — |t           j        j        vrt          j        |f|f¬¦  «        ‚t           j                             |¦  «        | _        |�	d| _        dS dS )z<read compression parameter and install payload decompression)r9   ÚvaluesNT)r   r  Úsupportedbundletypesr
   rÁ   r  r  rN  )r‹   r$  r  s      r"   Úprocesscompressionr‡  Ð  sd   € ð •DÔ$Ô9Ð9Ð9ÝÔ-°e°XÀuÀhÐOÑOÔOÐOÝ Ô,×:Ò:¸5ÑAÔA€IÔØÐØ $ˆ	ÔÐÐð Ðr$   c                   ó¤   — e Zd ZdZ	 	 	 	 dd„Zd„ Zd„ Zed„ ¦   «         Zej	        d	„ ¦   «         Zed
„ ¦   «         Z
ed„ ¦   «         Zdd„Zd„ Zd„ ZdS )r  a  A bundle2 part contains application level payload

    The part `type` is used to route the part to the application level
    handler.

    The part payload is contained in ``part.data``. It could be raw bytes or a
    generator of byte chunks.

    You can add parameters to the part using the ``addparam`` method.
    Parameters can be either mandatory (default) or advisory. Remote side
    should be able to safely ignore the advisory ones.

    Both data and parameters cannot be modified after the generation has begun.
    r0   r$   Tc                 ó~  — t          |¦  «         d | _        || _        || _        t	          |¦  «        | _        t	          |¦  «        | _        t          ¦   «         | _        | j        | j        z   D ]?\  }}|| j        v rt          j
        d|z  ¦  «        ‚| j                             |¦  «         Œ@d | _        || _        d S )Nó   duplicated params: %s)r-   rØ   r¤   Ú_datarÃ   Ú_mandatoryparamsÚ_advisoryparamsÚsetÚ_seenparamsr
   rv   rK   Ú
_generatedrÅ   )rE   r,   ÚmandatoryparamsÚadvisoryparamsrÐ   rÅ   ÚpnameÚ__s           r"   rF   zbundlepart.__init__ê  sÄ   € õ 	˜Ñ"Ô"Ð"ØˆŒØˆŒ	ØˆŒ
Ý $ _Ñ 5Ô 5ˆÔÝ# NÑ3Ô3ˆÔå™5œ5ˆÔØÔ.°Ô1EÑEð 	(ð 	(‰IˆE�2Ø˜Ô(Ð(Ð(ÝÔ,Ð-EÈÑ-MÑNÔNÐNØÔ× Ò  Ñ'Ô'Ð'Ð'ð
 ˆŒØ"ˆŒˆˆr$   c                 ó„   — | j         j        ›d| j         j        ›�}d|t          | ¦  «        | j        | j        | j        fz  S )Nú.z2<%s object at %x; id: %s; type: %s; mandatory: %s>)rQ  ra   r`   rØ   r¤   rÅ   )rE   rp  s     r"   Ú__repr__zbundlepart.__repr__  sM   € ØœÔ2Ð2Ð2°D´NÔ4KÐ4KÐLˆØCØÝˆt‰HŒHØŒGØŒIØŒNðG
ñ 
ð 	
r$   c                 óž   — t          j        | j        d¦  «        rJ ‚|                      | j        | j        | j        | j        | j        ¦  «        S )zšreturn a copy of the part

        The new part have the very same content but no partid assigned yet.
        Parts with generated data cannot be copied.Únext)	r   r|  rÐ   rQ  r¤   rŒ  r�  r‹  rÅ   rD   s    r"   r0  zbundlepart.copy  sP   € õ
 Ô# D¤I¨vÑ6Ô6Ð6Ð6Ð6Ø�~Š~ØŒIØÔ!ØÔ ØŒJØŒNñ
ô 
ð 	
r$   c                 ó   — | j         S r5   )r‹  rD   s    r"   rÐ   zbundlepart.data  s
   € àŒzÐr$   c                 óJ   — | j         �t          j        d¦  «        ‚|| _        d S )Nó   part is being generated)r�  r
   ÚReadOnlyPartErrorr‹  )rE   rÐ   s     r"   rÐ   zbundlepart.data"  s'   € àŒ?Ð&ÝÔ)Ð*DÑEÔEÐEØˆŒ
ˆ
ˆ
r$   c                 ó*   — t          | j        ¦  «        S r5   )rR   rŒ  rD   s    r"   r‘  zbundlepart.mandatoryparams(  s   € õ �TÔ*Ñ+Ô+Ð+r$   c                 ó*   — t          | j        ¦  «        S r5   )rR   r�  rD   s    r"   r’  zbundlepart.advisoryparams-  s   € õ �TÔ)Ñ*Ô*Ð*r$   c                 óô   — | j         �t          j        d¦  «        ‚|| j        v rt	          d|z  ¦  «        ‚| j                             |¦  «         | j        }|r| j        }|                     ||f¦  «         dS )zîadd a parameter to the part

        If 'mandatory' is set to True, the remote handler must claim support
        for this parameter or the unbundling will be aborted.

        The 'name' and 'value' cannot exceed 255 bytes each.
        Nrœ  rŠ  )	r�  r
   r�  r�  r*   rK   r�  rŒ  rI   )rE   r  r  rÅ   r9   s        r"   rÖ   zbundlepart.addparam2  s‹   € ð Œ?Ð&ÝÔ)Ð*DÑEÔEÐEØ�4Ô#Ð#Ð#ÝÐ5¸Ñ<Ñ=Ô=Ð=ØÔ×Ò˜TÑ"Ô"Ð"ØÔ%ˆØð 	+ØÔ*ˆFØ�Š�t˜U�mÑ$Ô$Ð$Ð$Ð$r$   c           	   #   óô  K  — | j         �t          j        d¦  «        ‚d| _         |j        �rd| j        z  g}| j        s|                     d¦  «         t          | j        ¦  «        }t          | j	        ¦  «        }|s|r^|                     d¦  «         |r|                     d|z  ¦  «         |r|                     d|z  ¦  «         |                     d¦  «         | j
        s|                     d	¦  «         ntt          j        | j
        d
¦  «        st          j        | j
        d¦  «        r|                     d¦  «         n*|                     dt          | j
        ¦  «        z  ¦  «         |                     d¦  «         |                     d                     |¦  «        ¦  «         | j        r| j                             ¦   «         }n| j                             ¦   «         }t#          |dt%          j        | j        ¦  «        |fz  ¦  «         t+          t,          t          |¦  «        ¦  «        |t+          t.          | j        ¦  «        g}| j        }| j	        }|                     t+          t0          t          |¦  «        t          |¦  «        ¦  «        ¦  «         g }	|D ]I\  }
}|	                     t          |
¦  «        ¦  «         |	                     t          |¦  «        ¦  «         ŒJ|D ]I\  }
}|	                     t          |
¦  «        ¦  «         |	                     t          |¦  «        ¦  «         ŒJt+          t3          t          |	¦  «        dz  ¦  «        g|	¢R Ž }|                     |¦  «         |D ]/\  }
}|                     |
¦  «         |                     |¦  «         Œ0|D ]/\  }
}|                     |
¦  «         |                     |¦  «         Œ0	 d                     |¦  «        }n # t4          $ r t5          d|z  ¦  «        ‚w xY wt#          |dt          |¦  «        z  ¦  «         t+          t6          t          |¦  «        ¦  «        V — |V — 	 |                      ¦   «         D ]J}t#          |dt          |¦  «        z  ¦  «         t+          t:          t          |¦  «        ¦  «        V — |V — ŒK�n# t<          $ r |                     d¦  «         ‚ t>          $ rà}tA          j!        |¦  «        }|                     d|z  ¦  «         tE          j#        ¦   «         d         }d|z  }tI          dd|fgd¬¦  «        }d|_        t+          t:          d¦  «        V — | %                    |¬¦  «        D ]}|V — Œt#          |d¦  «         t+          t:          d¦  «        V — t%          j&        ||¦  «         Y d }~nd }~ww xY wt#          |d¦  «         t+          t:          d¦  «        V — d| _         d S ) Ns   part can only be consumed onceFs   bundle2-output-part: "%s"r¼   r½   r¾   r¿   rÀ   s    empty payloadr™  ó   __next__s    streamed payloads    %i bytes payloadr­   r$   s   part %s: "%s"rD  z8Found a non-bytes trying to build bundle part header: %rs   header chunk size: %ió   payload chunk size: %is   bundle2-generatorexit
s5   bundle2-input-stream-interrupt: encoding exception %ss   unexpected error: %só   error:abortó   messagerÒ   r   éÿÿÿÿr,  s   closing payload chunkT)'r�  r
   rv   r®   r¤   rÅ   rI   r[   r‘  r’  rÐ   r   r|  r   r¯   Úupperr6   r#   r   r×   rØ   r   Ú_fparttypesizeÚ_fpartidÚ_fpartparamcountr2   Ú	TypeErrorr-  Ú_payloadchunksre  ÚGeneratorExitÚBaseExceptionr   ÚforcebytestrÚsysÚexc_infor  r&  Úraisewithtb)rE   r    r±   rÉ   rÊ   r,   ÚheaderÚmanparÚadvparÚparsizesrë   r  Ú
paramsizesÚheaderchunkr%  r¥   Úbexcr¦   Ú	interparts                      r"   r&  zbundlepart.getchunksE  s0  è è € ØŒ?Ð&ÝÔ(Ð)JÑKÔKÐKØˆŒàŒ<ñ 	$Ø/°$´)Ñ;Ð<ˆCØ”>ð +Ø—
’
˜>Ñ*Ô*Ð*Ý�tÔ+Ñ,Ô,ˆDÝ�tÔ*Ñ+Ô+ˆDØð !�tð !Ø—
’
˜<Ñ(Ô(Ð(Øð 8Ø—J’JÐ/°$Ñ6Ñ7Ô7Ð7Øð 7Ø—J’J˜°Ñ5Ñ6Ô6Ð6Ø—
’
˜4Ñ Ô Ð Ø”9ð BØ—
’
Ð,Ñ-Ô-Ð-Ð-ÝÔ! $¤)¨VÑ4Ô4ð B½Ô8HØ”	˜;ñ9ô 9ð Bð —
’
Ð/Ñ0Ô0Ð0Ð0à—
’
Ð/µ#°d´i±.´.Ñ@ÑAÔAÐAØ�JŠJ�uÑÔÐØ�HŠH�S—X’X˜c‘]”]Ñ#Ô#Ð#ð Œ>ð 	)Ø”y—’Ñ(Ô(ˆHˆHà”y—’Ñ(Ô(ˆHÝ�Ð%­Ô)9¸$¼'Ñ)BÔ)BÀHÐ(MÑMÑNÔNÐNõ •.¥# h¡-¤-Ñ0Ô0ØÝ•(˜DœGÑ$Ô$ð
ˆð Ô%ˆØÔ$ˆØ�Š•eÕ,­c°&©k¬k½3¸v¹;¼;ÑGÔGÑHÔHÐHàˆØ ð 	(ð 	(‰JˆC�Ø�OŠO�C ™HœHÑ%Ô%Ð%Ø�OŠO�C ™JœJÑ'Ô'Ð'Ð'Ø ð 	(ð 	(‰JˆC�Ø�OŠO�C ™HœHÑ%Ô%Ð%Ø�OŠO�C ™JœJÑ'Ô'Ð'Ð'ÝÕ/µ°H±´ÀÑ0BÑCÔCÐOÀhÐOÐOÐOˆ
Ø�Š�jÑ!Ô!Ð!à ð 	!ð 	!‰JˆC�Ø�MŠM˜#ÑÔÐØ�MŠM˜%Ñ Ô Ð Ð Ø ð 	!ð 	!‰JˆC�Ø�MŠM˜#ÑÔÐØ�MŠM˜%Ñ Ô Ð Ð ð	ØŸ(š( 6Ñ*Ô*ˆKˆKøÝð 	ð 	ð 	Ýð/Ø17ñ8ñô ð ð	øøøõ
 	�Ð-µ°KÑ0@Ô0@Ñ@ÑAÔAÐAÝÕ$¥c¨+Ñ&6Ô&6Ñ7Ô7Ð7Ð7Ð7ØÐÐÐð	*Ø×,Ò,Ñ.Ô.ð ð �Ý˜Ð6½¸U¹¼ÑCÑDÔDÐDÝ�M­3¨u©:¬:Ñ6Ô6Ð6Ð6Ð6Ø����ñøõ ð 	ð 	ð 	ð �HŠHÐ/Ñ0Ô0Ð0ØÝð 	*ð 	*ð 	*ÝÔ*¨3Ñ/Ô/ˆDà�HŠHØHÈ4ÑOñô ð õ ”‘” Ô"ˆBØ)¨DÑ0ˆCÝ"Ø *¨cÐ!2Ð 3¸uðñ ô ˆIð ˆIŒLÝ� rÑ*Ô*Ð*Ð*Ð*Ø"×,Ò,°Ð,Ñ3Ô3ð ð �Ø����Ý�RÐ1Ñ2Ô2Ð2å� qÑ)Ô)Ð)Ð)Ð)ÝÔ   bÑ)Ô)Ð)Ð)Ð)Ð)Ð)Ð)øøøøð%	*øøøõ( 	�Ð-Ñ.Ô.Ð.Ý•M 1Ñ%Ô%Ð%Ð%Ð%ØˆŒˆˆs&   ÏO4 Ï4PÑAR> Ò>)WÓ'CW×Wc              #   ób  K  — t          j        | j        d¦  «        st          j        | j        d¦  «        rYt          j        | j        ¦  «        }|                     t
          ¦  «        }|r"|V — |                     t
          ¦  «        }|° dS dS t          | j        ¦  «        r| j        V — dS dS )zmyield chunks of a the part payload

        Exists to handle the different methods to provide data to a part.r™  r¢  N)r   r|  rÐ   ÚchunkbufferÚreadÚpreferedchunksizer[   )rE   Úbuffr%  s      r"   r¬  zbundlepart._payloadchunks³  sÌ   è è € õ Ô˜DœI vÑ.Ô.ð 		µ$Ô2BØŒI�{ñ3
ô 3
ð 		õ Ô# D¤IÑ.Ô.ˆDØ—I’IÕ/Ñ0Ô0ˆEØð 5Ø���ØŸ	š	Õ"3Ñ4Ô4�ð ð 5ð 5ð 5ð 5ð 5õ �”‰^Œ^ð 	Ø”)ˆOˆOˆOˆOˆOð	ð 	r$   N)r0   r0   r$   T)r$   T)r`   ra   rb   rc   rF   r—  r0  r2  rÐ   Úsetterr‘  r’  rÖ   r&  r¬  r0   r$   r"   r  r  Ú  s  € € € € € ðð ð$ ØØØð#ð #ð #ð #ð6
ð 
ð 
ð
ð 
ð 
ð ðð ñ „Xðð 
„[ðð ñ „[ðð
 ð,ð ,ñ „Xð,ð ð+ð +ñ „Xð+ð%ð %ð %ð %ð&lð lð lð\ð ð ð ð r$   r  r¦  c                   ó.   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zˆ xZS )Úinterrupthandlerzþread one part and process it with restricted capability

    This allows to transmit exception raised on the producer size during part
    iteration while the consumer is reading a part.

    Part processed in this manner only have access to a ui object,c                 óf   •— t          t          | ¦  «                             |¦  «         || _        d S r5   )rO  rÂ  rF   r    rP  s      €r"   rF   zinterrupthandler.__init__Ð  s-   ø€ ÝÕ Ñ%Ô%×.Ò.¨rÑ2Ô2Ð2ØˆŒˆˆr$   c                 óÞ   — |                       t          ¦  «        d         }|dk     rt          j        d|z  ¦  «        ‚t	          | j        d|z  ¦  «         |r|                      |¦  «        S dS )rs  r   rt  s   part header size: %i
Nru  rv  s     r"   rn  z interrupthandler._readpartheaderÔ  sz   € ð —\’\Õ"2Ñ3Ô3°AÔ6ˆ
Ø˜Š>ˆ>ÝÔ(Ø0°:Ñ=ñô ð õ 	�”Ð2°ZÑ?Ñ@Ô@Ð@Øð 	/Ø—?’? :Ñ.Ô.Ð.Øˆtr$   c                 ó  — | j                              d¦  «         t          | j         d¦  «         |                      ¦   «         }|€t          | j         d¦  «         d S t	          | j         || j        ¦  «        }t          | j         ¦  «        }d}	 t          ||¦  «         n# t          t          f$ r d}‚ w xY w	 |s| 
                    ¦   «          n# |s| 
                    ¦   «          w w xY w| j                              d¦  «         d S )Ns<   bundle2-input-stream-interrupt: opening out of band context
s0   bundle2 stream interruption, looking for a part.s"   no part found during interruption.FTs<   bundle2-input-stream-interrupt: closing out of band context
)r    r   r&   rn  rm  r6  Úinterruptoperationr³   Ú
SystemExitÚKeyboardInterruptr™   )rE   rq  r¨   r�   Ú	hardaborts        r"   Ú__call__zinterrupthandler.__call__â  s/  € àŒ�ŠØLñ	
ô 	
ð 	
õ 	�”ÐLÑMÔMÐMØ×*Ò*Ñ,Ô,ˆØÐÝ�D”GÐBÑCÔCÐCØˆFÝ˜DœG [°$´(Ñ;Ô;ˆÝ ¤Ñ(Ô(ˆØˆ	ð	Ý˜˜TÑ"Ô"Ð"Ð"øÝÕ-Ð.ð 	ð 	ð 	ØˆIØð	øøøð #ð
 ð Ø—’‘”�øøð ð Ø—’‘”��ðøøøàŒ�ŠØLñ	
ô 	
ð 	
ð 	
ð 	
s   ÂB  ÂC Â B5Â5C ÃC))r`   ra   rb   rc   rF   rn  rÊ  r~  r  s   @r"   rÂ  rÂ  È  sb   ø€ € € € € ðFð Fðð ð ð ð ðð ð ð
ð 
ð 
ð 
ð 
ð 
ð 
r$   rÂ  c                   ó4   — e Zd ZdZd„ Zed„ ¦   «         Zd„ ZdS )rÆ  zpA limited operation to be use by part handler during interruption

    It only have access to an ui object.
    c                 ó0   — || _         d | _        d| _        d S )NF)r    rj   rk   )rE   r    s     r"   rF   zinterruptoperation.__init__  s   € ØˆŒØˆŒ
Ø"ˆÔÐÐr$   c                 ó*   — t          j        d¦  «        ‚©Ns'   no repo access from stream interruption)r
   rv   rD   s    r"   rh   zinterruptoperation.repo  s   € åÔ$Ð%OÑPÔPÐPr$   c                 ó    — t          d¦  «        ‚rÎ  r{   rD   s    r"   rt   z!interruptoperation.gettransaction  s   € Ý$Ð%OÑPÔPÐPr$   N)r`   ra   rb   rc   rF   r2  rh   rt   r0   r$   r"   rÆ  rÆ  ü  s_   € € € € € ðð ð
#ð #ð #ð
 ðQð Qñ „XðQðQð Qð Qð Qð Qr$   rÆ  c              #   ó6  K  — |                       dd¦  «        }| j        }t          j        t          ¦  «        }|j        }|j        }t          j        }|j	        } | |||¦  «        ¦  «        d         }	t          | d|	z  ¦  «         |	�r|	dk    rV ||	¦  «        }
t          |
¦  «        |	k     r3t          j        t          d¦  «        t          |
¦  «        |	fz  ¦  «        ‚|
V — n;|	t          k    r t!          | |¦  «        ¦   «          nt          j        d|	z  ¦  «        ‚ ||¦  «        }
t          |
¦  «        |k     r3t          j        t          d¦  «        t          |
¦  «        |	fz  ¦  «        ‚ ||
¦  «        d         }	|r |d|	z  ¦  «         |	�°dS dS )	z¡Reads bundle2 part payload data into chunks.

    Part payload data consists of framed chunks. This function takes
    a file handle and emits those chunks.
    r   r   r   r£  s6   stream ended unexpectedly  (got %d bytes, expected %d)s   negative payload chunk size: %ss&   bundle2-input: payload chunk size: %i
N)r   r   r:  ÚStructre  rA  Úunpackr   r@  r½  r&   r[   r
   rE  r   rf  rÂ  rT  )r    ÚfhÚdologr   Úheaderstructrw  rÒ  r@  r½  Ú	chunksizeÚss              r"   ÚdecodepayloadchunksrØ    sô  è è € ð �MŠM˜(Ð$4Ñ5Ô5€EØŒH€Eå”=¥Ñ/Ô/€LØÔ"€JØÔ €FåÔ)€KØŒ7€Dà��{�{ 2 zÑ2Ô2Ñ3Ô3°AÔ6€IÝˆBÐ)¨IÑ5Ñ6Ô6Ð6ð ñ !JØ˜Š>ˆ>Ø��Y‘”ˆAÝ�1‰vŒv˜	Ò!Ð!Ý”kÝð8ñô õ ˜1‘v”v˜yÐ)ñ	*ñô ð ð ˆGˆGˆGˆGØ�-Ò'Ð'ð %Õ˜R Ñ$Ô$Ñ&Ô&Ð&Ð&åÔ(Ø2°YÑ>ñô ð ð ˆD�ÑÔˆÝˆq‰6Œ6�JÒÐÝ”+ÝÐKÑLÔLÝ�q‘6”6˜9Ð%ñ&ñô ð ð
 �F˜1‘I”I˜a”Lˆ	ð ð 	JØˆEÐ<¸yÑHÑIÔIÐIðC ñ !Jð !Jð !Jð !Jð !Jr$   c                   óN   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
dd
„Zˆ xZS )rm  z a bundle part read from a bundlec                 ó”  •— t          t          | ¦  «                             |¦  «         t          j        |d¦  «        ot          j        |d¦  «        | _        || _        || _        d| _        d| _	        d| _
        d | _        d | _        d | _        d | _        d | _        d| _        |                      ¦   «          d | _        d| _        d S )NÚseeks   tellr   Fr0   )rO  rm  rF   r   r|  Ú	_seekabler    Ú_headerdataÚ_headeroffsetÚ_initializedÚconsumedrØ   r¤   r‘  r’  r9   rÂ   Ú_readheaderÚ
_mandatoryÚ_pos©rE   r    r³  r7  rQ  s       €r"   rF   zunbundlepart.__init__J  sÇ   ø€ Ý�l˜DÑ!Ô!×*Ò*¨2Ñ.Ô.Ð.ÝÔ)¨"¨fÑ5Ô5ð 
½$Ô:JØ�ñ;
ô ;
ˆŒð ˆŒà!ˆÔØˆÔØ!ˆÔØˆŒàˆŒØˆŒ	Ø#ˆÔØ"ˆÔØˆŒØˆÔØ×ÒÑÔÐØˆŒØˆŒ	ˆ	ˆ	r$   c                 óL   — | j         }| j        |||z   …         }||z   | _         |S )z+return the next <size> byte from the header)rÞ  rÝ  )rE   rA  ÚoffsetrÐ   s       r"   Ú_fromheaderzunbundlepart._fromheader`  s1   € àÔ#ˆØÔ ¨&°4©-Ð 8Ô9ˆØ# d™]ˆÔØˆr$   c                 óp   — |                       t          j        |¦  «        ¦  «        }t          ||¦  «        S )zaread given format from header

        This automatically compute the size of the format to read.)rç  r:  r;  r<  r=  s      r"   Ú_unpackheaderzunbundlepart._unpackheaderg  s1   € ð ×Ò¥¤°Ñ 7Ô 7Ñ8Ô8ˆÝ�v˜tÑ$Ô$Ð$r$   c                 ó  — t          |¦  «        | _        t          |¦  «        | _        t          j        | j        ¦  «        | _        | j                             | j        ¦  «         t          d„ |D ¦   «         ¦  «        | _        dS )z7internal function to setup all logic related parametersc              3   ó&   K  — | ]}|d          V — ŒdS )r   Nr0   )rã   r›   s     r"   r  z+unbundlepart._initparams.<locals>.<genexpr>v  s&   è è € Ð&EÐ&E° q¨¤tÐ&EÐ&EÐ&EÐ&EÐ&EÐ&Er$   N)	rR   r‘  r’  r   r[  r9   rr   r8   rÂ   )rE   r‘  r’  s      r"   Ú_initparamszunbundlepart._initparamsn  sv   € õ  % _Ñ5Ô5ˆÔÝ# NÑ3Ô3ˆÔå”m DÔ$8Ñ9Ô9ˆŒØŒ×Ò˜4Ô.Ñ/Ô/Ð/Ý&Ð&EÐ&E°_Ð&EÑ&EÔ&EÑEÔEˆÔÐÐr$   c           	      óÖ  — |                       t          ¦  «        d         }|                      |¦  «        | _        t	          | j        d| j        z  ¦  «         |                       t          ¦  «        d         | _        t	          | j        dt          j	        | j        ¦  «        z  ¦  «         | j        | j         
                    ¦   «         k    | _        | j         
                    ¦   «         | _        |                       t          ¦  «        \  }}t	          | j        d||z   z  ¦  «         t          ||z   ¦  «        }|                       |¦  «        }t          t          |ddd…         |ddd…         ¦  «        ¦  «        }|d|…         }||d…         }g }|D ]B\  }	}
|                     |                      |	¦  «        |                      |
¦  «        f¦  «         ŒCg }|D ]B\  }	}
|                     |                      |	¦  «        |                      |
¦  «        f¦  «         ŒC|                      ||¦  «         t%          j        |                      ¦   «         ¦  «        | _        d| _        dS )	z$read the header and setup the objectr   s   part type: "%s"s   part id: "%s"s   part parameters: %iNrD  r   T)ré  r¨  rç  r¤   r&   r    r©  rØ   r   r×   r6   rÅ   rª  r2   rÃ   ÚziprI   rì  r   r¼  r¬  Ú_payloadstreamrß  )rE   ÚtypesizeÚmancountÚadvcountÚfparamsizesr·  ÚmansizesÚadvsizesÚ	manparamsrë   r  Ú	advparamss               r"   rá  zunbundlepart._readheaderx  sA  € à×%Ò%¥nÑ5Ô5°aÔ8ˆØ×$Ò$ XÑ.Ô.ˆŒ	Ý�”Ð+¨d¬iÑ7Ñ8Ô8Ð8Ø×$Ò$¥XÑ.Ô.¨qÔ1ˆŒÝ�”Ð)­HÔ,<¸T¼WÑ,EÔ,EÑEÑFÔFÐFàœ d¤i§o¢oÑ&7Ô&7Ò7ˆŒØ”I—O’OÑ%Ô%ˆŒ	ð "×/Ò/Õ0@ÑAÔAÑˆ�(Ý�”Ð/°8¸hÑ3FÑGÑHÔHÐHå*¨8°hÑ+>Ñ?Ô?ˆØ×'Ò'¨Ñ4Ô4ˆ
å�#˜j¨¨¨1¨œo¨z¸!¸$¸Q¸$Ô/?Ñ@Ô@ÑAÔAˆ
à˜i˜x˜iÔ(ˆØ˜h˜i˜iÔ(ˆàˆ	Ø"ð 	Oð 	O‰JˆC�Ø×Ò˜d×.Ò.¨sÑ3Ô3°T×5EÒ5EÀeÑ5LÔ5LÐMÑNÔNÐNÐNØˆ	Ø"ð 	Oð 	O‰JˆC�Ø×Ò˜d×.Ò.¨sÑ3Ô3°T×5EÒ5EÀeÑ5LÔ5LÐMÑNÔNÐNÐNØ×Ò˜ IÑ.Ô.Ð.å"Ô.¨t×/BÒ/BÑ/DÔ/DÑEÔEˆÔà ˆÔÐÐr$   c                 ó6   — t          | j        | j        ¦  «        S )z+Generator of decoded chunks in the payload.)rØ  r    r6  rD   s    r"   r¬  zunbundlepart._payloadchunks›  s   € å" 4¤7¨D¬HÑ5Ô5Ð5r$   c                 ó²   — | j         rdS |                      d¦  «        }|r6| xj        t          |¦  «        z  c_        |                      d¦  «        }|°4dS dS )zµRead the part payload until completion.

        By consuming the part data, the underlying stream read offset will
        be advanced to the next part (or end of stream).
        Nr   )rà  r½  rã  r[   )rE   r%  s     r"   r™   zunbundlepart.consumeŸ  sq   € ð Œ=ð 	ØˆFà—	’	˜%Ñ Ô ˆØð 	%ØˆIŒI�˜U™œÑ#ˆIŒIØ—I’I˜eÑ$Ô$ˆEð ð 	%ð 	%ð 	%ð 	%ð 	%r$   Nc                 óz  — | j         s|                      ¦   «          |€| j                             ¦   «         }n| j                             |¦  «        }| xj        t          |¦  «        z  c_        |�t          |¦  «        |k     r7| j        s)| j        r"| j                             d| j        z  ¦  «         d| _        |S )zread payload dataNs*   bundle2-input-part: total payload size %i
T)	rß  rá  rï  r½  rã  r[   rà  r    r   )rE   rA  rÐ   s      r"   r½  zunbundlepart.read­  s¾   € àÔ ð 	Ø×ÒÑÔÐØˆ<ØÔ&×+Ò+Ñ-Ô-ˆDˆDàÔ&×+Ò+¨DÑ1Ô1ˆDØˆ	Œ	•S˜‘Y”YÑˆ	Œ	Øˆ<�3˜t™9œ9 tÒ+Ð+Ø”=ð  T¤Yð Ø”—’ØBÀTÄYÑNñô ð ð !ˆDŒMØˆr$   r5   )r`   ra   rb   rc   rF   rç  ré  rì  rá  r¬  r™   r½  r~  r  s   @r"   rm  rm  G  s°   ø€ € € € € Ø*Ð*ðð ð ð ð ð,ð ð ð%ð %ð %ðFð Fð Fð!!ð !!ð !!ðF6ð 6ð 6ð%ð %ð %ðð ð ð ð ð ð ð r$   rm  c                   óX   ‡ — e Zd ZdZˆ fd„Zd
d„Zd„ Zd„ Zej	        fd„Z
d
d„Zd	„ Zˆ xZS )rl  aÉ  A bundle2 part in a bundle that is seekable.

    Regular ``unbundlepart`` instances can only be read once. This class
    extends ``unbundlepart`` to enable bi-directional seeking within the
    part.

    Bundle2 part data consists of framed chunks. Offsets when seeking
    refer to the decoded data, not the offsets in the underlying bundle2
    stream.

    To facilitate quickly seeking within the decoded data, instances of this
    class maintain a mapping between offsets in the underlying stream and
    the decoded payload. This mapping will consume memory in proportion
    to the number of chunks within the payload (which almost certainly
    increases in proportion with the size of the part).
    c                 ój   •— g | _         t          t          | ¦  «                             |||¦  «         d S r5   )Ú_chunkindexrO  rl  rF   rä  s       €r"   rF   zseekableunbundlepart.__init__Ñ  s4   ø€ àˆÔåÕ" DÑ)Ô)×2Ò2°2°v¸rÑBÔBÐBÐBÐBr$   r   c              #   óp  K  — t          | j        ¦  «        dk    r?|dk    s
J d¦   «         ‚| j                             d|                      ¦   «         f¦  «         nK|t          | j        ¦  «        k     sJ d|z  ¦   «         ‚|                      | j        |         d         ¦  «         | j        |         d         }t          | j        | j        ¦  «        D ]c}|dz  }|t          |¦  «        z  }|t          | j        ¦  «        k    r.| j                             ||                      ¦   «         f¦  «         |V — ŒddS )z/seek to specified chunk and start yielding datar   s   Must start with chunk 0s   Unknown chunk %dr   N)r[   rý  rI   Ú_tellfpÚ_seekfprØ  r    r6  )rE   ÚchunknumÚposr%  s       r"   r¬  z#seekableunbundlepart._payloadchunks×  s;  è è € åˆtÔÑ Ô  AÒ%Ð%Ø˜q’=�=�=Ð"<‘=”=�=ØÔ×#Ò# Q¨¯ª©¬Ð$7Ñ8Ô8Ð8Ð8à�c $Ô"2Ñ3Ô3Ò3Ð3Ð3Ø# hÑ.ñ 4Ô3Ð3ð �LŠL˜Ô)¨(Ô3°AÔ6Ñ7Ô7Ð7àÔ˜xÔ(¨Ô+ˆå(¨¬°$´(Ñ;Ô;ð 	ð 	ˆEØ˜‰MˆHØ•3�u‘:”:ÑˆCØ�3˜tÔ/Ñ0Ô0Ò0Ð0ØÔ ×'Ò'¨¨d¯lªl©n¬nÐ(=Ñ>Ô>Ð>àˆKˆKˆKˆKð	ð 	r$   c                 ó¾   — t          | j        ¦  «        D ]:\  }\  }}||k    r|dfc S ||k    r |dz
  || j        |dz
           d         z
  fc S Œ;t          d¦  «        ‚)z>for a given payload position, return a chunk number and offsetr   r   s   Unknown chunk)r—   rý  r*   )rE   r  r%  ÚpposÚfposs        r"   Ú
_findchunkzseekableunbundlepart._findchunkì  s…   € å#,¨TÔ-=Ñ#>Ô#>ð 	Gð 	GÑˆE‘<�D˜$Ø�sŠ{ˆ{Ø˜a�x���Ø˜’�Ø˜q‘y #¨Ô(8¸À¹Ô(CÀAÔ(FÑ"FÐFÐFÐFÐFð åÐ)Ñ*Ô*Ð*r$   c                 ó   — | j         S r5   )rã  rD   s    r"   Útellzseekableunbundlepart.tellõ  s
   € ØŒyÐr$   c                 óx  — |t           j        k    r|}nŠ|t           j        k    r| j        |z   }no|t           j        k    rL| j        s.|                      d¦  «        }|r|                      d¦  «        }|°| j        d         d         |z
  }nt          d|fz  ¦  «        ‚|| j        d         d         k    r5| j        s.|                      d¦  «        }|r|                      d¦  «        }|°d|cxk    r| j        d         d         k    sn t          d¦  «        ‚| j        |k    r–|  	                    |¦  «        \  }}t          j        |                      |¦  «        ¦  «        | _        |                      |¦  «        }t          |¦  «        |k    r!t          j        t#          d¦  «        ¦  «        ‚|| _        d S d S )Nr   r¦  r   s   Unknown whence value: %riœ  s   Offset out of ranges   Seek failed
)ÚosÚSEEK_SETÚSEEK_CURrã  ÚSEEK_ENDrà  r½  rý  r*   r  r   r¼  r¬  rï  r[   r
   rE  r   )rE   ræ  ÚwhenceÚnewposr%  ÚinternaloffsetÚadjusts          r"   rÛ  zseekableunbundlepart.seekø  sÍ  € Ø•R”[Ò Ð ØˆFˆFØ•r”{Ò"Ð"Ø”Y Ñ'ˆFˆFØ•r”{Ò"Ð"Ø”=ð -àŸ	š	 %Ñ(Ô(�Øð -Ø ŸIšI eÑ,Ô,�Eð ð -àÔ% bÔ)¨!Ô,¨vÑ5ˆFˆFåÐ8¸F¸9ÑDÑEÔEÐEà�DÔ$ RÔ(¨Ô+Ò+Ð+°D´MÐ+à—I’I˜eÑ$Ô$ˆEØð )ØŸ	š	 %Ñ(Ô(�ð ð )ð �FÐ5Ð5Ò5Ð5˜dÔ.¨rÔ2°1Ô5Ò5Ð5Ð5Ð5ÝÐ3Ñ4Ô4Ð4àŒ9˜ÒÐØ$(§O¢O°FÑ$;Ô$;Ñ!ˆE�>Ý"&Ô"2°4×3FÒ3FÀuÑ3MÔ3MÑ"NÔ"NˆDÔØ—Y’Y˜~Ñ.Ô.ˆFÝ�6‰{Œ{˜nÒ,Ð,Ý”k¥!Ð$4Ñ"5Ô"5Ñ6Ô6Ð6ØˆDŒIˆIˆIð Ðr$   c                 ó~   — | j         r| j                             ||¦  «        S t          t	          d¦  «        ¦  «        ‚)a  move the underlying file pointer

        This method is meant for internal usage by the bundle2 protocol only.
        They directly manipulate the low level stream including bundle2 level
        instruction.

        Do not use it to implement higher-level logic or methods.s   File pointer is not seekable)rÜ  r6  rÛ  ÚNotImplementedErrorr   )rE   ræ  r  s      r"   r   zseekableunbundlepart._seekfp  s<   € ð Œ>ð 	JØ”8—=’= ¨Ñ0Ô0Ð0å%¥aÐ(GÑ&HÔ&HÑIÔIÐIr$   c                 ó²   — | j         rO	 | j                             ¦   «         S # t          $ r(}|j        t          j        k    rd| _         n‚ Y d}~nd}~ww xY wdS )a,  return the file offset, or None if file is not seekable

        This method is meant for internal usage by the bundle2 protocol only.
        They directly manipulate the low level stream including bundle2 level
        instruction.

        Do not use it to implement higher-level logic or methods.FN)rÜ  r6  r  ÚIOErrorÚerrnoÚESPIPE)rE   Úes     r"   rÿ  zseekableunbundlepart._tellfp%  sq   € ð Œ>ð 	ðØ”x—}’}‘”Ð&øÝð ð ð Ø”7�eœlÒ*Ð*Ø%*�D”N�Nàð #�N�N�N�Nøøøøðøøøð
 ˆts   ‰" ¢
A¬AÁA)r   )r`   ra   rb   rc   rF   r¬  r  r  r
  r  rÛ  r   rÿ  r~  r  s   @r"   rl  rl  ¿  s¼   ø€ € € € € ðð ð"Cð Cð Cð Cð Cðð ð ð ð*+ð +ð +ðð ð ð #%¤+ð ð ð ð ð@Jð Jð Jð Jðð ð ð ð ð ð r$   rl  )s   aborts   unsupportedcontents	   pushracedó   pushkey)s   https   https)s   heads)s   v2)
rú   ó	   bookmarkss   erroró   listkeysr  ó   digestsó   remote-changegroupó   hgtagsfnodesó   phasesó   streamFc                 óÄ  — |dvrt          j        d¦  «        ‚t                               ¦   «         }t	          t          t          j        | ¦  «        ¦  «        ¦  «        |d<   t          j	        | t          j
        ¦  «        r(t	          d„ t          j        D ¦   «         ¦  «        }||d<   |rd|d<   | j                             dd	¦  «        }|d
k    rd|d<   d| j                             dd¦  «        v r|                     d¦  «         |dk    rQ| j                             ddd¬¦  «        }| j                             dd¦  «        }|r|s|                     d¦  «         |S )a_  return the bundle2 capabilities for a given repo

    Exists to allow extensions (like evolution) to mutate the capabilities.

    The returned value is used for servers advertising their capabilities as
    well as clients advertising their capabilities to servers as part of
    bundle2 requests. The ``role`` argument specifies which is which.
    )s   clientó   servers&   role argument must be client or serverr¶   c              3   ó    K  — | ]	}d |z  V — Œ
dS )s   V%iNr0   râ   s     r"   r  zgetrepocaps.<locals>.<genexpr>Y  s&   è è € ÐEÐE¨q ¨¡
ÐEÐEÐEÐEÐEÐEr$   ó
   obsmarkersr0   s   pushbackr"  s   concurrent-push-modes   check-related)s   relateds
   checkheadsr  r   s   legacy.exchanges   uncompressedT)Ú	untrusteds   bundle2.streamr   )r
   rv   r¡   r0  rR   rò   r   Úsupportedincomingversionsr   Ú	isenabledÚexchangeoptÚformatsr    ÚconfigÚ
configlistÚpopr   )rh   ÚallowpushbackÚroleré   ÚsupportedformatÚcpmodeÚstreamsupportedÚfeaturesupporteds           r"   Úgetrepocapsr3  H  s‚  € ð Ð)Ð)Ð)ÝÔ$Ð%NÑOÔOÐOå×ÒÑÔ€DÝ Ý�{Ô4°TÑ:Ô:Ñ;Ô;ñô €DˆÑõ Ô˜$¥Ô 4Ñ5Ô5ð .ÝÐEÐEµHÔ4DÐEÑEÔEÑEÔEˆØ-ˆˆ]ÑØð Øˆˆ[ÑØŒW�^Š^˜IÐ'>Ñ?Ô?€FØÐ!Ò!Ð!Ø+ˆˆ]ÑØ�D”G×&Ò& xÐ1CÑDÔDÐDÐDØ�Š�ÑÔÐð ˆyÒÐØœ'×,Ò,Ø�°$ð -ñ 
ô 
ˆð  œ7×-Ò-¨iÐ9JÑKÔKÐàð 	 Ð&6ð 	 Ø�HŠH�YÑÔÐð €Kr$   c                 ó¸   — |                       d¦  «        }|s|dk    ri S t                               |                       d¦  «        ¦  «        }t          |¦  «        S )z0return the bundle capabilities of a peer as dictr   r$   )Úcapablerà   rá   rí   )ÚremoteÚrawÚcapsblobs      r"   Úbundle2capsr9  u  sS   € à
�.Š.˜Ñ
$Ô
$€CØð �3˜#’:�:Øˆ	Ý�~Š~˜fŸnšn¨ZÑ8Ô8Ñ9Ô9€HÝ�hÑÔÐr$   c                 óF   — |                       dd¦  «        }d„ |D ¦   «         S )zIextract the list of supported obsmarkers versions from a bundle2caps dictr$  r0   c                 óf   — g | ].}|                      d ¦  «        ¯t          |dd…         ¦  «        ‘Œ/S )ó   Vr   N)r/  Úint©rã   Úcs     r"   rå   z%obsmarkersversion.<locals>.<listcomp>�  s7   € Ð>Ð>Ð>˜1¨1¯<ª<¸Ñ+=Ô+=Ð>�C��!�"�"”‰JŒJÐ>Ð>Ð>r$   ©rS   )ré   Úobscapss     r"   ÚobsmarkersversionrB  ~  s)   € à�hŠh�} bÑ)Ô)€GØ>Ð> Ð>Ñ>Ô>Ð>r$   c
           	      óä  — |                      d¦  «        r-t          j        ||d|¦  «        }
t          | |
|||||	¬¦  «        S |                      d¦  «        st	          j        d|z  ¦  «        ‚i }|                     dd¦  «        rd|d	<   t          | |¦  «        }|                     ||	¦  «         t          | |||||¦  «         | 
                    ¦   «         }t          j        | |||¬
¦  «        S )Nrø   ó   01)ÚvfsÚcompressionr  rú   s   unknown bundle type: %só   obsolescenceF)s   V1r$  ©rE  )r/  r   ÚmakechangegroupÚwritebundler
   rv   rS   rý   r  Ú_addpartsfromoptsr&  Úwritechunks)r    rh   ro   ÚfilenameÚ
bundletypeÚoutgoingÚoptsrE  rF  r  r¹   ré   ÚbundleÚ	chunkiters                 r"   ÚwritenewbundlerS  „  s  € ð ×Ò˜WÑ%Ô%ð NÝÔ(¨¨x¸ÀÑGÔGˆÝØØØØØØ#Øð
ñ 
ô 
ð 	
ð ×"Ò" 7Ñ+Ô+ð NÝÔ$Ð%?À*Ñ%LÑMÔMÐMà€DØ‡x‚x� Ñ'Ô'ð 'Ø&ˆˆ]ÑÝ�b˜$ÑÔ€FØ
×Ò˜+ xÑ0Ô0Ð0Ý�b˜$ ¨°¸$Ñ?Ô?Ð?Ø× Ò Ñ"Ô"€IåÔ" 2 y°(ÀÐDÑDÔDÐDr$   c                 óö  — |                      dd¦  «        �r
|                      d¦  «        }|€t          j        |¦  «        }t          j        ||||¦  «        }|                     d|                     ¦   «         ¬¦  «        }|                     d|j        ¦  «         d|j        v r&|                     dd|j        d         z  d	¬
¦  «         |                      d¦  «        r@| 	                    d|j
        ¦  «        r%|                     ddt          j        z  d	¬
¦  «         t          j        |j        v r|                     dd¦  «         |                      dd	¦  «        rt!          ||d¬¦  «         |                      dd¦  «        rt#          |||¦  «         |                      dd¦  «        rt%          |||¦  «         |                      dd	¦  «        rE|j                             |j        ¦  «        }	t-          ||	|                      dd¦  «        ¬
¦  «         |                      dd	¦  «        rGt          j        ||j        ¦  «        }
t          j        |
¦  «        }|                     d|¬¦  «         d S d S )Nr¶   Ts
   cg.version©rÐ   ó   versionó   clcountó	   nbchangesó   %dFrÒ   r  s   %ln and secret()ó   targetphaseó   exp-sidedatar~   s   streamv2)Ústreams   tagsfnodescaches   revbranchcacherG  s   obsolescence-mandatoryó   phase-heads)rS   r   ÚsafeversionrI  rÕ   r&  rÖ   rI  ÚextrasÚrevsÚancestorsofr   Úsecretr   ÚREPO_FEATURE_SIDE_DATAÚfeaturesÚaddpartbundlestream2ÚaddparttagsfnodescacheÚaddpartrevbranchcacheÚobsstoreÚrelevantmarkersÚmissingÚbuildobsmarkerspartÚsubsetphaseheadsÚbinaryencode)r    rh   Úbundlerro   rO  rP  Ú	cgversionr¹   r¨   Ú
obsmarkersÚheadsbyphaseÚ	phasedatas               r"   rK  rK  ©  s†  € ð ‡x‚x� Ñ%Ô%ñ Ø—H’H˜]Ñ+Ô+ˆ	ØÐÝ#Ô/°Ñ5Ô5ˆIÝÔ(¨¨x¸ÀFÑKÔKˆØ�Š˜~°B·L²L±N´NˆÑCÔCˆØ�Š�j "¤*Ñ-Ô-Ð-Ø˜œÐ"Ð"Ø�MŠMØ˜e b¤i°
Ô&;Ñ;Àuð ñ ô ð ð �8Š8�IÑÔð 	 4§9¢9Ø Ô!5ñ$
ô $
ð 	ð �MŠMØ ­¬Ñ 5Àð ñ ô ð õ Ô(¨D¬MÐ9Ð9Ø�Š�o tÑ,Ô,Ð,à‡x‚x�˜UÑ#Ô#ð 9Ý˜W d°4Ð8Ñ8Ô8Ð8à‡x‚xÐ" DÑ)Ô)ð 8Ý˜t W¨hÑ7Ô7Ð7à‡x‚xÐ! 4Ñ(Ô(ð 7Ý˜d G¨XÑ6Ô6Ð6à‡x‚x� Ñ'Ô'ð 
Ø”]×2Ò2°8Ô3CÑDÔDˆ
ÝØØØ—h’hÐ8¸$Ñ?Ô?ð	
ñ 	
ô 	
ð 	
ð ‡x‚x�	˜5Ñ!Ô!ð 8ÝÔ.¨t°XÔ5EÑFÔFˆÝÔ'¨Ñ5Ô5ˆ	Ø�Š˜¨YˆÑ7Ô7Ð7Ð7Ð7ð8ð 8r$   c                 ó&  — t          j        |                      ¦   «         ¦  «        }g }|j        D ]2}|                     |d¬¦  «        }|r|                     ||g¦  «         Œ3|r,|                     dd                     |¦  «        ¬¦  «         d S d S )NF)Úcomputemissingr  r$   rU  )r   ÚhgtagsfnodescacheÚ
unfilteredra  ÚgetfnodeÚextendrÕ   r¯   )rh   rn  rO  Úcacheró   ÚnodeÚfnodes          r"   rf  rf  Þ  s¨   € õ Ô" 4§?¢?Ñ#4Ô#4Ñ5Ô5€EØ€Fð Ô$ð )ð )ˆà—’˜t°E�Ñ:Ô:ˆØð 	)Ø�MŠM˜4 ˜-Ñ(Ô(Ð(øàð @Ø�Š˜¨c¯hªh°vÑ.>Ô.>ˆÑ?Ô?Ð?Ð?Ð?ð@ð @r$   c                 ó‚  ‡	— |                       ¦   «         }|                      ¦   «         j        }t          j        d„ ¦  «        Š	|j        D ]N}|                     |                     |¦  «        ¦  «        \  }}‰	|         |                              |¦  «         ŒOˆ	fd„}| 	                    d |¦   «         d¬¦  «         d S )Nc                  ó:   — t          ¦   «         t          ¦   «         fS r5   )rŽ  r0   r$   r"   r„   z'addpartrevbranchcache.<locals>.<lambda>ü  s   € µC±E´E½3¹5¼5°>€ r$   c               3   ór  •K  — t          ‰                     ¦   «         ¦  «        D ]‘\  } \  }}t          j        | ¦  «        }t                               t          |¦  «        t          |¦  «        t          |¦  «        ¦  «        V — |V — t          |¦  «        D ]}|V — Œt          |¦  «        D ]}|V — ŒŒ’d S r5   )rò   Úitemsr	   Ú	fromlocalÚ	rbcstructÚpackr[   )ÚbranchÚnodesÚclosedÚ
utf8branchr
  Úbranchesdatas        €r"   Úgeneratez'addpartrevbranchcache.<locals>.generate  sÌ   øè è € Ý'-¨l×.@Ò.@Ñ.BÔ.BÑ'CÔ'Cð 	ð 	Ñ#ˆF‘O�U˜FÝ!Ô+¨FÑ3Ô3ˆJÝ—.’.¥ Z¡¤µ#°e±*´*½cÀ&¹k¼kÑJÔJÐJÐJÐJØÐÐÐÝ˜E‘]”]ð ð �Ø����Ý˜F‘^”^ð ð �Ø����ðð	ð 	r$   ó   cache:rev-branch-cacheFrÏ   )
Úrevbranchcacherv  Ú	changelogÚcollectionsÚdefaultdictrj  Ú
branchinfoÚrevrK   rÕ   )
rh   rn  rO  ry  Úclrz  rƒ  r{  rˆ  r‡  s
            @r"   rg  rg  ÷  sÐ   ø€ ð ×ÒÑ!Ô!€EØ	�ŠÑ	Ô	Ô	$€BÝÔ*Ð+AÐ+AÑBÔB€LØÔ ð .ð .ˆØ×(Ò(¨¯ª°©¬Ñ6Ô6‰ˆ�Ø�VÔ˜UÔ#×'Ò'¨Ñ-Ô-Ð-Ð-ðð ð ð ð ð ‡O‚OÐ-°H°H±J´JÈ%€OÑPÔPÐPÐPÐPr$   c                 óŽ   — d„ | D ¦   «         } t                                d                     t          | ¦  «        ¦  «        ¦  «        S )Nc                 ó   — g | ]
}|d k    ¯|‘ŒS )s   sharedr0   )rã   Úreqs     r"   rå   z+_formatrequirementsspec.<locals>.<listcomp>  s"   € ÐDÐDÐD˜C°3¸)Ò3CÐ3C�CÐ3CÐ3CÐ3Cr$   rÝ   )rà   rð   r¯   rò   )r   s    r"   Ú_formatrequirementsspecr”    s;   € ØDÐD <ÐDÑDÔD€LÝ�<Š<˜Ÿ	š	¥&¨Ñ"6Ô"6Ñ7Ô7Ñ8Ô8Ð8r$   c                 ób   — t          | ¦  «        } dt                               d¦  «        | fz  }|S )Ns   %s%ss   requirements=)r”  rà   rð   )r   r9   s     r"   Ú_formatrequirementsparamsr–    s0   € Ý*¨<Ñ8Ô8€LØ�ŸšÐ%5Ñ6Ô6¸ÐEÑE€FØ€Mr$   c                 óz   — d}| j         r1d                     d„ t          | j         ¦  «        D ¦   «         ¦  «        }|S )z\Formats a repo's wanted sidedata categories into a bytestring for
    capabilities exchange.r$   rÝ   c              3   ó>   K  — | ]}t          j        |¦  «        V — Œd S r5   )r   r×   r>  s     r"   r  z0format_remote_wanted_sidedata.<locals>.<genexpr>  s>   è è € ð 
ð 
Ø$%�HÔ˜QÑÔð
ð 
ð 
ð 
ð 
ð 
r$   )Ú_wanted_sidedatar¯   rò   )rh   Úwanteds     r"   Úformat_remote_wanted_sidedatar›    sU   € ð €FØÔð 
Ø—’ð 
ð 
Ý)/°Ô0EÑ)FÔ)Fð
ñ 
ô 
ñ 
ô 
ˆð €Mr$   c                 óJ   — |                       d¦  «        }t          |¦  «        S )Nó   exp-wanted-sidedata)r5  Úread_wanted_sidedata)r6  Úsidedata_categoriess     r"   Úread_remote_wanted_sidedatar   $  s$   € Ø Ÿ.š.Ð)?Ñ@Ô@ÐÝÐ 3Ñ4Ô4Ð4r$   c                 óf   — | r"t          |                      d¦  «        ¦  «        S t          ¦   «         S )NrÝ   )rŽ  rç   )Ú	formatteds    r"   rž  rž  )  s-   € Øð *Ý�9—?’? 4Ñ(Ô(Ñ)Ô)Ð)Ý‰5Œ5€Lr$   c                 óŠ  — |                      dd¦  «        sd S t          j        |¦  «        s0t          j        t          d¦  «        t          d¦  «        ¬¦  «        ‚d| _        |                      d¦  «        }|                      d¦  «        }|j                             dd	¦  «        }|s|r#|s!t          j        t          d
¦  «        ¦  «        ‚d}|j	        rGt          | j        ¦  «        }|s!t          j        t          d¦  «        ¦  «        ‚|j	        j        |v rd}t          j        ||||¦  «        \  }}	}
t          j        |¦  «        }t          |¦  «        }|                      d|
¬¦  «        }|                     dd|	z  d¬¦  «         |                     dd|z  d¬¦  «         |                     d|d¬¦  «         d S )Nr\  Fs<   stream data requested but server does not allow this featuresr   well-behaved clients should not be requesting stream data from servers not advertising it; the client may be buggy©ÚhintÚincludepatsÚexcludepatsó   experimentals   server.stream-narrow-cloness,   server does not support narrow stream clonessP   server has obsolescence markers, but client cannot receive them via stream cloneTó   stream2rU  ó	   bytecountrY  rÒ   ó	   filecountó   requirements)rS   r   Úallowservergenerationr
   rE  r   r  r    r   rh  rB  r¡   Ú_versionÚ
generatev2Ústreamed_requirementsr”  rÕ   rÖ   )rn  rh   rŒ   r¦  r§  ÚnarrowstreamÚincludeobsmarkersÚremoteversionsÚ	filecountÚ	bytecountÚitr   r¨   s                r"   re  re  /  s  € Ø�:Š:�h Ñ&Ô&ð ØˆåÔ,¨TÑ2Ô2ð 
ÝŒkÝð ñô õ ð;ñô ð

ñ 

ô 

ð 
	
ð  %€GÔð —*’*˜]Ñ+Ô+€KØ—*’*˜]Ñ+Ô+€Kà”7×%Ò%ØÐ7ñô €Lð 	ð N�{ð N¨Lð NÝŒk�!ÐKÑLÔLÑMÔMÐMàÐØ„}ð 
%Ý*¨7Ô+?Ñ@Ô@ˆØð 	%Ý”+Ýð<ñô ñô ð ð Œ]Ô# ~Ð5Ð5Ø $Ðå*Ô5Øˆk˜;Ð(9ñ ô  Ñ€Iˆy˜"õ Ô4°TÑ:Ô:€LÝ*¨<Ñ8Ô8€LØ�?Š?˜:¨Bˆ?Ñ/Ô/€DØ‡M‚M�, ¨	Ñ 1¸T€MÑBÔBÐBØ‡M‚M�, ¨	Ñ 1¸T€MÑBÔBÐBØ‡M‚M�/ <¸4€MÑ@Ô@Ð@Ð@Ð@r$   Tc                 óÚ   — |sdS t          | j        ¦  «        }t          j        |¦  «        }|€t	          d¦  «        ‚t          j        |d|¬¦  «        }|                      d||¬¦  «        S )z¶add an obsmarker part to the bundler with <markers>

    No part is created if markers is empty.
    Raises ValueError if the bundler doesn't support any known obsmarker format.
    Ns0   bundler does not support common obsmarker formatT)rI  r$  rÏ   )rB  r¡   r   Úcommonversionr*   ÚencodemarkersrÕ   )rn  ÚmarkersrÅ   r³  rI  r\  s         r"   rk  rk  h  st   € ð ð Øˆtå& wÔ';Ñ<Ô<€NÝÔ$ ^Ñ4Ô4€GØ€ÝÐLÑMÔMÐMÝÔ# G¨T¸7ÐCÑCÔC€FØ�?Š?˜=¨vÀˆ?ÑKÔKÐKr$   c                 óð  ‡‡‡‡— |dk    r­t          | ¦  «        }|                     |‰¦  «         |                     d‰                     ¦   «         ¬¦  «        }|                     d‰j        ¦  «         d‰j        v r&|                     dd‰j        d         z  d¬	¦  «         |                     ¦   «         }	n¨|�J ‚‰j        dk    r!t          j        t          d¦  «        ¦  «        ‚t          |         \  Š}
|
t          j        j        vr$t          j        t          d¦  «        |
z  ¦  «        ‚t          j                             |
¦  «        Šˆˆˆˆfd„}	 |	¦   «         }	t          j        | |	||¬¦  «        S )zúWrite a bundle file and return its filename.

    Existing files will not be overwritten.
    If no filename is specified, a temporary file is created.
    bz2 compression can be turned off.
    The bundle file will be deleted in case of errors.
    rú   r¶   rU  rV  rW  rX  rY  FrÒ   NrD  s.   old bundle types only supports v1 changegroupss#   unknown stream compression type: %sc               3   ór   •K  — ‰V — ‰                      ‰                     ¦   «         ‰¦  «        D ]} | V — Œd S r5   )r"  r&  )r%  r¹   Ú
compenginer  r³  s    €€€€r"   rR  zwritebundle.<locals>.chunkiterš  sL   øè è € ØˆLˆLˆLØ#×2Ò2°2·<²<±>´>À8ÑLÔLð ð �Ø����ðð r$   rH  )rý   r  rÕ   r&  rÖ   rI  r_  r
   rE  r   Úbundletypesr   r  r†  r  r   rL  )r    r¹   rM  rN  rE  rF  r  rQ  r¨   rR  Úcompr½  r³  s    `    `    @@r"   rJ  rJ  y  s˜  øøøø€ ð �WÒÐÝ˜"‘”ˆØ×Ò˜k¨8Ñ4Ô4Ð4Ø�~Š~˜n°2·<²<±>´>ˆ~ÑBÔBˆØ�Š�j "¤*Ñ-Ô-Ð-Ø˜œÐ"Ð"Ø�MŠMØ˜e b¤i°
Ô&;Ñ;Àuð ñ ô ð ð ×$Ò$Ñ&Ô&ˆ	ˆ	ð Ð"Ð"Ð"ØŒ:˜ÒÐÝ”+ÝÐCÑDÔDñô ð õ # :Ô.‰ˆ�Ø•tÔ'Ô<Ð<Ð<Ý”+�aÐ FÑGÔGÈ$ÑNÑOÔOÐOÝÔ%×3Ò3°DÑ9Ô9ˆ
ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð
 �I‘K”Kˆ	õ Ô" 2 y°(ÀÐDÑDÔDÐDr$   c                 óÂ   — d„ | j         d         D ¦   «         }d}d}|D ])}|dk    rd} n|dk     r	||dz   z  }Œ|dk    r||dz
  z  }Œ*|dk    rd|z   }n|dk     rd|z   }|S )z:logic to combine 0 or more addchangegroup results into onec                 ó:   — g | ]}|                      d d¦  «        ‘ŒS )r·   r   r@  )rã   Úrs     r"   rå   z-combinechangegroupresults.<locals>.<listcomp>¨  s&   € ÐGÐGÐG qˆq�uŠu�Y Ñ"Ô"ÐGÐGÐGr$   r¶   r   r   r¦  )ri   )r�   ÚresultsÚchangedheadsÚresultrº   s        r"   ÚcombinechangegroupresultsrÆ  ¦  sª   € àGÐG¨B¬J°~Ô,FÐGÑGÔG€GØ€LØ€FØð $ð $ˆà�!Š8ˆ8ØˆFØˆEØ�Š8ˆ8Ø˜C !™GÑ#ˆLˆLØ�1ŠWˆWØ˜C !™GÑ#ˆLøØ�aÒÐØ�\Ñ!ˆˆØ	˜Ò	Ð	Ø�lÑ"ˆØ€Mr$   r¶   )rV  rX  r[  r�  ó   treemanifestrZ  c                 óº  — ddl m} |                      ¦   «         }|j                             dd¦  «        }t          j        ||d¦  «        }d}d|j        v r't          |j                             d¦  «        ¦  «        }d|j        v rÝt          j	        | j
        ¦  «        sÄt          | j
        j        ¦  «        dk    r!t          j        t          d	¦  «        ¦  «        ‚| j
        j                             t           j        ¦  «         |                     | j
        j        | j
        j        | j
        j        ¦  «        | j
        j        _        t          j        | j
        ¦  «         i }|j                             d
¦  «        }|�t          |¦  «        |d<   |j                             d¦  «        }	t3          |	¦  «        |d<   t5          | ||| j        dfd|i|¤Ž}
| j        �f| j                             dd¬¦  «        }|                     dt?          j         |j!        ¦  «        d¬¦  «         |                     dd|
z  d¬¦  «         | "                    ¦   «         rJ ‚dS )z$apply a changegroup part on the repor   )Ú	localreporV  rD  NrX  rÇ  r   s[   bundle contains tree manifests, but local repo is non-empty and does not use tree manifestsrZ  Útargetphaser�  rŸ  r   Úexpectedtotaló   reply:changegroupFrÒ   rÑ   r·   ó   %i)#Ú rÉ  rt   r9   rS   r   rK  r=  r   Úistreemanifestrh   r[   r‹  r
   rE  r   r   rK   ÚTREEMANIFEST_REQUIREMENTÚresolvestorevfsoptionsr    rd  ÚsvfsÚoptionsÚwritereporequirementsrž  rŠ   ro   rj   rÕ   rÖ   r   r×   rØ   r½  )r�   ÚinpartrÉ  rƒ   Úunpackerversionr¹   ÚnbchangesetsÚextrakwargsrÊ  Úremote_sidedatarº   r¨   s               r"   ÚhandlechangegrouprÚ  »  sg  € ð ÐÐÐÐÐà	×	Ò	Ñ	Ô	€BØ”m×'Ò'¨
°EÑ:Ô:€Oå	Ô	! /°6¸4Ñ	@Ô	@€Bð €LØ�v”}Ð$Ð$Ý˜6œ=×,Ò,¨\Ñ:Ô:Ñ;Ô;ˆØ˜&œ-Ð'Ð'µÔ0FÀrÄwÑ0OÔ0OÐ'ÝˆrŒwÔ Ñ!Ô! QÒ&Ð&Ý”+ÝðAñô ñô ð ð 	ŒÔ× Ò ¥Ô!FÑGÔGÐGØ(×?Ò?ØŒGŒJ˜œÔ,¨b¬gÔ.>ñ 
ô  
ˆŒŒÔõ 	Ô% b¤gÑ.Ô.Ð.à€KØ”-×#Ò# NÑ3Ô3€KØÐÝ%(¨Ñ%5Ô%5ˆ�MÑ"à”m×'Ò'Ð(>Ñ?Ô?€OÝ)=¸oÑ)NÔ)N€KÐ%Ñ&å
Ø
Ø
Ø
Ø
Œ	Øðð ð #ðð ðð €Cð 
„xÐð Œx×ÒÐ 4ÀÐÑFÔFˆØ�ŠØ�HÔ,¨V¬YÑ7Ô7À5ð 	ñ 	
ô 	
ð 	
ð 	�Š�i ¨¡¸ˆÑ>Ô>Ð>Ø�{Š{‰}Œ}ÐÐÐÐÐr$   )r€   ó   sizer  c                 ó   — g | ]}d |z  ‘ŒS )ó	   digest:%sr0   )rã   rh  s     r"   rå   rå   ÿ  s   € Ð5Ð5Ð5˜A€|�aÑÐ5Ð5Ð5r$   r  c                 ó’  — 	 |j         d         }n2# t          $ r% t          j        t	          d¦  «        dz  ¦  «        ‚w xY wt          j        |¦  «        }|j        t          d         vr)t          j        t	          d¦  «        |j        z  ¦  «        ‚	 t          |j         d         ¦  «        }n_# t          $ r% t          j        t	          d¦  «        dz  ¦  «        ‚t          $ r% t          j        t	          d¦  «        dz  ¦  «        ‚w xY wi }|j                              dd¦  «                             ¦   «         D ]M}d	|z  }	 |j         |         }n2# t          $ r% t          j        t	          d¦  «        |z  ¦  «        ‚w xY w|||<   ŒNt          j        t          j        | j        |¦  «        ||¦  «        }	|                      ¦   «         }
d
dlm} |                     | j        j        |	|¦  «        }t-          |t.          j        ¦  «        s6t          j        t	          d¦  «        t          j        |¦  «        z  ¦  «        ‚t5          | ||
| j        d¦  «        }| j        �d| j                             d¦  «        }|                     dt?          j         |j!        ¦  «        d¬¦  «         |                     dd|z  d¬¦  «         	 |	 "                    ¦   «          nT# t          j        $ rB}t          j        t	          d¦  «        t          j        |¦  «        |j#        fz  ¦  «        ‚d}~ww xY w| $                    ¦   «         rJ ‚dS )a÷  apply a bundle10 on the repo, given an url and validation information

    All the information about the remote bundle to import are given as
    parameters. The parameters include:
      - url: the url to the bundle10.
      - size: the bundle10 file size. It is used to validate what was
        retrieved by the client matches the server knowledge about the bundle.
      - digests: a space separated list of the digest types provided as
        parameters.
      - digest:<digest-type>: the hexadecimal representation of the digest with
        that name. Like the size, it is used to validate what was retrieved by
        the client matches what the server knows about the bundle.

    When multiple digest types are given, all of them are checked.
    r€   s&   remote-changegroup: missing "%s" paramr  s+   remote-changegroup does not support %s urlsrÛ  s0   remote-changegroup: invalid value for param "%s"r  r$   rÝ  r   )Úexchanges   %s: not a bundle version 1.0r   NrÌ  rÑ   FrÒ   r·   rÍ  s   bundle at %s is corrupted:
%s)%r9   r`  r
   rE  r   r   r   Úschemer¡   r=  r*   rS   rç   r   ÚdigestcheckerÚopenr    rt   rÎ  rß  Ú
readbundlerh   r‡   r   Úcg1unpackerÚhidepasswordrŠ   ro   rj   rÕ   rÖ   r   r×   rØ   Úvalidater!   r½  )r�   rÕ  Úraw_urlÚ
parsed_urlrA  ÚdigestsÚtypr$  r  Ú	real_partrƒ   rß  r¹   rº   r¨   r  s                   r"   Úhandleremotechangegrouprì    s�  € ð"QØ”- Ô'ˆˆøÝð Qð Qð QÝŒk�!ÐEÑFÔFÈÑOÑPÔPÐPðQøøøå”˜WÑ%Ô%€JØÔ¥Ð-BÔ CÐCÐCÝŒkÝÐ<Ñ=Ô=ØÔñ ñ
ô 
ð 	
ð
	
Ý�6”= Ô)Ñ*Ô*ˆˆøÝð 
ð 
ð 
ÝŒkÝÐAÑBÔBÀWÑLñ
ô 
ð 	
õ ð 
ð 
ð 
ÝŒkÝÐ7Ñ8Ô8¸7ÑBñ
ô 
ð 	
ð
øøøð
 €GØŒ}× Ò  ¨SÑ1Ô1×7Ò7Ñ9Ô9ð ð ˆØ˜sÑ"ˆð	Ø”M %Ô(ˆEˆEøÝð 	ð 	ð 	Ý”+ÝÐ;Ñ<Ô<¸uÑDñô ð ð	øøøð ˆ�‰ˆåÔ"¥3¤8¨B¬E°7Ñ#;Ô#;¸TÀ7ÑKÔK€Ià	×	Ò	Ñ	Ô	€BØÐÐÐÐÐà	×	Ò	˜RœWœZ¨°GÑ	<Ô	<€BÝ�b�+Ô1Ñ2Ô2ð 
ÝŒkÝÐ-Ñ.Ô.µÔ1EÀgÑ1NÔ1NÑNñ
ô 
ð 	
õ ˜b " b¨"¬)°ZÑ
@Ô
@€CØ	„xÐð Œx×ÒÐ 4Ñ5Ô5ˆØ�ŠØ�HÔ,¨V¬YÑ7Ô7À5ð 	ñ 	
ô 	
ð 	
ð 	�Š�i ¨¡¸ˆÑ>Ô>Ð>ð
Ø×ÒÑÔÐÐøÝŒ;ð 
ð 
ð 
ÝŒkÝÐ/Ñ0Ô0ÝÔ# GÑ,Ô,¨a¬iÐ8ñ9ñ
ô 
ð 	
øøøøð
øøøð
 �{Š{‰}Œ}ÐÐÐÐÐs9   ‚ �/?ÂB/ Â/ADÅEÅ/FËK ËL.Ë,=L)Ì)L.rÌ  )r·   rÑ   c                 óª   — t          |j        d         ¦  «        }t          |j        d         ¦  «        }| j                             dd|i|¦  «         d S )Nr·   rÑ   r¶   ©r=  r9   ri   rK   )r�   rÕ  rº   Úreplytos       r"   Úhandlereplychangegrouprð  R  sM   € å
ˆfŒm˜IÔ&Ñ
'Ô
'€CÝ�&”- Ô/Ñ0Ô0€GØ„J‡N‚N�> I¨sÐ#3°WÑ=Ô=Ð=Ð=Ð=r$   s   check:bookmarksc                 óh  — t          j        | j        |¦  «        }d}d}d}|D ]Ž\  }}| j        j                             |¦  «        }||k    rd|€||t          |¦  «        fz  }	n9|€||t          |¦  «        fz  }	n"||t          |¦  «        t          |¦  «        fz  }	t          j        |	¦  «        ‚Œ�dS )z÷check location of bookmarks

    This part is to be used to detect push race regarding bookmark, it
    contains binary encoded (bookmark, node) tuple. If the local state does
    not marks the one in the part, a PushRaced exception is raised
    s]   remote repository changed while pushing - please try again (bookmark "%s" move from %s to %s)sb   remote repository changed while pushing - please try again (bookmark "%s" is missing, expected %s)sf   remote repository changed while pushing - please try again (bookmark "%s" set on %s, expected missing)N)r   Úbinarydecoderh   Ú
_bookmarksrS   r   r
   Ú	PushRaced)
r�   rÕ  ÚbookdataÚmsgstandardÚ
msgmissingÚmsgexistÚbookrz  ÚcurrentnodeÚfinalmsgs
             r"   Úhandlecheckbookmarksrü  Y  sð   € õ Ô% b¤g¨vÑ6Ô6€Hð	.ð ð
	3ð ð
	7ð ð ð ,ð ,‰
ˆˆdØ”gÔ(×,Ò,¨TÑ2Ô2ˆØ˜$ÒÐØˆ|Ø# t­U°;Ñ-?Ô-?Ð&@Ñ@��ØÐ$Ø%¨­u°T©{¬{Ð(;Ñ;��à&ØÝ˜$‘K”KÝ˜+Ñ&Ô&ð*ñ �õ
 ”/ (Ñ+Ô+Ð+ð ð,ð ,r$   s   check:headsc                 óÐ  — |                      d¦  «        }g }t          |¦  «        dk    r=|                     |¦  «         |                      d¦  «        }t          |¦  «        dk    °=|rJ ‚| j                             dd¦  «        r|                      ¦   «          t          |¦  «        t          | j                             ¦   «         ¦  «        k    rt          j
        d¦  «        ‚dS )z›check that head of the repo did not change

    This is used to detect a push race when using unbundle.
    This replaces the "heads" argument of unbundle.é   r¨  ó   bundle2lazylockingó:   remote repository changed while pushing - please try againN)r½  r[   rI   r    r   rt   rò   rh   Úheadsr
   rô  )r�   rÕ  Úhr  s       r"   Úhandlecheckheadsr    sÐ   € ð 	�Š�B‰Œ€AØ€EÝ
ˆa‰&Œ&�BŠ,ˆ,Ø�Š�Q‰ŒˆØ�KŠK˜‰OŒOˆõ ˆa‰&Œ&�BŠ,ˆ,ð €L€L€Là	„u×Ò˜Ð)>Ñ?Ô?ð Ø
×ÒÑÔÐÝˆe�}„}�˜rœwŸ}š}™œÑ/Ô/Ò/Ð/ÝŒoØIñ
ô 
ð 	
ð 0Ð/r$   s   check:updated-headsc                 ó  — |                      d¦  «        }g }t          |¦  «        dk    r=|                     |¦  «         |                      d¦  «        }t          |¦  «        dk    °=|rJ ‚| j                             dd¦  «        r|                      ¦   «          t          ¦   «         }| j                             ¦   «          	                    ¦   «         D ]}| 
                    |¦  «         Œ|D ]}||vrt          j        d¦  «        ‚ŒdS )aN  check for race on the heads touched by a push

    This is similar to 'check:heads' but focus on the heads actually updated
    during the push. If other activities happen on unrelated heads, it is
    ignored.

    This allow server with high traffic to avoid push contention as long as
    unrelated parts of the graph are involved.rþ  r¨  rÿ  r   N)r½  r[   rI   r    r   rt   rŽ  rh   Ú	branchmapÚ	iterheadsrr   r
   rô  )r�   rÕ  r  r  ÚcurrentheadsÚlss         r"   Úhandlecheckupdatedheadsr	  ”  s  € ð 	�Š�B‰Œ€AØ€EÝ
ˆa‰&Œ&�BŠ,ˆ,Ø�Š�Q‰ŒˆØ�KŠK˜‰OŒOˆõ ˆa‰&Œ&�BŠ,ˆ,ð €L€L€Là	„u×Ò˜Ð)>Ñ?Ô?ð Ø
×ÒÑÔÐå‘5”5€LØŒg×ÒÑ!Ô!×+Ò+Ñ-Ô-ð  ð  ˆØ×Ò˜BÑÔÐÐàð ð ˆØ�LÐ Ð Ý”/ð$ñô ð ð !ðð r$   s   check:phasesc                 ó®  — t          j        |¦  «        }| j                             ¦   «         }|j        }|j        }d}|                     ¦   «         D ]‚\  }}|D ]z}	|                     ||                     |	¦  «        ¦  «        }
|
|k    rI|t          |	¦  «        t           j
        |
         t           j
        |         fz  }t          j        |¦  «        ‚Œ{ŒƒdS )zjcheck that phase boundaries of the repository did not change

    This is used to detect a push race.
    sQ   remote repository changed while pushing - please try again (%s is %s expected %s)N)r   rò  rh   rv  r‹  Ú_phasecacher  Úphaser�  r   Ú
phasenamesr
   rô  )r�   rÕ  ÚphasetonodesÚunfir�  Ú
phasecacher±   Úexpectedphaser„  r
  Úactualphaserû  s               r"   Úhandlecheckphasesr  ´  sï   € õ Ô& vÑ.Ô.€LØŒ7×ÒÑÔ€DØ	Œ€BØÔ!€Jð	"ð ð !-× 2Ò 2Ñ 4Ô 4ð 	0ð 	0Ñˆ�uØð 	0ð 	0ˆAØ$×*Ò*¨4°·²¸±´Ñ;Ô;ˆKØ˜mÒ+Ð+ØÝ˜!‘H”HÝÔ% kÔ2ÝÔ% mÔ4ð"ñ �õ
 ”o hÑ/Ô/Ð/ð ,ð	0ð	0ð 	0r$   rÎ   c                 ó¬   — |                      ¦   «                              ¦   «         D ],}| j                             t	          d¦  «        |z  ¦  «         Œ-dS )z3forward output captured on the server to the clients   remote: %s
N)r½  ræ   r    rÆ   r   )r�   rÕ  rê   s      r"   Úhandleoutputr  Î  sU   € ð —’‘”×(Ò(Ñ*Ô*ð 0ð 0ˆØ
Œ�Š•Q�Ñ'Ô'¨$Ñ.Ñ/Ô/Ð/Ð/ð0ð 0r$   s	   replycapsc                 óŽ   — t          |                     ¦   «         ¦  «        }| j        €t          | j        |¦  «        | _        dS dS )zqNotify that a reply bundle should be created

    The payload contains the capabilities information for the replyN)rí   r½  rj   rý   r    )r�   rÕ  ré   s      r"   Úhandlereplycapsr  Õ  s@   € õ
 �f—k’k‘m”mÑ$Ô$€DØ	„xÐÝ˜BœE 4Ñ(Ô(ˆŒˆˆð Ðr$   c                   ó   — e Zd ZdZdS )ÚAbortFromPartz=Sub-class of Abort that denotes an error from a bundle2 part.N)r`   ra   rb   rc   r0   r$   r"   r  r  ß  s   € € € € € ØGÐGÐGÐGr$   r  r¤  )r¥  ó   hintc                 ój   — t          |j        d         |j                             d¦  «        ¬¦  «        ‚)z*Used to transmit abort error over the wirer¥  r  r¤  )r  r9   rS   ©r�   rÕ  s     r"   Úhandleerrorabortr  ã  s7   € õ ØŒ�jÔ!¨¬×(9Ò(9¸'Ñ(BÔ(Bðñ ô ð r$   s   error:pushkey)ó	   namespaceó   keyó   newó   oldó   retrÑ   c                 ó°   — i }dD ]#}|j                              |¦  «        }|�|||<   Œ$t          j        |j         d         fi t	          j        |¦  «        ¤Ž‚)z=Used to transmit failure of a mandatory pushkey over the wire©r  r  r   r!  r"  NrÑ   )r9   rS   r
   ÚPushkeyFailedr   Ú	strkwargs)r�   rÕ  rŒ   r  r  s        r"   Úhandleerrorpushkeyr'  ë  st   € ð €FØ>ð !ð !ˆØ”×!Ò! $Ñ'Ô'ˆØÐØ ˆF�4‰LøÝ
Ô
ØŒ�nÔ%ðð Ý)1Ô);¸FÑ)CÔ)Cðð ð r$   s   error:unsupportedcontent)ó   parttypeó   paramsc                 óö   — i }|j                              d¦  «        }|�||d<   |j                              d¦  «        }|�|                     d¦  «        |d<   t          j        di t          j        |¦  «        ¤Ž‚)z4Used to transmit unknown content error over the wirer(  Nr)  ó    r0   )r9   rS   rç   r
   rÁ   r   r&  )r�   rÕ  rŒ   r,   r9   s        r"   Úhandleerrorunsupportedcontentr,  û  s�   € ð €FØŒ}× Ò  Ñ-Ô-€HØÐØ&ˆˆ{ÑØŒ]×Ò˜yÑ)Ô)€FØÐØ"ŸLšL¨Ñ/Ô/ˆˆyÑå
Ô
)Ð
GÐ
G­HÔ,>¸vÑ,FÔ,FÐ
GÐ
GÐGr$   s   error:pushraced)r¥  c                 ó\   — t          j        t          d¦  «        |j        d         ¦  «        ‚)z.Used to transmit push race error over the wires   push failed:r¥  )r
   ÚResponseErrorr   r9   r  s     r"   Úhandleerrorpushracedr/  		  s&   € õ Ô
�a Ñ0Ô0°&´-À
Ô2KÑ
LÔ
LÐLr$   r  )r  c                 ó¦   — |j         d         }t          j        |                     ¦   «         ¦  «        }| j                             d||f¦  «         dS )z6retrieve pushkey namespace content stored in a bundle2r  r  N)r9   r   Ú
decodekeysr½  ri   rK   )r�   rÕ  Ú	namespacerÂ  s       r"   Úhandlelistkeysr3  	  sH   € ð ”˜lÔ+€IÝÔ˜6Ÿ;š;™=œ=Ñ)Ô)€AØ„J‡N‚N�; ¨A Ñ/Ô/Ð/Ð/Ð/r$   r  ©r  r  r!  r   c                 ó0  — t           j        } ||j        d         ¦  «        } ||j        d         ¦  «        } ||j        d         ¦  «        } ||j        d         ¦  «        }| j                             dd¦  «        r|                      ¦   «          | j                              ||||¦  «        }||||dœ}| j                             d|¦  «         | j	        �d| j	         
                    d
¦  «        }	|	                     dt          j        |j        ¦  «        d¬¦  «         |	                     dd|z  d¬¦  «         |j        rO|sOi }
dD ]}||j        v r|j        |         |
|<   Œt!          j        ddd|j        z  it          j        |
¦  «        ¤Ž‚d	S d	S )zprocess a pushkey requestr  r  r!  r   r¨  rÿ  r4  r  Nó   reply:pushkeyrÑ   FrÒ   r·   rÍ  r$  rP   rY  r0   )r   Údecoder9   r    r   rt   rh   ri   rK   rj   rÕ   rÖ   r   r×   rØ   rÅ   r
   r%  r&  )r�   rÕ  Údecr2  rë   ÚoldÚnewrº   ÚrecordÚrpartrŒ   s              r"   Úhandlepushkeyr=  	  sÑ  € õ Œ.€CØ��F”M ,Ô/Ñ0Ô0€IØ
ˆ#ˆfŒm˜FÔ#Ñ
$Ô
$€CØ
ˆ#ˆfŒm˜FÔ#Ñ
$Ô
$€CØ
ˆ#ˆfŒm˜FÔ#Ñ
$Ô
$€Cð 
„u×Ò˜Ð)>Ñ?Ô?ð Ø
×ÒÑÔÐØ
Œ'�/Š/˜) S¨#¨sÑ
3Ô
3€CØ%¨s¸CÈÐMÐM€FØ„J‡N‚N�:˜vÑ&Ô&Ð&Ø	„xÐØ”× Ò Ð!1Ñ2Ô2ˆØ�ŠØ�HÔ,¨V¬YÑ7Ô7À5ð 	ñ 	
ô 	
ð 	
ð 	�Š�y %¨#¡+¸ˆÑ?Ô?Ð?ØÔð 
 ð 
ØˆØAð 	1ð 	1ˆCØ�f”mÐ#Ð#Ø$œm¨CÔ0��s‘øÝÔ!ð 
ð 
Ø˜6œ9Ñ$ð
Ý(0Ô(:¸6Ñ(BÔ(Bð
ð 
ð 	
ð
ð 
ð 
ð 
r$   r  c                 ó  ‡ ‡— t          j        ‰ j        |¦  «        }‰ j        j                             dd¦  «        }‰ j                             dd¦  «        }|dk    �rg‰                      ¦   «         }‰ j        j        }|r¯g Š|D ]~\  }}|j	         
                    ¦   «         }	d|	d<   d|	d<   ||	d<   t          |                     |d	¦  «        ¦  «        |	d
<   t          |�|nd	¦  «        |	d<   ‰                     |	¦  «         Œ‰D ])}	 ‰ j        j        	 dddit          j        |	¦  «        ¤Ž Œ*|D ]?\  }}t          j        |¦  «        r&t#          d¦  «        |z  }
t%          j        |
¦  «        ‚Œ@|                     ‰ j        ‰                      ¦   «         |¦  «         |r"ˆˆ fd„}‰ j                             |¦  «         dS dS |dk    r*|D ]%\  }}||dœ}‰ j                             d|¦  «         Œ&dS t%          j        d|z  ¦  «        ‚)ad  transmit bookmark information

    The part contains binary encoded bookmark information.

    The exact behavior of this part can be controlled by the 'bookmarks' mode
    on the bundle operation.

    When mode is 'apply' (the default) the bookmark information is applied as
    is to the unbundling repository. Make sure a 'check:bookmarks' part is
    issued earlier to check for push races in such update. This behavior is
    suitable for pushing.

    When mode is 'records', the information is recorded into the 'bookmarks'
    records of the bundle operation. This behavior is suitable for pulling.
    r"  s   bookmarks-pushkey-compatr  s   applyr~   s   pushkeycompatr  r  r$   r!  Nr   ó
   prepushkeyÚthrowTs$   cannot accept divergent bookmark %s!c                 óZ   •— ‰D ]&} ‰j         j        di t          j        |¦  «        ¤Ž Œ'd S )Nr  )r  )rh   Úhookr   r&  )Úunused_successrl   Úallhooksr�   s     €€r"   Úrunhookzhandlebookmark.<locals>.runhookj	  sH   ø€ Ø (ð Mð M�HØ �B”G”LÐLÐL­xÔ/AÀ(Ñ/KÔ/KÐLÐLÐLÐLðMð Mr$   s   records)s   bookmarks   nodes   unknown bookmark mode: %s)r?  )r   rò  rh   r    r   rn   rS   rt   ró  rl   r0  r   rI   rB  r   r&  Úisdivergentr   r
   rE  ÚapplychangesÚ
_afterlockri   rK   rv   )r�   rÕ  ÚchangesÚpushkeycompatÚbookmarksmoderƒ   Ú	bookstorerù  rz  rl   r±   rE  r;  rD  s   `            @r"   ÚhandlebookmarkrM  6	  s¢  øø€ õ" Ô$ R¤W¨fÑ5Ô5€Gà”G”J×)Ò)ØÐ.ñô €Mð ”H—L’L ¨xÑ8Ô8€Mà˜Ò Ñ Ø×ÒÑ Ô ˆØ”GÔ&ˆ	Øð 	ØˆHØ%ð *ð *‘
��dØœ;×+Ò+Ñ-Ô-�Ø-1�Ð)Ñ*Ø)5�˜Ñ&Ø#'�˜Ñ Ý#& y§}¢}°T¸3Ñ'?Ô'?Ñ#@Ô#@�˜Ñ Ý#&¨tÐ/? t tÀSÑ#IÔ#I�˜Ñ Ø—’ Ñ)Ô)Ð)Ð)à$ð ð �Ø�””Ø!ðð Ø)-ðÝ19Ô1CÀHÑ1MÔ1Mðð ð ð ð "ð 	'ð 	'‰JˆD�$ÝÔ$ TÑ*Ô*ð 'ÝÐ?Ñ@Ô@À4ÑG�Ý”k #Ñ&Ô&Ð&ð'ð 	×Ò˜rœw¨×(9Ò(9Ñ(;Ô(;¸WÑEÔEÐEàð 	(ðMð Mð Mð Mð Mð Mð ŒG×Ò˜wÑ'Ô'Ð'Ð'Ð'ð	(ð 	(ð 
˜*Ò	$Ð	$Ø!ð 	1ð 	1‰JˆD�$Ø#'°$Ð7Ð7ˆFØŒJ�NŠN˜<¨Ñ0Ô0Ð0Ð0ð	1ð 	1õ Ô$Ø(¨=Ñ8ñ
ô 
ð 	
r$   r]  c                 ó’   — t          j        |¦  «        }t          j        | j                             ¦   «         | j        |¦  «         dS )z%apply phases from bundle part to repoN)r   rò  Úupdatephasesrh   rv  rt   )r�   rÕ  rq  s      r"   ÚhandlephasesrP  z	  s@   € õ Ô& vÑ.Ô.€LÝ
Ô˜œ×*Ò*Ñ,Ô,¨bÔ.?ÀÑNÔNÐNÐNÐNr$   r6  c                 óª   — t          |j        d         ¦  «        }t          |j        d         ¦  «        }| j                             dd|i|¦  «         dS )ú(retrieve the result of a pushkey requestr·   rÑ   r  Nrî  ©r�   rÕ  rº   rP   s       r"   ÚhandlepushkeyreplyrT  �	  sO   € õ ˆfŒm˜IÔ&Ñ
'Ô
'€CÝ�”˜~Ô.Ñ/Ô/€FØ„J‡N‚N�: 	¨3Ð/°Ñ8Ô8Ð8Ð8Ð8r$   r$  c                 óØ  — |                       ¦   «         }|                     ¦   «         }| j                             dd¦  «        r*| j                             dt          |¦  «        z  ¦  «         |j        s2| j        j        j	        r!| j        j         
                    d¦  «         dS | j        j                             ||¦  «        }| j                             ¦   «          | j                             dd|i¦  «         | j        �f| j                             d¦  «        }|                     d	t%          j        |j        ¦  «        d
¬¦  «         |                     dd|z  d
¬¦  «         dS dS )z&add a stream of obsmarkers to the repor¨  s   obsmarkers-exchange-debugs&   obsmarker-exchange: %i bytes received
s3   ignoring obsolescence markers, feature not enabled
Nr$  r   ó   reply:obsmarkersrÑ   FrÒ   rÍ  )rt   r½  r    r*  Úwritenoi18nr[   rÅ   rh   rh  Úreadonlyr   ÚmergemarkersÚinvalidatevolatilesetsri   rK   rj   rÕ   rÖ   r   r×   rØ   )r�   rÕ  rƒ   Ú
markerdatar:  r<  s         r"   Úhandleobsmarkerr\  ‰	  sf  € ð 
×	Ò	Ñ	Ô	€BØ—’‘”€JØ	„u‡|‚|�OÐ%AÑBÔBð 
Ø
Œ×ÒØ6½¸Z¹¼ÑHñ	
ô 	
ð 	
ð
 Ôð  ¤Ô 0Ô 9ð Ø
ŒŒ
×ÒØCñ	
ô 	
ð 	
ð 	ˆØ
Œ'Ô
×
'Ò
'¨¨JÑ
7Ô
7€CØ„G×"Ò"Ñ$Ô$Ð$Ø„J‡N‚N�= 6¨3 -Ñ0Ô0Ð0Ø	„xÐØ”× Ò Ð!4Ñ5Ô5ˆØ�ŠØ�HÔ,¨V¬YÑ7Ô7À5ð 	ñ 	
ô 	
ð 	
ð 	�Š�v˜u s™{°eˆÑ<Ô<Ð<Ð<Ð<ð Ðr$   rV  )r   rÑ   c                 óª   — t          |j        d         ¦  «        }t          |j        d         ¦  «        }| j                             dd|i|¦  «         dS )rR  r   rÑ   r$  Nrî  rS  s       r"   Úhandleobsmarkerreplyr^  ¤	  sN   € õ ˆfŒm˜FÔ#Ñ
$Ô
$€CÝ�”˜~Ô.Ñ/Ô/€FØ„J‡N‚N�= 6¨3 -°Ñ8Ô8Ð8Ð8Ð8r$   r  c                 ó0  — | j                              dd¦  «        r|                      ¦   «          t          j        | j                             ¦   «         ¦  «        }d}	 |                     d¦  «        }|                     d¦  «        }t          |¦  «        dk     st          |¦  «        dk     r| j          	                    d¦  «         n| 
                    ||¦  «         |dz  }Œ‡|                     ¦   «          | j          	                    d|z  ¦  «         d	S )
z|Applies .hgtags fnodes cache entries to the local repo.

    Payload is pairs of 20 byte changeset nodes and filenodes.
    r¨  rÿ  r   Trþ  s1   ignoring incomplete received .hgtags fnodes data
r   s'   applied %i hgtags fnodes cache entries
N)r    r   rt   r   ru  rh   rv  r½  r[   r   ÚsetfnodeÚwrite)r�   rÕ  ry  r“   rz  r{  s         r"   Úhandlehgtagsfnodesrb  ¬	  sý   € ð 
„u×Ò˜Ð)>Ñ?Ô?ð Ø
×ÒÑÔÐÝÔ" 2¤7×#5Ò#5Ñ#7Ô#7Ñ8Ô8€Eà€EðØ�{Š{˜2‰ŒˆØ—’˜B‘”ˆÝˆt‰9Œ9�rŠ>ˆ>�S ™ZœZ¨"š_˜_ØŒE�KŠKÐMÑNÔNÐNØØ�Š�t˜UÑ#Ô#Ð#Ø�‰
ˆðð 
‡K‚K�M„M€MØ„E‡K‚KÐ;¸eÑCÑDÔDÐDÐDÐDr$   s   >IIIr‰  c                 ó   — dS )zÖLegacy part, ignored for compatibility with bundles from or
    for Mercurial before 5.7. Newer Mercurial computes the cache
    efficiently enough during unbundling that the additional transfer
    is unnecessary.Nr0   r  s     r"   Ú	handlerbcrd  È	  s   € € € r$   s   pushvarsc                 óÄ   — | j                              dd¦  «        rDi }|j        D ]#\  }}|                     ¦   «         }d|z   }|||<   Œ$|                      |¦  «         dS dS )z5unbundle a bundle2 containing shellvars on the servers   pushs   pushvars.servers   USERVAR_N)r    r   r’  r§  rw   )r�   r¨   rl   rë   r  s        r"   Úbundle2getvarsrf  Ð	  s€   € ð 
„u×Ò˜Ð!3Ñ4Ô4ð !ØˆØÔ-ð 	"ð 	"‰JˆC�Ø—)’)‘+”+ˆCð  Ñ#ˆCØ!ˆH�S‰MˆMØ
�Š�xÑ Ô Ð Ð Ð ð!ð !r$   r©  )r¬  r«  rª  c                 ó¶  — t                                |j        d         ¦  «        }|r |j        d¦  «        ng }t	          |j        d         ¦  «        }t	          |j        d         ¦  «        }| j        }t          |¦  «        r#t          d¦  «        }t          j	        |¦  «        ‚|j
                             d¦  «         t          j        |||||¦  «         d S )Nr¬  rÝ   r«  rª  s1   cannot apply stream clone to non empty repositorys   applying stream bundle
)rà   rá   r9   rç   r=  rh   r[   r   r
   rE  r    r   r   Úapplybundlev2)r�   r¨   r   r´  rµ  rh   r±   s          r"   Úhandlestreamv2bundleri  ß	  sÈ   € õ —>’> $¤+¨oÔ">Ñ?Ô?€LØ/;ÐCÐ%�<Ô% dÑ+Ô+Ð+À€LÝ�D”K Ô-Ñ.Ô.€IÝ�D”K Ô-Ñ.Ô.€IàŒ7€DÝ
ˆ4�y„yð ÝÐDÑEÔEˆÝŒk˜#ÑÔÐà„G‡M‚MÐ-Ñ.Ô.Ð.ÝÔ˜d D¨)°YÀÑMÔMÐMÐMÐMr$   c                 óŒ  — t          ¦   «         }|j        }	|                     d|¦  «        D ]*}
|                     |	                     |
¦  «        ¦  «         Œ+|r�t          j        |||||¬¦  «        }|                     |j        ht          |¦  «        ddd¬¦  «        }|  
                    d|¬¦  «        }|                     d|¦  «         t          j        |¦  «        r|                     d	d
¦  «         t          j        |j        v r;|                     dd
¦  «         t#          |¦  «        }|                     d|¦  «         | S )aK  generates bundle2 for widening a narrow clone

    bundler is the bundle to which data should be added
    repo is the localrepository instance
    oldmatcher matches what the client already has
    newmatcher matches what the client needs (including what it already has)
    common is set of common heads between server and client
    known is a set of revs known on the client side (used in ellipses)
    cgversion is the changegroup version to send
    ellipses is boolean value telling whether to send ellipses data or not

    returns bundle2 of the data required for extending
    s   ::%ln)Ú
oldmatcherÚmatcherÚ	fullnodesFs   narrow_widen)r‹  r¶   rU  rV  rÇ  r~   r[  r�  )rŽ  r‹  r`  rK   rz  r   Ú
getbundlerrˆ  ÚnullidrÃ   rÕ   rÖ   r   rÏ  r   rc  rd  r›  )rn  rh   rk  Ú
newmatcherÚcommonÚknownro  ÚellipsesÚcommonnodesr�  rÂ  ÚpackerÚcgdatar¨   rš  s                  r"   Úwiden_bundlerw  ð	  sP  € õ  ‘%”%€KØ	Œ€BØ�YŠY�x Ñ(Ô(ð $ð $ˆØ�Š˜Ÿš ™
œ
Ñ#Ô#Ð#Ð#Øð 1ÝÔ'ØØØ!ØØ!ð
ñ 
ô 
ˆð —’ØŒ[ˆMÝ�ÑÔØØØð !ñ 
ô 
ˆð �Š˜~°FˆÑ;Ô;ˆØ�Š�j )Ñ,Ô,Ð,ÝÔ! $Ñ'Ô'ð 	1Ø�MŠM˜/¨4Ñ0Ô0Ð0ÝÔ(¨D¬MÐ9Ð9Ø�Š�o tÑ,Ô,Ð,Ý.¨tÑ4Ô4ˆØ�ŠÐ,¨fÑ5Ô5Ð5à€Nr$   r1  r5   )NNr$   )FN)NNN)T)ˆrc   rŒ  r  r
  Úrer  r:  r°  Úi18nr   rz  r   r   rÎ  r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   Úutilsr   r   Ú
interfacesr   Úurlerrrà   r‚  r   rÒ  r<  r!  r-  r¨  r©  re  rª  r¾  Úcompiler(   r#   r&   r-   r2   r7   r=   r?   rf   ÚRuntimeErrorry   r|   rŽ   r�   r‰   r°   rŠ   rË   r³   rí   rõ   r¾  Úbundlepriorityrý   r4  rK  rˆ   rF  r_  rƒ  r‡  r  rf  rÂ  rÆ  rØ  rm  rl  rR   rò   ÚDIGESTSÚkeysr¡   r3  r9  rB  rS  rK  rf  rg  r”  r–  r›  r   rž  re  rk  rJ  rÆ  rÚ  Ú_remotechangegroupparamsrì  rð  rü  r  r	  r  r  r  rE  r  r  r'  r,  r/  r3  r=  rM  rP  rT  r\  r^  rb  rÑ  r�  rd  rf  ri  rw  r0   r$   r"   ú<module>rƒ     s�  ððKð Kð\ Ð Ð Ð Ø €€€Ø 	€	€	€	Ø 	€	€	€	Ø €€€Ø €€€Ø 
€
€
€
à Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð #Ð "Ð "Ð "Ð "Ð "à	Œ€Ø	Œ€àŒ€Ø
Œ-€àÐ ØÐ Ø€Ø€Ø€ØÐ àÐ à�R”ZÐ 2Ñ3Ô3Ð ð4ð 4ð 4ð3ð 3ð 3ð#ð #ð #ð%ð %ð %ð Ð ðð ð ð ð,-ð -ð -ð -ð -ñ -ô -ð -ð`1'ð 1'ð 1'ð 1'ð 1'ñ 1'ô 1'ð 1'ðh	ð 	ð 	ð 	ð 	˜\ñ 	ô 	ð 	ð#ð #ð #ðð ð ð ð D
ð D
ð D
ð D
ð D
ñ D
ô D
ð D
ðN"ð "ð "ð "ðJ#ð #ð #ðð ð ð'ð 'ð 'ðTð ð ð:ð ð ð0
ð 
ð 
ð 
ð Ø!ØØ!ðð €ð 3Ð2Ð2€ðyð yð yð yð yñ yô yð yðx7ð 7ð 7ð 7ð 7ñ 7ô 7ð 7ð8ð ð ð ð&]$ð ]$ð ]$ð ]$ð ]$�ñ ]$ô ]$ð ]$ð@ �JÐ€	àÐ ðð ð ð Ð�nÑ%Ô%ð%ð %ñ &Ô%ð%ðhð hð hð hð hñ hô hð hðV €ð1
ð 1
ð 1
ð 1
ð 1
�}ñ 1
ô 1
ð 1
ðhQð Qð Qð Qð Qñ Qô Qð Qð&5Jð 5Jð 5Jðpuð uð uð uð u�=ñ uô uð uðpvð vð vð vð v˜<ñ vô vð vðx ØØIØØØ��f�f˜Tœ\×.Ò.Ñ0Ô0Ñ1Ô1Ñ2Ô2Ø.ØØØðð €ð*ð *ð *ð *ðZ ð  ð  ð?ð ?ð ?ð 	ØØð"Eð "Eð "Eð "EðJ28ð 28ð 28ðj@ð @ð @ð2Qð Qð Qð.9ð 9ð 9ð
ð ð ðð ð ð5ð 5ð 5ð
ð ð ð6Að 6Að 6AðrLð Lð Lð Lð$ HLð*Eð *Eð *Eð *EðZð ð ð* €Øðñ
ô 
ð4ð 4ñ
ô 
ð4ðn !˜5Ø!Ð!Ð!Ø5Ð5 ¤×!2Ò!2Ñ!4Ô!4Ð5Ñ5Ô5ñ6ñô Ð ð €Ð"Ð$<Ñ=Ô=ðKð Kñ >Ô=ðKð\ €Ð!Ð#>Ñ?Ô?ð>ð >ñ @Ô?ð>ð €ÐÑ Ô ð",ð ",ñ !Ô ð",ðJ €ˆ^ÑÔð
ð 
ñ Ôð
ð( €Ð#Ñ$Ô$ðð ñ %Ô$ðð> €ˆ_ÑÔð0ð 0ñ Ôð0ð2 €ˆYÑÔð0ð 0ñ Ôð0ð €ˆ\ÑÔð)ð )ñ Ôð)ðHð Hð Hð Hð H�E”Kñ Hô Hð Hð €ˆ^Ð2Ñ3Ô3ðð ñ 4Ô3ðð €ØØBñô ð	ð 	ñ	ô ð	ð €Ð(Ð*BÑCÔCð
Hð 
Hñ DÔCð
Hð €Ð Ñ/Ô/ðMð Mñ 0Ô/ðMð
 €ˆ[˜/Ñ*Ô*ð0ð 0ñ +Ô*ð0ð €ˆZÐ?Ñ@Ô@ð
ð 
ñ AÔ@ð
ð< €ˆ\ÑÔð@
ð @
ñ Ôð@
ðF €ˆ^ÑÔðOð Oñ ÔðOð €ÐÐ:Ñ;Ô;ð9ð 9ñ <Ô;ð9ð €ˆ]ÑÔð=ð =ñ Ôð=ð4 €Ð Ð":Ñ;Ô;ð9ð 9ñ <Ô;ð9ð €ˆ_ÑÔðEð Eñ ÔðEð0 ˆFŒM˜'Ñ"Ô"€	ð €Ð&Ñ'Ô'ðð ñ (Ô'ðð €ˆ[ÑÔð!ð !ñ Ôð!ð €ˆZÐFÑGÔGðNð Nñ HÔGðNð -ð -ð -ð -ð -r$   