§
    	^µc%g  ã                   ó˜   — d dl mZ d dlmZmZmZ d dlmZ dZdZ	dZ
dZd„ Z	 	 dd„Z G d„ dej        ¦  «        Z ed¦  «        Zdd„Zd
S )é   )Ú_)ÚerrorÚpycompatÚutil)Ú
stringutilé   s   alls   prefinalizes   postfinalizec                 ó   ‡ — ˆ fd„}|S )Nc                 óZ   •— | j         dk    rt          j        d¦  «        ‚ ‰| g|¢R i |¤ŽS )Né    s;   cannot use transaction when it is already committed/aborted)Ú_countr   ÚProgrammingError)ÚselfÚargsÚkwdsÚfuncs      €ú7/usr/lib/python3/dist-packages/mercurial/transaction.pyÚ_activezactive.<locals>._active   sJ   ø€ ØŒ;˜!ÒÐÝÔ(ØNñô ð ð ˆt�DÐ(˜4Ð(Ð(Ð( 4Ð(Ð(Ð(ó    © )r   r   s   ` r   Úactiver      s#   ø€ ð)ð )ð )ð )ð )ð €Nr   TNc                 óº  — t          t          |¦  «                             ¦   «         ¦  «        D ]ë\  }}	|	s|s¼|o|df|v }
	  ||d|
¬¦  «        }|                     ¦   «         |	k     r9t	          j        t          d¦  «        ||	|                     ¦   «         fz  ¦  «        ‚|                     |	¦  «         |                     ¦   «          Œ›# t          $ r  |t          d¦  «        |z  ¦  «         ‚ w xY w	 | 
                    |¦  «         ŒÜ# t          $ r Y Œèw xY wg }|D �]#\  }}}}||vr|r |d||fz  ¦  «         ||         }	 |rª|r¨|                     |¦  «        }|                     |¦  «        }|o||f|v }
	 t          j        |||
¬¦  «         |                     |¦  «         ns# t          $ r;}t!          j        |¦  «        } |t          d¦  «        ||fz  ¦  «         Y d }~n3d }~ww xY w|p|}	 | 
                    |¦  «         n# t          $ r Y nw xY wŒÿ# t          t$          t          j        f$ r |s‚ Y �Œ!w xY wd| z  }|                     |¦  «        r| 
                    |¦  «         | 
                    | ¦  «         	 |D ],}|                     |¦  «        r| 
                    |¦  «         Œ-d S # t          t$          t          j        f$ r Y d S w xY w)	Nr   ó   a)Ú
checkambigsB   attempted to truncate %s to %d bytes, but it was already %d bytes
s   failed to truncate %s
s.   couldn't handle %s: unknown cache location %s
s   failed to recover %s (%s)
ó   %s.backupfiles)ÚsortedÚdictÚitemsÚtellr   ÚAbortr   ÚtruncateÚcloseÚIOErrorÚunlinkÚFileNotFoundErrorÚjoinr   ÚcopyfileÚappendr   ÚforcebytestrÚOSErrorÚexists)ÚjournalÚreportÚopenerÚvfsmapÚentriesÚbackupentriesr#   ÚcheckambigfilesÚfÚor   ÚfpÚbackupfilesÚlÚbÚcÚvfsÚfilepathÚ
backuppathÚexcÚe_msgÚtargets                         r   Ú	_playbackr?   )   s´  € õ •t˜G‘}”}×*Ò*Ñ,Ô,Ñ-Ô-ð ð ‰ˆˆ1Øð 	�Fð 	Ø(ÐH¨a°¨X¸Ð-HˆJðØ�V˜A˜t°
Ð;Ñ;Ô;�Ø—7’7‘9”9˜q’=�=Ýœ+Ýð2ñô ð ˜a §¢¡¤Ð+ñ	,ñô ð ð —’˜A‘”�Ø—’‘
”
�
�
øÝð ð ð Ø�•qÐ3Ñ4Ô4°qÑ8Ñ9Ô9Ð9ØðøøøðØ—’˜aÑ Ô Ð Ð øÝ$ð ð ð Ø�ðøøøð €KØ#ð ñ ‰
ˆˆ1ˆa�Ø�Fˆ?ˆ?˜qˆ?ØˆFÐEÈÈAÈÑNÑOÔOÐOØ�QŒiˆð	Øð �Qð ØŸ8š8 A™;œ;�Ø ŸXšX a™[œ[�
Ø,ÐJ°!°Q°¸?Ð1J�
ðKÝ”M *¨hÀ:ÐNÑNÔNÐNØ×&Ò& qÑ)Ô)Ð)Ð)øÝð Kð Kð KÝ&Ô3°CÑ8Ô8�EØ�F�1Ð;Ñ<Ô<ÀÀ5¸zÑIÑJÔJÐJÐJÐJÐJÐJÐJøøøøðKøøøð ˜˜a�ðØ—J’J˜vÑ&Ô&Ð&Ð&øÝ(ð ð ð Ø�Dðøøøøøå�¥%¤+Ð.ð 	ð 	ð 	Øð Øðñ ð	øøøð # WÑ,€JØ‡}‚}�ZÑ Ô ð "Ø�Š�jÑ!Ô!Ð!Ø
‡M‚M�'ÑÔÐðØð 	!ð 	!ˆAØ�}Š}˜QÑÔð !Ø—’˜aÑ Ô Ð øð	!ð 	!øõ •W�eœkÐ*ð ð ð àˆˆðøøøs‘   ÁBC
Ã
'C1Ã5DÄ
DÄDÅ6HÅ=,F*Æ)HÆ*
G/Æ41G*Ç%HÇ*G/Ç/HÇ7HÈHÈ
HÈHÈHÈHÈIÉ IÊ	/J: Ê:KËKc                   óB  — e Zd Z	 	 	 	 	 	 	 d'd„Zd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Z	ed„ ¦   «         Z
ed	„ ¦   «         Zd
„ Zed(d„¦   «         Zd„ Zed)d„¦   «         Ze	 	 	 d*d„¦   «         Zed„ ¦   «         Zdefd„Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed+d„¦   «         Zd„ Zd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed „ ¦   «         Zed!„ ¦   «         Z ed"„ ¦   «         Z!ed#„ ¦   «         Z"ed$„ ¦   «         Z#d%„ Z$d&„ Z%dS ),ÚtransactionNú	<unnamed>c                 ó€  — d| _         d| _        || _        || _        |                     ¦   «         }||d<   || _        || _        i | _        t          ¦   «         | _	        || _
        || _        g | _        |	€d„ }	|	| _        t          ¦   «         | _        |
r| j                             |
¦  «         |g| _        i | _        i | _        |                     | j
        d¦  «        | _        g | _        i | _        d| j
        z  | _        |                     | j        d¦  «        | _        | j                             dt4          z  ¦  «         |�<|                     | j
        |d	z  ¦  «         |                     | j        |d	z  ¦  «         i | _        i | _        d
| _        i | _        i | _         |�
|| j         d<   i | _!        i | _"        dS )a  Begin a new transaction

        Begins a new transaction that allows rolling back writes in the event of
        an exception.

        * `after`: called after the transaction has been committed
        * `createmode`: the mode of the journal file that will be created
        * `releasefn`: called after releasing (with transaction and result)

        `checkambigfiles` is a set of (path, vfs-location) tuples,
        which determine whether file stat ambiguity should be avoided
        for corresponded files.
        r   r   Nc                 ó   — d S ©Nr   )ÚtrÚsuccesss     r   ú<lambda>z&transaction.__init__.<locals>.<lambda>Ÿ   s   € ¨D€ r   s   w+r   ó   wó   %d
i¶  Fs   001-userhooks)#r   Ú_usagesÚ_reportÚ_openerÚcopyÚ_vfsmapÚ_afterÚ
_offsetmapÚsetÚ	_newfilesÚ_journalÚ	_undonameÚ_queueÚ
_releasefnÚ_checkambigfilesÚupdateÚ_namesÚchangesÚhookargsÚopenÚ_fileÚ_backupentriesÚ
_backupmapÚ_backupjournalÚ_backupsfileÚwriteÚversionÚchmodÚ_filegeneratorsÚ_pendingcallbackÚ_anypendingÚ_finalizecallbackÚ_validatecallbackÚ_postclosecallbackÚ_abortcallback)r   r,   r-   r.   ÚjournalnameÚundonameÚafterÚ
createmodeÚ	validatorÚ	releasefnr1   Únames               r   Ú__init__ztransaction.__init__s   sÅ  € ð6 ˆŒØˆŒØˆŒàˆŒà—’‘”ˆØˆˆs‰ØˆŒØˆŒØˆŒÝ™œˆŒØ#ˆŒØ!ˆŒØˆŒàÐØ0Ð0ˆIØ#ˆŒå #¡¤ˆÔØð 	:ØÔ!×(Ò(¨Ñ9Ô9Ð9à�fˆŒð ˆŒð ˆŒØ—[’[ ¤°Ñ6Ô6ˆŒ
ð !ˆÔØˆŒØ/°$´-Ñ?ˆÔØ"ŸKšK¨Ô(;¸TÑBÔBˆÔØÔ×Ò ­'Ñ 1Ñ2Ô2Ð2àÐ!Ø�LŠL˜œ¨
°UÑ(:Ñ;Ô;Ð;Ø�LŠL˜Ô,¨j¸5Ñ.@ÑAÔAÐAð  "ˆÔà "ˆÔà ˆÔà!#ˆÔð "$ˆÔØÐ Ø7@ˆDÔ"Ð#3Ñ4à"$ˆÔà ˆÔÐÐr   c                 óZ   — d                      | j        ¦  «        }d|| j        | j        fz  S )Nú/z*<transaction name=%s, count=%d, usages=%d>)r%   rZ   r   rK   ©r   rs   s     r   Ú__repr__ztransaction.__repr__Ò   s4   € Ø�xŠx˜œÑ$Ô$ˆØ;ØØŒKØŒLð?
ñ 
ð 	
r   c                 ó@   — | j         r|                      ¦   «          d S d S rE   )rT   Ú_abort©r   s    r   Ú__del__ztransaction.__del__Ú   s'   € ØŒ=ð 	Ø�KŠK‰MŒMˆMˆMˆMð	ð 	r   c                 ó   — | j         d u S rE   ©ri   r{   s    r   Ú	finalizedztransaction.finalizedÞ   s   € àÔ%¨Ð-Ð-r   c                 ó:   — | j                              g ¦  «         dS )z±delay registration of file entry

        This is used by strip to delay vision of strip offset. The transaction
        sees either none or all of the strip actions to be done.N)rV   r'   r{   s    r   Ú
startgroupztransaction.startgroupâ   s    € ð 	Œ×Ò˜2ÑÔÐÐÐr   c                 ót   — | j                              ¦   «         }|D ]\  }}|                      ||¦  «         ŒdS )zºapply delayed registration of file entry.

        This is used by strip to delay vision of strip offset. The transaction
        sees either none or all of the strip actions to be done.N)rV   ÚpopÚ	_addentry)r   Úqr2   r3   s       r   Úendgroupztransaction.endgroupê   sI   € ð ŒK�OŠOÑÔˆØð 	!ð 	!‰DˆAˆqØ�NŠN˜1˜aÑ Ô Ð Ð ð	!ð 	!r   c                 óÂ   — || j         v s|| j        v s	|| j        v rdS | j        r$| j        d                              ||f¦  «         dS |                      ||¦  «         dS )z5record the state of an append-only file before updateNéÿÿÿÿ)rS   rQ   r`   rV   r'   r„   ©r   ÚfileÚoffsets      r   Úaddztransaction.addô   sw   € ð �D”NÐ"Ð"Ø�t”Ð&Ð&Ø�t”Ð&Ð&àˆFØŒ;ð 	ØŒK˜ŒO×"Ò" D¨& >Ñ2Ô2Ð2ØˆFà�Š�t˜VÑ$Ô$Ð$Ð$Ð$r   c                 óþ   — || j         v s|| j        v s	|| j        v rdS |r|| j        |<   n| j                              |¦  «         | j                             d||fz  ¦  «         | j                             ¦   «          dS )z3add a append-only entry to memory and on-disk stateNó   %s %d
)rS   rQ   r`   rŒ   r^   rc   Úflushr‰   s      r   r„   ztransaction._addentry  s–   € ð �D”NÐ"Ð"Ø�t”Ð&Ð&Ø�t”Ð&Ð&àˆFØð 	%Ø$*ˆDŒO˜DÑ!Ð!àŒN×Ò˜tÑ$Ô$Ð$àŒ
×Ò˜¨¨f ~Ñ5Ñ6Ô6Ð6ØŒ
×ÒÑÔÐÐÐr   Tr   c                 óì  — | j         rd}t          j        |¦  «        ‚|| j        v s|| j        v s	|| j        v rdS | j        |         }|                     |¦  «        \  }}d| j        |fz  }| 	                    ||¦  «        }	| 
                    |¦  «        rB|                     |¦  «        }
|                     |	¦  «        }t          j        |
||¬¦  «         nd}	|                      |||	df¦  «         dS )aW  Adds a backup of the file to the transaction

        Calling addbackup() creates a hardlink backup of the specified file
        that is used to recover the file in the event of the transaction
        aborting.

        * `file`: the file path, relative to .hg/store
        * `hardlink`: use a hardlink to quickly create the backup
        s/   cannot use transaction.addbackup inside "group"Ns   %s.backup.%s©Úhardlinkr   F)rV   r   r   rS   rQ   r`   rO   ÚsplitrT   Úreljoinr*   r%   r   r&   Ú_addbackupentry)r   rŠ   r’   ÚlocationÚmsgr9   ÚdirnameÚfilenameÚbackupfilenameÚ
backupfiler:   r;   s               r   Ú	addbackupztransaction.addbackup  s  € ð Œ;ð 	.ØDˆCÝÔ(¨Ñ-Ô-Ð-ð �D”NÐ"Ð"Ø�t”Ð&Ð&Ø�t”Ð&Ð&àˆFØŒl˜8Ô$ˆØŸIšI d™OœOÑˆ�Ø(¨D¬M¸8Ð+DÑDˆØ—[’[ ¨.Ñ9Ô9ˆ
Ø�:Š:�dÑÔð 	Ø—x’x ‘~”~ˆHØŸš *Ñ-Ô-ˆJÝŒM˜( J¸ÐBÑBÔBÐBÐBàˆJà×Ò˜h¨¨j¸%Ð@ÑAÔAÐAÐAÐAr   c                 óð   — | j                              |¦  «         t          | j         ¦  «        dz
  | j        |d         <   | j                             d|z  ¦  «         | j                             ¦   «          dS )z0register a new backup entry and write it to diskr   ó   %s %s %s %d
N)r_   r'   Úlenr`   rb   rc   r�   )r   Úentrys     r   r•   ztransaction._addbackupentry5  sq   € àÔ×"Ò" 5Ñ)Ô)Ð)Ý$'¨Ô(;Ñ$<Ô$<¸qÑ$@ˆŒ˜˜aœÑ!ØÔ×ÒÐ 3°eÑ ;Ñ<Ô<Ð<ØÔ×ÒÑ!Ô!Ð!Ð!Ð!r   c                 ó8   — |                       |d|df¦  «         dS )z”register a temporary transaction file

        Such files will be deleted when the transaction exits (on both
        failure and success).
        r   FN)r•   )r   Útmpfiler–   s      r   Úregistertmpztransaction.registertmp<  s'   € ð 	×Ò˜h¨¨W°eÐ<Ñ=Ô=Ð=Ð=Ð=r   r   Fc                 ó(   — |||||f}|| j         |<   dS )a]  add a function to generates some files at transaction commit

        The `genfunc` argument is a function capable of generating proper
        content of each entry in the `filename` tuple.

        At transaction close time, `genfunc` will be called with one file
        object argument per entries in `filenames`.

        The transaction itself is responsible for the backup, creation and
        final write of such file.

        The `genid` argument is used to ensure the same set of file is only
        generated once. Call to `addfilegenerator` for a `genid` already
        present will overwrite the old entry.

        The `order` argument may be used to control the order in which multiple
        generator will be executed.

        The `location` arguments may be used to indicate the files are located
        outside of the the standard directory for transaction. It should match
        one of the key of the `transaction.vfsmap` dictionary.

        The `post_finalize` argument can be set to `True` for file generation
        that must be run after the transaction has been finalized.
        N©rf   )r   ÚgenidÚ	filenamesÚgenfuncÚorderr–   Úpost_finalizer    s           r   Úaddfilegeneratorztransaction.addfilegeneratorE  s(   € ðJ ˜	 7¨H°mÐDˆØ&+ˆÔ˜UÑ#Ð#Ð#r   c                 ó,   — || j         v r
| j         |= dS dS )z=reverse of addfilegenerator, remove a file generator functionNr¥   )r   r¦   s     r   Úremovefilegeneratorztransaction.removefilegeneratorm  s+   € ð �DÔ(Ð(Ð(ØÔ$ UÐ+Ð+Ð+ð )Ð(r   c           
      ó~  — d}|t           k    rdx}}n|t          k    }|t          k    }t          | j                             ¦   «         ¦  «        D ]í\  }}d}|\  }}	}
}}|r|rŒ|r|sŒ| j        |         }g }	 |	D ]g}||z  }|r|                      ||¬¦  «         d}n"|                      ||¬¦  «         ||f| j	        v }| 
                     ||dd|¬¦  «        ¦  «         Œh |
|Ž  |D ]}|                     ¦   «          Œ|d d …= |D ]}|                     ¦   «          ŒŒÐ# |D ]}|                     ¦   «          Œw xY w|S )NFT)r–   rI   )Ú
atomictempr   )ÚGEN_GROUP_ALLÚGEN_GROUP_POST_FINALIZEÚGEN_GROUP_PRE_FINALIZEr   rf   r   rO   r£   rœ   rX   r'   r!   Údiscard)r   ÚsuffixÚgroupÚanyÚ	skip_postÚskip_preÚidr    r©   r§   r¨   r–   rª   r9   Úfilesrs   r   r2   s                     r   Ú_generatefilesztransaction._generatefiless  sÍ  € àˆà•MÒ!Ð!Ø#(Ð(ˆI˜˜àÕ 7Ò7ˆHØÕ!7Ò7ˆIå Ô 4× :Ò :Ñ <Ô <Ñ=Ô=ð 	 ð 	 ‰IˆB�ØˆCØAFÑ>ˆE�9˜g x°ð ð ˜]ð ØØð  -ð Øà”,˜xÔ(ˆCØˆEð Ø%ð 
ð 
�DØ˜F‘N�DØð OØ×(Ò(¨¸Ð(ÑAÔAÐAØ%*˜
˜
àŸš t°h˜Ñ?Ô?Ð?Ø&*¨HÐ%5¸Ô9NÐ%N˜
Ø—L’LØ˜˜D $°4ÀJÐOÑOÔOñô ð ð ð �˜��Øð ð �AØ—G’G‘I”I�I�Ià˜!˜!˜!�Hàð  ð  �AØ—I’I‘K”K�K�Kð ø˜ð  ð  �AØ—I’I‘K”K�K�Kð øøøàˆ
s   Á8BDÄD:c                 óL   — || j         v rdS | j                             |¦  «        S ©Nr   )rS   rQ   Úget)r   rŠ   s     r   Ú
findoffsetztransaction.findoffsetŸ  s*   € à�4”>Ð!Ð!Ø�1ØŒ×"Ò" 4Ñ(Ô(Ð(r   c                 óî   — | j                              d¦  «         g }| j                              ¦   «         D ]>}|                     d¦  «        \  }}|                     |t          |¦  «        f¦  «         Œ?|S )Nr   ó    )r^   ÚseekÚ	readlinesr“   r'   Úint)r   r/   r6   rŠ   Útroffsets        r   Úreadjournalztransaction.readjournal¥  sp   € àŒ
�Š˜ÑÔÐØˆØ”×%Ò%Ñ'Ô'ð 	2ð 	2ˆAØŸWšW U™^œ^‰NˆD�(Ø�NŠN˜D¥# h¡-¤-Ð0Ñ1Ô1Ð1Ð1Øˆr   c                 ój  — || j         v r)|sdS | j                              |¦  «         || j        |<   nH|| j        v r0|s#| j        |= | j                              |¦  «         n|| j        |<   nt	          |¦  «        ‚| j                             d||fz  ¦  «         | j                             ¦   «          dS )zn
        replace can only replace already committed entries
        that are not pending in the queue
        NrŽ   )rS   ÚremoverQ   rŒ   ÚKeyErrorr^   rc   r�   r‰   s      r   Úreplaceztransaction.replace®  sÏ   € ð �4”>Ð!Ð!Øð Ø�ØŒN×!Ò! $Ñ'Ô'Ð'Ø$*ˆDŒO˜DÑ!Ð!Ø�T”_Ð$Ð$Øð /Ø”O DÐ)Ø”×"Ò" 4Ñ(Ô(Ð(Ð(à(.�” Ñ%Ð%å˜4‘.”.Ð ØŒ
×Ò˜¨¨f ~Ñ5Ñ6Ô6Ð6ØŒ
×ÒÑÔÐÐÐr   c                 óz   — | xj         dz  c_         | xj        dz  c_        | j                             |¦  «         | S )Nr   )r   rK   rZ   r'   rw   s     r   Únestztransaction.nestÄ  s=   € àˆŒ�qÑˆŒØˆŒ˜ÑˆŒØŒ×Ò˜4Ñ Ô Ð Øˆr   c                 óØ   — | j         dk    r| xj        dz  c_        | j        r| j                             ¦   «          | j         dk    r!| j        dk    r|                      ¦   «          d S d S d S )Nr   r   )r   rK   rZ   rƒ   rz   r{   s    r   Úreleaseztransaction.releaseË  sn   € ØŒ;˜Š?ˆ?ØˆLŒL˜AÑˆLŒLØŒ;ð 	ØŒK�OŠOÑÔÐàŒ;˜Š?ˆ?˜tœ|¨qÒ0Ð0Ø�KŠK‰MŒMˆMˆMˆMð ˆ?Ð0Ð0r   c                 ó   — | j         dk    S r½   )r   r{   s    r   Úrunningztransaction.runningÔ  s   € ØŒ{˜QŠÐr   c                 ó   — || j         |<   dS )zöadd a callback to be called when the transaction is pending

        The transaction will be given as callback's first argument.

        Category is a unique identifier to allow overwriting an old callback
        with a newer callback.
        N)rg   ©r   ÚcategoryÚcallbacks      r   Ú
addpendingztransaction.addpending×  s   € ð +3ˆÔ˜hÑ'Ð'Ð'r   c                 óì   — t          | j        ¦  «        }|D ]3} | j                             |¦  «        | ¦  «        }| j        p|| _        Œ4| xj        |                      d¬¦  «        z  c_        | j        S )zpwrite pending file to temporary version

        This is used to allow hooks to view a transaction before commits   .pending)r´   )r   rg   rƒ   rh   r»   )r   Ú
categoriesÚcatr¶   s       r   Úwritependingztransaction.writependingá  s„   € õ
 ˜DÔ1Ñ2Ô2ˆ
Øð 	7ð 	7ˆCà0�$Ô'×+Ò+¨CÑ0Ô0°Ñ6Ô6ˆCØ#Ô/Ð6°3ˆDÔÐØÐÔ˜D×/Ò/°{Ð/ÑCÔCÑCÐÔØÔÐr   c                 ó   — || j         v S )z0check is a callback already exist for a categoryr~   ©r   rÓ   s     r   Úhasfinalizeztransaction.hasfinalizeî  s   € ð ˜4Ô1Ð1Ð1r   c                 ó   — || j         |<   dS )zòadd a callback to be called when the transaction is closed

        The transaction will be given as callback's first argument.

        Category is a unique identifier to allow overwriting old callbacks with
        newer callbacks.
        Nr~   rÒ   s      r   Úaddfinalizeztransaction.addfinalizeó  s   € ð ,4ˆÔ˜xÑ(Ð(Ð(r   c                 ó   — || j         |<   dS )zþadd or replace a callback to be called after the transaction closed

        The transaction will be given as callback's first argument.

        Category is a unique identifier to allow overwriting an old callback
        with a newer callback.
        N)rk   rÒ   s      r   Úaddpostcloseztransaction.addpostcloseþ  s   € ð -5ˆÔ Ñ)Ð)Ð)r   c                 ó8   — | j                              |d¦  «        S )z1return a postclose callback added before, or NoneN)rk   r¾   rÛ   s     r   Úgetpostcloseztransaction.getpostclose	  s   € ð Ô&×*Ò*¨8°TÑ:Ô:Ð:r   c                 ó   — || j         |<   dS )a   add a callback to be called when the transaction is aborted.

        The transaction will be given as the first argument to the callback.

        Category is a unique identifier to allow overwriting an old callback
        with a newer callback.
        N)rl   rÒ   s      r   Úaddabortztransaction.addabort  s   € ð )1ˆÔ˜HÑ%Ð%Ð%r   c                 ó   — || j         |<   dS )zÌadds a callback to be called when validating the transaction.

        The transaction will be given as the first argument to the callback.

        callback should raise exception if to abort transactionN)rj   rÒ   s      r   Úaddvalidatorztransaction.addvalidator  s   € ð ,4ˆÔ˜xÑ(Ð(Ð(r   c                 ó   — | j         dk    r²t          | j        ¦  «        D ]} | j        |         | ¦  «         Œd| _        |                      t          ¬¦  «         | j        r:| j        }i | _        t          |¦  «        }|D ]} ||         | ¦  «         Œ| j        °:d| _        |                      t          ¬¦  «         | xj         dz  c_         | j         dk    rdS | j                             ¦   «          | j	                             ¦   «          | j
        D ]Ã\  }}}}|| j        vr|r|                      d||fz  ¦  «         Œ-| j        |         }	|s‡|r…|	                     |¦  «        rp	 |	                     |¦  «         Œj# t          t           t"          j        f$ r:}
|s‚ |                      d|	                     |¦  «        |
fz  ¦  «         Y d}
~
Œ»d}
~
ww xY wŒÄi | _        t+          ¦   «         | _        |                      ¦   «          | j        r|                      ¦   «          d| _        | j                             | j        ¦  «        r| j                             | j        ¦  «         | j                             | j        ¦  «        r| j                             | j        ¦  «         | j
        D ]Á\  }}}}|| j        vr|r|                      d||fz  ¦  «         Œ-| j        |         }	|r…|	                     |¦  «        rp	 |	                     |¦  «         Œh# t          t           t"          j        f$ r:}
|s‚ |                      d|	                     |¦  «        |
fz  ¦  «         Y d}
~
Œ¹d}
~
ww xY wŒÂg | _
        d| _        |                      | d¦  «         d| _        t          | j        ¦  «        }|D ]} | j        |         | ¦  «         Œd| _        dS )	zcommit the transactionr   N)rµ   r   s.   couldn't remove %s: unknown cache location %s
s   couldn't remove %s: %s
ó-   couldn't remove %s: unknown cache location%s
T)r   r   rj   r»   r²   ri   r±   r^   r!   rb   r_   rO   rL   r*   r#   r"   r)   r   r   r%   rQ   rR   rS   Ú
_writeundorP   rM   Úisfilera   rT   rW   rk   )r   rÓ   Ú	callbacksr×   rØ   r6   r2   r7   r8   r9   ÚinstÚ_fs               r   r!   ztransaction.close"  sf  € ð Œ;˜!ÒÐÝ" 4Ô#9Ñ:Ô:ð 7ð 7�Ø0�Ô& xÔ0°Ñ6Ô6Ð6Ð6Ø%)ˆDÔ"Ø×ÒÕ&<ÐÑ=Ô=Ð=ØÔ(ð )Ø Ô2�	Ø)+�Ô&Ý# IÑ.Ô.�
Ø%ð )ð )�CØ"�I˜c”N 4Ñ(Ô(Ð(Ð(ð Ô(ð )ð &*ˆDÔ"Ø×ÒÕ&=ÐÑ>Ô>Ð>àˆŒ�qÑˆŒØŒ;˜!ÒÐØˆFØŒ
×ÒÑÔÐØÔ×ÒÑ!Ô!Ð!àÔ-ð 	ð 	‰JˆAˆq�!�QØ˜œÐ$Ð$¨Ð$Ø—’ØFÈ!ÈQÈÑOñô ð ð Ø”,˜q”/ˆCØð 	˜ð 	˜sŸzšz¨!™}œ}ð 	ðØ—J’J˜q‘M”M�M�MøÝ¥­%¬+Ð6ð ð ð Øð Øà—L’LØ3°s·x²xÀ±{´{ÀDÐ6IÑIñô ð ð ð ð ð ð øøøøð	øøøøð ˆŒÝ™œˆŒØ�ŠÑÔÐØŒ;ð 	Ø�KŠK‰MŒMˆMØˆDŒKØŒ<×Ò˜tÔ2Ñ3Ô3ð 	5ØŒL×Ò Ô 3Ñ4Ô4Ð4ØŒ<×Ò˜tœ}Ñ-Ô-ð 	/ØŒL×Ò ¤Ñ.Ô.Ð.ØÔ.ð 	ð 	‰KˆAˆr�1�aØ˜œÐ$Ð$¨Ð$Ø—’ðØ  !˜fñ%ñô ð ð Ø”,˜q”/ˆCØð 	�S—Z’Z ‘]”]ð 	ðØ—J’J˜q‘M”M�M�MøÝ¥­%¬+Ð6ð ð ð Øð Øà—L’LØ3°s·x²xÀ±{´{ÀDÐ6IÑIñô ð ð ð ð ð ð øøøøð	øøøøð !ˆÔØˆŒà�Š˜˜dÑ#Ô#Ð#ØˆŒõ ˜DÔ3Ñ4Ô4ˆ
Øð 	/ð 	/ˆCØ(ˆDÔ# CÔ(¨Ñ.Ô.Ð.Ð.à"&ˆÔÐÐs0   Å(E>Å>GÆ0GÇGË=LÌM)Ì/0M$Í$M)c                 ó.   — |                       ¦   «          dS )z�abort the transaction (generally called on error, or when the
        transaction is not explicitly committed before going out of
        scope)N)rz   r{   s    r   Úabortztransaction.abortt  s   € ð
 	�Š‰Œˆˆˆr   c                 óô  — | j         €dS d| j         z  }| j                             |d¦  «        }|                     dt          z  ¦  «         | j        D �]\  }}}}|sŒ|sd}nã|| j        vr|r|                      d||fz  ¦  «         Œ6| j        |         }|                     |¦  «        \  }	}
|
 	                    | j
        ¦  «        s
J |
¦   «         ‚|
                     | j
        | j         d¦  «        }|                     |	|¦  «        }t          j        |                     |¦  «        |                     |¦  «        d¬	¦  «         |                     d
||||fz  ¦  «         �Œ|                     ¦   «          dS )z4write transaction data for possible future undo callNr   rI   rJ   r   rè   r   Tr‘   rž   )rU   rM   r]   rc   rd   r_   rO   rL   r“   Ú
startswithrT   rÊ   r”   r   r&   r%   r!   )r   Úundo_backup_pathÚundobackupfiler6   r2   r7   r8   Úur9   Úbasers   Úunames               r   ré   ztransaction._writeundo{  s–  € àŒ>Ð!ØˆFà,¨t¬~Ñ=ÐØœ×*Ò*Ð+;¸TÑBÔBˆØ×Ò˜W¥wÑ.Ñ/Ô/Ð/ØÔ-ð 	Eñ 	E‰JˆAˆq�!�QØð ØØð GØ��à˜DœLÐ(Ð(¨QÐ(Ø—L’Lð Ø#$ a &ñ)ñô ð ð Ø”l 1”o�Ø ŸYšY q™\œ\‘
��dØ—’ t¤}Ñ5Ô5Ð;Ð;°tÑ;Ô;Ð;ØŸš T¤]°D´NÀAÑFÔF�Ø—K’K  eÑ,Ô,�Ý”˜cŸhšh q™kœk¨3¯8ª8°A©;¬;ÀÐFÑFÔFÐFØ× Ò Ð!4¸¸1¸aÀ°|Ñ!CÑDÔDÐDÑDØ×ÒÑÔÐÐÐr   c           
      ó€  — |                       ¦   «         }d| _        d| _        | j                             ¦   «          | j                             ¦   «          	 |sz| j        ss| j        r| j         	                    | j        ¦  «         | j
        r| j         	                    | j
        ¦  «         	 d | _
        |                      | d¦  «         d | _        d S |                      t          d¦  «        ¦  «         	 t          | j        ¦  «        D ]} | j        |         | ¦  «         Œd | _        t!          | j
        | j        | j        | j        || j        d| j        ¬¦  «         |                      t          d¦  «        ¦  «         np# t&          $ rc}|                      t          d¦  «        ¦  «         |                      t          d¦  «        t)          j        |¦  «        z  ¦  «         Y d }~nd }~ww xY wd | _
        |                      | d¦  «         d | _        d S # d | _
        |                      | d¦  «         d | _        w xY w)Nr   Fs   transaction abort!
©r1   s   rollback completed
s(   rollback failed - please run hg recover
s   (failure reason: %s)
)rÆ   r   rK   r^   r!   rb   r_   ra   rM   r#   rT   rW   rL   r   r   rl   r?   rO   rX   ÚBaseExceptionr   r(   )r   r/   rØ   r<   s       r   rz   ztransaction._abort˜  sl  € Ø×"Ò"Ñ$Ô$ˆØˆŒØˆŒØŒ
×ÒÑÔÐØÔ×ÒÑ!Ô!Ð!ð"	#Øð  4Ô#6ð ØÔ&ð =Ø”L×'Ò'¨Ô(;Ñ<Ô<Ð<Ø”=ð 7Ø”L×'Ò'¨¬Ñ6Ô6Ð6Øð4 !ˆDŒMØ�OŠO˜D %Ñ(Ô(Ð(Ø"ˆDŒOˆOˆOð5 �LŠL�Ð2Ñ3Ô3Ñ4Ô4Ð4ðÝ! $Ô"5Ñ6Ô6ð 3ð 3�CØ,�DÔ'¨Ô,¨TÑ2Ô2Ð2Ð2à&*�Ô#ÝØ”MØ”LØ”LØ”LØØÔ'ØØ$(Ô$9ð	ñ 	ô 	ð 	ð —’�QÐ6Ñ7Ô7Ñ8Ô8Ð8Ð8øÝ ð ð ð Ø—’�QÐKÑLÔLÑMÔMÐMØ—’ÝÐ/Ñ0Ô0µ:Ô3JÈ3Ñ3OÔ3OÑOñô ð ð ð ð ð ð øøøøðøøøð !ˆDŒMØ�OŠO˜D %Ñ(Ô(Ð(Ø"ˆDŒOˆOˆOøð !ˆDŒMØ�OŠO˜D %Ñ(Ô(Ð(Ø"ˆDŒOÐ"Ð"Ð"Ð"s?   ÁAH Ã"H Ã5BF Æ H Æ
G.ÆAG)Ç$H Ç)G.Ç.H È&H=)NNNNNNrB   )Tr   )r   )r   r   F)rB   )&Ú__name__Ú
__module__Ú__qualname__rt   rx   r|   Úpropertyr   r   r�   r†   rŒ   r„   rœ   r•   r£   r«   r­   r°   r»   r¿   rÆ   rÊ   rÌ   rÎ   rÐ   rÕ   rÙ   rÜ   rÞ   rà   râ   rä   ræ   r!   rï   ré   rz   r   r   r   rA   rA   r   sG  € € € € € ð ØØØØØØð]!ð ]!ð ]!ð ]!ð~
ð 
ð 
ðð ð ð ð.ð .ñ „Xð.ð ðð ñ „Vðð ð!ð !ñ „Vð!ð ð%ð %ñ „Vð%ðð ð ð  ðBð Bð Bñ „VðBðB"ð "ð "ð ð>ð >ð >ñ „Vð>ð ð ØØð%,ð %,ð %,ñ „Vð%,ðN ð,ð ,ñ „Vð,ð
 %(¨}ð *ð *ð *ð *ðX ð)ð )ñ „Vð)ð
 ðð ñ „Vðð ðð ñ „Vðð* ðð ð ñ „Vððð ð ðð ð ð3ð 3ð 3ð ð
 ð 
 ñ „Vð
 ð ð2ð 2ñ „Vð2ð ð4ð 4ñ „Vð4ð ð5ð 5ñ „Vð5ð ð;ð ;ñ „Vð;ð ð1ð 1ñ „Vð1ð ð4ð 4ñ „Vð4ð ðO'ð O'ñ „VðO'ðb ðð ñ „Vððð ð ð:)#ð )#ð )#ð )#ð )#r   rA   s8   journal was created by a different version of Mercurial
c           	      óT  — g }g }|                       |¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   |D ]|}		 |	                     d¦  «        \  }
}|                     |
t	          |¦  «        f¦  «         Œ@# t
          $ r0  |t          d¦  «        t          j        |	¦  «        z  ¦  «         Y Œyw xY wd|z  }|  	                    |¦  «        r³|                       |¦  «        }|                     ¦   «         }|rˆ|d         dd…         }|dt          z  k    r |t          ¦  «         nY|dd…         D ]N}|rJ|dd…         }|                     d¦  «        \  }	}
}}|                     |	|
|t          |¦  «        f¦  «         ŒOt          ||| ||||¬	¦  «         dS )
a‹  Rolls back the transaction contained in the given file

    Reads the entries in the specified file, and the corresponding
    '*.backupfiles' file, to recover from an incomplete transaction.

    * `file`: a file containing a list of entries, specifying where
    to truncate each file.  The file should contain a list of
    file offset pairs, delimited by newlines. The corresponding
    '*.backupfiles' file should contain a list of file backupfile
    pairs, delimited by  .

    `checkambigfiles` is a set of (path, vfs-location) tuples,
    which determine whether file stat ambiguity should be avoided at
    restoring corresponded files.
    NrÁ   s    couldn't read journal entry %r!
r   r   rˆ   s   %dr   rø   )r]   rÃ   r“   r'   rÄ   Ú
ValueErrorr   r   Úbytestrr*   rd   ÚBAD_VERSION_MSGÚboolr?   )r-   r.   rŠ   r,   r1   r/   r0   r4   Úlinesr6   r2   r3   ÚbackupjournalÚverÚliner7   r8   s                    r   Úrollbackr  É  s7  € ð  €GØ€Mà	�Š�TÑ	Ô	ð ˜bØ—’‘”ˆðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð àð ð ˆð	Ø—7’7˜5‘>”>‰DˆAˆqØ�NŠN˜A�s 1™vœv˜;Ñ'Ô'Ð'Ð'øÝð 	ð 	ð 	ØˆFÝÐ6Ñ7Ô7½(Ô:JÈ1Ñ:MÔ:MÑMñô ð ð ð ð	øøøð
 &¨Ñ,€MØ‡}‚}�]Ñ#Ô#ð AØ�[Š[˜Ñ'Ô'ˆØ—’‘”ˆØð 
	AØ˜”(˜3˜B˜3”-ˆCØ�u�w‘Ò'Ð'Ø�•Ñ'Ô'Ð'Ð'à! ! " "œIð Að A�DØð Aà# C R Cœy˜Ø%)§Z¢Z°Ñ%6Ô%6™
˜˜1˜a Ø%×,Ò,¨a°°Aµt¸A±w´wÐ-?Ñ@Ô@Ð@øåØØØØØØØ'ðñ ô ð ð ð s   š;»?Á?Á<BÂ7CÃC)TNrE   )Úi18nr   Ú r   r   r   Úutilsr   rd   r°   r²   r±   r   r?   ÚtransactionalrA   r  r  r   r   r   ú<module>r     s  ðð Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð
 Ð Ð Ð Ð Ð à
€à€Ø'Ð Ø)Ð ðð ð ð$ ØðFð Fð Fð FðRO	#ð O	#ð O	#ð O	#ð O	#�$Ô$ñ O	#ô O	#ð O	#ðd �!Ø@ñô €ð
6ð 6ð 6ð 6ð 6ð 6r   