OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Gclient-specific SCM-specific operations.""" | 5 """Gclient-specific SCM-specific operations.""" |
6 | 6 |
7 import collections | 7 import collections |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import posixpath | 10 import posixpath |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1024 | 1024 |
1025 def _Run(self, args, _options, git_filter=False, **kwargs): | 1025 def _Run(self, args, _options, git_filter=False, **kwargs): |
1026 kwargs.setdefault('cwd', self.checkout_path) | 1026 kwargs.setdefault('cwd', self.checkout_path) |
1027 kwargs.setdefault('nag_timer', self.nag_timer) | 1027 kwargs.setdefault('nag_timer', self.nag_timer) |
1028 kwargs.setdefault('nag_max', self.nag_max) | 1028 kwargs.setdefault('nag_max', self.nag_max) |
1029 if git_filter: | 1029 if git_filter: |
1030 kwargs['filter_fn'] = GitFilter(kwargs['nag_timer'] / 2, | 1030 kwargs['filter_fn'] = GitFilter(kwargs['nag_timer'] / 2, |
1031 kwargs.get('filter_fn')) | 1031 kwargs.get('filter_fn')) |
1032 kwargs.setdefault('print_stdout', False) | 1032 kwargs.setdefault('print_stdout', False) |
1033 # Don't prompt for passwords; just fail quickly and noisily. | 1033 # Don't prompt for passwords; just fail quickly and noisily. |
1034 # By default, git will use an interactive terminal prompt when a username/ | |
1035 # password is needed. That shouldn't happen in the chromium workflow, | |
1036 # and if it does, then gclient may hide the prompt in the midst of a flood | |
1037 # of terminal spew. The only indication that something has gone wrong | |
1038 # will be when gclient hangs unresponsively. Instead, we disable the | |
1039 # password prompt and simply allow git to fail noisily. The error | |
1040 # message produced by git will be copied to gclient's output. | |
Dirk Pranke
2013/07/10 00:54:26
nit: this doesn't mention why we need to set SSH_A
| |
1034 env = kwargs.get('env') or kwargs.setdefault('env', os.environ.copy()) | 1041 env = kwargs.get('env') or kwargs.setdefault('env', os.environ.copy()) |
M-A Ruel
2013/07/10 01:02:50
In general I'd recommend:
env = kwargs.setdefault(
| |
1035 env.setdefault('GIT_ASKPASS', 'true') | 1042 env.setdefault('GIT_ASKPASS', 'true') |
1036 env.setdefault('SSH_ASKPASS', 'true') | 1043 env.setdefault('SSH_ASKPASS', 'true') |
1037 else: | 1044 else: |
1038 kwargs.setdefault('print_stdout', True) | 1045 kwargs.setdefault('print_stdout', True) |
1039 stdout = kwargs.get('stdout', sys.stdout) | 1046 stdout = kwargs.get('stdout', sys.stdout) |
1040 stdout.write('\n________ running \'git %s\' in \'%s\'\n' % ( | 1047 stdout.write('\n________ running \'git %s\' in \'%s\'\n' % ( |
1041 ' '.join(args), kwargs['cwd'])) | 1048 ' '.join(args), kwargs['cwd'])) |
1042 gclient_utils.CheckCallAndFilter(['git'] + args, **kwargs) | 1049 gclient_utils.CheckCallAndFilter(['git'] + args, **kwargs) |
1043 | 1050 |
1044 | 1051 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1425 new_command.append('--force') | 1432 new_command.append('--force') |
1426 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1433 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1427 new_command.extend(('--accept', 'theirs-conflict')) | 1434 new_command.extend(('--accept', 'theirs-conflict')) |
1428 elif options.manually_grab_svn_rev: | 1435 elif options.manually_grab_svn_rev: |
1429 new_command.append('--force') | 1436 new_command.append('--force') |
1430 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1437 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1431 new_command.extend(('--accept', 'postpone')) | 1438 new_command.extend(('--accept', 'postpone')) |
1432 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1439 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1433 new_command.extend(('--accept', 'postpone')) | 1440 new_command.extend(('--accept', 'postpone')) |
1434 return new_command | 1441 return new_command |
OLD | NEW |