#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys # Find depot_tools in PATH, append it to sys.path so we can import. paths = os.environ.get("PATH") for path in paths.split(':'): if not path.endswith("depot_tools"): continue sys.path.append(path) break import git_cl_hooks # Ensure we were called with the necessary number of arguments. program_name = os.path.basename(sys.argv[0]) if len(sys.argv) != 2: raise Exception("usage: %s [upstream branch]" % program_name) # Run the hooks library with our arguments. exec git_cl_hooks.RunHooks(hook_name=program_name, upstream_branch=sys.argv[1])