File: //usr/lib/python3/dist-packages/hgext/hooklib/__pycache__/changeset_obsoleted.cpython-310.pyc
o
�]Lb� � @ s� d Z ddlmZ ddlmZ ddlmZ ddl m
Z
ddlmZm
Z
mZmZmZmZmZmZ ddlmZ ddlmZ i Ze�e�Zed d
dd� ed ddd� ed d
dd� dd� Zdd� Zddd�ZdS )a� changeset_obsoleted is a hook to send a mail when an
existing draft changeset is obsoleted by an obsmarker without successor.
Correct message threading requires the same messageidseed to be used for both
the original notification and the new mail.
Usage:
[notify]
messageidseed = myseed
[hooks]
txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook
� )�absolute_importN)�_)�encoding�error� formatter�
logcmdutil�mail�obsutil�pycompat� registrar)�dateutil� )�notify� notify_obsoleted� domain)�default�
messageidseed� templatesA Subject: changeset abandoned
This changeset has been abandoned.
c
C s\ | � dd�p| � dd�}| � dd�p| � dd�}| � dd�}t�|�}t�| ||�}| �� t�| |d�}t� } |j D ]!\}
}|d u rI| �
|
� q;|�d||�� �}t
|�r\| �
|
� q;q;t
| �dkrj| �d � d S |j||�� | � d
d�|j|jd� | �� }zt�|�}
W n tjy� } zt�|��d }~ww t�|||�|
d
<