| 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 logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import posixpath | 9 import posixpath |
| 10 import re | 10 import re |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 # and if it does, then gclient may hide the prompt in the midst of a flood | 955 # and if it does, then gclient may hide the prompt in the midst of a flood |
| 956 # of terminal spew. The only indication that something has gone wrong | 956 # of terminal spew. The only indication that something has gone wrong |
| 957 # will be when gclient hangs unresponsively. Instead, we disable the | 957 # will be when gclient hangs unresponsively. Instead, we disable the |
| 958 # password prompt and simply allow git to fail noisily. The error | 958 # password prompt and simply allow git to fail noisily. The error |
| 959 # message produced by git will be copied to gclient's output. | 959 # message produced by git will be copied to gclient's output. |
| 960 env = kwargs.get('env') or kwargs.setdefault('env', os.environ.copy()) | 960 env = kwargs.get('env') or kwargs.setdefault('env', os.environ.copy()) |
| 961 env.setdefault('GIT_ASKPASS', 'true') | 961 env.setdefault('GIT_ASKPASS', 'true') |
| 962 env.setdefault('SSH_ASKPASS', 'true') | 962 env.setdefault('SSH_ASKPASS', 'true') |
| 963 else: | 963 else: |
| 964 kwargs.setdefault('print_stdout', True) | 964 kwargs.setdefault('print_stdout', True) |
| 965 stdout = kwargs.get('stdout', sys.stdout) | 965 cmd = ['git'] + args |
| 966 stdout.write('\n________ running \'git %s\' in \'%s\'\n' % ( | 966 return gclient_utils.CheckCallAndFilterAndHeader(cmd, **kwargs) |
| 967 ' '.join(args), kwargs['cwd'])) | |
| 968 return gclient_utils.CheckCallAndFilter(['git'] + args, **kwargs) | |
| 969 | 967 |
| 970 | 968 |
| 971 class SVNWrapper(SCMWrapper): | 969 class SVNWrapper(SCMWrapper): |
| 972 """ Wrapper for SVN """ | 970 """ Wrapper for SVN """ |
| 973 name = 'svn' | 971 name = 'svn' |
| 974 | 972 |
| 975 @staticmethod | 973 @staticmethod |
| 976 def BinaryExists(): | 974 def BinaryExists(): |
| 977 """Returns true if the command exists.""" | 975 """Returns true if the command exists.""" |
| 978 try: | 976 try: |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 new_command.append('--force') | 1425 new_command.append('--force') |
| 1428 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1426 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1429 new_command.extend(('--accept', 'theirs-conflict')) | 1427 new_command.extend(('--accept', 'theirs-conflict')) |
| 1430 elif options.manually_grab_svn_rev: | 1428 elif options.manually_grab_svn_rev: |
| 1431 new_command.append('--force') | 1429 new_command.append('--force') |
| 1432 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1430 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1433 new_command.extend(('--accept', 'postpone')) | 1431 new_command.extend(('--accept', 'postpone')) |
| 1434 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1432 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1435 new_command.extend(('--accept', 'postpone')) | 1433 new_command.extend(('--accept', 'postpone')) |
| 1436 return new_command | 1434 return new_command |
| OLD | NEW |