Log the location where we start to search .gclient for
R=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/1789713004
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299261 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient.py b/gclient.py
index 7ba378a..5d0e412 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1378,6 +1378,9 @@
client = GClient('.', options)
client.SetConfig(options.spec)
else:
+ if options.verbose:
+ print('Looking for %s starting from %s\n' % (
+ options.config_filename, os.getcwd()))
path = gclient_utils.FindGclientRoot(os.getcwd(), options.config_filename)
if not path:
return None
@@ -1696,6 +1699,12 @@
"""No DEPS to parse for a .gclient file."""
raise gclient_utils.Error('Internal error')
+ def PrintLocationAndContents(self):
+ # Print out the .gclient file. This is longer than if we just printed the
+ # client dict, but more legible, and it might contain helpful comments.
+ print('Loaded .gclient config in %s:\n%s' % (
+ self.root_dir, self.config_content))
+
@property
def root_dir(self):
"""Root directory of gclient checkout."""
@@ -1738,9 +1747,7 @@
if not client:
raise gclient_utils.Error('client not configured; see \'gclient config\'')
if options.verbose:
- # Print out the .gclient file. This is longer than if we just printed the
- # client dict, but more legible, and it might contain helpful comments.
- print(client.config_content)
+ client.PrintLocationAndContents()
return client.RunOnDeps('cleanup', args)
@@ -1929,9 +1936,7 @@
if not client:
raise gclient_utils.Error('client not configured; see \'gclient config\'')
if options.verbose:
- # Print out the .gclient file. This is longer than if we just printed the
- # client dict, but more legible, and it might contain helpful comments.
- print(client.config_content)
+ client.PrintLocationAndContents()
return client.RunOnDeps('pack', args)
@@ -1946,9 +1951,7 @@
if not client:
raise gclient_utils.Error('client not configured; see \'gclient config\'')
if options.verbose:
- # Print out the .gclient file. This is longer than if we just printed the
- # client dict, but more legible, and it might contain helpful comments.
- print(client.config_content)
+ client.PrintLocationAndContents()
return client.RunOnDeps('status', args)
@@ -2061,9 +2064,7 @@
print('Warning: you cannot use both --head and --revision')
if options.verbose:
- # Print out the .gclient file. This is longer than if we just printed the
- # client dict, but more legible, and it might contain helpful comments.
- print(client.config_content)
+ client.PrintLocationAndContents()
ret = client.RunOnDeps('update', args)
if options.output_json:
slns = {}
@@ -2093,9 +2094,7 @@
if not client:
raise gclient_utils.Error('client not configured; see \'gclient config\'')
if options.verbose:
- # Print out the .gclient file. This is longer than if we just printed the
- # client dict, but more legible, and it might contain helpful comments.
- print(client.config_content)
+ client.PrintLocationAndContents()
return client.RunOnDeps('diff', args)
@@ -2138,9 +2137,7 @@
if not client:
raise gclient_utils.Error('client not configured; see \'gclient config\'')
if options.verbose:
- # Print out the .gclient file. This is longer than if we just printed the
- # client dict, but more legible, and it might contain helpful comments.
- print(client.config_content)
+ client.PrintLocationAndContents()
options.force = True
options.nohooks = False
return client.RunOnDeps('runhooks', args)