From c3dd9247b70263fb855a9864d2e8ce695f4c4531 Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Mon, 10 Apr 2023 16:42:13 +0000 Subject: [PATCH] Print migration script steps. Bug: 1415507 Change-Id: I6957a03380e72f1a8a1c72c3e825d452fd3ad258 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4404114 Reviewed-by: Gavin Mak Commit-Queue: Gavin Mak Auto-Submit: Joanna Wang --- infra_to_superproject.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/infra_to_superproject.py b/infra_to_superproject.py index de4f26246..0b67706ae 100644 --- a/infra_to_superproject.py +++ b/infra_to_superproject.py @@ -37,6 +37,7 @@ infra or infra_internal checkout. import subprocess import os +import platform import sys import json from pathlib import Path @@ -44,6 +45,7 @@ from pathlib import Path def main(argv): assert len(argv) == 1, 'One and only one arg expected.' + assert platform.system() == 'Linux', 'Non-linux OSs not supported yet.' destination = argv[0] # In case there is '~' in the destination string @@ -51,9 +53,15 @@ def main(argv): Path(destination).mkdir(parents=True, exist_ok=True) - cp = subprocess.Popen(['cp', '-a', os.getcwd() + '/.', destination]) + print(f'Copying {os.getcwd()} into {destination}') + cp = subprocess.Popen( + ['cp', '-a', os.path.join(os.getcwd(), '.'), destination], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) cp.wait() + print('Copying complete') + print(f'Deleting old {destination}/.gclient file') gclient_file = os.path.join(destination, '.gclient') with open(gclient_file, 'r') as file: data = file.read() @@ -61,9 +69,11 @@ def main(argv): os.remove(gclient_file) + print('Migrating to infra/infra_superproject') cmds = ['fetch', '--force'] if internal: cmds.append('infra_internal') + print('including internal code in checkout') else: cmds.append('infra') fetch = subprocess.Popen(cmds, cwd=destination)