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

Unified Diff: git_cl.py

Issue 7484002: Fix git-cl --contributor flag support for presubmit checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fixed whth --contributor is not used, duh Created 9 years, 5 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 | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index e59749f7710dcf8b43d308ec7e00777cadf3c033..42afb630d7fa6375e4aec355881c594f459abcd2 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -532,7 +532,7 @@ or verify this branch is set up to track another (via the --track argument to
'%s...' % (upstream_branch)]).strip()
if not author:
- author = RunGit(['config', 'user.email']).strip()
+ author = RunGit(['config', 'user.email']).strip() or None
change = presubmit_support.GitChange(
name,
description,
@@ -1064,6 +1064,11 @@ def SendUpstream(parser, args, cmd):
# Default to merging against our best guess of the upstream branch.
args = [cl.GetUpstreamBranch()]
+ if options.contributor:
+ if not re.match('^.*\s<\S+@\S+>$', options.contributor):
+ print "Please provide contibutor as 'First Last <email@example.com>'"
+ return 1
+
base_branch = args[0]
# Make sure index is up-to-date before running diff-index.
@@ -1095,9 +1100,12 @@ def SendUpstream(parser, args, cmd):
return 1
if not options.bypass_hooks and not options.force:
+ author = None
+ if options.contributor:
+ author = re.search(r'\<(.*)\>', options.contributor).group(1)
cl.RunHook(committing=True, upstream_branch=base_branch,
may_prompt=True, verbose=options.verbose,
- author=options.contributor)
+ author=author)
if cmd == 'dcommit':
# Check the tree status if the tree status URL is set.
@@ -1123,9 +1131,6 @@ def SendUpstream(parser, args, cmd):
description += "\n\nReview URL: %s" % cl.GetIssueURL()
if options.contributor:
- if not re.match('^.*\s<\S+@\S+>$', options.contributor):
- print "Please provide contibutor as 'First Last <email@example.com>'"
- return 1
description += "\nPatch from %s." % options.contributor
print 'Description:', repr(description)
« no previous file with comments | « gclient_scm.py ('k') | tests/gclient_scm_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698