File: //usr/lib/python3/dist-packages/mercurial/__pycache__/hook.cpython-310.pyc
o
�]Lb. � @ s� d dl mZ d dlZd dlZd dlZd dlZddlmZ ddlm Z ddl
mZmZm
Z
mZmZmZ ddlmZmZmZ dd � Zd
d� Ze� Zdd
� Zddd�Zdadd� Zdd� Zddd�Zejdd� �Zddd�Z dS )� )�absolute_importN� )�_)�getattr)�demandimport�encoding�error�
extensions�pycompat�util)�procutil�resourceutil�
stringutilc
C sp t |�r|}t�|jd |j �}n�|�d�}|dkr&t�td�||f ��|d|� } t j
}
t�� rLt
j
�| �\}}|rL|rLt j
dd� |g t _
|} t�� �o z tt�| ��}W n] ttfy� t �� }
ztdt�| � �}W nB ttfy� t �� }| jr�| �td�� | �|
� | jr�| �td�� | �|� | js�td �}nd}tjtd
�|| f |d��w Y nw W d � n1 s�w Y |
t _
z|�d�dd� D ]}t||�}q�W n ty� t�td
�||f ��w t |�s�t�td�||f ��| �td�||f � t�� }z}z|d| ||d�t�|���}W n[ t�yz } zNt |tj!��r>| �td�||j"d f � n| �td�|t#�$|�f � |�rP� | j�s[| �td�� | �� W Y d}~W t�� | }| �%dd|||� dS d}~ww W t�� | }| �%dd|||� nt�� | }| �%dd|||� w |�r�|�r�t�&td�| ��| �td�| � |dfS )a� call python hook. hook is callable object, looked up as
name in python module. if callable returns "true", hook
fails, else passes. if hook raises exception, treated as
hook failure. exception propagates if throw is "true".
reason for "true" meaning "hook failed" is so that
unmodified commands (e.g. mercurial.commands.update) can
be run as hooks without wrappers to convert return values.�.� .���s( %s hook is invalid: "%s" not in a moduleNzhgext_%ss, exception from first failed import attempt:
s- exception from second failed import attempt:
s$ run with --traceback for stack traces) %s hook is invalid: import of "%s" failed��hintr s'