a +b @sdZddlmZddlmZddlmZmZmZm Z m Z m Z m Z iZ e e ZdZejZejZddgeded fgZed eeeed ejd d ddZdS)z5close arbitrary heads without checking them out first)absolute_import)_) bookmarkscmdutilcontexterror logcmdutilpycompat registrarsships-with-hg-corerrevsrevision to checksREVsclose-head|close-headss[OPTION]... [REV]...T)Z helpcategoryZ inferrepoc sNfdd}t|tdg7}t|}|sNttdg} D]}|  |qZfdd|D}|D]}||vrttd|qt |sttdd d id:|D]$}|}|}|d <||qWd n1s 0YWd n1s@0Yd 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 shtj|dggdddd}d}|d}t|dg||||dS)Nsusersdate)parentstextfilesZ filectxfnuserdateextrascommitT) rZmemctxgetZ transactionZ commitctxrupdateZ markcommittedclose)revZcctxtrretrmessageoptsrepo5/usr/lib64/python3.9/site-packages/hgext/closehead.pydocommit3s   zclose_branch..docommitr sno revisions specifiedcsh|]}|qSr)r).0h)rrr Ozclose_branch..s revision is not an open head: %ds)no commit message specified with -l or -msclose1sbranchNr)r Z byteskwargstuplerrZrevrangerZAbortrZ branchmapextendZ branchheadsrZ logmessageZwlocklockbranch) ZuirZrevsrrZheadsr(rrrrr close_branch"s0    Jr*N)__doc__Z __future__rZmercurial.i18nrZ mercurialrrrrrr r ZcmdtableZcommandZ testedwithZ commitoptsZ commitopts2Z commitopts3ZCATEGORY_CHANGE_MANAGEMENTr*rrrrs"  $