Prepare to make --revision <number> to be an error when multiple solutions are present.

It will help catch issues like the one we are getting on linux_chromeos where
the ordering of the solution is now by name, causing the default solution to be
used for --revision being the wrong one.

R=dpranke@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/8276020

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@105387 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 14 years ago
parent 9d9f21011f
commit 69392e7ca7

@ -847,6 +847,17 @@ solutions = [
client = GClient(path, options)
client.SetConfig(gclient_utils.FileRead(
os.path.join(path, options.config_filename)))
if (options.revisions and
len(client.dependencies) > 1 and
any('@' not in r for r in options.revisions)):
print >> sys.stderr, (
'You must specify the full solution name like --revision %s@%s\n'
'when you have multiple solutions setup in your .gclient file.\n'
'Other solutions present are: %s.') % (
client.dependencies[0].name,
options.revisions[0],
', '.join(s.name for s in client.dependencies[1:]))
return client
def SetDefaultConfig(self, solution_name, deps_file, solution_url,

@ -1093,7 +1093,11 @@ class GClientSmokeBoth(GClientSmokeBase):
['sync', '--deps', 'mac', '--jobs', '1', '--revision', '1',
'-r', 'src-git@' + self.githash('repo_1', 1)],
['running', 'running', 'running', 'running',
'running', 'running', 'running', 'running'])
'running', 'running', 'running', 'running'],
expected_stderr=
'You must specify the full solution name like --revision src@1\n'
'when you have multiple solutions setup in your .gclient file.\n'
'Other solutions present are: src-git.\n')
tree = self.mangle_git_tree(('repo_1@1', 'src-git'),
('repo_2@2', 'src/repo2'),
('repo_3@1', 'src/repo2/repo3'),

Loading…
Cancel
Save