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

Side by Side Diff: gclient.py

Issue 2049583003: Add resource locking in gclient (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Review and fix Created 4 years, 6 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 | gclient_utils.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/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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 # dependency. It is read from the actual DEPS file so cannot be set on 368 # dependency. It is read from the actual DEPS file so cannot be set on
369 # class instantiation. 369 # class instantiation.
370 self.recursion_override = None 370 self.recursion_override = None
371 # recursedeps is a mutable value that selectively overrides the default 371 # recursedeps is a mutable value that selectively overrides the default
372 # 'no recursion' setting on a dep-by-dep basis. It will replace 372 # 'no recursion' setting on a dep-by-dep basis. It will replace
373 # recursion_override. 373 # recursion_override.
374 # 374 #
375 # It will be a dictionary of {deps_name: {"deps_file": depfile_name}} or 375 # It will be a dictionary of {deps_name: {"deps_file": depfile_name}} or
376 # None. 376 # None.
377 self.recursedeps = None 377 self.recursedeps = None
378 # This is inherited from WorkItem. We want the URL to be a resource.
379 if url and isinstance(url, basestring):
380 # The url is usually given to gclient either as https://blah@123
381 # or just https://blah. The @123 portion is irrelevent.
382 self.resources.append(url.split('@')[0])
378 383
379 if not self.name and self.parent: 384 if not self.name and self.parent:
380 raise gclient_utils.Error('Dependency without name') 385 raise gclient_utils.Error('Dependency without name')
381 386
382 @property 387 @property
383 def requirements(self): 388 def requirements(self):
384 """Calculate the list of requirements.""" 389 """Calculate the list of requirements."""
385 requirements = set() 390 requirements = set()
386 # self.parent is implicitly a requirement. This will be recursive by 391 # self.parent is implicitly a requirement. This will be recursive by
387 # definition. 392 # definition.
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 2355
2351 2356
2352 if '__main__' == __name__: 2357 if '__main__' == __name__:
2353 try: 2358 try:
2354 sys.exit(main(sys.argv[1:])) 2359 sys.exit(main(sys.argv[1:]))
2355 except KeyboardInterrupt: 2360 except KeyboardInterrupt:
2356 sys.stderr.write('interrupted\n') 2361 sys.stderr.write('interrupted\n')
2357 sys.exit(1) 2362 sys.exit(1)
2358 2363
2359 # vim: ts=2:sw=2:tw=80:et: 2364 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | gclient_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698