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 from __future__ import print_function | 7 from __future__ import print_function |
8 | 8 |
9 import errno | 9 import errno |
10 import logging | 10 import logging |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 config_cmd = ['config', 'remote.%s.fetch' % self.remote, | 1118 config_cmd = ['config', 'remote.%s.fetch' % self.remote, |
1119 '+refs/tags/*:refs/tags/*', | 1119 '+refs/tags/*:refs/tags/*', |
1120 '^\\+refs/tags/\\*:.*$'] | 1120 '^\\+refs/tags/\\*:.*$'] |
1121 self._Run(config_cmd, options) | 1121 self._Run(config_cmd, options) |
1122 need_fetch = True | 1122 need_fetch = True |
1123 if fetch and need_fetch: | 1123 if fetch and need_fetch: |
1124 self._Fetch(options) | 1124 self._Fetch(options) |
1125 | 1125 |
1126 def _Run(self, args, options, show_header=True, **kwargs): | 1126 def _Run(self, args, options, show_header=True, **kwargs): |
1127 # Disable 'unused options' warning | pylint: disable=W0613 | 1127 # Disable 'unused options' warning | pylint: disable=W0613 |
1128 cwd = kwargs.setdefault('cwd', self.checkout_path) | 1128 kwargs.setdefault('cwd', self.checkout_path) |
1129 kwargs.setdefault('stdout', self.out_fh) | 1129 kwargs.setdefault('stdout', self.out_fh) |
1130 kwargs['filter_fn'] = self.filter | 1130 kwargs['filter_fn'] = self.filter |
1131 kwargs.setdefault('print_stdout', False) | 1131 kwargs.setdefault('print_stdout', False) |
1132 env = scm.GIT.ApplyEnvVars(kwargs) | 1132 env = scm.GIT.ApplyEnvVars(kwargs) |
1133 cmd = ['git'] + args | 1133 cmd = ['git'] + args |
1134 if show_header: | 1134 if show_header: |
1135 header = "running '%s' in '%s'" % (' '.join(cmd), cwd) | 1135 gclient_utils.CheckCallAndFilterAndHeader(cmd, env=env, **kwargs) |
1136 self.filter(header) | 1136 else: |
1137 return gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs) | 1137 gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs) |
1138 | 1138 |
1139 | 1139 |
1140 class SVNWrapper(SCMWrapper): | 1140 class SVNWrapper(SCMWrapper): |
1141 """ Wrapper for SVN """ | 1141 """ Wrapper for SVN """ |
1142 name = 'svn' | 1142 name = 'svn' |
1143 | 1143 |
1144 @staticmethod | 1144 @staticmethod |
1145 def BinaryExists(): | 1145 def BinaryExists(): |
1146 """Returns true if the command exists.""" | 1146 """Returns true if the command exists.""" |
1147 try: | 1147 try: |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 new_command.append('--force') | 1599 new_command.append('--force') |
1600 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1600 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1601 new_command.extend(('--accept', 'theirs-conflict')) | 1601 new_command.extend(('--accept', 'theirs-conflict')) |
1602 elif options.manually_grab_svn_rev: | 1602 elif options.manually_grab_svn_rev: |
1603 new_command.append('--force') | 1603 new_command.append('--force') |
1604 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1604 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1605 new_command.extend(('--accept', 'postpone')) | 1605 new_command.extend(('--accept', 'postpone')) |
1606 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1606 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1607 new_command.extend(('--accept', 'postpone')) | 1607 new_command.extend(('--accept', 'postpone')) |
1608 return new_command | 1608 return new_command |
OLD | NEW |