瀏覽代碼

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>
Joanna Wang 2 年之前
父節點
當前提交
c3dd9247b7
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      infra_to_superproject.py

+ 11 - 1
infra_to_superproject.py

@@ -37,6 +37,7 @@ infra or infra_internal checkout.
 
 
 import subprocess
 import subprocess
 import os
 import os
+import platform
 import sys
 import sys
 import json
 import json
 from pathlib import Path
 from pathlib import Path
@@ -44,6 +45,7 @@ from pathlib import Path
 
 
 def main(argv):
 def main(argv):
   assert len(argv) == 1, 'One and only one arg expected.'
   assert len(argv) == 1, 'One and only one arg expected.'
+  assert platform.system() == 'Linux', 'Non-linux OSs not supported yet.'
   destination = argv[0]
   destination = argv[0]
 
 
   # In case there is '~' in the destination string
   # In case there is '~' in the destination string
@@ -51,9 +53,15 @@ def main(argv):
 
 
   Path(destination).mkdir(parents=True, exist_ok=True)
   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()
   cp.wait()
+  print('Copying complete')
 
 
+  print(f'Deleting old {destination}/.gclient file')
   gclient_file = os.path.join(destination, '.gclient')
   gclient_file = os.path.join(destination, '.gclient')
   with open(gclient_file, 'r') as file:
   with open(gclient_file, 'r') as file:
     data = file.read()
     data = file.read()
@@ -61,9 +69,11 @@ def main(argv):
 
 
   os.remove(gclient_file)
   os.remove(gclient_file)
 
 
+  print('Migrating to infra/infra_superproject')
   cmds = ['fetch', '--force']
   cmds = ['fetch', '--force']
   if internal:
   if internal:
     cmds.append('infra_internal')
     cmds.append('infra_internal')
+    print('including internal code in checkout')
   else:
   else:
     cmds.append('infra')
     cmds.append('infra')
   fetch = subprocess.Popen(cmds, cwd=destination)
   fetch = subprocess.Popen(cmds, cwd=destination)