
    6h                        S r SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJrJrJrJrJrJrJrJr  SSKJrJr  SSKJr  0 r\R4                  " \5      r\" S	S
SS9  \" S	SSS9  \" S	SSS9  S rS rSS jrg)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
    )annotationsN)_)encodingerror	formatter
logcmdutilmailobsutilpycompat	registrar)dateutil
stringutil   )notify   notify_obsoleted   domain)default   messageidseed   templatesA   Subject: changeset abandoned

This changeset has been abandoned.
c                   U R                  SS5      =(       d    U R                  SS5      nU R                  SS5      =(       d    U R                  SS5      nU R                  SS5      n[        R                  " U5      n[        R                  " XU5      nU R                  5         [        R                  " XS5      n[        5       n	UR                   H^  u  pUc  U	R                  U
5        M  UR                  SXbR                  5       5      n[        U5      (       d  MM  U	R                  U
5        M`     [        U	5      S:X  a  U R                  S	5        g UR                  UUR!                  5       U R                  S
S5      UR"                  UR"                  S9  U R%                  5       n [&        R(                  " U5      n[        R6                  " X#U5      US'   [        R6                  " X#US-   5      US'   [8        R:                  " [<        R>                  " SS95      US'   US   (       du  U R                  SS5      =(       d    U RA                  5       nSU;  d  SU;   a  URC                  U5      n[&        RD                  " XURF                  URH                  5      US'   SRK                  [M        U	5      5      US'   URO                  5       nU RQ                  SS5      (       a:  U RS                  U5        URU                  S5      (       d  U RS                  S5        g g U RW                  [Y        S5      UR                  5       -  5        [&        RZ                  " U [\        R^                  " US   5      S   U	UUR`                  S9  g ! [*        R,                   a/  n[.        R0                  " [2        R4                  " U5      5      eS nAff = f)Nr   r   s   notifyr   r   s   incomings
   %r and %d:r   s=   notify_obsoleted: no subscribers to selected repo and revset
s   webs   baseurl)changesbaseurlrootwebrootzIn-reply-tos
   -obsoletedz
Message-Ids   %a, %d %b %Y %H:%M:%S %1%2)formatDateFroms   emails   from   @s
   @localhostz, Tos   test   
s&   notify_obsoleted: sending mail for %d
   )mbox)1configr   literal_templatespecr   changesettemplater
pushbufferr   notifiersetsubsaddrevsrevlendebugshow	changesetr   	popbufferr	   
parsebytesemailerrorsMessageParseErrorr   Abortr   forcebytestr	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_obsoleted.py_report_commitrY   A   s   YY*I6 "))9;F II- 0	9.	/  yy,k:H))(3D--b=IMMO+.A5DVV	<HHSMyyggi8t99HHSM  4yA~
M	
 	NN		&*-YY   <<>D9ood#  ))#}EC((]]2C '' =>CK v;8W->v&!8YYv&F((QZZHF		&,'CIllnG	}}Y((
&&HHUO ' 			!>?#'')KL
$$S[1!4dG!&&	
1 (( 9kk*11$7889s   ,N	 	O*OOc                n   ^ [        U4S j[        R                  " U R                  T/5       5       5      $ )Nc              3  6   >#    U  H  oT:w  d  M
  Uv   M     g 7fN ).0rr,   s     rX   	<genexpr> has_successor.<locals>.<genexpr>   s      >as(>s   		)anyr
   allsuccessorsobsstore)rJ   r,   s    `rX   has_successorre      s0     ((>      c                6   US:w  a6  [         R                  " [        S5      [        R                  " U5      -  5      e[
        R                  " XS   S9 HB  nUR                  5       U   n[        XR                  5       5      (       a  M6  [        XU5        MD     g )Ns   txncloses   Unsupported hook type %rr   )r   )r   r5   r   r   bytestrr
   getobsoleted
unfilteredre   noderY   )rI   rJ   hooktyperk   kwargsr,   rK   s          rX   hookrn      s}    ;kk)*X-=-=h-GG
 	
 ##D2CDoo$T88:..2S) Erf   r\   )__doc__
__future__r   email.errorserrorsr3   email.utilsutilsrG   mercurial.i18nr   	mercurialr   r   r   r   r	   r
   r   r   mercurial.utilsr   r    r   configtable
configitemrY   re   rn   r]   rf   rX   <module>r{      s   
 # "   	 	 	 !!+.
 

 
 A
H*rf   