def _checksubrepostate(pushop):
    """Ensure all outgoing referenced subrepo revisions are present locally"""
    for n in pushop.outgoing.missing:
        ctx = pushop.repo[n]
        if b'.hgsub' in ctx.manifest() and b'.hgsubstate' in ctx.files():
            for subpath in sorted(ctx.substate):
                sub = ctx.sub(subpath)
                sub.verify(onpush=True)
