Ë ŒÍø�á.Å·ãón—dZddlmZddlmZddlmZddlmZddl m Z Gd„d e «Z Gd „d «Z y ) zCbase class for store implementations and store-related utility codeé)Ú_)Úshort)Úutil)Úurlutilé)Úlfutilcó"—eZdZdZd„Zd„Zd„Zy)Ú StoreErrorzZRaised when there is a problem getting files from or putting files to a central store.có<—||_||_||_||_y©N)ÚfilenameÚhashÚurlÚdetail)Úselfr rrrs ú>usr/lib/python3.12/site-packages/hgext/largefiles/basestore.pyÚ__init__zStoreError.__init__s€Ø ˆŒ ؈Œ ؈ŒØˆ� ócóœ—td«|jtj|j«|j |j fzS)Ns0error getting id %s from url %s for file %s: %s )rrrÚ hidepasswordrr r©rs rÚ longmessagezStoreError.longmessage sB€ÜÐEÓFØ �I‰IÜ × Ñ  §¡Ó *Ø �M‰MØ �K‰Kð J ñ ð rcó^—dtj|j«|jfzS)Ns%s: %s)rrrrrs rÚ__str__zStoreError.__str__(s%€ØœG×0Ñ0°·±Ó:¸D¿K¹KÐHÑHÐHrN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rrr©rrr r s„ñ!òò  óIrr có>—eZdZd„Zd„Zd„Zd„Zd„Zd d„Zd„Z d„Z y ) Ú basestorecó.—||_||_||_yr )ÚuiÚrepor)rr#r$rs rrzbasestore.__init__-s€ØˆŒØˆŒ ؈�rcó—td«‚)z>Put source file into the store so it can be retrieved by hash.óabstract method©ÚNotImplementedError)rÚsourcers rÚputz basestore.put2s€ä!Ð"4Ó5Ð5rcó—td«‚)z€Check to see if the store contains the given hashes. Given an iterable of hashes it returns a mapping from hash to bool.r&r')rÚhashess rÚexistszbasestore.exists6s€ô"Ð"4Ó5Ð5rc ó¾—g}g}|j}d}|j|D��chc]\}}|’Œ c}}«}|jtd«td«t |«¬«5} |D]Ñ\} }| j |«|dz }|j td«| |fz«|j|«sO|jtd«| |tj|j«fz«|j| «Œ›|j| |«r|j| |f«ŒÁ|j| «ŒÓ ddd«||fScc}}w#1swY||fSxYw) aúGet the specified largefiles from the store and write to local files under repo.root. files is a list of (filename, hash) tuples. Return (success, missing), lists of files successfully downloaded and those not found in the store. success is a list of (filename, hash) tuples; missing is a list of filenames that we could not get. (The detailed error message will already have been presented to the user, so missing is just supplied as a summary.)rsgetting largefilessfiles)ÚunitÚtotalrsgetting %s:%s s'%s: largefile %s not available from %s N)r#r-Ú makeprogressrÚlenÚupdateÚnoteÚgetÚwarnrrrÚappendÚ_gethash) rÚfilesÚsuccessÚmissingr#ÚatÚ _filenamerÚ availableÚprogressr s rr5z basestore.get;sM€ðˆØˆØ �W‰Wˆà ˆØ—K‘K¹uÔ E¹uÑ*;¨9°d¢¸uÒ EÓFˆ Ø �_‰_Ü Ð#Ó $¬1¨X«;¼cÀ%»jðô à Û"'‘�˜$Ø—‘ Ô#Ø�a‘�Ø—‘œÐ,Ó-°¸4Ð0@Ñ@ÔAà —}‘} TÔ*Ø—G‘GÜÐEÓFØ# T¬7×+?Ñ+?ÀÇÁÓ+IÐJñKôð—N‘N 8Ô,Øà—=‘= ¨4Ô0Ø—N‘N H¨dÐ#3Õ4à—N‘N 8Õ,ñ!#(÷ ð*˜Ð!Ð!ùó-!F÷ ð*˜Ð!Ð!ús£ E Á&CEÅEcóò—tjtj|jd««tj|j|«}|dz}tj ||jj j¬«5} |j|||«}ddd«|k7rE|dk7r*|jjtd«|||fz«tj|«ytj||«tj |j|«y#t$r5}|jj|j««d}Yd}~ŒÂd}~wwxYw#1swYŒËxYw)z¢Get file with the provided hash and store it in the local repo's store and in the usercache. filename is for informational messages only. rs.tmp)Ú createmodeNs*%s: data corruption (expected %s, got %s) FT)rÚmakedirsrÚ storepathr$ÚatomictempfileÚstorerAÚ_getfiler r#r6rrÚunlinkÚrenameÚlinktousercache)rr rÚ storefilenameÚtmpnameÚtmpfileÚgothashÚerrs rr8zbasestore._gethashas(€ô � ‰ ”f×&Ñ& t§y¡y°#Ó6Ô7Ü×(Ñ(¨¯©°DÓ9ˆ à 'Ñ)ˆÜ × Ñ Ø  § ¡ §¡× :Ñ :õ à ð ØŸ-™-¨°¸4Ó@�÷  ð �dŠ?ؘ#Š~Ø—‘— ‘ ÜÐDÓEØ  wÐ/ñ0ôô �K‰K˜Ô Øä � ‰ �G˜]Ô+Ü×јtŸy™y¨$Ô/Øøôò Ø—‘— ‘ ˜SŸ_™_Ó.Ô/Ø•ûð ú÷  ð ús0ÂE-ÂD,Ä, E*Ä5+E%Å E-Å%E*Å*E-Å-E6có>—|jjtd«t|«z«t «}g}|D]²}|j |}d|j «t|j««fz}|D]p}tj|«} | sŒ||} | | j«f} | |vsŒ7|j| «tj| «} |j|| | f«ŒrŒ´|j||«} t|«}t|D��chc]\}}|’Œ c}}«}|r4|jjtd«||fz«t!| «S|jjtd«||fz«t!| «Scc}}w)z³Verify the existence (and, optionally, contents) of every big file revision referenced by every changeset in revs. Return 0 if all is well, non-zero on any errors.s'searching %d changesets for largefiles s%d:%ss3verified contents of %d revisions of %d largefiles s4verified existence of %d revisions of %d largefiles )r#Ústatusrr2Úsetr$ÚrevrÚnoderÚ splitstandinÚfilenodeÚaddÚ readasstandinr7Ú _verifyfilesÚint)rÚrevsÚcontentsÚverifiedÚ filestocheckrRÚcctxÚcsetÚstandinr ÚfctxÚkeyÚ expectedhashÚfailedÚnumrevsÚfnameÚfnodeÚ numlfiless rÚverifyzbasestore.verify€s‚€ð �‰�‰Ü Ð9Ó :¼SÀ»YÑ Fô ô“5ˆØˆ ÛˆCØ—9‘9˜S‘>ˆDؘtŸx™x›z¬5°·±³Ó+=Ð>Ñ>ˆDã�Ü!×.Ñ.¨wÓ7�ÚØ ™=�DØ# T§]¡]£_Ð5�CØ (Ò*Ø Ÿ ™  SÔ)Ü'-×';Ñ';¸DÓ'A˜ Ø$×+Ñ+¨T°8¸\Ð,JÕKñ ð ð×"Ñ" 8¨\Ó:ˆä�h“-ˆÜ±XÔ>±X¡> E¨5š°XÒ>Ó?ˆ Ù Ø �G‰G�N‰NÜÐIÓJؘIÐ&ñ'ô ô�6‹{Ðð �G‰G�N‰NÜÐJÓKؘIÐ&ñ'ô ô�6‹{Ðùó?sÄ F có—td«‚)aFetch one revision of one file from the store and write it to tmpfile. Compute the hash of the file on-the-fly as it downloads and return the hash. Close tmpfile. Raise StoreError if unable to download the file (e.g. it does not exist in the store).r&r')rrLr rs rrFzbasestore._getfile¨ó€ô "Ð"4Ó5Ð5rcó—td«‚)zÝPerform the actual verification of files in the store. 'contents' controls verification of content hash. 'filestocheck' is list of files to check. Returns _true_ if any problems are found! r&r')rr[r]s rrXzbasestore._verifyfiles°rkrN)F) rrrrr*r-r5r8rirFrXrrrr!r!,s,„òò 6ò6ò $"òLó>&òP6ó6rr!N)rÚmercurial.i18nrÚmercurial.noderÚ mercurialrÚmercurial.utilsrÚrÚ Exceptionr r!rrrÚrss8ðñJåå ÝõõôI�ôI÷,J6òJ6r