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 <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
changes/14/4404114/4
Joanna Wang 2 years ago committed by LUCI CQ
parent 80cc67cc00
commit c3dd9247b7

@ -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)

Loading…
Cancel
Save