File: //usr/lib/python3/dist-packages/hgext/hooklib/__pycache__/enforce_draft_commits.cpython-310.pyc
o
�]Lb� � @ s: d Z ddlmZ ddlmZ ddlmZmZ ddd�ZdS ) a� enforce_draft_commits us a hook to ensure that all new changesets are
in the draft phase. This allows enforcing policies for work-in-progress
changes in overlay repositories, i.e. a shared hidden repositories with
different views for work-in-progress code and public history.
Usage:
[hooks]
pretxnclose-phase.enforce_draft_commits = python:hgext.hooklib.enforce_draft_commits.hook
� )�absolute_import)�_)�error�pycompatNc K s� |dkrt �td�t�|� ��|�� | }|d r0t �td�t�|d �t�|d �|f ��|d dkrFt �td�|t�|d �f ��d S )Ns pretxnclose-phases Unsupported hook type %r�oldphases* Phase change from %r to %r for %s rejected�phases drafts% New changeset %s in phase %r rejected)r �Abortr r �bytestr�
unfiltered)�ui�repo�hooktype�node�kwargs�ctx� r �E/usr/lib/python3/dist-packages/hgext/hooklib/enforce_draft_commits.py�hook s* �������r )N) �__doc__�
__future__r �mercurial.i18nr � mercurialr r r r r r r �<module> s