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

Side by Side Diff: gclient.py

Issue 227603003: Clarify the .gclient URL mismatch error message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 solutions.""" 1050 solutions."""
1051 for dep in self.dependencies: 1051 for dep in self.dependencies:
1052 if dep.managed and dep.url: 1052 if dep.managed and dep.url:
1053 scm = gclient_scm.CreateSCM(dep.url, self.root_dir, dep.name) 1053 scm = gclient_scm.CreateSCM(dep.url, self.root_dir, dep.name)
1054 actual_url = scm.GetActualRemoteURL() 1054 actual_url = scm.GetActualRemoteURL()
1055 if actual_url and not scm.DoesRemoteURLMatch(): 1055 if actual_url and not scm.DoesRemoteURLMatch():
1056 raise gclient_utils.Error(''' 1056 raise gclient_utils.Error('''
1057 Your .gclient file seems to be broken. The requested URL is different from what 1057 Your .gclient file seems to be broken. The requested URL is different from what
1058 is actually checked out in %(checkout_path)s. 1058 is actually checked out in %(checkout_path)s.
1059 1059
1060 Expected: %(expected_url)s (%(expected_scm)s) 1060 The .gclient file contains:
1061 Actual: %(actual_url)s (%(actual_scm)s) 1061 %(expected_url)s (%(expected_scm)s)
1062
1063 The local checkout in %(checkout_path)s reports:
1064 %(actual_url)s (%(actual_scm)s)
1062 1065
1063 You should ensure that the URL listed in .gclient is correct and either change 1066 You should ensure that the URL listed in .gclient is correct and either change
1064 it or fix the checkout. If you're managing your own git checkout in 1067 it or fix the checkout. If you're managing your own git checkout in
1065 %(checkout_path)s but the URL in .gclient is for an svn repository, you probably 1068 %(checkout_path)s but the URL in .gclient is for an svn repository, you probably
1066 want to set 'managed': False in .gclient. 1069 want to set 'managed': False in .gclient.
1067 ''' % {'checkout_path': os.path.join(self.root_dir, dep.name), 1070 ''' % {'checkout_path': os.path.join(self.root_dir, dep.name),
1068 'expected_url': dep.url, 1071 'expected_url': dep.url,
1069 'expected_scm': gclient_scm.GetScmName(dep.url), 1072 'expected_scm': gclient_scm.GetScmName(dep.url),
1070 'actual_url': actual_url, 1073 'actual_url': actual_url,
1071 'actual_scm': gclient_scm.GetScmName(actual_url)}) 1074 'actual_scm': gclient_scm.GetScmName(actual_url)})
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 print >> sys.stderr, 'Error: %s' % str(e) 1955 print >> sys.stderr, 'Error: %s' % str(e)
1953 return 1 1956 return 1
1954 finally: 1957 finally:
1955 gclient_utils.PrintWarnings() 1958 gclient_utils.PrintWarnings()
1956 1959
1957 1960
1958 if '__main__' == __name__: 1961 if '__main__' == __name__:
1959 sys.exit(Main(sys.argv[1:])) 1962 sys.exit(Main(sys.argv[1:]))
1960 1963
1961 # vim: ts=2:sw=2:tw=80:et: 1964 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698