o ]Lb @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) helpcategory inferrepoc s\fdd}t|tdg7}t|}|s'ttdg} D] }|  |q-fdd|D}|D]}||vrRttd|qCt |sbttdd d i:|D]}|}|}|d <||qrWd n1swYWd d SWd d S1swYd 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)parentstextfiles filectxfnuserdateextrascommitT) rmemctxget transaction commitctxrupdate markcommittedclose)revcctxtrretrmessageoptsrepo1/usr/lib/python3/dist-packages/hgext/closehead.pydocommit3s   zclose_branch..docommitr sno revisions specifiedcsh|]}|qSr%)r).0h)r$r%r& Oszclose_branch..s revision is not an open head: %ds)no commit message specified with -l or -msclose1sbranchNr)r byteskwargstuplerrrevrangerAbortr branchmapextend branchheadsr logmessagewlocklockbranch) uir$revsr#r'headsr6rrr%r!r& close_branch"s>     ( r;N)__doc__ __future__rmercurial.i18nr mercurialrrrrrr r cmdtablecommand testedwith commitopts commitopts2 commitopts3CATEGORY_CHANGE_MANAGEMENTr;r%r%r%r&s$  $