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

Side by Side Diff: gclient.py

Issue 233333003: Make it possible to refer to github-style URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Added another test for the LateOverride to work correctly with scp-style urls. Created 6 years, 8 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 # Call LateOverride() again. 428 # Call LateOverride() again.
429 found_dep = found_deps[0] 429 found_dep = found_deps[0]
430 parsed_url = found_dep.LateOverride(found_dep.url) 430 parsed_url = found_dep.LateOverride(found_dep.url)
431 logging.info( 431 logging.info(
432 'Dependency(%s).LateOverride(%s) -> %s (From)' % 432 'Dependency(%s).LateOverride(%s) -> %s (From)' %
433 (self.name, url, parsed_url)) 433 (self.name, url, parsed_url))
434 return parsed_url 434 return parsed_url
435 435
436 if isinstance(url, basestring): 436 if isinstance(url, basestring):
437 parsed_url = urlparse.urlparse(url) 437 parsed_url = urlparse.urlparse(url)
438 if not parsed_url[0]: 438 if (not parsed_url[0] and
439 not re.match(r'^\w+\@[\w\.-]+\:[\w\/]+', parsed_url[2])):
439 # A relative url. Fetch the real base. 440 # A relative url. Fetch the real base.
440 path = parsed_url[2] 441 path = parsed_url[2]
441 if not path.startswith('/'): 442 if not path.startswith('/'):
442 raise gclient_utils.Error( 443 raise gclient_utils.Error(
443 'relative DEPS entry \'%s\' must begin with a slash' % url) 444 'relative DEPS entry \'%s\' must begin with a slash' % url)
444 # Create a scm just to query the full url. 445 # Create a scm just to query the full url.
445 parent_url = self.parent.parsed_url 446 parent_url = self.parent.parsed_url
446 if isinstance(parent_url, self.FileImpl): 447 if isinstance(parent_url, self.FileImpl):
447 parent_url = parent_url.file_location 448 parent_url = parent_url.file_location
448 scm = gclient_scm.CreateSCM( 449 scm = gclient_scm.CreateSCM(
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 print >> sys.stderr, 'Error: %s' % str(e) 1967 print >> sys.stderr, 'Error: %s' % str(e)
1967 return 1 1968 return 1
1968 finally: 1969 finally:
1969 gclient_utils.PrintWarnings() 1970 gclient_utils.PrintWarnings()
1970 1971
1971 1972
1972 if '__main__' == __name__: 1973 if '__main__' == __name__:
1973 sys.exit(Main(sys.argv[1:])) 1974 sys.exit(Main(sys.argv[1:]))
1974 1975
1975 # vim: ts=2:sw=2:tw=80:et: 1976 # 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