Ë ö̇TILYeãó˜—ddlZddlZddlmZddlmZddlmZmZm Z m Z ddl m Z ddl mZddlmZmZmZGd „d «ZGd „d «Zy) éN)Úbin)Ú_)ÚancestorÚerrorÚmdiffÚrevlog)Ú storageutil)Úflagutilé)Ú constantsÚfileserverclientÚ shallowutilcó—eZdZd„Zd„Zd„Zy)Úremotefilelognodemapcó —||_||_y©N)Ú _filenameÚ_store)ÚselfÚfilenameÚstores úEusr/lib/python3.12/site-packages/hgext/remotefilelog/remotefilelog.pyÚ__init__zremotefilelognodemap.__init__s€Ø!ˆŒØˆ� ócój—|jj|j|fg«}t|« Sr)rÚ getmissingrÚbool)rÚnodeÚmissings rÚ __contains__z!remotefilelognodemap.__contains__#s/€Ø—+‘+×(Ñ(¨4¯>©>¸4Ð*@Ð)AÓBˆÜ˜“=Ð Ð rcó$—||vr t|«‚|Sr)ÚKeyError©rrs rÚ__get__zremotefilelognodemap.__get__'s€Ø �tÑ Ü˜4“.Р؈ rN)Ú__name__Ú __module__Ú __qualname__rr r$©rrrrs„òò!órrcó.—eZdZdZej Zd„Zd„Zd$d„Z d„Z dde jdfd„Z d$d„Zd „Zd „ZeZd „Zd „ZeZd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d%d„Zd„Zd„Zd„Z d„Z!d&d„Z"d„Z#d„Z$d„Z%d„Z&d„Z'd „Z(d!„Z)d"„Z*d#„Z+y)'Ú remotefilelogTcó—||_||_||_t|j|j«|_d|_ttj«|_ y)Nr ) ÚopenerrÚreporÚ contentstoreÚnodemapÚversionÚdictr ÚflagprocessorsÚ_flagprocessors)rr,Úpathr-s rrzremotefilelog.__init__2sI€ØˆŒ ؈Œ ؈Œ Ü+¨D¯M©M¸4×;LÑ;LÓMˆŒ àˆŒ ä#¤H×$;Ñ$;Ó<ˆÕrcó~—|j|«}|jd«s|S|jdd«}||dzdS)z&returns the file contents at this nodes éN)ÚrevisionÚ startswithÚindex)rrÚtÚss rÚreadzremotefilelog.read<sA€à �M‰M˜$Ó ˆØ�|‰|˜GÔ$؈HØ �G‰G�G˜QÓ ˆØ��Q‘�ˆzÐrNcóÈ—tj||jd«|jd««}tj|||«}|j ||||||¬«S)Nócopyócopyrev)r)rÚcreaterevlogtextÚgetr Úhashrevisionsha1Ú addrevision) rÚtextÚmetaÚ transactionÚlinknodeÚp1Úp2Úhashtextrs rÚaddzremotefilelog.addDsf€ä×/Ñ/Ø �$—(‘(˜7Ó# T§X¡X¨jÓ%9ó ˆô×+Ñ+¨H°b¸"Ó=ˆØ×ÑØ �k 8¨R°¸$ð ó ð rcóè—tjt|«|«}d||fz} |} d} |rd|vr|d} t|d«} | d|| ||| fzz } t «} i} g}| |j j k7rg|}| r!t|j| |j «}| j|j| ««|j| «| j| «||j j k7rB| j|j|««|j|«| j|«d}|r¯|jd«}| |\}}}}|xsd}|d|||||fzz }||j j k7r&|| vr"|j|«| j|«||j j k7r&|| vr"|j|«| j|«|rŒ¯| |z } | S)Ns%s%srr>r?s %s%s%s%s%sr)rÚbuildfileblobheaderÚlenrÚsetr-Únullidr*r,ÚupdateÚ ancestormapÚappendrKÚpop)rrDrEÚflagsrHrIrrGÚheaderÚdataÚrealp1ÚcopyfromÚvisitedÚ pancestorsÚqueueÚp1flogÚ ancestortextÚcÚpa1Úpa2ÚancestorlinknodeÚ pacopyfroms rÚ_createfileblobzremotefilelog._createfileblobNsò€ä×0Ñ0´°T³¸EÓBˆØ˜F D˜>Ñ)ˆàˆØˆÙ �G˜t‘OؘG‘}ˆHܘ˜jÑ)Ó*ˆFà � 4¨°°X¸xÐ"HÑHÑHˆä“%ˆàˆ ØˆØ �T—Y‘Y×%Ñ%Ò %؈FÙÜ& t§{¡{°H¸d¿i¹iÓH�à × Ñ ˜f×0Ñ0°Ó8Ô 9Ø �L‰L˜Ô Ø �K‰K˜Ô Ø �—‘×!Ñ!Ò !Ø × Ñ ˜d×.Ñ.¨rÓ2Ô 3Ø �L‰L˜Ô Ø �K‰K˜ŒOàˆ ñØ— ‘ ˜!“ ˆAØ5?À±]Ñ 2ˆC�Ð&¨ à#Ò* sˆJØ ˜OØØØØ Øð /ññ ˆLð�d—i‘i×&Ñ&Ò&¨3°gÑ+=Ø— ‘ ˜SÔ!Ø— ‘ ˜CÔ Ø�d—i‘i×&Ñ&Ò&¨3°gÑ+=Ø— ‘ ˜SÔ!Ø— ‘ ˜CÔ ò%ð( � Ñˆàˆ rc óЗ|€tj|||«}tj|«\} } tj|||«\} } |j | |||||||| | f¬« S)N)Ú _metatuple)r rBÚ parsemetar ÚprocessflagswriteÚaddrawrevision)rrDrFrGrHrIÚ cachedeltarrUÚsidedatarEÚ metaoffsetÚrawtextÚ validatehashs rrCzremotefilelog.addrevision‡sŠ€ð ˆ<Ü×/Ñ/°°b¸"Ó=ˆDä&×0Ñ0°Ó6шˆjÜ (× :Ñ :Ø Ø Ø ó! ш�ð ×"Ñ"Ø Ø Ø Ø Ø Ø Ø Ø Ø˜jÐ)ð#ó  ð rc óø—| r| \} } ntj|«\} } |dk7rd} | r|| d} n|} |j| | |||||«} |jjj |j || «|S)Nr)r rgrdr-r.Úaddremotefilelognoder)rrmrFrGrHrIrrUrjrfrErlÚblobtextrWs rrizremotefilelog.addrawrevision©s”€ñ ð *Ñ ˆD‘*ô +×4Ñ4°WÓ=Ñ ˆD�*Ø �AŠ:ðˆJÙ ð˜z˜{Ð+‰HàˆHØ×#Ñ#Ø �d˜E 2 r¨4°ó ˆð � ‰ ×Ñ×3Ñ3°D·M±MÀ4ÈÔNàˆ rcó„—|jjj|j|«}||\}}}}|r||fSy©NF©r-Ú metadatastoreÚ getancestorsr)rrÚ ancestorsrHrIrGrYs rÚrenamedzremotefilelog.renamedÕsD€Ø—I‘I×+Ñ+×8Ñ8¸¿¹ÈÓMˆ Ø%.¨t¡_Ñ"ˆˆB�˜(٠ؘb�>Ð !àrcó6—t|j|««S)z#return the size of a given revision)rNr<r#s rÚsizezremotefilelog.sizeÝs€ä�4—9‘9˜T“?Ó#Ð#rcób—||jjk(ry|j|«}||k7S)zpcompare text with a given file revision returns True if text is different than what is stored. T)r-rPr<)rrrDÚnodetexts rÚcmpzremotefilelog.cmpãs1€ð �4—9‘9×#Ñ#Ò #Øà—9‘9˜T“?ˆØ˜4ÑÐrcó—y)NTr(©rs rÚ __nonzero__zremotefilelog.__nonzero__ïó€Ørcó6—|jdvrytd«‚)N)s.hgtagss.hgsubs .hgsubstaterslen not supported)rÚ RuntimeErrorrs rÚ__len__zremotefilelog.__len__ôs €Ø �=‰=ÐCÑ Cð äÐ/Ó0Ð0rcó—gSrr(rs rÚheadszremotefilelog.headsþs€àˆ rcó—yrsr(rs rÚemptyzremotefilelog.emptys€Ørcóì—t|t«rtjd«‚|jj }|j |j|«jtjd«S)Ns3remotefilelog does not accept integer rev for flagsr) Ú isinstanceÚintrÚProgrammingErrorr-r.ÚgetmetarrAr Ú METAKEYFLAG)rrrs rrUzremotefilelog.flagss[€Ü �dœCÔ Ü×(Ñ(ØFóð ð— ‘ ×&Ñ&ˆØ�}‰}˜TŸ]™]¨DÓ1×5Ñ5´i×6KÑ6KÈQÓOÐOrcó8—||jjk(r,|jj|jjfS|jjj|j|«}||\}}}}|r|jj}||fSr)r-rPrurvr©rrrRrHrIrGrYs rÚparentszremotefilelog.parents s�€Ø �4—9‘9×#Ñ#Ò #Ø—9‘9×#Ñ# T§Y¡Y×%5Ñ%5Ð5Ð 5à—i‘i×-Ñ-×:Ñ:¸4¿=¹=È$ÓOˆ Ø%0°Ñ%6Ñ"ˆˆB�˜(Ù Ø—‘×!Ñ!ˆBà�2ˆvˆ rcó$—|j|«Sr)r‘©rÚrevs rÚ parentrevszremotefilelog.parentrevss€ð�|‰|˜CÓ Ð rcóz—|jjj|j|«}||\}}}}|Srrtr�s rrGzremotefilelog.linknodes:€Ø—i‘i×-Ñ-×:Ñ:¸4¿=¹=È$ÓOˆ Ø%0°Ñ%6Ñ"ˆˆB�˜(؈rcó†—|jj«jj|j |««Sr)r-Ú unfilteredÚ changelogr”rGr#s rÚlinkrevzremotefilelog.linkrev"s/€Ø�y‰y×#Ñ#Ó%×/Ñ/×3Ñ3°D·M±MÀ$Ó4GÓHÐHrc #ó”K—~~~~~d} |D]¸} |j| «\} } | €| x} }  | k(r|jj} | |jjk7rd}|j| | «}n|j | «}d}t j | | | |j| «| |j| «d||dd¬« –—Œºy­w)Nr) rÚp1nodeÚp2noderGÚbasenoderUÚbaserevisionsizer7ÚdeltarkÚprotocol_flags) r‘r-rPÚrevdiffÚrawdatarÚrevlogrevisiondeltarGrU)rÚnodesÚ nodesorderÚ revisiondataÚassumehaveparentrevisionsÚ deltapreviousÚ deltamodeÚsidedata_helpersÚ debug_infoÚprevnoderrHrIržr7r s rÚ emitrevisionszremotefilelog.emitrevisions%sÝèø€ð ˜ Ð&?ÀØ ØˆÛˆDØ—\‘\ $Ó'‰FˆB�ØÐØ&(Ð(�˜8ؘ4ÒØŸ9™9×+Ñ+�ؘ4Ÿ9™9×+Ñ+Ò+Ø�ØŸ ™  X¨tÓ4‘àŸ<™<¨Ó-�Ø�Ü×,Ñ,ØØØØŸ™ tÓ,Ø!Ø—j‘j Ó&Ø!%Ø!Øàà ôó ñùs‚CCcój—tj|j|«|j|««Sr)rÚtextdiffr£)rÚnode1Únode2s rr¢zremotefilelog.revdiffPs%€Ü�~‰~˜dŸl™l¨5Ó1°4·<±<ÀÓ3FÓGÐGrcó¨—t|«dk(r t|«}t|«dk7r*tj||jt d««‚|S)Né(ésinvalid lookup input)rNrrÚ LookupErrorrrr#s rÚlookupzremotefilelog.lookupSsL€Ü ˆt‹9˜Š?Ü�t“9ˆDÜ ˆt‹9˜Š?Ü×#Ñ#Ø�d—m‘m¤QÐ'>Ó%?óð ðˆ rcó—|Srr(r#s rr”zremotefilelog.rev]s€àˆ rcóP—t|t«rtjd«‚|S)Ns2remotefilelog does not convert integer rev to node)rŠr‹rrŒr“s rrzremotefilelog.nodeas)€ä �cœ3Ô Ü×(Ñ(ØEóð ðˆ rcór—||jjk(ryt|«dk7r*tj||j t d««‚||jjjk(s"||jjjvrtj‚|jj}|j|j |«}|r|S|j|j |«jtjd«}|dk(r|St!j"|||«dS)zâreturns the revlog contents at this node. this includes the meta data traditionally included in file revlogs. this is generally only used for bundling and communicating with vanilla hg clients. rrµsinvalid revision inputr)r-rPrNrr¶rrÚ nodeconstantsÚwdiridÚwdirfilenodeidsÚWdirUnsupportedr.rAr�r rŽr Úprocessflagsread)rrÚrawrrmrUs rr7zremotefilelog.revisionisþ€ð �4—9‘9×#Ñ#Ò #ØÜ ˆt‹9˜Š?Ü×#Ñ#Ø�d—m‘m¤QÐ'@Ó%Aóð ð �D—I‘I×+Ñ+×2Ñ2Ò 2Ø�t—y‘y×.Ñ.×>Ñ>Ñ>ä×'Ñ'Ð 'à— ‘ ×&Ñ&ˆØ—)‘)˜DŸM™M¨4Ó0ˆÙ ؈NØ— ‘ ˜dŸm™m¨TÓ2×6Ñ6´y×7LÑ7LÈaÓPˆØ �AŠ:؈NÜ×(Ñ(¨¨w¸Ó>¸qÑAÐArcó(—|j|d¬«S)NF)rÀ)r7r#s rr£zremotefilelog.rawdata„s€Ø�}‰}˜T uˆ}Ó-Ð-rcó¢—|jj}|j}tj|jj |j |«} |j|«S#t$rYnwxYwtj|j |«}tjj|j|«} tj|«S#t $rYnwxYw|j#|j |fg« |j|«S#t$rYnwxYwt%j&||j t)d««‚)z3reads the raw file blob from disk, cache, or serversno node)r-Ú fileserviceÚ localcacher Ú getcachekeyÚnamerr<r"Ú getlocalkeyÚosr4ÚjoinÚ localpathrÚreadfileÚIOErrorÚprefetchrr¶r)rÚidrÃrÄÚcachekeyÚlocalkeyrÊs rÚ_readzremotefilelog._read‡s€à—i‘i×+Ñ+ˆ Ø ×+Ñ+ˆ Ü#×/Ñ/Ø �I‰I�N‰N˜DŸM™M¨2ó ˆð Ø—?‘? 8Ó,Ð ,øÜò Ù ð úô$×/Ñ/°· ± ¸rÓBˆÜ—G‘G—L‘L §¡°Ó:ˆ ð Ü×'Ñ'¨ Ó2Ð 2øÜò Ù ð úð ×јtŸ}™}¨bÐ1Ð2Ô3ð Ø—?‘? 8Ó,Ð ,øÜò Ù ð úô×Ñ  D§M¡M´1°Z³=ÓAÐAs6ÁA*Á* A6Á5A6ÃCà C%Ã$C%ÄDÄ D$Ä#D$cób—|jjj|j|«Srrtr#s rrRzremotefilelog.ancestormap¢s#€Ø�y‰y×&Ñ&×3Ñ3°D·M±MÀ4ÓHÐHrcó¶—||jjk(s||jjk(r|jjS|j||«\}}|j«D��cic]\}}||“Œ }}}t j |||||«}|rt t|j|««S|jjScc}}wr) r-rPÚ_buildrevgraphÚitemsrrwÚminÚmapÚ __getitem__© rÚaÚbÚrevmapÚ parentfuncÚkÚvr/Úancss rrzremotefilelog.ancestor¥sº€Ø �— ‘ × Ñ Ò  A¨¯©×)9Ñ)9Ò$9Ø—9‘9×#Ñ#Ð #à!×0Ñ0°°AÓ6ш� Ø&,§l¡l¤nÔ5¡n™F˜Q �1�a‘4 nˆÑ5ä×!Ñ! *¨f°Q©i¸À¹ÓCˆÙ ä”s˜7×.Ñ.°Ó5Ó6Ð 6Ø�y‰y×ÑÐùó 6sÁ1 Ccót—||jjk(s||jjk(r|jjS|j||«\}}|j«D��cic]\}}||“Œ }}}t j |||||«}t |j|«Scc}}w)z@calculate all the heads of the common ancestors of nodes a and b)r-rPrÔrÕrÚcommonancestorsheadsr×rØrÙs rrâz"remotefilelog.commonancestorsheads²s¤€ð �— ‘ × Ñ Ò  A¨¯©×)9Ñ)9Ò$9Ø—9‘9×#Ñ#Ð #à!×0Ñ0°°AÓ6ш� Ø&,§l¡l¤nÔ5¡n™F˜Q �1�a‘4 nˆÑ5ä×,Ñ,¨Z¸À¹ÀFÈ1ÁIÓNˆÜ�7×&Ñ&¨Ó-Ð-ùó6sÁ1 B4có�‡—|j|«}|j|«}tjt«}t «Š||fD]Ÿ}|j «D]Š\}}||} |\} } } } | |j jk7r$| s"| j| «‰j| «| |j jk7sŒi| j| «‰j| «ŒŒŒ¡tjt«}i}tjˆfd„|D««}|r’|j«\}}||vr|r||j||«Œ3t|«t|«z dz }|||<|r||j|«|j|«D]}|j||f«Œ|rŒ’||jfS)z„Builds a numeric revision graph for the given two nodes. Returns a node->rev map and a rev->[revs] parent function. c3ó0•K—|] }|‰vsŒd|f–—Œy­wrr()Ú.0ÚnÚ allparentss €rÚ z/remotefilelog._buildrevgraph..Ùsøèø€Ð B¡ ˜1¨a°zÒ.Aˆd�AŒY¡ ùsƒ � r )rRÚ collectionsÚ defaultdictÚlistrOrÕr-rPrSrKÚdequerTrNrAÚ appendleftrØ)rrÚrÛÚamapÚbmapÚ parentsmapÚmappingrÚpdatar‘rHrIrGrYr•rÜr\ÚprevrevÚcurrentÚ currentrevÚparentrçs @rrÔzremotefilelog._buildrevgraph¾s¯ø€ð×Ñ Ó"ˆØ×Ñ Ó"ˆô!×,Ñ,¬TÓ2ˆ Ü“Uˆ ؘd“|ˆGØ&Ÿ}™}ž‘ ��eØ$ TÑ*�Ø-2Ñ*��B˜ (𘟙×)Ñ)Ò)±(Ø—N‘N 2Ô&Ø—N‘N 2Ô&ؘŸ™×)Ñ)Ó)Ø—N‘N 2Ô&Ø—N‘N 2Õ&ñ /ð$ô!×,Ñ,¬TÓ2ˆ ؈Ü×!Ñ!Û B¡ Ó Bó ˆñØ$Ÿy™y›{Ñ ˆG�Wؘ&Ñ ÙØ˜wÑ'×.Ñ.¨v°g©Ô?Øô˜Z›¬3¨v«;Ñ6¸Ñ:ˆJØ(ˆF�7‰OáØ˜7Ñ#×*Ñ*¨:Ô6à$Ÿ.™.¨Ö1�Ø× Ñ  *¨fÐ!5Õ6ð2òð$�z×-Ñ-Ð-Ð-rcó—yrr()rÚminlinkrFs rÚstripzremotefilelog.stripïs€Ø rcó—gSrr(rs rÚfileszremotefilelog.filesós€Øˆ rcó—y)N)rrr(rs rÚ checksizezremotefilelog.checksizeör�r)NN)NFFFNNN)F),r%r&r'Ú _generaldeltarÚ RevlogErrorÚ_flagserrorclassrr<rKrdrÚREVIDX_DEFAULT_FLAGSrCrirxrzÚrawsizer}r€Ú__bool__r„r†rˆrUr‘r•rGršr®r¢r·r”rr7r£rÑrRrrârÔrùrûrýr(rrr*r*-s„à€MØ×(Ñ(Ðò=òó ò7ð@Ø Ø×)Ñ)Øó  ðVØó*òXò$ð€Gò  òð€Hò1òòòPò ò!ò ò Ið ØØ"'ØØØØó)òVHòòòóBò6.òBò6Iò  ò .ò/.òb òórr*)rérÈÚmercurial.noderÚmercurial.i18nrÚ mercurialrrrrÚmercurial.utilsr Úmercurial.revlogutilsr Úr r rrr*r(rrÚr sEðóÛ åÝ÷óõ (Ý*÷ñ÷ ñ ÷JòJr