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

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 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:
380 # The url is usually given to gclient either as https://blah@123
381 # or just https://blah. The @123 portion is irrelevent.
382 url_segments = url.split('@')
383 if url_segments > 0:
Sergey Berezin 2016/06/08 18:50:47 nit: str.split('@') always returns a non-empty arr
384 self.resources.append(url_segments[0])
378 385
379 if not self.name and self.parent: 386 if not self.name and self.parent:
380 raise gclient_utils.Error('Dependency without name') 387 raise gclient_utils.Error('Dependency without name')
381 388
382 @property 389 @property
383 def requirements(self): 390 def requirements(self):
384 """Calculate the list of requirements.""" 391 """Calculate the list of requirements."""
385 requirements = set() 392 requirements = set()
386 # self.parent is implicitly a requirement. This will be recursive by 393 # self.parent is implicitly a requirement. This will be recursive by
387 # definition. 394 # definition.
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after
2350 2357
2351 2358
2352 if '__main__' == __name__: 2359 if '__main__' == __name__:
2353 try: 2360 try:
2354 sys.exit(main(sys.argv[1:])) 2361 sys.exit(main(sys.argv[1:]))
2355 except KeyboardInterrupt: 2362 except KeyboardInterrupt:
2356 sys.stderr.write('interrupted\n') 2363 sys.stderr.write('interrupted\n')
2357 sys.exit(1) 2364 sys.exit(1)
2358 2365
2359 # vim: ts=2:sw=2:tw=80:et: 2366 # 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