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

Side by Side Diff: gclient_scm.py

Issue 777533005: Update cpplint.py to r141. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools@master
Patch Set: Fixed pylint issue in fix_encoding (slice index is not an int) Created 6 years 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 | « fix_encoding.py ('k') | 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 """Generates a patch file which can be applied to the root of the 291 """Generates a patch file which can be applied to the root of the
292 repository. 292 repository.
293 293
294 The patch file is generated from a diff of the merge base of HEAD and 294 The patch file is generated from a diff of the merge base of HEAD and
295 its upstream branch. 295 its upstream branch.
296 """ 296 """
297 merge_base = self._Capture(['merge-base', 'HEAD', self.remote]) 297 merge_base = self._Capture(['merge-base', 'HEAD', self.remote])
298 gclient_utils.CheckCallAndFilter( 298 gclient_utils.CheckCallAndFilter(
299 ['git', 'diff', merge_base], 299 ['git', 'diff', merge_base],
300 cwd=self.checkout_path, 300 cwd=self.checkout_path,
301 filter_fn=GitDiffFilterer(self.relpath).Filter, print_func=self.Print) 301 filter_fn=GitDiffFilterer(self.relpath, print_func=self.Print).Filter)
302 302
303 def _FetchAndReset(self, revision, file_list, options): 303 def _FetchAndReset(self, revision, file_list, options):
304 """Equivalent to git fetch; git reset.""" 304 """Equivalent to git fetch; git reset."""
305 quiet = [] 305 quiet = []
306 if not options.verbose: 306 if not options.verbose:
307 quiet = ['--quiet'] 307 quiet = ['--quiet']
308 self._UpdateBranchHeads(options, fetch=False) 308 self._UpdateBranchHeads(options, fetch=False)
309 309
310 self._Fetch(options, prune=True, quiet=options.verbose) 310 self._Fetch(options, prune=True, quiet=options.verbose)
311 self._Run(['reset', '--hard', revision] + quiet, options) 311 self._Run(['reset', '--hard', revision] + quiet, options)
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 def pack(self, _options, args, _file_list): 1181 def pack(self, _options, args, _file_list):
1182 """Generates a patch file which can be applied to the root of the 1182 """Generates a patch file which can be applied to the root of the
1183 repository.""" 1183 repository."""
1184 if not os.path.isdir(self.checkout_path): 1184 if not os.path.isdir(self.checkout_path):
1185 raise gclient_utils.Error('Directory %s is not present.' % 1185 raise gclient_utils.Error('Directory %s is not present.' %
1186 self.checkout_path) 1186 self.checkout_path)
1187 gclient_utils.CheckCallAndFilter( 1187 gclient_utils.CheckCallAndFilter(
1188 ['svn', 'diff', '-x', '--ignore-eol-style'] + args, 1188 ['svn', 'diff', '-x', '--ignore-eol-style'] + args,
1189 cwd=self.checkout_path, 1189 cwd=self.checkout_path,
1190 print_stdout=False, 1190 print_stdout=False,
1191 filter_fn=SvnDiffFilterer(self.relpath).Filter, print_func=self.Print) 1191 filter_fn=SvnDiffFilterer(self.relpath, print_func=self.Print).Filter)
1192 1192
1193 def update(self, options, args, file_list): 1193 def update(self, options, args, file_list):
1194 """Runs svn to update or transparently checkout the working copy. 1194 """Runs svn to update or transparently checkout the working copy.
1195 1195
1196 All updated files will be appended to file_list. 1196 All updated files will be appended to file_list.
1197 1197
1198 Raises: 1198 Raises:
1199 Error: if can't get URL for relative path. 1199 Error: if can't get URL for relative path.
1200 """ 1200 """
1201 # Only update if hg is not controlling the directory. 1201 # Only update if hg is not controlling the directory.
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
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', 'theirs-conflict')) 1605 new_command.extend(('--accept', 'theirs-conflict'))
1606 elif options.manually_grab_svn_rev: 1606 elif options.manually_grab_svn_rev:
1607 new_command.append('--force') 1607 new_command.append('--force')
1608 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1608 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1609 new_command.extend(('--accept', 'postpone')) 1609 new_command.extend(('--accept', 'postpone'))
1610 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1610 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1611 new_command.extend(('--accept', 'postpone')) 1611 new_command.extend(('--accept', 'postpone'))
1612 return new_command 1612 return new_command
OLDNEW
« no previous file with comments | « fix_encoding.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698