Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: gclient.py

Issue 490233003: Don't be pedantic about .gclient file for non-mutating commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Meta checkout manager supporting both Subversion and GIT.""" 6 """Meta checkout manager supporting both Subversion and GIT."""
7 # Files 7 # Files
8 # .gclient : Current client configuration, written by 'config' command. 8 # .gclient : Current client configuration, written by 'config' command.
9 # Format is a Python script defining 'solutions', a list whose 9 # Format is a Python script defining 'solutions', a list whose
10 # entries each are maps binding the strings "name" and "url" 10 # entries each are maps binding the strings "name" and "url"
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 def RunOnDeps(self, command, args, ignore_requirements=False, progress=True): 1317 def RunOnDeps(self, command, args, ignore_requirements=False, progress=True):
1318 """Runs a command on each dependency in a client and its dependencies. 1318 """Runs a command on each dependency in a client and its dependencies.
1319 1319
1320 Args: 1320 Args:
1321 command: The command to use (e.g., 'status' or 'diff') 1321 command: The command to use (e.g., 'status' or 'diff')
1322 args: list of str - extra arguments to add to the command line. 1322 args: list of str - extra arguments to add to the command line.
1323 """ 1323 """
1324 if not self.dependencies: 1324 if not self.dependencies:
1325 raise gclient_utils.Error('No solution specified') 1325 raise gclient_utils.Error('No solution specified')
1326 1326
1327 self._CheckConfig()
1328
1329 revision_overrides = {} 1327 revision_overrides = {}
1330 # It's unnecessary to check for revision overrides for 'recurse'. 1328 # It's unnecessary to check for revision overrides for 'recurse'.
1331 # Save a few seconds by not calling _EnforceRevisions() in that case. 1329 # Save a few seconds by not calling _EnforceRevisions() in that case.
1332 if command not in ('diff', 'recurse', 'runhooks', 'status'): 1330 if command not in ('diff', 'recurse', 'runhooks', 'status'):
1331 self._CheckConfig()
1333 revision_overrides = self._EnforceRevisions() 1332 revision_overrides = self._EnforceRevisions()
1334 pm = None 1333 pm = None
1335 # Disable progress for non-tty stdout. 1334 # Disable progress for non-tty stdout.
1336 if (sys.stdout.isatty() and not self._options.verbose and progress): 1335 if (sys.stdout.isatty() and not self._options.verbose and progress):
1337 if command in ('update', 'revert'): 1336 if command in ('update', 'revert'):
1338 pm = Progress('Syncing projects', 1) 1337 pm = Progress('Syncing projects', 1)
1339 elif command == 'recurse': 1338 elif command == 'recurse':
1340 pm = Progress(' '.join(args), 1) 1339 pm = Progress(' '.join(args), 1)
1341 work_queue = gclient_utils.ExecutionQueue( 1340 work_queue = gclient_utils.ExecutionQueue(
1342 self._options.jobs, pm, ignore_requirements=ignore_requirements, 1341 self._options.jobs, pm, ignore_requirements=ignore_requirements,
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 print >> sys.stderr, 'Error: %s' % str(e) 2065 print >> sys.stderr, 'Error: %s' % str(e)
2067 return 1 2066 return 1
2068 finally: 2067 finally:
2069 gclient_utils.PrintWarnings() 2068 gclient_utils.PrintWarnings()
2070 2069
2071 2070
2072 if '__main__' == __name__: 2071 if '__main__' == __name__:
2073 sys.exit(Main(sys.argv[1:])) 2072 sys.exit(Main(sys.argv[1:]))
2074 2073
2075 # vim: ts=2:sw=2:tw=80:et: 2074 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698