Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
This fixes the case where a new workdir is created from a repository
which was previously created with gclient-new-workdir.py and that
repository is later deleted, rendering the symbolic links created by
gclient-new-workdir.py invalid.
It also fixes support_cow() returning 'True' in that case because 'cp
--reflink' does not fail when copying a symlink.
Bug: 721585
Change-Id: I84f4d80b8698af0da346be559d46a328ec0d0e9b
Reviewed-on: https://chromium-review.googlesource.com/842402
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
gclient-new-workdir.py should work on systems not supporting reflink now.
Bug: 728903, 721585
Change-Id: I1385c4281bbf61d4ccae64c3595a39972fbe9d9e
Reviewed-on: https://chromium-review.googlesource.com/522232
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
If the repo is a btrfs subvolume, take a snapshot instead of using
"cp --reflink". Taking a snapshot is much faster, and uses less
disk space for metadata.
Bug: 721585
Change-Id: I97753dc30d46ff56d84d65f8d815c19d09cf104b
Reviewed-on: https://chromium-review.googlesource.com/513586
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
On filesystems supporting copy-on-write, like Btrfs and ZFS, use
"cp --reflink" to achieve faster speed and lower disk space usage.
Option --reflink and --no-reflink can override the automatic detection.
When reflink is supported, toolchains, support libraries, and artifacts
would also be preserved. This means you can do incremental builds right
after creating a new workdir.
For Linux Chromium checkout, one additional workdir only takes 0.8~1 GB
disk space in Btrfs, including data and metadata, depending on how many
artifacts are there inside the out*/ directories.
Change-Id: I8b913efba9e5afaeea2adc1c10a561f63cb50282
Bug: 721585
Reviewed-on: https://chromium-review.googlesource.com/499567
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This makes it easier to add options to this script.
There should be no functional changes except for slightly different
text output.
Change-Id: I4d68a8c4aa0c159eae9435fe962e53f6f09d2d47
Reviewed-on: https://chromium-review.googlesource.com/499527
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This uses the same trick as git-new-workdir to reuse an existing git
checkout without interfering with it. However, this makes it only usable
on platforms where os.symlink exists.
BUG=404755
Review URL: https://codereview.chromium.org/1342383002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296920 0039d316-1c4b-4281-b951-d872f2087c98