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/hgext/hooklib/__pycache__/changeset_published.cpython-39.pyc
a

%0�_��@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
Csn|�dd�p|�dd�}|�dd�p.|�dd�}|�dd�}t�|�}t�|||�}|��t�||d�}t�}	|j	D]B\}
}|dur�|	�
|
�qv|�d||���}t
|�rv|	�
|
�qvqvt
|	�dkr�|�d	�dS|j||��|�d
d�|j|jd�|��}zt�|�}
Wn2tj�y@}zt�|��WYd}~n
d}~00t�|||�|
d
<t�|||d�|
d<t�tjdd��|
d<|
d�s�|�dd��p�|��}d|v�s�d|v�r�|�|�}t� |||j!|j"�|
d<d�#t$|	��|
d<t%j&�r�|
�'�n|
�(�}|�)dd��r0|�*|�|�+d��sj|�*d�n:|�,t-d�|���tj.|t/�0|
d�d|	||j1d�dS)Nrrsnotifyrrsincomings
%r and %d:rs=notify_published: no subscribers to selected repo and revset
swebsbaseurl)ZchangesZbaseurl�rootZwebrootzIn-reply-tos
-publishedz
Message-Ids%a, %d %b %Y %H:%M:%S %1%2)�formatZDateZFromsemailsfrom�@s
@localhostz, ZTostest�
s&notify_published: sending mail for %d
�)�mbox)2ZconfigrZliteral_templatespecrZchangesettemplaterZ
pushbufferr
Znotifier�set�subs�add�revsZrev�len�debugZshowZ	changesetrZ	popbufferrZ
parsebytes�emailerrorsZMessageParseErrorr�AbortZ	messageidrZstrfromlocalrZdatestrZusernameZfixmailZ
addressencodeZcharsets�test�join�sortedr	Zispy3Zas_bytesZ	as_stringZ
configbool�write�endswithZstatusrZsendmail�
emailutilsZ	parseaddrr)�ui�repo�ctxZdomainZ
messageidseed�template�specZ	templater�nr�subr�data�msg�instZsenderZmsgtext�r1�C/usr/lib/python3/dist-packages/hgext/hooklib/changeset_published.py�_report_commit9sz��
�


�
� 
�
�


�r3cKsT|dkr t�td�t�|���|��|}|ddkrP|ddkrPt|||�dS)Nstxnclose-phasesUnsupported hook type %rZoldphasesdraftZphasespublic)rr rr	ZbytestrZ
unfilteredr3)r'r(ZhooktypeZnode�kwargsr)r1r1r2�hook}s�r5)N)�__doc__Z
__future__rZemail.errors�errorsrZemail.utilsZutilsr&Zmercurial.i18nrZ	mercurialrrrrrr	r
Zmercurial.utilsr�r
ZconfigtableZ
configitemr3r5r1r1r1r2�<module>s,$	
���
D