Browse Source

Add messages in gclient-new-workdir.py

When the repo is copied in copy-on-write mode, print informative
messages afterwards to help users.

Also, skip "git clean" step in copy-on-write mode.

Bug: 721585, 723856
Change-Id: I3235398c960d59a4cf44cfe7dffc79ed008a5190
Reviewed-on: https://chromium-review.googlesource.com/512262
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Wei-Yin Chen (陳威尹) 8 years ago
parent
commit
56e4ad939b
1 changed files with 8 additions and 3 deletions
  1. 8 3
      gclient-new-workdir.py

+ 8 - 3
gclient-new-workdir.py

@@ -12,6 +12,7 @@ import os
 import shutil
 import shutil
 import subprocess
 import subprocess
 import sys
 import sys
+import textwrap
 
 
 import git_common
 import git_common
 
 
@@ -69,7 +70,7 @@ def main():
   if args.reflink is None:
   if args.reflink is None:
     args.reflink = support_cow(gclient, new_gclient)
     args.reflink = support_cow(gclient, new_gclient)
     if args.reflink:
     if args.reflink:
-      print('Copy-on-write is supported. Using reflink to copy the repo.')
+      print('Copy-on-write support is detected.')
   os.symlink(gclient, new_gclient)
   os.symlink(gclient, new_gclient)
 
 
   for root, dirs, _ in os.walk(args.repository):
   for root, dirs, _ in os.walk(args.repository):
@@ -92,9 +93,13 @@ def main():
       else:
       else:
         subprocess.check_call(['git', 'checkout', '-f'], cwd=workdir)
         subprocess.check_call(['git', 'checkout', '-f'], cwd=workdir)
 
 
-      if args.reflink:
-        subprocess.check_call(['git', 'clean', '-df'], cwd=workdir)
+  if args.reflink:
+    print(textwrap.dedent('''\
+      The repo was copied with copy-on-write, and the artifacts were retained.
+      More details on http://crbug.com/721585.
 
 
+      Depending on your usage pattern, you might want to do "gn gen"
+      on the output directories. More details: http://crbug.com/723856.'''))
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
   sys.exit(main())
   sys.exit(main())