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

Side by Side Diff: gclient.py

Issue 7885008: Fix the case where a dep not processed could be set as a requirement. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: comment Created 9 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 | Annotate | Revision Log
« 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) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if self.parent in self.root_parent().dependencies: 217 if self.parent in self.root_parent().dependencies:
218 root_deps = self.root_parent().dependencies 218 root_deps = self.root_parent().dependencies
219 for i in range(0, root_deps.index(self.parent)): 219 for i in range(0, root_deps.index(self.parent)):
220 value = root_deps[i] 220 value = root_deps[i]
221 if value.name: 221 if value.name:
222 self.requirements.add(value.name) 222 self.requirements.add(value.name)
223 223
224 if isinstance(self.url, self.FromImpl): 224 if isinstance(self.url, self.FromImpl):
225 self.requirements.add(self.url.module_name) 225 self.requirements.add(self.url.module_name)
226 226
227 if self.name: 227 if self.name and self.should_process:
228 def yield_full_tree(root): 228 def yield_full_tree(root):
229 """Depth-first recursion.""" 229 """Depth-first recursion."""
230 yield root 230 yield root
231 for i in root.dependencies: 231 for i in root.dependencies:
232 for j in yield_full_tree(i): 232 for j in yield_full_tree(i):
233 yield j 233 if j.should_process:
234 yield j
234 235
235 for obj in yield_full_tree(self.root_parent()): 236 for obj in yield_full_tree(self.root_parent()):
236 if obj is self or not obj.name: 237 if obj is self or not obj.name:
237 continue 238 continue
238 # Step 1: Find any requirements self may need. 239 # Step 1: Find any requirements self may need.
239 if self.name.startswith(posixpath.join(obj.name, '')): 240 if self.name.startswith(posixpath.join(obj.name, '')):
240 self.requirements.add(obj.name) 241 self.requirements.add(obj.name)
241 # Step 2: Find any requirements self may impose. 242 # Step 2: Find any requirements self may impose.
242 if obj.name.startswith(posixpath.join(self.name, '')): 243 if obj.name.startswith(posixpath.join(self.name, '')):
243 obj.requirements.add(self.name) 244 obj.requirements.add(self.name)
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1358 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1358 print >> sys.stderr, 'Error: %s' % str(e) 1359 print >> sys.stderr, 'Error: %s' % str(e)
1359 return 1 1360 return 1
1360 1361
1361 1362
1362 if '__main__' == __name__: 1363 if '__main__' == __name__:
1363 fix_encoding.fix_encoding() 1364 fix_encoding.fix_encoding()
1364 sys.exit(Main(sys.argv[1:])) 1365 sys.exit(Main(sys.argv[1:]))
1365 1366
1366 # vim: ts=2:sw=2:tw=80:et: 1367 # 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