mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Revert "bot_update: Specify the target branch for patch_refs."
This reverts commit 01f0c698fb.
Reason for revert: https://chromium-review.googlesource.com/c/chromium/tools/build/+/1211422
Original change's description:
> bot_update: Specify the target branch for patch_refs.
>
> Bug: 870279
> Recipe-Manual-Change: build
> Recipe-Manual-Change: infra
> Recipe-Manual-Change: build_limited_scripts_slave
> Recipe-Manual-Change: skia
> Recipe-Manual-Change: release_scripts
> Change-Id: I58110ff8c5a6ca6906bbbf3eafa09dcbaf39f777
> Reviewed-on: https://chromium-review.googlesource.com/1174988
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
TBR=tandrii@chromium.org,ehmaldonado@chromium.org,jbudorick@chromium.org
Change-Id: Ic78a264ccf5e2ca15452659e17d41da264560eb8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 870279
Reviewed-on: https://chromium-review.googlesource.com/1211462
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
Commit-Queue: Nodir Turakulov <nodir@chromium.org>
This commit is contained in:
committed by
Commit Bot
parent
b56a43a906
commit
9af7d107de
@@ -2,17 +2,15 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import copy
|
||||
|
||||
from recipe_engine import recipe_test_api
|
||||
|
||||
|
||||
# Exemplary change. Note: This contains only a subset of the key/value pairs
|
||||
# present in production to limit recipe simulation output.
|
||||
EXAMPLE_RESPONSE = {
|
||||
EXAMPLE_CHANGE = {
|
||||
'status': 'NEW',
|
||||
'created': '2017-01-30 13:11:20.000000000',
|
||||
'_number': 91827,
|
||||
'_number': '91827',
|
||||
'change_id': 'Ideadbeef',
|
||||
'project': 'chromium/src',
|
||||
'has_review_started': False,
|
||||
@@ -20,7 +18,7 @@ EXAMPLE_RESPONSE = {
|
||||
'subject': 'Change title',
|
||||
'revisions': {
|
||||
'184ebe53805e102605d11f6b143486d15c23a09c': {
|
||||
'_number': 1,
|
||||
'_number': '1',
|
||||
'commit': {
|
||||
'message': 'Change commit message',
|
||||
},
|
||||
@@ -46,43 +44,10 @@ class GerritTestApi(recipe_test_api.RecipeTestApi):
|
||||
"revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
|
||||
})
|
||||
|
||||
def get_one_change_response_data(
|
||||
self, branch=None, change=None, project=None, patchset=None, host=None,
|
||||
o_params=None):
|
||||
o_params = o_params or []
|
||||
response = copy.deepcopy(EXAMPLE_RESPONSE)
|
||||
patchset_dict = response['revisions'].values()[0]
|
||||
|
||||
if branch:
|
||||
response['branch'] = branch
|
||||
if change:
|
||||
response['_number'] = int(change)
|
||||
if project:
|
||||
response['project'] = project
|
||||
if patchset:
|
||||
patchset_dict['_number'] = int(patchset)
|
||||
|
||||
if 'DOWNLOAD_COMMANDS' in o_params:
|
||||
patchset_dict['fetch'] = {
|
||||
'http': {
|
||||
'url': 'https://chromium.googlesource.com/chromium/src',
|
||||
'ref': 'refs/changes/27/91827/1',
|
||||
},
|
||||
}
|
||||
|
||||
if host:
|
||||
patchset_dict['fetch']['http']['url'] = host
|
||||
elif project:
|
||||
patchset_dict['fetch']['http']['url'] = (
|
||||
'https://chromium.googlesource.com/' + project)
|
||||
|
||||
if change or patchset:
|
||||
patchset_dict['fetch']['http']['ref'] = 'refs/changes/{}/{}/{}'.format(
|
||||
str(response['_number'])[-2:],
|
||||
response['_number'],
|
||||
patchset_dict['_number'])
|
||||
|
||||
return self._make_gerrit_response_json([response])
|
||||
def get_one_change_response_data(self, **kwargs):
|
||||
change = EXAMPLE_CHANGE.copy()
|
||||
change.update(kwargs)
|
||||
return self._make_gerrit_response_json([change])
|
||||
|
||||
def get_empty_changes_response_data(self):
|
||||
return self._make_gerrit_response_json([])
|
||||
|
||||
Reference in New Issue
Block a user