# hgrc/draft -- repository configuration for work-in-progress draft
# changesets before they are committed to the public history

[extensions]
clonebundles =
evolve =
topic =

[phases]
# Keep draft-phase changesets pushed here as such -- don't transition
# them to public-phase.
publish = false

[server]
# Serve public-phase and draft-phase changesets, but not secret-phase
# changesets and not obsolete changesets.
view = visible

[notify]
# Work around bug where hg does
#       int(self.ui.config(b'notify', b'strip'))
# which crashes when notify.strip is undefined.  Will be fixed in
# Mercurial by doing
#       self.ui.configint(b'notify', b'strip')
# instead, which returns 0 in that case rather than crashing, but that
# hasn't been released yet as of Mercurial 7.1.1.
strip = 0

[acl]
# Apply ACLs to all sources.  Sync with hgrc/public.
sources = serve push pull bundle

[acl.deny]
# Deny files that might cause trouble in other revision control
# systems.  Can't put .hg in here because of:
#
# Mercurial issue 10039: hg allows changesets affecting files called .hg
# https://foss.heptapod.net/mercurial/mercurial-devel/-/issues/10039
#
# Sync with hgrc/public.
#
**/.cvsignore/** = *
**/.darcs = *
**/.darcs/** = *
**/.git = *
**/.git/** = *
**/.gitignore/** = *
**/.ignore/** = *
**/.pijul = *
**/.pijul/** = *
**/.svn = *
**/.svn/** = *
**/CVS = *
**/CVS/** = *
**/RCS = *
**/RCS/** = *
**/_darcs = *
**/_darcs/** = *

[hooks]
# Require authorship to match login name.
pretxnchangegroup.require_user_login = python:netbsd_hghooks.require_user_login.hook

# Apply access control lists.
pretxnchangegroup.acl = python:hgext.acl.hook
pretxnchangegroup.aclbranchpat = python:netbsd_hghooks.aclbranchpat.hook

# Reject files that collide in normalization or case, so that this
# repository can be safely checked out on, e.g., macOS HFS+ or APFS.
pretxnchangegroup.reject_normcasecollision = python:netbsd_hghooks.reject_normcasecollision.hook

# Reject files called `.hg' or files under a `.hg/' directory.
pretxnchangegroup.reject_hgmeta = python:netbsd_hghooks.reject_hgmeta.hook

# Accept only draft changesets.
pretxnclose-phase.enforce_draft_commits = python:hgext.hooklib.enforce_draft_commits.hook

# Require changesets to have a topic.
pretxnclose-phase.enforce_topic = python:netbsd_hghooks.enforce_topic.hook

# Notify on transition from draft to public.
#
# XXX Shouldn't draft to public be done only in the public view, since
# you can't make things public in this view anyway?
#
# XXX Shouldn't we notify on transition from draft to
# obsolete-without-successor?
txnclose-phase.changeset_published = python:hgext.hooklib.changeset_published.hook
#txnclose.changeset_obsoleted = python:/etc/mercurial/changeset_obsoleted.py:hook

# Tell git it's time to fetch when we have new changesets.
txnclose.gitmirror = python:netbsd_hghooks.gitmirror.hook

# Obsolete a topic's changesets when a git user force-pushes to it.
pretxnclose.git_amend_topic = python:netbsd_hghooks.git_amend_topic.hook
