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

Side by Side Diff: gclient.py

Issue 391048: gclient: fix another bug where ssh urls weren't parsed correctly (Closed)
Patch Set: fix per code review Created 11 years, 1 month 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_scm.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/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright 2008 Google Inc. All Rights Reserved. 3 # Copyright 2008 Google Inc. All Rights Reserved.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 solutions = self.GetVar("solutions") 802 solutions = self.GetVar("solutions")
803 if not solutions: 803 if not solutions:
804 raise gclient_utils.Error("No solution specified") 804 raise gclient_utils.Error("No solution specified")
805 805
806 entries = {} 806 entries = {}
807 entries_deps_content = {} 807 entries_deps_content = {}
808 808
809 # Inner helper to generate base url and rev tuple (including honoring 809 # Inner helper to generate base url and rev tuple (including honoring
810 # |revision_overrides|) 810 # |revision_overrides|)
811 def GetURLAndRev(name, original_url): 811 def GetURLAndRev(name, original_url):
812 if original_url.find("@") < 0: 812 revision, url = gclient_utils.SplitUrlRevision(original_url)
813 if not revision:
813 if revision_overrides.has_key(name): 814 if revision_overrides.has_key(name):
814 return (original_url, revision_overrides[name]) 815 return (url, revision_overrides[name])
815 else: 816 else:
816 scm = gclient_scm.CreateSCM(solution["url"], self._root_dir, name) 817 scm = gclient_scm.CreateSCM(solution["url"], self._root_dir, name)
817 return (original_url, scm.revinfo(self._options, [], None)) 818 return (url, scm.revinfo(self._options, [], None))
818 else: 819 else:
819 url_components = original_url.split("@")
820 if revision_overrides.has_key(name): 820 if revision_overrides.has_key(name):
821 return (url_components[0], revision_overrides[name]) 821 return (url, revision_overrides[name])
822 else: 822 else:
823 return (url_components[0], url_components[1]) 823 return (url, revision)
824 824
825 # Run on the base solutions first. 825 # Run on the base solutions first.
826 for solution in solutions: 826 for solution in solutions:
827 name = solution["name"] 827 name = solution["name"]
828 if name in entries: 828 if name in entries:
829 raise gclient_utils.Error("solution %s specified more than once" % name) 829 raise gclient_utils.Error("solution %s specified more than once" % name)
830 (url, rev) = GetURLAndRev(name, solution["url"]) 830 (url, rev) = GetURLAndRev(name, solution["url"])
831 entries[name] = "%s@%s" % (url, rev) 831 entries[name] = "%s@%s" % (url, rev)
832 # TODO(aharper): SVN/SCMWrapper cleanup (non-local commandset) 832 # TODO(aharper): SVN/SCMWrapper cleanup (non-local commandset)
833 entries_deps_content[name] = gclient_scm.CaptureSVN( 833 entries_deps_content[name] = gclient_scm.CaptureSVN(
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1180
1181 if "__main__" == __name__: 1181 if "__main__" == __name__:
1182 try: 1182 try:
1183 result = Main(sys.argv) 1183 result = Main(sys.argv)
1184 except gclient_utils.Error, e: 1184 except gclient_utils.Error, e:
1185 print >> sys.stderr, "Error: %s" % str(e) 1185 print >> sys.stderr, "Error: %s" % str(e)
1186 result = 1 1186 result = 1
1187 sys.exit(result) 1187 sys.exit(result)
1188 1188
1189 # vim: ts=2:sw=2:tw=80:et: 1189 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698