
    6hn                    t    S SK Jr  S SKrS SKJrJrJrJrJrJ	r	J
r
  SSKJrJrJr  \	\\4   r " S S\5      rg)    )annotationsN)Callable
CollectionListOptionalProtocolTupleUnion   )CallbackCategoryTHgPathTVfsKeyTc                     \ rS rSr\\R                  SS j5       5       r\R                  SS j5       r\R                  SS j5       r	\R                  SS j5       r
\R                     S          S!S jj5       r\R                  S"S#S jj5       r\R                     S$             S%S jj5       r\R                  S&S	 j5       r\R                  S'S
 j5       r\R                  S(S j5       r\R                  SS j5       r\R                  S)S*S jj5       r\R                  SS j5       r\R                  SS j5       r\R                        S+S j5       r\R                  SS j5       r\R                  S,S j5       r\R                        S+S j5       r\R                        S+S j5       r\R                      S-S j5       r\R                        S+S j5       r\R                        S+S j5       r\R                  SS j5       r\R                  SS j5       r\R                  S.S j5       rSr g)/ITransaction%   c                    g N selfs    B/usr/lib/python3/dist-packages/mercurial/interfaces/transaction.py	finalizedITransaction.finalized&   s     	    c                    g)zdelay 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.Nr   r   s    r   
startgroupITransaction.startgroup+       r   c                    g)zapply 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.Nr   r   s    r   endgroupITransaction.endgroup2   r   r   c                    g)z5record the state of an append-only file before updateNr   r   fileoffsets      r   addITransaction.add9   r   r   c                    g)a  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

If `for_offset` is set, we expect a offset for this file to have been
previously recorded
Nr   )r   r$   hardlinklocation
for_offsets        r   	addbackupITransaction.addbackup=   r   r   c                    g)z|register a temporary transaction file

Such files will be deleted when the transaction exits (on both
failure and success).
Nr   )r   tmpfiler*   s      r   registertmpITransaction.registertmpR   r   r   c                    g)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.
Nr   )r   genid	filenamesgenfuncorderr*   post_finalizes          r   addfilegeneratorITransaction.addfilegeneratorZ   r   r   c                    g)z=reverse of addfilegenerator, remove a file generator functionNr   )r   r3   s     r   removefilegenerator ITransaction.removefilegenerator~   r   r   c                    g r   r   )r   r$   s     r   
findoffsetITransaction.findoffset       r   c                    g r   r   r   s    r   readjournalITransaction.readjournal   r@   r   c                    g)zV
replace can only replace already committed entries
that are not pending in the queue
Nr   r#   s      r   replaceITransaction.replace   r   r   c                    g r   r   )r   names     r   nestITransaction.nest   r@   r   c                    g r   r   r   s    r   releaseITransaction.release   r@   r   c                    g r   r   r   s    r   runningITransaction.running   r@   r   c                    g)zadd 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.
Nr   r   categorycallbacks      r   
addpendingITransaction.addpending   r   r   c                    g)zhwrite pending file to temporary version

This is used to allow hooks to view a transaction before commitNr   r   s    r   writependingITransaction.writepending   r   r   c                    g)z0check is a callback already exist for a categoryNr   r   rS   s     r   hasfinalizeITransaction.hasfinalize   r   r   c                    g)zadd 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   rR   s      r   addfinalizeITransaction.addfinalize   r   r   c                    g)zadd 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.
Nr   rR   s      r   addpostcloseITransaction.addpostclose   r   r   c                    g)z1return a postclose callback added before, or NoneNr   r[   s     r   getpostcloseITransaction.getpostclose   r   r   c                    g)zadd 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.
Nr   rR   s      r   addabortITransaction.addabort   r   r   c                    g)zadds 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 transactionNr   rR   s      r   addvalidatorITransaction.addvalidator   r   r   c                    g)zcommit the transactionNr   r   s    r   closeITransaction.close   r   r   c                    g)zabort the transaction (generally called on error, or when the
transaction is not explicitly committed before going out of
scope)Nr   r   s    r   abortITransaction.abort   r   r   c                    g r   r   )r   vfs_idpaths      r   add_journalITransaction.add_journal   r@   r   r   N)returnbool)rx   None)r$   r   r%   intrx   rz   )Tr   F)
r$   r   r)   ry   r*   r   r+   zUnion[bool, int]rx   rz   )r   )r/   r   r*   r   rx   rz   )r   r   F)r3   bytesr4   zCollection[HgPathT]r5   r   r6   r{   r*   r   r7   ry   rx   rz   )r3   r|   rx   rz   )r$   r   rx   zOptional[int])rx   zList[JournalEntryT])s	   <unnamed>)rH   r|   rx   r   )rS   r   rT   zCallable[[ITransaction], None]rx   rz   )rS   r   rx   ry   )rS   r   rx   z(Optional[Callable[[ITransaction], None]])rt   r   ru   r   rx   rz   )!__name__
__module____qualname____firstlineno__propertyabcabstractmethodr   r   r    r&   r,   r0   r8   r;   r>   rB   rE   rI   rL   rO   rU   rX   r\   r_   rb   re   rh   rk   rn   rq   rv   __static_attributes__r   r   r   r   r   %   s      	D D 	D D 	D D 	 ',  	
 % 
 ( 	  	 #!! '! 	!
 ! ! ! 
! !F 	L L 	  	  	  	  	  	  	# 1 
	  	K K
 	? ? 	# 1 
	  	# 1 
	  	@)@	1@ @
 	# 1 
	  		C#	C 1	C 
		C 	C 	% % 	 
 	 r   r   )
__future__r   r   typingr   r   r   r   r   r	   r
   
_basetypesr   r   r   r{   JournalEntryTr   r   r   r   <module>r      sD    # 
    gsl#X8 Xr   