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

Side by Side Diff: gclient.py

Issue 2103663004: Slight fix for gclient readability (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 5 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
« 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 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 """Checks for revision overrides.""" 1474 """Checks for revision overrides."""
1475 revision_overrides = {} 1475 revision_overrides = {}
1476 if not self._options.revisions: 1476 if not self._options.revisions:
1477 for s in self.dependencies: 1477 for s in self.dependencies:
1478 if not s.managed and not self._options.head: 1478 if not s.managed and not self._options.head:
1479 self._options.revisions.append('%s@unmanaged' % s.name) 1479 self._options.revisions.append('%s@unmanaged' % s.name)
1480 if not self._options.revisions: 1480 if not self._options.revisions:
1481 return revision_overrides 1481 return revision_overrides
1482 solutions_names = [s.name for s in self.dependencies] 1482 solutions_names = [s.name for s in self.dependencies]
1483 for i, revision in enumerate(self._options.revisions): 1483 for i, revision in enumerate(self._options.revisions):
1484 if not '@' in revision: 1484 if '@' in revision:
1485 name, rev = revision.split('@', 1)
1486 else:
1485 # Support for --revision 123 1487 # Support for --revision 123
1486 name, rev = solutions_names[i], revision 1488 name, rev = solutions_names[i], revision
1487 else:
1488 name, rev = revision.split('@', 1)
1489 revision_overrides[name] = rev 1489 revision_overrides[name] = rev
1490 return revision_overrides 1490 return revision_overrides
1491 1491
1492 def RunOnDeps(self, command, args, ignore_requirements=False, progress=True): 1492 def RunOnDeps(self, command, args, ignore_requirements=False, progress=True):
1493 """Runs a command on each dependency in a client and its dependencies. 1493 """Runs a command on each dependency in a client and its dependencies.
1494 1494
1495 Args: 1495 Args:
1496 command: The command to use (e.g., 'status' or 'diff') 1496 command: The command to use (e.g., 'status' or 'diff')
1497 args: list of str - extra arguments to add to the command line. 1497 args: list of str - extra arguments to add to the command line.
1498 """ 1498 """
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 2315
2316 2316
2317 if '__main__' == __name__: 2317 if '__main__' == __name__:
2318 try: 2318 try:
2319 sys.exit(main(sys.argv[1:])) 2319 sys.exit(main(sys.argv[1:]))
2320 except KeyboardInterrupt: 2320 except KeyboardInterrupt:
2321 sys.stderr.write('interrupted\n') 2321 sys.stderr.write('interrupted\n')
2322 sys.exit(1) 2322 sys.exit(1)
2323 2323
2324 # vim: ts=2:sw=2:tw=80:et: 2324 # 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