Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: gclient_scm.py

Issue 2320573005: gclient: Prune dangling remote tracking refs when fetching with --force (Closed)
Patch Set: inline Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698