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

Side by Side Diff: gclient.py

Issue 3104036: Cleanup the code in gclient_utils to standardize on CheckCall nomenclature. (Closed)
Patch Set: Rewrote the patch in part as I had introduced regressions. Removed a lot of dead code Created 10 years, 3 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 | « gcl.py ('k') | gclient_scm.py » ('j') | 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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 7
8 Files 8 Files
9 .gclient : Current client configuration, written by 'config' command. 9 .gclient : Current client configuration, written by 'config' command.
10 Format is a Python script defining 'solutions', a list whose 10 Format is a Python script defining 'solutions', a list whose
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 if command[0] == 'python': 441 if command[0] == 'python':
442 # If the hook specified "python" as the first item, the action is a 442 # If the hook specified "python" as the first item, the action is a
443 # Python script. Run it by starting a new copy of the same 443 # Python script. Run it by starting a new copy of the same
444 # interpreter. 444 # interpreter.
445 command[0] = sys.executable 445 command[0] = sys.executable
446 446
447 if '$matching_files' in command: 447 if '$matching_files' in command:
448 splice_index = command.index('$matching_files') 448 splice_index = command.index('$matching_files')
449 command[splice_index:splice_index + 1] = matching_file_list 449 command[splice_index:splice_index + 1] = matching_file_list
450 450
451 # Use a discrete exit status code of 2 to indicate that a hook action 451 try:
452 # failed. Users of this script may wish to treat hook action failures 452 gclient_utils.CheckCallAndFilterAndHeader(
453 # differently from VC failures. 453 command, cwd=self.root_dir(), always=True)
454 return gclient_utils.SubprocessCall(command, cwd=self.root_dir(), 454 except gclient_utils.Error, e:
455 fail_status=2) 455 # Use a discrete exit status code of 2 to indicate that a hook action
456 # failed. Users of this script may wish to treat hook action failures
457 # differently from VC failures.
458 print >> sys.stderr, 'Error: %s' % str(e)
459 sys.exit(2)
456 460
457 def root_dir(self): 461 def root_dir(self):
458 return self.parent.root_dir() 462 return self.parent.root_dir()
459 463
460 def enforced_os(self): 464 def enforced_os(self):
461 return self.parent.enforced_os() 465 return self.parent.enforced_os()
462 466
463 def recursion_limit(self): 467 def recursion_limit(self):
464 return self.parent.recursion_limit() - 1 468 return self.parent.recursion_limit() - 1
465 469
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 return CMDhelp(parser, argv) 1228 return CMDhelp(parser, argv)
1225 except gclient_utils.Error, e: 1229 except gclient_utils.Error, e:
1226 print >> sys.stderr, 'Error: %s' % str(e) 1230 print >> sys.stderr, 'Error: %s' % str(e)
1227 return 1 1231 return 1
1228 1232
1229 1233
1230 if '__main__' == __name__: 1234 if '__main__' == __name__:
1231 sys.exit(Main(sys.argv[1:])) 1235 sys.exit(Main(sys.argv[1:]))
1232 1236
1233 # vim: ts=2:sw=2:tw=80:et: 1237 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « gcl.py ('k') | gclient_scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698