mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 02:31:29 +00:00
skip printing a warning message for missing .gclient_entries on cog
The function prints a warning message when it finds that a given directory contains .gclient only without .gclient_entries. It can possibly happen if gclient sync execution is halted in the middle, and it causes format function commands to mess up the format output with the warning message. This CL is to bypass the warning in Cog env. Find more context visit the linked bug. Bug: 450901048 Change-Id: I87e376e9a64c8e2ce2231dc9549e0683a9f393ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7133882 Commit-Queue: Scott Lee <ddoman@chromium.org> Auto-Submit: Scott Lee <ddoman@chromium.org> Reviewed-by: Terrence Reilly <treilly@google.com>
This commit is contained in:
@@ -40,13 +40,15 @@ def FindGclientRoot(from_dir, filename='.gclient'):
|
||||
# a sub directory that is controlled by this configuration.
|
||||
entries_filename = os.path.join(path, filename + '_entries')
|
||||
if not os.path.exists(entries_filename):
|
||||
# If .gclient_entries does not exist, a previous call to gclient sync
|
||||
# might have failed. In that case, we cannot verify that the .gclient
|
||||
# is the one we want to use. In order to not to cause too much trouble,
|
||||
# just issue a warning and return the path anyway.
|
||||
print(
|
||||
"%s missing, %s file in parent directory %s might not be the file "
|
||||
"you want to use." % (entries_filename, filename, path),
|
||||
if not gclient_utils.IsEnvCog():
|
||||
# If .gclient_entries does not exist, a previous call to
|
||||
# gclient sync might have failed. In that case, we cannot verify
|
||||
# that the .gclient is the one we want to use. In order to not
|
||||
# to cause too much trouble, just issue a warning and return
|
||||
# the path anyway.
|
||||
print("%s missing, %s file in parent directory %s might not be "
|
||||
"the file you want to use." %
|
||||
(entries_filename, filename, path),
|
||||
file=sys.stderr)
|
||||
return path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user