cm: build: Fix cherry picking specific patchsets

Change-Id: I396a1218f141a1ff4cb45252cc01a1487c2afd31
gugelfrei
LuK1337 7 years ago committed by Dan Pasanen
parent fc9a4c5793
commit 2756418873

@ -268,6 +268,7 @@ if __name__ == '__main__':
continue
change = int(change)
patchset = int(patchset)
review = next((x for x in reviews if x['number'] == change), None)
if review is None:
print('Change %d not found, skipping' % change)
@ -286,7 +287,7 @@ if __name__ == '__main__':
mergables[-1]['id'] = change
if patchset:
try:
mergables[-1]['fetch'] = [x['fetch'] for x in review['revisions'] if x['_number'] == patchset][0]
mergables[-1]['fetch'] = [review['revisions'][x]['fetch'] for x in review['revisions'] if review['revisions'][x]['_number'] == patchset][0]
mergables[-1]['id'] = '{0}/{1}'.format(change, patchset)
except (IndexError, ValueError):
args.quiet or print('ERROR: The patch set {0}/{1} could not be found, using CURRENT_REVISION instead.'.format(change, patchset))

Loading…
Cancel
Save