o ]Lb@s:dZddlmZddlmZddlmZmZdddZdS) aBreject_new_heads is a hook to check that branches touched by new changesets have at most one open head. It can be used to enforce policies for merge-before-push or rebase-before-push. It does not handle pre-existing hydras. Usage: [hooks] pretxnclose.reject_new_heads = python:hgext.hooklib.reject_new_heads.hook )absolute_import)_)errorpycompatNc Ks|dkrttdt|||}t}|jj| dD] }||}| | q"|D]}t |d|dkrJttdt|q2dS)Ns pretxnclosesUnsupported hook type %r)startz&head() and not closed() and branch(%s)s/Changes on branch %r resulted in multiple heads) rAbortrrbytestr unfilteredset changelogrevsrevaddbranchlen) uirepohooktypenodekwargsctxbranchesrrr@/usr/lib/python3/dist-packages/hgext/hooklib/reject_new_heads.pyhooks$ r)N) __doc__ __future__rmercurial.i18nr mercurialrrrrrrrs