HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/hgext/hooklib/__pycache__/changeset_obsoleted.cpython-310.pyc
o

�]Lb��@s�dZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZmZddlmZddlmZiZe�e�Zed	d
dd�ed	ddd�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�templatesASubject: changeset abandoned

This changeset has been abandoned.
c
Cs\|�dd�p|�dd�}|�dd�p|�dd�}|�dd�}t�|�}t�|||�}|��t�||d�}t�}	|j	D]!\}
}|durI|	�
|
�q;|�d||���}t
|�r\|	�
|
�q;q;t
|	�dkrj|�d	�dS|j||��|�d
d�|j|jd�|��}zt�|�}
Wntjy�}zt�|��d}~wwt�|||�|
d
<t�|||d�|
d<t�tjdd��|
d<|
ds�|�dd�p�|��}d|vs�d|vr�|�|�}t� |||j!|j"�|
d<d�#t$|	��|
d<t%j&r�|
�'�n|
�(�}|�)dd��r|�*|�|�+d��s
|�*d�dSdS|�,t-d�|���tj.|t/�0|
d�d|	||j1d�dS)Nrrsnotifyrrsincomings
%r and %d:rs=notify_obsoleted: no subscribers to selected repo and revset
swebsbaseurl)�changes�baseurl�root�webrootzIn-reply-tos
-obsoletedz
Message-Ids%a, %d %b %Y %H:%M:%S %1%2)�format�Date�Fromsemailsfrom�@s
@localhostz, �Tostest�
s&notify_obsoleted: sending mail for %d
�)�mbox)2�configr�literal_templatespecr�changesettemplater�
pushbufferr�notifier�set�subs�add�revs�rev�len�debug�show�	changesetr�	popbufferr�
parsebytes�emailerrors�MessageParseErrorr�Abort�	messageidr�strfromlocalr�datestr�username�fixmail�
addressencode�charsets�test�join�sortedr
�ispy3�as_bytes�	as_string�
configbool�write�endswith�statusr�sendmail�
emailutils�	parseaddrr)�ui�repo�ctx�domain�
messageidseed�template�spec�	templater�nr&�subr(�data�msg�inst�sender�msgtext�rV�C/usr/lib/python3/dist-packages/hgext/hooklib/changeset_obsoleted.py�_report_commit>s���
�


��
�
��
�
�

�
�rXcs"t�fdd�t�|j�g�D��S)Nc3s�|]	}|�kr|VqdS�NrV)�.0�r�r)rVrW�	<genexpr>�s��z has_successor.<locals>.<genexpr>)�anyr	�
allsuccessors�obsstore)rHr)rVr\rW�
has_successor�s�racKsb|dkrt�td�t�|���tj||dd�D]}|��|}t||�	��s.t
|||�qdS)NstxnclosesUnsupported hook type %rr)r)rr2rr
�bytestrr	�getobsoleted�
unfilteredra�noderX)rGrH�hooktypere�kwargsr)rIrVrVrW�hook�s���rhrY)�__doc__�
__future__r�email.errors�errorsr0�email.utils�utilsrE�mercurial.i18nr�	mercurialrrrrrr	r
r�mercurial.utilsr�r�configtable�
configitemrXrarhrVrVrVrW�<module>s8(

���
D