Commit 1e67bb7b authored by tandrii@chromium.org's avatar tandrii@chromium.org

Gerrit git cl: run same post-upload hooks.

R=rmistry@chromium.org,andybons@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298733 0039d316-1c4b-4281-b951-d872f2087c98
parent dc58a97f
......@@ -2474,8 +2474,9 @@ def CMDupload(parser, args):
options.squash = ((settings.GetSquashGerritUploads() or options.squash) and
not options.no_squash)
return GerritUpload(options, args, cl, change)
ret = RietveldUpload(options, args, cl, change)
ret = GerritUpload(options, args, cl, change)
else:
ret = RietveldUpload(options, args, cl, change)
if not ret:
git_set_branch_value('last-upload-hash',
RunGit(['rev-parse', 'HEAD']).strip())
......
......@@ -227,6 +227,11 @@ class TestGitCl(TestCase):
'https://codereview.example.com'],), ''),
((['git',
'config', 'branch.master.rietveldpatchset', '2'],), ''),
] + cls._git_post_upload_calls()
@classmethod
def _git_post_upload_calls(cls):
return [
((['git', 'rev-parse', 'HEAD'],), 'hash'),
((['git', 'symbolic-ref', 'HEAD'],), 'hash'),
((['git',
......@@ -574,8 +579,8 @@ class TestGitCl(TestCase):
'+dat'),
]
@staticmethod
def _gerrit_upload_calls(description, reviewers, squash,
@classmethod
def _gerrit_upload_calls(cls, description, reviewers, squash,
expected_upstream_ref='origin/refs/heads/master'):
calls = [
((['git', 'config', '--bool', 'gerrit.squash-uploads'],), 'false'),
......@@ -640,7 +645,7 @@ class TestGitCl(TestCase):
'refs/heads/git_cl_uploads/master', 'abcdef0123456789'],),
'')
]
calls += cls._git_post_upload_calls()
return calls
def _run_gerrit_upload_test(
......
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