Ë á™L§)Gºãó—ddlZddlZddlZddlmZddlmZddlmZddl m Z m Z Gd„de «Z Gd„d e «ZGd „d «ZGd „d «Zdd„ZGd„de«Zy)éN)Úhex)Úopen)Úpycompat)ÚhashutilÚprocutilcó —eZdZy)ÚBundleWriteExceptionN©Ú__name__Ú __module__Ú __qualname__©óúÐ>rcól—ttj|«j««}|j |«}t j j|«st j|«t|j|«d«5}|j|«ddd«|S#1swY|SxYw)Nswb) rrÚsha1Údigestr5r,r-r.r/rr8r)rrr7ÚdirpathÚfs rrzfilebundlestore.writeUs�€Ü”x—}‘} TÓ*×1Ñ1Ó3Ó4ˆØ—-‘- Ó)ˆä�w‰w�~‰~˜gÔ&Ü �K‰K˜Ô ä �$—.‘. Ó*¨EÔ 2°aØ �G‰G�DŒM÷3ðˆ÷3ðˆús  B)Â)B3có¤— t|j|«d«5}|j«cddd«S#1swYyxYw#t$rYywxYw)Nsrb)rr8rÚIOError)rrr=s rrzfilebundlestore.readasB€ð Ü�d—n‘n SÓ)¨5Ô1°QØ—v‘v“x÷2×1Ò1ûäò Ùð ús*‚A�7­ A·A¼AÁAÁ AÁAN) r r r rr0r5r8rrrrrr$r$;s!„ñò (òLò ?ò órr$cóž—g}|D]E}|r|dk(r|j|«Œ|r|dk(r|j|«Œ5|j|«ŒG|S)z‚Formats `args` with Infinitepush replacements. Hack to get `str.format()`-ed strings working in a BC way with bytes. s {filename}s{handle})Úappend)Úargsr7ÚhandleÚformatted_argsÚargs rÚformat_placeholders_argsrFisY€ð €NÛˆÙ ˜˜}Ò,Ø × !Ñ ! (Õ +Ù ˜˜{Ò*Ø × !Ñ ! &Õ )à × !Ñ ! #Õ &ð ð Ðrcó$—eZdZd„Zd„Zd„Zd„Zy)Úexternalbundlestorecó<—||_||_||_||_y)a6 `put_binary` - path to binary file which uploads bundle to external storage and prints key to stdout `put_args` - format string with additional args to `put_binary` {filename} replacement field can be used. `get_binary` - path to binary file which accepts filename and key (in that order), downloads bundle from store and saves it to file `get_args` - format string with additional args to `get_binary`. {filename} and {handle} replacement field can be used. N)Úput_argsÚget_argsÚ put_binaryÚ get_binary)rrLrJrMrKs rr0zexternalbundlestore.__init__{s €ð!ˆŒ Ø ˆŒ Ø$ˆŒØ$ˆ�rcóø—tjtjtj |«tj tj d¬«}|j«\}}|j}|||fS)NT)ÚstdoutÚstderrÚ close_fds) Ú subprocessÚPopenrÚrapplyrÚ tonativestrÚPIPEÚ communicateÚ returncode)rrBÚprOrPrXs rÚ _call_binaryz externalbundlestore._call_binaryŒs^€Ü × Ñ Ü �O‰OœH×0Ñ0°$Ó 7Ü—?‘?Ü—?‘?Øô  ˆð Ÿ™›‰ˆ�Ø—\‘\ˆ ؘ6 6Ð)Ð)rcóâ—tj«5}|j|«|j«|j d«t |j |j¬«}|j|jg|z«\}}}|dk7rtd|z«‚|j«}t|«dk(r|dcddd«Std|j|fz«‚#1swYyxYw)Nr)r7s&Failed to upload to external store: %sésBad output from %s: %s) rÚ namedtempfilerÚflushÚseekrFrJÚnamerZrLr Ú splitlinesÚlen)rrÚtemprDrXrOrPÚ stdout_liness rrzexternalbundlestore.write—sä€ô × #Ñ #Ô %¨Ø �J‰J�tÔ Ø �J‰JŒLØ �I‰I�aŒLÜ5Ø— ‘ ¨¯ © ôˆNð*.×):Ñ):Ø—‘Ð! NÑ2ó*Ñ &ˆJ˜ ð˜QŠÜ*Ø=ÀÑFóðð"×,Ñ,Ó.ˆLÜ�<Ó  AÒ%Ø# A‘÷#&Ñ %ô&+Ø-°·±À&Ð0IÑIóð÷'&Ð %ús•B,C%à C%Ã%C.có&—tj«5}t|j|j|¬«}|j |j g|z«\}}}|dk7rtd|z«‚|j«cddd«S#1swYyxYw)N)r7rCrs*Failed to download from external store: %s) rr]rFrKr`rZrMrr)rrCrcrDrXrOrPs rrzexternalbundlestore.read³sˆ€ô× #Ñ #Ô %¨Ü5Ø— ‘ ¨¯ © ¸&ôˆNð*.×):Ñ):Ø—‘Ð! NÑ2ó*Ñ &ˆJ˜ ð˜QŠÜ)ØAÀFÑJóðð—9‘9“;÷&× %Ò %ús •A(BÂBN)r r r r0rZrrrrrrHrHzs„ò%ò" *òó8rrH)NN)rr,rRÚmercurial.noderÚmercurial.pycompatrÚ mercurialrÚmercurial.utilsrrÚ Exceptionr rrr$rFrHrrrÚrks_ðó Û ÛåÝ#Ý÷ô  ˜9ô ô ˜)ô ÷ ñ ÷>+ñ+ó\ô"HÐ-õHr