^c\> \ddlZddlmZddlmZddlmZmZm Z m Z ddl m Z e j Z dZejGdd Zd d d d d Zdd ddddddd ddddddd dddddddd idd idZeded<diiZhdZdZeeedZdZd"dZdZdZd#dZGdd Zd!ZdS)$N)_)attr)error requirementssslutilutil) stringutilsclonebundles.manifestceZdZejZejZejZejZejZ ejZ e dZ e dZ ddZdS) bundlespecc@tj|j|jSN) collectionsChainMap_explicit_params _default_optsselfs 8/usr/lib/python3/dist-packages/mercurial/bundlecaches.pyparamszbundlespec.params&s#D$94;MNNNc|jSr)rrs r contentoptszbundlespec.contentopts*s {rTc4|s ||jvr ||j|<dSdS)zOSet a bundle parameter value. Will only overwrite if overwrite is trueN)r)rkeyvalue overwrites r set_paramzbundlespec.set_param/s4  /4#888).D !# & & &98rNT)__name__ __module__ __qualname__rib compressionwirecompressionversion wireversionrrpropertyrrrrrr r s$'))KdgiiOdgiiG$'))KtwyyDGIIM OOXOX//////rr s0102s1)v1v2packed1bundle2TF) changegroup cg.version obsolescencephasestagsfnodescacherevbranchcache)r0r1r2r3streamv2r4r5r1)r,r-r6r.r/r-r/r6>gzipnonebzip2ctj|}|*td}|||fz}tj||S)z'make a boolean out of a parameter valueNs'parameter %s should be a boolean ('%s'))r parseboolrrInvalidBundleSpecification)rrbmsgs r param_boolr?isIU##Ay:;; U|.s333 Hr)r2sobsolescence-mandatoryr3cd|vr|ifSi}|dd\}}td}|dD]}d|vr||z}tj||dd\}}t|}t|}t |} | | ||}|||<||fS)z~parse bundlespec parameter section input: "comp-version;params" string return: (spec; {param_key: param_value}) ;rs:invalid bundle specification: missing "=" in parameter: %s=)splitrrr<urlrequnquotebundle_spec_param_processingget) srr&paramstrerrpr>rrprocesss r _parseparamsrM{s 1}}"u Fa((GX I J JC ^^D ! !   q=='C2377 7WWT1%% UnnS!!u%%.22377  GC''Es F?rc|r(d|vr$tjtd|z|ddd}d|vr|dd\}}|tjjvr$tjtd|zt|\}}|tvr$tjtd|zn|rJt|\}}|tjjvr;|}d}tj |j vrd }ntj |j vrd }|tvrd }n;|tvr|d krd }nd }|}n$tjtd |z|dkr-|tvr$tjtd|z|d krd|vr}t|dd}|tjz }|rDtjtddt%|zd|vr|dd krd}t|i} |dkrd }tj|} | \}} t|d} t/|| || || S)aParse a bundle string specification into parts. Bundle specifications denote a well-defined bundle/exchange format. The content of a given specification should not change over time in order to ensure that bundles produced by a newer version of Mercurial are readable from an older version. The string currently has the form: -[;[;]] Where is one of the supported compression formats and is (currently) a version string. A ";" can follow the type and all text afterwards is interpreted as URI encoded, ";" delimited key=value pairs. If ``strict`` is True (the default) is required. Otherwise, it is optional. Returns a bundlespec object of (compression, version, parameters). Compression will be ``None`` if not in strict mode and a compression isn't defined. An ``InvalidBundleSpecification`` is raised when the specification is not syntactically well formed. An ``UnsupportedBundleSpecification`` is raised when the compression or bundle type/version is not recognized. Note: this function will likely eventually return a more complex data structure, including bundle2 part information. -sCinvalid bundle specification; must be prefixed with compression: %srArrs%s compression is not supporteds%%s is not a recognized bundle versionr,r-r.r8r9s+%s is not a recognized bundle specifications4compression engine %s is not supported on v1 bundless requirements,s+missing support for repository features: %ss, sstreamr6r1)rr<rrCr compenginessupportedbundlenamesUnsupportedBundleSpecificationrM_bundlespeccontentoptsrequirementsmodGENERALDELTA_REQUIREMENTrREVLOGV2_REQUIREMENT_bundlespecv1compenginessetSTREAM_FIXED_REQUIREMENTSjoinsortedrGcopy forbundlename bundletyper ) repospecstrictpre_argsr$r&rr missingreqsrenginer%r's rparsebundlespecrfsHB $d"". 9       zz$""1%H x#zz$22 W d.C C C6455 C 'w// 0 0 06:;;gE  1#D)) f 4#8 8 8KG74;LLL 59JJJ"::: + + +z!!% & GG6@AADH  %K/GGG2 E F F    *F!:!:6/288>>?? "_%NN  6@AA**VK00112  Fvi0E99(,,Wb99>>@@K+   + +K 8 8F#)#4#4#6#6 K(1-@K _g{FK  rcg}|D]}|}|sd|di}|ddD]}|dd\}}tj|}tj|}|||<|dkrK t ||} | j|d<| j|d<#tj $rYtj $rYwxYw| ||S) zParses the raw text of a clone bundles manifest. Returns a list of dicts. The dicts have a ``URL`` key corresponding to the URL and other keys are the attributes for the entry. URLrrNrB BUNDLESPECs COMPRESSIONsVERSION) splitlinesrCr rDrErfr$r&rr<rSappend) r`rHmlinefieldsattrsrawattrrrr s rparseclonebundlesmanifestrqs? A   #abbz  G tQ//JC+%%c**CK''..EE#J m##!0u!=!=J,6,BE.)(2(:E*%%7D;D$  Hs)$CC0C0/C0c|jdkr |jdkrdS|jdkr'|jdkr|jdrdSdS)NsUNr+Tr*r6F)r%r'rrG)r s risstreamclonespecrs@se!U**z/E/N/Nt "e++  "e + +  " & &{ 3 3 ,t 5rc 0g}|D]}|d}|r t||d}|r3t|s$|jd|dzbn#t j$r9}|jtj|dzYd}~d}~wt j $rA}|jd|dtj|fzYd}~d}~wwxYw|r%|jd |dz#d |vr1tj s%|jd |dzXd |vr tj |d }n9#t j$r'|jd |dzYwxYw|j} | .| dz|kr%|jd|dz|||S)auRemove incompatible clone bundle manifest entries. Accepts a list of entries parsed with ``parseclonebundlesmanifest`` and returns a new list consisting of only the entries that this client should be able to apply. There is no guarantee we'll be able to apply all returned entries because the metadata we use to filter on may be missing or wrong. riT)rbs(filtering %s because not a stream clone rh Ns1filtering %s because unsupported bundle spec: %s s?filtering %s because cannot determine if a stream clone bundle s REQUIRESNIs'filtering %s because SNI not supported s REQUIREDRAMs0filtering %s due to a bad REQUIREDRAM attribute gQ?s8filtering %s as it needs more than 2/3 of system memory )rGrfrsuidebugrr<r forcebytestrrSrhassnir sizetoint ParseErrorestimatememoryrk) r`entriesstreamclonerequested newentriesentryrar e requiredram actualrams rfilterclonebundleentriesrPsJ8!8!yy''   ,T4EEE (0A*0M0MGMMD-(3    j5a885@AAA7    "%*6]J4KA4N4N$OP  "  GMM"$)&M2     E ! !'. ! GMM;eFmK     U " " "nU>-BCC #    HFm$   ..00I$T)9K)G)G PFm$%    s6AA((C>7/B++C>=7C99C>"E==2F32F3cBeZdZdZdZdZdZdZdZdZ dZ d Z d S) clonebundleentryzRepresents an item in a clone bundles manifest. This rich class is needed to support sorting since sorted() in Python 3 doesn't support ``cmp`` and our comparison is complex enough that ``key=`` won't work. c"||_||_dSr)rprefers)rrrs r__init__zclonebundleentry.__init__s  rc|jD]q\}}|j|}|j|}| | ||krdS| | ||krdS||X||kr_||krdS||krdSrdS)Nrr)rrrG)rotherprefkey prefvalueavaluebvalues r_cmpzclonebundleentry._cmps"&,   GYZ^^G,,F[__W--F!fn99L9Lrr!fn99L9Lqq~""rr""qq qrc4||dkSNrrrrs r__lt__zclonebundleentry.__lt__yy!##rc4||dkSrrrs r__gt__zclonebundleentry.__gt__rrc4||dkSrrrs r__eq__zclonebundleentry.__eq__yy1$$rc4||dkSrrrs r__le__zclonebundleentry.__le__rrc4||dkSrrrs r__ge__zclonebundleentry.__ge__rrc4||dkSrrrs r__ne__zclonebundleentry.__ne__rrN) r r!r"__doc__rrrrrrrrr)rrrrs   D$$$$$$%%%%%%%%%%%%%%rrc|ddst|SdfdDtfd|D}d|DS)Nsuisclonebundlepreferscd|vr5td}tjtd|z||ddS)NrBs3each comma separated item should be key=value pairss&invalid ui.clonebundleprefers item: %s)hintr)rrAbortrC)rKrs r_splitz&sortclonebundleentries.._splits[ q==KLLD+;<z*sortclonebundleentries..s!***Qvvayy***rc38K|]}t|VdSr)r)rvrs r z)sortclonebundleentries..s.AAA#Aw//AAAAAArcg|] }|j Sr))r)ris rrz*sortclonebundleentries..s # # #AG # # #r) configlistlistr\)rvr}itemsrrs @@rsortclonebundleentriesrsmmE#899G G}}   +***'***G AAAAAAA A AE # #U # # ##rr)F)ri18nr thirdpartyrrrrUrr utilsr rDCB_MANIFEST_FILErHr _bundlespeccgversionsrT_bundlespecvariantsrXr?rFrMrfrqrsrrrr)rrrs\   +////////>   !       !  u u;  B&%>%>%>%>%>%>%>%B$$$$$r