Commit 549cbbcd authored by wkorman's avatar wkorman Committed by Commit bot

Remove optional --commit-author argument from auto-rebaseline script.

The bot now uses 'git config' to explicitly set the intended
author/committer user name and email before running the script, rather
than routing through the rebaseline script itself.

BUG=594817,589140

Review URL: https://codereview.chromium.org/1809723002

Cr-Commit-Position: refs/heads/master@{#381776}
parent 5fbdd015
......@@ -265,12 +265,10 @@ class Git(SCM):
raise ScriptError(message="Can't find a branch to diff against. %s does not exist" % remote_master_ref)
return remote_master_ref
def commit_locally_with_message(self, message, commit_all_working_directory_changes=True, author=None):
def commit_locally_with_message(self, message, commit_all_working_directory_changes=True):
command = ['commit', '-F', '-']
if commit_all_working_directory_changes:
command.insert(1, '--all')
if author:
command.insert(1, "--author='%s'" % (author))
self._run_git(command, input=message)
# These methods are git specific and are meant to provide support for the Git oriented workflow
......
......@@ -136,6 +136,6 @@ class SCM:
def supports_local_commits():
SCM._subclass_must_implement()
def commit_locally_with_message(self, message, commit_all_working_directory_changes=True, author=None):
def commit_locally_with_message(self, message, commit_all_working_directory_changes=True):
_log.error("Your source control manager does not support local commits.")
sys.exit(1)
......@@ -92,8 +92,8 @@ class MockSCM(object):
def timestamp_of_revision(self, path, revision):
return '2013-02-01 08:48:05 +0000'
def commit_locally_with_message(self, message, commit_all_working_directory_changes=True, author=None):
self._local_commits.append([message, commit_all_working_directory_changes, author])
def commit_locally_with_message(self, message, commit_all_working_directory_changes=True):
self._local_commits.append([message, commit_all_working_directory_changes])
pass
def local_commits(self):
......
......@@ -687,8 +687,6 @@ class AutoRebaseline(AbstractParallelRebaselineCommand):
# FIXME: Remove this option.
self.results_directory_option,
optparse.make_option("--auth-refresh-token-json", help="Rietveld auth refresh JSON token."),
optparse.make_option("--commit-author",
help='Optionally specify an explicit author for local commit. Format as "Name <email>".'),
optparse.make_option("--dry-run", action='store_true', default=False,
help='Run without creating a temporary branch, committing locally, or uploading/landing '
'changes to the remote repository.')
......@@ -903,8 +901,7 @@ class AutoRebaseline(AbstractParallelRebaselineCommand):
return
tool.scm().commit_locally_with_message(
self.commit_message(author, revision, commit, bugs),
author=options.commit_author)
self.commit_message(author, revision, commit, bugs))
# FIXME: It would be nice if we could dcommit the patch without uploading, but still
# go through all the precommit hooks. For rebaselines with lots of files, uploading
......
......@@ -1422,20 +1422,6 @@ Bug(foo) [ Linux Win ] fast/dom/prototype-taco.html [ NeedsRebaseline ]
],
auth_refresh_token_json=RIETVELD_REFRESH_TOKEN)
def test_execute_with_commit_author(self):
COMMIT_AUTHOR = "JRR Tolkien <tolkien@greyhavens.org>"
self._basic_execute_test(
[
['git', 'cl', 'upload', '-f'],
['git', 'pull'],
['git', 'cl', 'land', '-f', '-v'],
['git', 'config', 'branch.auto-rebaseline-temporary-branch.rietveldissue'],
], commit_author=COMMIT_AUTHOR)
self.assertEqual(self.tool.scm().local_commits(),
[['Auto-rebaseline for r1234\n\nhttps://chromium.googlesource.com/chromium/src/+/6469e754a1\n\nTBR=foobarbaz1@chromium.org\n',
True,
COMMIT_AUTHOR]])
def test_execute_with_dry_run(self):
self._basic_execute_test([], dry_run=True)
self.assertEqual(self.tool.scm().local_commits(), [])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment