Revert "Add previous_got_revision and previous_got_revision_cp to output"

This reverts commit 6d0c0ffef5.

Reason for revert: this appears to  break builders if reference
is a commit hash:

git log --format=%B -n1 HEAD failed with code 128

Original change's description:
> Add previous_got_revision and previous_got_revision_cp to output
>
> As chrome browser infra works to improve CQ times, we would like to
> easily glance at builds and see how many new commits were checked out.
> Currently you have to open up bot_update stdout to see the previous
> HEAD revision and go from there. Having this conveniently outputted
> would be very convenient.
>
> If the bot has previously checked out the repo, output which revision
> and commit position were checked out.
>
> example LED build showing new output: https://ci.chromium.org/swarming/task/51592e46d6a70e10?server=chromium-swarm.appspot.com
>
> Change-Id: Ib8a6f152a593446ce4082477bc9ada44f1fd1fc3
> Bug: 1170568
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2644829
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Stephanie Kim <kimstephanie@google.com>

TBR=infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com,kimstephanie@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1170568
Change-Id: I50d6ef6802c2eb1614cca804391c7826a79a2cf9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2657023
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
changes/23/2657023/2
Josip Sokcevic 5 years ago committed by LUCI CQ
parent 9bdbb8f944
commit 2c9dbb89fb

@ -839,8 +839,7 @@ def get_commit_position(git_path, revision='HEAD'):
return None return None
def parse_got_revision(gclient_output, got_revision_mapping, def parse_got_revision(gclient_output, got_revision_mapping):
prev_checkout_info):
"""Translate git gclient revision mapping to build properties.""" """Translate git gclient revision mapping to build properties."""
properties = {} properties = {}
solutions_output = { solutions_output = {
@ -863,16 +862,9 @@ def parse_got_revision(gclient_output, got_revision_mapping,
revision = git('rev-parse', 'HEAD', cwd=dir_name).strip() revision = git('rev-parse', 'HEAD', cwd=dir_name).strip()
commit_position = get_commit_position(dir_name) commit_position = get_commit_position(dir_name)
prev_revision, prev_cp = prev_checkout_info.get(dir_name.rstrip('/'),
(None, None))
properties[property_name] = revision properties[property_name] = revision
if prev_revision:
properties['prev_%s' % property_name] = prev_revision
if commit_position: if commit_position:
properties['%s_cp' % property_name] = commit_position properties['%s_cp' % property_name] = commit_position
if prev_cp:
properties['prev_%s_cp' % property_name] = prev_cp
return properties return properties
@ -1113,16 +1105,6 @@ def prepare(options, git_slns, active):
print('Fetching Git checkout at %s@%s' % (first_sln, revisions[first_sln])) print('Fetching Git checkout at %s@%s' % (first_sln, revisions[first_sln]))
return revisions, step_text return revisions, step_text
def current_checkout_info(solutions):
r = {}
build_dir = os.getcwd()
for sln in solutions:
sln_dir = path.join(build_dir, sln['name'])
if path.isdir(sln_dir) and not is_broken_repo_dir(sln_dir):
r[sln['name']] = (git('rev-parse', 'HEAD', cwd=sln_dir).strip(),
get_commit_position(sln_dir))
return r
def checkout(options, git_slns, specs, revisions, step_text): def checkout(options, git_slns, specs, revisions, step_text):
print('Using Python version: %s' % (sys.version,)) print('Using Python version: %s' % (sys.version,))
@ -1146,8 +1128,6 @@ def checkout(options, git_slns, specs, revisions, step_text):
# create file, no content # create file, no content
pass pass
prev_checkout_info = current_checkout_info(git_slns)
should_delete_dirty_file = False should_delete_dirty_file = False
try: try:
@ -1221,8 +1201,7 @@ def checkout(options, git_slns, specs, revisions, step_text):
if not revision_mapping: if not revision_mapping:
revision_mapping['got_revision'] = first_sln revision_mapping['got_revision'] = first_sln
got_revisions = parse_got_revision(gclient_output, revision_mapping, got_revisions = parse_got_revision(gclient_output, revision_mapping)
prev_checkout_info)
if not got_revisions: if not got_revisions:
# TODO(hinoka): We should probably bail out here, but in the interest # TODO(hinoka): We should probably bail out here, but in the interest

Loading…
Cancel
Save