Ë É|Á¢±Ž=UãóB—ddlZddlmZmZddlmZddlmZddlm Z m Z m Z dZ eje «ZdZd Zeje«Zd Zd Zd Zd ZdZdZdZdZdZd ZGd„de j8«ZGd„de j«ZGd„de j>«Z y)éN)ÚhexÚsha1nodeconstants)Úutil)Úhashutilé)ÚbasepackÚ constantsÚ shallowutils!20sQQIIés!20sQs!20s20s20s20sHéRés.histidxs .histpackéécó.—eZdZeZeZd„Zdd„Zd„Zd„Zy)Úhistorypackstorecó—t|«S©N)Ú historypack)ÚselfÚpaths úCusr/lib/python3.12/site-packages/hgext/remotefilelog/historypack.pyÚgetpackzhistorypackstore.getpack-s €Ü˜4Ó Ð óNcóü—|jD]} |j|||¬«cS|j«D]} |j|||¬«cSt||f«‚#t$rYŒ^wxYw#t$rYŒBwxYw)N©Úknown)ÚpacksÚ getancestorsÚKeyErrorÚrefresh)rÚnameÚnoderÚpacks rrzhistorypackstore.getancestors0s”€Ø—J”JˆDð Ø×(Ñ(¨¨t¸5Ð(ÓAÒAðð —L‘L–NˆDð Ø×(Ñ(¨¨t¸5Ð(ÓAÒAð#ô ˜˜d�|Ó$Ð$øôò Ùð ûô ò Ùð ús"‘A ¼A/Á A,Á+A,Á/ A;Á:A;cóô—|jD]} |j||«cS|j«D]} |j||«cSt||f«‚#t$rYŒZwxYw#t$rYŒ@wxYwr)rÚ getnodeinforr )rr!r"r#s rr%zhistorypackstore.getnodeinfo?sŠ€Ø—J”JˆDð Ø×'Ñ'¨¨dÓ3Ò3ðð —L‘L–NˆDð Ø×'Ñ'¨¨dÓ3Ò3ð#ô ˜˜d�|Ó$Ð$øôò Ùð ûô ò Ùð ús"‘AºA+Á A(Á'A(Á+ A7Á6A7có4—td|t|«fz«‚)Ns&cannot add to historypackstore (%s:%s)©Ú RuntimeErrorr©rÚfilenamer"Úp1Úp2ÚlinknodeÚcopyfroms rÚaddzhistorypackstore.addNs €ÜØ 5¸Ä3ÀtÃ9Ð8MÑ Mó ð rr) Ú__name__Ú __module__Ú __qualname__Ú INDEXSUFFIXÚ PACKSUFFIXrrr%r/©rrrr)s „Ø€KØ€Jò!ó %ò %ó rrc󀇗eZdZeZeZdgZˆfd„Zd„Zdd„Zd„Z dd„Z d„Z d„Z d „Z d „Zd „Zdd „Zd „Zd„Zd„ZˆxZS)rrcóX•—tt|� |«t|_t |_yr)ÚsuperrÚ__init__Ú INDEXFORMAT2Ú INDEXFORMATÚINDEXENTRYLENGTH2ÚINDEXENTRYLENGTH)rrÚ __class__s €rr9zhistorypack.__init__Zs"ø€Ü Œk˜4Ñ)¨$Ô/Ü'ˆÔÜ 1ˆÕrcóˆ—g}|D]\}} |j||«Œ|S#t$r|j||f«YŒ;wxYwr)Ú _findnoderÚappend)rÚkeysÚmissingr!r"s rÚ getmissingzhistorypack.getmissing_sP€ØˆÛ‰JˆD�$ð -Ø—‘˜t TÕ*ðð ˆøôò -Ø—‘  d˜|Ö,ð -úsŒ"¢AÁAcóŒ—|r||vrgS|j|||¬«}i}|D]\}}}} } ||| | f||<Œ|s t||f«‚|S)z–Returns as many ancestors as we're aware of. return value: { node: (p1, p2, linknode, copyfrom), ... } r)Ú _getancestorsr) rr!r"rÚ ancestorsÚresultsÚancnoder+r,r-r.s rrzhistorypack.getancestorsiso€ñ �T˜U‘]؈Ià×&Ñ& t¨T¸Ð&Ó?ˆ ؈Û3<Ñ /ˆG�R˜˜X xØ " B¨°(Ð;ˆG�GÒ ð4=ñܘD $˜<Ó(Ð (؈rcó,—|j||«ddS)Nr)r@)rr!r"s rr%zhistorypack.getnodeinfo}s€ð�~‰~˜d DÓ)¨!¨"Ð-Ð-rc#óþK—|€ t«}|j|«}|\}}}}} |h} d} | |krÊ| sy|j|| z«\} } | tz } | r| t | «z } | t }|| vrƒ| j |«| t}| t}|tjk7r||vr| j|«|tjk7r||vr| j|«|||| t| f–—| |krŒÉyy­w©Nr) ÚsetÚ _findsectionÚ _readentryÚPACKENTRYLENGTHÚlenÚANC_NODEÚremoveÚ ANC_P1NODEÚ ANC_P2NODErÚnullidr/Ú ANC_LINKNODE)rr!r"rÚsectionr*ÚoffsetÚsizeÚnodeindexoffsetÚ nodeindexsizeÚpendingÚoÚentryr.rIÚp1nodeÚp2nodes rrFzhistorypack._getancestors‚sèø€Ø ˆ=Ü“EˆEØ×#Ñ# DÓ)ˆØAHÑ>ˆ�&˜$ °Ø�&ˆØ ˆØ�$ŠhÙØØ"Ÿo™o¨f°q©jÓ9‰OˆE�8Ø ”Ñ ˆAÙØ”S˜“]Ñ"�àœH‘oˆGؘ'Ñ!Ø—‘˜wÔ'ØœzÑ*�ØœzÑ*�ØÔ.×5Ñ5Ò5¸&ÈÑ:MØ—K‘K Ô'ØÔ.×5Ñ5Ò5¸&ÈÑ:MØ—K‘K Ô'à ¨°´lÑ0CÀXÐNÒNð%�$�hùs ‚C8C=Ã;C=có¬—|j}tjt|||tz«}d}|t }|dk7r|tz }||||z}||fSrL)Ú_dataÚstructÚunpackÚ PACKFORMATrPÚ ANC_COPYFROM)rrYÚdatar_r.Ú copyfromlens rrOzhistorypack._readentry�sh€Ø�z‰zˆÜ— ‘ Ü ˜˜V f¬Ñ&>Ð?ó ˆðˆØœLÑ)ˆ Ø ˜!Ò Ø ”oÑ %ˆFؘF V¨kÑ%9Ð:ˆHØ�hˆÐrcó4—td|t|«fz«‚)Ns!cannot add to historypack (%s:%s)r'r)s rr/zhistorypack.add©s €ÜØ 0°H¼cÀ$»iÐ3HÑ Hó ð rcóŽ—|jdk(r.|j||«}|D]\}}}}}||k(sŒ|||||fcSnp|j|«} | dd\} } |j|| | | zt«} | �:t j t| «\}} |j| «\} }| dd|fzStd|t|«fz«‚)Nrrr s unable to find history for %s:%s) ÚVERSIONrFrNÚ_bisectÚNODEINDEXENTRYLENGTHrdreÚNODEINDEXFORMATrOrr)rr!r"rGrIr`rar-r.rXr[r\r_rYs rr@zhistorypack._findnode®sí€Ø �<‰<˜1Ò Ø×*Ñ*¨4°Ó6ˆIÛ?HÑ;�˜ ¨°8ؘd“?Ø# V¨V°X¸xÐHÒHñ@Ið×'Ñ'¨Ó-ˆGØ-4°Q°R¨[Ñ *ˆO˜]Ø—L‘LØØØ -Ñ/Ü$ó ˆEð Ð Ü%Ÿ}™}¬_¸eÓD‘ ��fØ"&§/¡/°&Ó"9‘��xð˜R˜a�y H ;Ñ.Ð.äÐ:¸dÄCÈÃIÐ=NÑNÓOÐOrcóf—|j}tj|«j«}t j |j |d|j«d}|j}|||jz}|j}t|dz|j«D]}|||jz} | |k7sŒn|} |j||| |j«} | s t|«‚t j |j | «} | \} } }}}|j"||t$j&z}t j d|«d}|t$j&z }|j"|||z}||k7rtd||fz«‚||z }t j d|j(| | t$j&z«d}| t$j&z } |j(| | |z}| |z } ||k7rtd||fz«‚| t*z } | }|t$j&z |z t*z }|||||fS)Nrró!Hs&found file name %s when looking for %s)ÚparamsrÚsha1ÚdigestrdreÚ fanoutstructÚ fanoutprefixÚ _fanouttableÚ indexstartÚ _indexendÚrangeÚ fanoutcountrmr=rr;Ú_indexr Ú FILENAMESIZErcÚENTRYCOUNTSIZE)rr!rrÚnamehashÚ fanoutkeyÚfanoutÚstartÚindexendÚiÚendr_ÚrawentryÚxrYrZr[r\Ú rawnamelenÚ actualnamelenÚ actualnameÚfilenamelengthÚnodelistoffsetÚ nodelistsizes rrNzhistorypack._findsectionÆsc€Ø—‘ˆÜ—=‘= Ó&×-Ñ-Ó/ˆÜ—M‘MØ × Ñ  Ð*?¨F×,?Ñ,?Ð!@ó à ñ ˆ ð×"Ñ"ˆà�yÑ! F×$5Ñ$5Ñ5ˆØ—>‘>ˆä�y 1‘} f×&8Ñ&8Ö9ˆAؘ‘)˜f×/Ñ/Ñ/ˆCØ�e‹|Ùð:ð ˆCà— ‘ ˜X u¨c°4×3HÑ3HÓIˆÙܘ4“.Ð ä—=‘= ×!1Ñ!1°5Ó9ˆØ:BÑ7ˆˆ6�4˜¨-Ø—[‘[Ø ˜o´ ×0FÑ0FÑFð ˆ ôŸ ™  e¨ZÓ8¸Ñ;ˆ Øœ9×1Ñ1Ñ1ˆØ—[‘[Ø ˜o° Ñ=ð ˆ ð ˜Ò ÜØ9¸ZÈÐØ‘EؘG’^Ø�Cð˜# ™.Ó(ðrcó>—|D]\}}|j|||«Œyr)Úmarkhistoryentry)rÚledgerÚoptionsr*r"s rÚ markledgerzhistorypack.markledgers"€Û"‰NˆH�dØ × #Ñ # D¨(°DÕ 9ñ#rcóš—|jj|g«}t|«}|D�chc]'}|jsŒ|j|j f’Œ)}}t ||z «dk(r\|j|jvrCtj|jd¬«tj|jd¬«yyycc}w)NrT)Ú ignoremissing) ÚsourcesÚgetrMÚhistoryrepackedr*r"rQrÚcreatedrÚ unlinkpathÚ indexpathÚpackpath)rr˜ÚentriesÚallkeysÚeÚ repackedkeyss rÚcleanupzhistorypack.cleanup#s©€Ø—.‘.×$Ñ$ T¨2Ó.ˆÜ�d“)ˆá*1ó Ù*1 Q°Q×5FÓ5FˆQ�Z‰Z˜Ÿ™Ò ¨'ð ð ô ˆw˜Ñ%Ó &¨!Ò +Ø�y‰y §¡Ñ.Ü—‘ §¡¸dÕCÜ—‘ § ¡ ¸TÖBð/ð ,ùò  s ¬C¾Cc#óPK—|j«D]\}}}}}}||f–—Œy­wr)Ú iterentries)rÚfÚnr‡s rÚ__iter__zhistorypack.__iter__/s/èø€Ø $× 0Ñ 0Ö 2Ñ ˆAˆq�!�Q˜˜1Ø�Q�$‹Jñ!3ùs‚$&c#ó¬K—d}||jk�r>|j}tjd|||tj z«d}|tj z }||||z}||z }tjd|||t z«d}|t z }t|«D]‰}tjt|||tz«}|tz }||||tz}||tz }||t|t|t|t|f–—|xjtz c_Œ‹|j!«||jkr�Œ=yy­w)Nrrqró!I)Údatasizercrdrer r}r~rzrfrPrgrRrTrUrWÚ_pagedinÚ freememory) rrYrhÚ filenamelenr*Úrevcountr„r_r.s rrªzhistorypack.iterentries3sgèø€àˆØ�t—}‘}Ó$Ø—:‘:ˆDä Ÿ-™-Ø�t˜F V¬i×.DÑ.DÑ%DÐEóàñˆKð ”i×,Ñ,Ñ ,ˆFؘF V¨kÑ%9Ð:ˆHØ �kÑ !ˆFä—}‘}Ø�t˜F V¬nÑ%<Ð=óàñˆHð ”nÑ $ˆFä˜8–_�ÜŸ ™ Ü  V¨f´Ñ.FÐ Gó�ðœ/Ñ)�à ¨°%¼ Ñ2EÑ)EÐF�ؘ%¤ Ñ-Ñ-�ðØœ(‘OØœ*Ñ%Øœ*Ñ%Øœ,Ñ'Øð òð— ’ ¤Ñ0– ð%%ð* �O‰OÔ ðI�t—}‘}Ö$ùs ‚EEÅEr)r0r1r2r3r4ÚSUPPORTED_VERSIONSr9rDrr%rFrOr/r@rNrmršr¨r­rªÚ __classcell__©r>s@rrrTs`ø„Ø€KØ€Jà˜Ðô2ò óò(.ó Oò6 ò ò Pò0@ òDó.:ò Còö'rrcóP‡—eZdZdZeZeZdgZdˆfd„ Zd„Zd„Z d ˆfd„ Z d„Z ˆxZ S) ÚmutablehistorypackaŠ A class for constructing and serializing a histpack file and index. A history pack is a pair of files that contain the revision history for various file revisions in Mercurial. It contains only revision history (like parent pointers and linknodes), not any revision content information. It consists of two files, with the following format: .histpack The pack itself is a series of file revisions with some basic header information on each. datapack = [,...] filesection = [,...] revision = The revisions within each filesection are stored in topological order (newest first). If a given entry has a parent from another file (a copy) then p1node is the node from the other file, and copyfrom is the filepath of the other file. .histidx The index file provides a mapping from filename to the file section in the histpack. In V1 it also contains sub-indexes for specific nodes within each file. It consists of three parts, the fanout, the file index and the node indexes. The file index is a list of index entries, sorted by filename hash (one per file section in the pack). Each entry has: - node (The 20 byte hash of the filename) - pack entry offset (The location of this file section in the histpack) - pack content size (The on-disk length of this file section's pack data) - node index offset (The location of the file's node index in the index file) [1] - node index size (the on-disk length of this file's node index) [1] The fanout is a quick lookup table to reduce the number of steps for bisecting the index. It is a series of 4 byte pointers to positions within the index. It has 2^16 entries, which corresponds to hash prefixes [00, 01, 02,..., FD, FE, FF]. Example: the pointer in slot 4F points to the index position of the first revision whose node starts with 4F. This saves log(2^16) bisect steps. dataidx = [1] [1] [,...] [1] fanouttable = [,...] (2^16 entries) fileindex = [,...] fileindexentry = [1] [1] nodeindex = [,...] [1] filename = [1] nodeindexentry = [1] [1] [1]: new in version 1. rcó´•—tt|� |||¬«i|_i|_i|_t |_t|_ t|_ t|_ y)N)Úversion) r8r¹r9ÚfilesÚentrylocationsÚ fileentriesr:r;r<r=rorn)rÚuir£r»r>s €rr9zmutablehistorypack.__init__®sQø€Ü Ô  $Ñ0°°XÀwÐ0ÔO؈Œ Ø ˆÔ؈Ôä'ˆÔÜ 1ˆÔä.ˆÔÜ$8ˆÕ!rcó°—|xsd}tjdt|««}|jj |g«j ||||||f«y)Nrrq)rdr#rQr¾Ú setdefaultrA)rr*r"r+r,r-r.ris rr/zmutablehistorypack.addºsP€Ø’?˜sˆÜ—k‘k %¬¨X«Ó7ˆ Ø ×Ñ×#Ñ# H¨bÓ1×8Ñ8Ø �2�r˜8 [°(Ð ;õ rc 󜇗t|j«D�]­}|j|}|jj«}|D�cic]}|d|“Œ c}Šˆfd„}t t t jd„|D«|«««}|jdtjdt|««|tjdt|««fz«tjt|«zdz}g}|jj|i«} ||z} |D].} | | | <d‰| z} |j!| «| t| «z } Œ0d j#|«} |t| «z }|j| «||f|j$|<t'j(|«j+«} | |j,| <�Œ°ycc}w) Nrcó´•—‰|\}}}}}}g}|tjk7r|j|«|tjk7r|j|«|Sr)rrVrA)r"r‡r+r,ÚparentsÚentrymaps €rÚ parentfuncz-mutablehistorypack._write..parentfuncÉsYø€Ø%-¨d¡^Ñ"��2�r˜1˜a Ø�ØÔ*×1Ñ1Ò1Ø—N‘N 2Ô&ØÔ*×1Ñ1Ò1Ø—N‘N 2Ô&Ø�rc3ó&K—|] }|d–—Œ y­w)rNr5)Ú.0r¦s rÚ z,mutablehistorypack._write..Ôsèø€Ð*A¹°A¨1¨Q­4¹ùs‚s%s%s%srqr¯r s %s%s%s%s%s%sr)Úsortedr¾ÚpackfpÚtellÚlistÚreversedr Ú sortnodesÚwriterawrdr#rQr r}r½rÁrAÚjoinr¼rrsrtr¤)rr*r¤Ú sectionstartr¦rÆÚ sortednodesÚ sectionlenÚ rawstringsÚ locationsrYr"ÚrawÚrawdatarÅs @rÚ_writezmutablehistorypack._writeÁsµø€Ü˜t×/Ñ/×0ˆHØ×&Ñ& xÑ0ˆGØŸ;™;×+Ñ+Ó-ˆLñ*1Ó1© A˜˜!™˜a™¨Ñ1ˆHô ôÜÜ×)Ñ)Ñ*A¹Ó*AÀ:ÓNóóˆKð �M‰MØä—K‘K ¤s¨8£}Ó5ØÜ—K‘K ¤s¨;Ó'7Ó8ðñô ô#×/Ñ/´#°h³-Ñ?À!ÑCˆJàˆJð×+Ñ+×6Ñ6°xÀÓDˆIØ! JÑ.ˆFÛ#�Ø"(� ˜$‘Ø%¨°©Ñ6�Ø×!Ñ! #Ô&Øœ#˜c›(Ñ"‘ð $ð —h‘h˜zÓ*ˆGØ œ#˜g›,Ñ &ˆJà �M‰M˜'Ô "ð%1°*Ð#=ˆD�J‰J�xÑ Ü—=‘= Ó*×1Ñ1Ó3ˆDØ!%ˆD�L‰L˜Ó ñk1ùò 2sÁ G cóf•—|jry|j«tt|�|¬«S)N)r˜)Ú_closedrÙr8r¹Úclose)rr˜r>s €rrÜzmutablehistorypack.closeùs,ø€Ø �<Š<Ø à � ‰ Œ äÔ'¨Ñ4¸FÐ4ÓCÐCrc ó¸—|j}|j}|j}|j}d„|jj «D«}t |«}tjd«}||zt|«|zz|z} g} g} d} |D�] \} }}}|j|}t|«|z}tj|| ||| |«}| jtjtjt|««|z«| tjt|«zz } t |j ««D]0\}}| jtj|||««| dz } Œ2| t|«|zz } | j|«�Œtjd| «}dj!| «|zdj!| «zS)Nc3óvK—|]1\}\}}tj|«j«|||f–—Œ3y­wr)rrsrt)rÈr*rYrZs rrÉz1mutablehistorypack.createindex..s<èø€ð á,>Ñ(�™.˜6 4ô�]‰]˜8Ó $× +Ñ +Ó -¨x¸ÀÔ FÙ,>ùs‚79s!Qrrr)r;r=rornr¼ÚitemsrÊrdÚcalcsizerQr½r#rAr ÚFILENAMESTRUCTr}rÑ)rÚ nodelocationsÚ indexoffsetÚfileindexformatÚfileindexlengthÚnodeindexformatÚnodeindexlengthr¼Ú indexlensizer[ÚfileindexentriesÚnodeindexentriesÚ nodecountrr*rYrZr\r†r"ÚlocationÚ nodecountraws rÚ createindexzmutablehistorypack.createindexs倨×*Ñ*ˆØ×/Ñ/ˆØ×.Ñ.ˆØ×3Ñ3ˆñ à,0¯J©J×,<Ñ,<Ô,>ó ˆô�u“ ˆô—‘ uÓ-ˆ à Øñ ä�5‹z˜OÑ+ñ -ðñ ð ðÐØÐØˆ Ü05Ñ ,ˆH�h ¨à ×/Ñ/°Ñ9ˆMä  Ó.°Ñ@ˆMä—{‘{ØØØØØØó ˆHð × #Ñ #Ü— ‘ œI×4Ñ4´c¸(³mÓDÀxÑOô ð œy×5Ñ5¼¸H» ÑEÑ EˆOä"(¨×)<Ñ)<Ó)>Ö"?‘��hØ ×'Ñ'Ü—K‘K °°xÓ@ôð˜Q‘‘ ð #@ð œs =Ó1°OÑCÑ CˆOà × #Ñ # HÖ -ð916ô<—{‘{ 5¨)Ó4ˆ à �H‰HÐ%Ó &Øñ à�h‰hÐ'Ó(ñ )ð r)rr) r0r1r2Ú__doc__r3r4rµr9r/rÙrÜrîr¶r·s@rr¹r¹]s9ø„ñIðV€KØ€Jà˜Ðõ 9ò ò6&õpDö; rr¹)!rdÚmercurial.noderrÚ mercurialrÚmercurial.utilsrÚrr r r:ràr<r�rornrfrPr~r3r4rRrTrUrWrgÚ basepackstorerrÚmutablebasepackr¹r5rrÚrösÄðÛ ÷õõ%÷ñð€ Ø#�F—O‘O LÓ1ÐØ € à€Ø&�v—‘ Ó7Ðð€ Ø€à€à€ Ø € à €Ø € Ø € Ø€ Ø€ ô( �x×-Ñ-ô( ôVF�(×#Ñ#ôFôR_ ˜×1Ñ1õ_ r