 Chromium Code Reviews
 Chromium Code Reviews Issue 2968005:
  Add testing for the From(File()) case, fix revinfo.  (Closed)
    
  
    Issue 2968005:
  Add testing for the From(File()) case, fix revinfo.  (Closed) 
  | OLD | NEW | 
|---|---|
| 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 743 # containing directories get populated first and for readability) | 743 # containing directories get populated first and for readability) | 
| 744 deps = self._ParseAllDeps(entries) | 744 deps = self._ParseAllDeps(entries) | 
| 745 deps_to_process = deps.keys() | 745 deps_to_process = deps.keys() | 
| 746 deps_to_process.sort() | 746 deps_to_process.sort() | 
| 747 | 747 | 
| 748 # First pass for direct dependencies. | 748 # First pass for direct dependencies. | 
| 749 for d in deps_to_process: | 749 for d in deps_to_process: | 
| 750 if type(deps[d]) == str: | 750 if type(deps[d]) == str: | 
| 751 (url, rev) = GetURLAndRev(d, deps[d]) | 751 (url, rev) = GetURLAndRev(d, deps[d]) | 
| 752 entries[d] = "%s@%s" % (url, rev) | 752 entries[d] = "%s@%s" % (url, rev) | 
| 753 elif isinstance(deps[d], self.FileImpl): | |
| 754 (url, rev) = GetURLAndRev(d, deps[d].file_location) | |
| 
tony
2010/07/12 17:26:59
Nit: parens on the left are not needed (although I
 
M-A Ruel
2010/07/12 17:29:49
All this code will be deleted anyway.
 | |
| 755 entries[d] = "%s@%s" % (url, rev) | |
| 753 | 756 | 
| 754 # Second pass for inherited deps (via the From keyword) | 757 # Second pass for inherited deps (via the From keyword) | 
| 755 for d in deps_to_process: | 758 for d in deps_to_process: | 
| 756 if isinstance(deps[d], self.FromImpl): | 759 if isinstance(deps[d], self.FromImpl): | 
| 757 deps_parent_url = entries[deps[d].module_name] | 760 deps_parent_url = entries[deps[d].module_name] | 
| 758 if deps_parent_url.find("@") < 0: | 761 if deps_parent_url.find("@") < 0: | 
| 759 raise gclient_utils.Error("From %s missing revisioned url" % | 762 raise gclient_utils.Error("From %s missing revisioned url" % | 
| 760 deps[d].module_name) | 763 deps[d].module_name) | 
| 761 sub_deps_base_url = deps[deps[d].module_name] | 764 sub_deps_base_url = deps[deps[d].module_name] | 
| 762 sub_deps = Dependency(self, deps[d].module_name, sub_deps_base_url | 765 sub_deps = Dependency(self, deps[d].module_name, sub_deps_base_url | 
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1199 return CMDhelp(parser, argv) | 1202 return CMDhelp(parser, argv) | 
| 1200 except gclient_utils.Error, e: | 1203 except gclient_utils.Error, e: | 
| 1201 print >> sys.stderr, 'Error: %s' % str(e) | 1204 print >> sys.stderr, 'Error: %s' % str(e) | 
| 1202 return 1 | 1205 return 1 | 
| 1203 | 1206 | 
| 1204 | 1207 | 
| 1205 if '__main__' == __name__: | 1208 if '__main__' == __name__: | 
| 1206 sys.exit(Main(sys.argv[1:])) | 1209 sys.exit(Main(sys.argv[1:])) | 
| 1207 | 1210 | 
| 1208 # vim: ts=2:sw=2:tw=80:et: | 1211 # vim: ts=2:sw=2:tw=80:et: | 
| OLD | NEW |