
    	^c                         d Z ddlmZ ddlmZ ddlmZ ddl	m
Z
mZmZmZmZmZmZ ddlmZ ddlmZ i Z ej        e          Z edd	d
            eddd
            eddd
           d ZddZdS )aw  changeset_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
    N)_)encodingerror	formatter
logcmdutilmailpycompat	registrar)dateutil   )notify   notify_published   domain)default   messageidseed   templatesA   Subject: changeset published

This changeset has been published.
c                    |                      dd          p|                      dd          }|                      dd          p|                      dd          }|                      dd          }t          j        |          }t          j        | ||          }|                                  t          j        | |d          }t                      }	|j	        D ]k\  }
}||	
                    |
           |                    d||                                          }t          |          r|	
                    |
           klt          |	          dk    r|                     d	           d S |                    ||                                |                      d
d          |j        |j                   |                                 }	 t'          j        |          }n+# t*          j        $ r}t/          j        |          d }~ww xY wt          j        |||          |d<   t          j        |||dz             |d<   t5          j        t9          j        d                    |d<   |d         sk|                      dd          p|                                 }d|vsd|v r|                    |          }t'          j         | ||j!        |j"                  |d<   d#                    tI          |	                    |d<   |%                                }| &                    dd          rC| '                    |           |(                    d          s| '                    d           d S d S | )                    tU          d          |                                z             t'          j+        | tY          j-        |d                   d         |	||j.                   d S )Nr   r   s   notifyr   r   s   incomings
   %r and %d:r   s=   notify_published: no subscribers to selected repo and revset
s   webs   baseurl)changesbaseurlrootwebrootzIn-reply-tos
   -publishedz
Message-Ids   %a, %d %b %Y %H:%M:%S %1%2)formatDateFroms   emails   from   @s
   @localhostz, Tos   test   
s&   notify_published: sending mail for %d
   )mbox)/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sortedas_bytes
configboolwriteendswithstatusr   sendmail
emailutils	parseaddrr   )uirepoctxdomainmessageidseedtemplatespec	templaternr&   subr(   datamsginstsendermsgtexts                    C/usr/lib/python3/dist-packages/hgext/hooklib/changeset_published.py_report_commitrU   <   s   YY*I66 "))9; ;F II-  0	9.	/	/  yy,k::H)(33D-b$==IMMOOOD+..A55DV  	T<HHSMMMyycggii88t99 	HHSMMM	 4yyA~~
M	
 	
 	
 	NN		&*--Y     <<>>D od##(      k$   )#v}EEC(V]]2 C ' =>>> CK v; I8W-->v&!8!8YYv&&F(VQZHHF		&,,''CIllnnG	}}Y(( 

&& 	HHUOOOOO	 	 			!>??#''))KLLL
$S[11!4dG!&	
 	
 	
 	
 	
 	
s   G" "H
1HH
c                    |dk    r6t          j        t          d          t          j        |          z            |                                |         }|d         dk    r|d         dk    rt          | ||           d S d S d S )Ns   txnclose-phases   Unsupported hook type %roldphases   draftphases   public)r   r2   r   r	   bytestr
unfilteredrU   )rE   rF   hooktypenodekwargsrG   s         rT   hookr^      s    $$$k)**X-=h-G-GG
 
 	
 //

D
!CjX%%&/Y*F*Fr4%%%%% &%*F*F    )N)__doc__email.errorserrorsr0   email.utilsutilsrC   mercurial.i18nr   	mercurialr   r   r   r   r   r	   r
   mercurial.utilsr    r   configtable
configitemrU   r^    r_   rT   <module>rl      s{  
   # " " " " "                                    % $ $ $ $ $      !Y!+..
 

   
 
   
 
   A
 A
 A
H& & & & & &r_   