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 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 '^\\+refs/branch-heads/\\*:.*$'] | 1228 '^\\+refs/branch-heads/\\*:.*$'] |
1229 self._Run(config_cmd, options) | 1229 self._Run(config_cmd, options) |
1230 need_fetch = True | 1230 need_fetch = True |
1231 if hasattr(options, 'with_tags') and options.with_tags: | 1231 if hasattr(options, 'with_tags') and options.with_tags: |
1232 config_cmd = ['config', 'remote.%s.fetch' % self.remote, | 1232 config_cmd = ['config', 'remote.%s.fetch' % self.remote, |
1233 '+refs/tags/*:refs/tags/*', | 1233 '+refs/tags/*:refs/tags/*', |
1234 '^\\+refs/tags/\\*:.*$'] | 1234 '^\\+refs/tags/\\*:.*$'] |
1235 self._Run(config_cmd, options) | 1235 self._Run(config_cmd, options) |
1236 need_fetch = True | 1236 need_fetch = True |
1237 if fetch and need_fetch: | 1237 if fetch and need_fetch: |
1238 self._Fetch(options) | 1238 self._Fetch(options, prune=options.force) |
1239 | 1239 |
1240 def _Run(self, args, options, show_header=True, **kwargs): | 1240 def _Run(self, args, options, show_header=True, **kwargs): |
1241 # Disable 'unused options' warning | pylint: disable=W0613 | 1241 # Disable 'unused options' warning | pylint: disable=W0613 |
1242 kwargs.setdefault('cwd', self.checkout_path) | 1242 kwargs.setdefault('cwd', self.checkout_path) |
1243 kwargs.setdefault('stdout', self.out_fh) | 1243 kwargs.setdefault('stdout', self.out_fh) |
1244 kwargs['filter_fn'] = self.filter | 1244 kwargs['filter_fn'] = self.filter |
1245 kwargs.setdefault('print_stdout', False) | 1245 kwargs.setdefault('print_stdout', False) |
1246 env = scm.GIT.ApplyEnvVars(kwargs) | 1246 env = scm.GIT.ApplyEnvVars(kwargs) |
1247 cmd = ['git'] + args | 1247 cmd = ['git'] + args |
1248 if show_header: | 1248 if show_header: |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1729 new_command.append('--force') | 1729 new_command.append('--force') |
1730 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1730 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1731 new_command.extend(('--accept', 'theirs-conflict')) | 1731 new_command.extend(('--accept', 'theirs-conflict')) |
1732 elif options.manually_grab_svn_rev: | 1732 elif options.manually_grab_svn_rev: |
1733 new_command.append('--force') | 1733 new_command.append('--force') |
1734 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1734 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1735 new_command.extend(('--accept', 'postpone')) | 1735 new_command.extend(('--accept', 'postpone')) |
1736 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1736 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1737 new_command.extend(('--accept', 'postpone')) | 1737 new_command.extend(('--accept', 'postpone')) |
1738 return new_command | 1738 return new_command |
OLD | NEW |