Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: git-cl-upload-hook

Issue 6646009: update git-cl for OWNERS file support via .git/hooks/pre-cl-* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: clean up after running owners-related git-cl tests Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | git_cl/git_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git-cl-upload-hook
diff --git a/git-cl-upload-hook b/git-cl-upload-hook
index f8d860258680ce9cb3b76e2c0f5fe87125b5b5dd..8bc194c9a607f95acb3d4dc952088048f0a85312 100755
--- a/git-cl-upload-hook
+++ b/git-cl-upload-hook
@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import optparse
import os
import sys
from subprocess import Popen, PIPE
@@ -42,11 +43,18 @@ except ImportError:
print "ERROR: Make sure %s is up-to-date and try again." % depot_tools_path
sys.exit(1)
-# Ensure we were called with the necessary number of arguments.
-program_name = os.path.basename(sys.argv[0])
-if len(sys.argv) != 2:
- print "usage: %s [upstream branch]" % program_name
- sys.exit(1)
+parser = optparse.OptionParser()
+parser.set_usage('%prog [options] <upstream-branch>')
+parser.add_option('--tbr', action='store_true', default=False,
+ help='skip checks for reviewers, owners')
+parser.add_option('--host-url', default=None,
+ help='scheme, origin, and port for Rietveld server')
+options, args = parser.parse_args()
+if len(args) != 1:
+ parser.print_help()
+ sys.exit(1)
# Run the hooks library with our arguments.
-exec git_cl_hooks.RunHooks(hook_name=program_name, upstream_branch=sys.argv[1])
+exec git_cl_hooks.RunHooks(hook_name=parser.get_prog_name(),
+ upstream_branch=args[0],
+ cmd_line_options=options)
« no previous file with comments | « no previous file | git_cl/git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698