# hgrc/public -- repository configuration for public committed history

[extensions]
clonebundles =
evolve =
topic =

[phases]
# Any draft-phase changesets pushed here transition to public-phase.
publish = true

[server]
# Serve only public changesets -- don't serve draft-phase changesets
# (or secret-phase, of which there should be none; and certainly not
# hidden changesets, which should not be possible for public-phase).
view = immutable

[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/draft.
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/draft.
#
**/.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
pretxnclose-phase.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

# Reject merge commits on a branch.  We only do linear history for now.
pretxnchangegroup.reject_merge_commits = python:hgext.hooklib.reject_merge_commits.hook

# Reject new heads on existing branches.  Developers must rebase local
# changes before pushing.
pretxnclose.reject_new_heads = python:netbsd_hghooks.reject_new_heads.hook

# Reject bookmarks.
prepushkey.reject_bookmarks = python:netbsd_hghooks.reject_bookmarks.hook

# Notify on transition from draft to public or to
# obsolete-without-successor.
#
# XXX Shouldn't draft to obsolete-without-successor be done in the
# draft view?
txnclose-phase.changeset_published = python:hgext.hooklib.changeset_published.hook
txnclose.changeset_obsoleted = python:hgext.hooklib.changeset_obsoleted.hook

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