a —+«by-ã@sddlmZddlZddlZddlmZddlmZmZm Z m Z m Z m Z m Z mZmZmZmZddlmZdZdZdZd Zd Zd Zd Zd ZdZdZe e¡Ze e¡Z d dd„Z!dd„Z"dd„Z#e $eeef¡dd„ƒZ%e $e¡dd„ƒZ&e $e¡dd„ƒZ'dd„Z(dd„Z)dS)!é)Úabsolute_importN)Ú_) Úbundle2Ú changegroupÚerrorÚexchangeÚ localrepoÚ narrowspecÚrepairÚ requirementsÚscmutilÚutilÚwireprototypes)Ú stringutils narrowaclsnarrow:changespecsnarrow:responsespecs narrow:specsincludesexcludesKILLsDONEs >20s20s20sls>20s20s20s20slc s‚| d¡}‡fdd„|Dƒ}|s,ttdƒƒ‚t|ƒ} ttt| dg¡ƒƒ} ttt| dg¡ƒƒ} t|ˆ| | | ||| dd¡ƒdS)Nó changegroupcsg|]}|t ˆ¡vr|‘qS©)rZsupportedoutgoingversions)Ú.0Úv©Úreporú@/usr/lib64/python3.9/site-packages/hgext/narrow/narrowbundle2.pyÚ 8sþz3getbundlechangegrouppart_narrow..sno common changegroup versionÚ includepatsÚ excludepatsÚdepth)ÚgetÚ ValueErrorrÚmaxÚsortedÚfilterÚboolÚgenerateellipsesbundle2) ÚbundlerrÚsourceZ bundlecapsZb2capsÚheadsÚcommonÚkwargsZ cgversionsÚversionÚincludeÚexcluderrrÚgetbundlechangegrouppart_narrow+s&  þ  ør*c Csòtj|j||d}|dur“óz9generate_ellipses_bundle2_for_widening..c3s(ˆD]}tVˆj |¡VqtVdS©N)Ú_KILLNODESIGNALrGZnodeÚ _DONESIGNAL)Úr©ZdeadrevsrrrÚgenkillsšsz8generate_ellipses_bundle2_for_widening..genkillsr0TFr,r/rr2r3r4) r9r:rAÚ_CHANGESPECPARTrr;rr?r@rBr rC)r"rZoldmatchZnewmatchr'r%ZknownZ knownrevsrPZnewvisitZnewfullZ newellipsisrDrErFrrOrÚ&generate_ellipses_bundle2_for_wideningys.  ÿ ù   rRcCsˆt|j td¡ ¡ƒ}t|j td¡ ¡ƒ}t |¡t |¡tj |j jvrj|j j  tj ¡t   |j ¡|j  ||¡t |j ¡dS)NrJ)r9ÚparamsrÚ_SPECPART_INCLUDEÚ splitlinesÚ_SPECPART_EXCLUDEr Úvalidatepatternsr ÚNARROW_REQUIREMENTrÚaddr ÚwritereporequirementsÚ setnarrowpatsÚcopytoworkingcopy)ÚopÚinpartrrrrrÚ_handlechangespec_2¶s   r_cCsŠ| ¡}| d¡\}}t| ¡ƒ}t| ¡ƒ}t |¡t |¡tj|jjvrl|jj  tj¡t   |j¡|j  ||¡t  |j¡dS)Nó)ÚreadÚsplitr9rUr rWr rXrrYr rZr[r\)r]r^r1ZincÚexcrrrrrÚ_handlenarrowspecsÈs     rdc Csð|j}|j}tƒ}t |d¡}|tkrp|tkrPt |d¡}| |¡rb| |¡nt   t dƒ|¡‚t |d¡}q|rØ|j |_ Gdd„dtƒ}tjj  ||ƒ¡tj|j|t|ƒddd}|rØ|j ¡|_|j ¡||_t |d ¡rì| ¡dS) Néés)unexpected changespec node chunk type: %sc@seZdZdd„ZdS)z'_handlechangespec..dummybmstorecSsdSrKr)ÚselfrÚtrZchangesrrrÚ applychangesøsz4_handlechangespec..dummybmstore.applychangesN)Ú__name__Ú __module__Ú __qualname__rirrrrÚ dummybmstore÷srmTswiden)ZbackupZtopicÚsetnewnarrowpats)rrGr9rZ readexactlyrMrLZhasnoderYrr8rÚ _bookmarksÚ_bookmarksbackupÚdictrÚlocalrepositoryr Ústripr<ÚlistZuninterruptibleÚ_widen_uninterrÚ __enter__Ú _widen_bundler Ú safehasattrrn) r]r^rZclZclkillsZ chunksignalZckrmÚ chgrpfilerrrÚ_handlechangespecØs4     ÿÿ   rzc s˜|j}|j}|j}|`|j}| tdƒ¡| |d¡}z¾t ||||¡}|j sV|  ¡nt   ¡}|xt |tjƒr²| d¡&‰t ||‡fdd„¡WdƒqÌ1s¦0Yn| |dd| |¡d¡Wdƒn1sà0YW| ¡n | ¡0| ¡D]p\} } z|  | ¡WnVtyt} z<| jtjkr`| td ƒ|  | ¡t | ¡f¡WYd} ~ n d} ~ 00q|j ddd¡| |¡dS) zFChangegroup exchange handler which restores temporarily-stripped nodessadding branch srbsstripcsˆSrKrr©rhrrÚ"rJz)handlechangegroup_widen..Nsbundle:Tserror removing %s: %s )rr<rwÚvfsZnoterÚopenrZ readbundleÚverboseZsilentr ZnullcontextmanagerÚ isinstancerZ unbundle20Z transactionZ processbundleZapplyÚjoinÚcloseZ undofilesÚunlinkÚOSErrorÚerrnoÚENOENTÚwarnrZ forcebytestrruÚ__exit__) r]r^rr<ryr}ÚfÚgenZ maybe_silentZundovfsZundofileÚerr{rÚhandlechangegroup_widen s> ÿ  6ÿ$ÿÿrŒcsztj}d|d<d|d<d|d<d|d<d|d<tjd ‰‡fd d „}|tjd <tjd ‰‡fd d „}ˆj|_|tjd <dS)z?Enable narrow repo support in bundle2-related extension points.sbooleansnarrowsplainsdepthscsvsoldincludepatssoldexcludepatssknownrcs\|d}|j t¡r t ||¡}| dd¡rJ|j dd¡rJt|i|¤Žnˆ|i|¤ŽdS)Nr+ZnarrowFs experimentalsnarrowservebrokenellipses)r<Z has_sectionÚ_NARROWACL_SECTIONrZapplynarrowaclrZ configboolr*)Úargsr&r)ÚorigcgfnrrÚ wrappedcgfnGs  ÿzsetup..wrappedcgfncsHˆ||ƒt |d¡r t||ƒt |d¡rDtjj |j|j¡|`dS)Nrwrp) r rxrŒrrrror9rrp)r]r^)Ú origcghandlerrrÚwrappedcghandlerXs    ÿzsetup..wrappedcghandlerN)rZGETBUNDLE_ARGUMENTSrZgetbundle2partsmappingrZparthandlermappingrS)Z getbundleargsrr’r)rr‘rÚsetup:s    r“)NNNN)*Z __future__rr…ÚstructZmercurial.i18nrZ mercurialrrrrrr r r r r rZmercurial.utilsrrrQZ _RESSPECSZ _SPECPARTrTrVrLrMZ_ELIDEDCSHEADERZ_ELIDEDMFHEADERÚcalcsizeZ _CSHEADERSIZEZ _MFHEADERSIZEr*r!rRZ parthandlerr_rdrzrŒr“rrrrÚs@  4   ù $*=   3.