treestatus
author Connor Sheehan <sheehan@mozilla.com>
Wed, 14 Sep 2022 20:40:02 +0000
changeset 7872 f1e6b84a26b781973fbd32f228687db125711a06
parent 7541 525d21339c70db7268e6d9340a7dc46a96f79e94
permissions -rwxr-xr-x
hooks: add `.arcconfig` change blocking hook for `conduit-testing` repos (Bug 1789686) r=grammar,zeid Adds a hook to check that changes to `.arcconfig` files in `conduit-testing` repos do not revert the file from pointing to the dev Phabricator server. Differential Revision: https://phabricator.services.mozilla.com/D157342

#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os
import sys

HERE = os.path.abspath(os.path.dirname(__file__))

def main(args):
    if 'VIRTUAL_ENV' not in os.environ:
        activate = os.path.join(HERE, 'venv', 'bin', 'activate_this.py')
        with open(activate) as f:
            exec(f.read(), dict(__file__=activate))
        sys.executable = os.path.join(HERE, 'venv', 'bin', 'python')

    from mach.main import Mach

    m = Mach(os.getcwd())

    m.define_category('treestatus', 'Treestatus',
        'Control and interact with Treestatus', 50)
    import vcttesting.treestatus_mach_commands

    return m.run(args)

if __name__ == '__main__':
    sys.exit(main(sys.argv[1:]))