
    	^c
                        d Z ddlmZ ddlmZmZmZmZmZm	Z	m
Z
 i Z e
j        e          ZdZej        Zej        Zddg  ed           ed          fgZ ed	eez   ez    ed
          ej        d          d             ZdS )z5close arbitrary heads without checking them out first    )_)	bookmarkscmdutilcontexterror
logcmdutilpycompat	registrars   ships-with-hg-core   r   revs   revision to checks   REVs   close-head|close-headss   [OPTION]... [REV]...T)helpcategory	inferrepoc                   	
 	
fd}t          j                  |t                              dg                     z  }t	          j        |          }|s!t          j        t          d                    g }	                                D ]*}|
                                        |                     +fd|D             }|D ]*}||vr$t          j        t          d          |z            +t          j        |           

s!t          j        t          d                    ddi	                                5                                  5  |D ].}|         }|                                }|	d	<    ||           /	 d
d
d
           n# 1 swxY w Y   d
d
d
           n# 1 swxY w Y   dS )a	  close the given head revisions

    This is equivalent to checking out each revision in a clean tree and running
    ``hg commit --close-branch``, except that it doesn't change the working
    directory.

    The commit message must be specified with -l or -m.
    c                 h   t          j        | d gg d                     d                              d                    }                    d          }                    |d          }t          j        | d g|           |                    |           |                                 d S )Ns   users   date)parentstextfiles	filectxfnuserdateextras   commitT)	r   memctxgettransaction	commitctxr   updatemarkcommittedclose)revcctxtrretr   messageoptsrepos       1/usr/lib/python3/dist-packages/hgext/closehead.pydocommitzclose_branch.<locals>.docommit2   s    ~$K'""'""	
 	
 	
 i((nnT4((T{C0003





    r   s   no revisions specifiedc                 D    h | ]}|                                          S  )r   ).0hr%   s     r&   	<setcomp>zclose_branch.<locals>.<setcomp>N   s%    ***qT!W[[]]***r(   s    revision is not an open head: %ds)   no commit message specified with -l or -ms   close   1s   branchNr   )r	   byteskwargstupler   r   revranger   Abortr   	branchmapextendbranchheadsr   
logmessagewlocklockbranch)uir%   revsr$   r'   headsr9   r   rr   r#   s    ` `     @@r&   close_branchr>   !   s{   "       " %%DE$((62&&'''DtT**D 8k!566777E.."" / /T%%f--....****E***E L Le+a CDDsJKKK   T**G Kk!HIIJJJtE	  tyy{{   	 	CS	AXXZZF%E)HQKKKK		                              1s6   F6 2FF6F#	#F6&F#	'F66F:=F:N)__doc__mercurial.i18nr   	mercurialr   r   r   r   r   r	   r
   cmdtablecommand
testedwith
commitoptscommitopts2commitopts3CATEGORY_CHANGE_MANAGEMENTr>   r*   r(   r&   <module>rI      s1   < ;                        
)
H
%
%
 #

!fb!!$8"9"911V99EF 	{*A3  6 6 6 6 6r(   