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_published.cpython-310.pyc
o

�]Lb��@s�dZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZddlmZddlmZiZe�e�Zed	d
dd�ed	ddd�ed	d
dd�dd�Zddd�ZdS)awchangeset_published is a hook to send a mail when an
existing draft changeset is moved to the public phase.

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-phase.changeset_published =     python:hgext.hooklib.changeset_published.hook
�)�absolute_importN)�_)�encoding�error�	formatter�
logcmdutil�mail�pycompat�	registrar)�dateutil�)�notify�notify_published�domain)�default�
messageidseed�templatesASubject: changeset published

This changeset has been published.
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_published: no subscribers to selected repo and revset
swebsbaseurl)�changes�baseurl�root�webrootzIn-reply-tos
-publishedz
Message-Ids%a, %d %b %Y %H:%M:%S %1%2)�format�Date�Fromsemailsfrom�@s
@localhostz, �Tostest�
s&notify_published: 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�rU�C/usr/lib/python3/dist-packages/hgext/hooklib/changeset_published.py�_report_commit=s���
�


��
�
��
�
�

�
�rWcKs\|dkrt�td�t�|���|��|}|ddkr*|ddkr,t|||�dSdSdS)Nstxnclose-phasesUnsupported hook type %r�oldphasesdraft�phasespublic)rr1rr	�bytestr�
unfilteredrW)rFrG�hooktype�node�kwargsrHrUrUrV�hook�s��r_)N)�__doc__�
__future__r�email.errors�errorsr/�email.utils�utilsrD�mercurial.i18nr�	mercurialrrrrrr	r
�mercurial.utilsr�r
�configtable�
configitemrWr_rUrUrUrV�<module>s6$	
���
D