HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/fastimport/__pycache__/processor.cpython-39.pyc
a

�+yW��@sPdZddlZddlZddlmZddlmZGdd�de�ZGdd�de�Z	dS)	a$Processor for fast-import commands.

This module provides the skeleton of a fast-import backend.
To import from a fast-import stream to your version-control system:

 - derive a class from the abstract ImportProcessor class and
   implement the *_helper methods.

 - parse a fast-import stream into a sequence of commands, for example
   using the helpers from the parser module.

 - pass that command sequence to the process method of your processor.

See git-fast-import.1 for the meaning of each command and the
processors package for examples.
�N)�errors)�	newobjectc@s�eZdZdZgZd(dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))�ImportProcessorz�Base class for fast-import stream processors.

    Subclasses should override the pre_*, post_* and *_handler
    methods as appropriate.
    NFcCsF|durtj|_n||_||_|dur.i|_n||_|��d|_dS)NF)�sys�stdout�outf�verbose�params�validate_parameters�finished)�selfr	rr�r
�6/usr/lib/python3/dist-packages/fastimport/processor.py�__init__0s
zImportProcessor.__init__cCs(|jD]}||jvrt�||j��qdS)z5Validate that the parameters are correctly specified.N)r	�known_paramsrZUnknownParameter)r�pr
r
rr
@s

z#ImportProcessor.validate_parameterscCs|�|�dS)z�Import data into Bazaar by processing a stream of commands.

        :param command_iter: an iterator providing commands
        N)�_process)r�command_iterr
r
r�processFszImportProcessor.processc	Cs�|��|�D]l}z |jd�d�}t|j|�}WntyPt�|j��Yn 0|�|�|||�|�	|�|j
rq|q|��dS)N�_handler�utf8)�pre_process�name�decode�getattr�	__class__�KeyErrorr�MissingHandler�pre_handler�post_handlerr�post_process)rr�cmdr�handlerr
r
rrMs



zImportProcessor._processcGsdS)z"Output a warning but timestamp it.Nr
�r�msg�argsr
r
r�warning]szImportProcessor.warningcGsdS)zOutput a debug message.Nr
)rZmgsr%r
r
r�debugaszImportProcessor.debugcCs
t�d�S)zTime of day as a string.z%H:%M:%S)�time�strftime�rr
r
r�_time_of_dayeszImportProcessor._time_of_daycCsdS)z&Hook for logic at start of processing.Nr
r*r
r
rrjszImportProcessor.pre_processcCsdS)z$Hook for logic at end of processing.Nr
r*r
r
rr nszImportProcessor.post_processcCsdS)z*Hook for logic before each handler starts.Nr
�rr!r
r
rrrszImportProcessor.pre_handlercCsdS)z+Hook for logic after each handler finishes.Nr
r,r
r
rrvszImportProcessor.post_handlercCst|j��dS)zProcess a ProgressCommand.N)�NotImplementedError�progress_handlerr,r
r
rr.zsz ImportProcessor.progress_handlercCst|j��dS)zProcess a BlobCommand.N)r-�blob_handlerr,r
r
rr/~szImportProcessor.blob_handlercCst|j��dS)zProcess a CheckpointCommand.N)r-�checkpoint_handlerr,r
r
rr0�sz"ImportProcessor.checkpoint_handlercCst|j��dS)zProcess a CommitCommand.N)r-�commit_handlerr,r
r
rr1�szImportProcessor.commit_handlercCst|j��dS)zProcess a ResetCommand.N)r-�
reset_handlerr,r
r
rr2�szImportProcessor.reset_handlercCst|j��dS)zProcess a TagCommand.N)r-�tag_handlerr,r
r
rr3�szImportProcessor.tag_handlercCst|j��dS)zProcess a FeatureCommand.N)r-�feature_handlerr,r
r
rr4�szImportProcessor.feature_handler)NFN)�__name__�
__module__�__qualname__�__doc__rrr
rrr&r'r+rr rrr.r/r0r1r2r3r4r
r
r
rr's(
rc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�
CommitHandlerz�Base class for commit handling.

    Subclasses should override the pre_*, post_* and *_handler
    methods as appropriate.
    cCs
||_dS)N)�command)rr:r
r
rr�szCommitHandler.__init__c	Csv|��|j��D]V}z(|jdd�d�d�}t|j|�}Wnty\t�	|j��Yq0|||�q|�
�dS)N�rr)�pre_process_filesr:Z
iter_filesrrrrrrr�post_process_files)rZfcrr"r
r
rr�szCommitHandler.processcGsdS)z!Output a warning but add context.Nr
r#r
r
rr&�szCommitHandler.warningcCsdS)zPrepare for committing.Nr
r*r
r
rr<�szCommitHandler.pre_process_filescCsdS)zSave the revision.Nr
r*r
r
rr=�sz CommitHandler.post_process_filescCst|j��dS)zHandle a filemodify command.N)r-�modify_handler�rZfilecmdr
r
rr>�szCommitHandler.modify_handlercCst|j��dS)zHandle a filedelete command.N)r-�delete_handlerr?r
r
rr@�szCommitHandler.delete_handlercCst|j��dS)zHandle a filecopy command.N)r-�copy_handlerr?r
r
rrA�szCommitHandler.copy_handlercCst|j��dS)zHandle a filerename command.N)r-�rename_handlerr?r
r
rrB�szCommitHandler.rename_handlercCst|j��dS)zHandle a filedeleteall command.N)r-�deleteall_handlerr?r
r
rrC�szCommitHandler.deleteall_handlerN)r5r6r7r8rrr&r<r=r>r@rArBrCr
r
r
rr9�sr9)
r8rr(Z
fastimportrZfastimport.helpersr�objectrr9r
r
r
r�<module>sp