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

Side by Side Diff: scm.py

Issue 9442028: Make sure to remove color output from patches uploaded for try jobs (and other (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
« 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 """SCM-specific utility classes.""" 5 """SCM-specific utility classes."""
6 6
7 import cStringIO 7 import cStringIO
8 import glob 8 import glob
9 import logging 9 import logging
10 import os 10 import os
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 @staticmethod 337 @staticmethod
338 def GenerateDiff(cwd, branch=None, branch_head='HEAD', full_move=False, 338 def GenerateDiff(cwd, branch=None, branch_head='HEAD', full_move=False,
339 files=None): 339 files=None):
340 """Diffs against the upstream branch or optionally another branch. 340 """Diffs against the upstream branch or optionally another branch.
341 341
342 full_move means that move or copy operations should completely recreate the 342 full_move means that move or copy operations should completely recreate the
343 files, usually in the prospect to apply the patch for a try job.""" 343 files, usually in the prospect to apply the patch for a try job."""
344 if not branch: 344 if not branch:
345 branch = GIT.GetUpstreamBranch(cwd) 345 branch = GIT.GetUpstreamBranch(cwd)
346 command = ['diff', '-p', '--no-prefix', '--no-ext-diff', 346 command = ['diff', '-p', '--no-color', '--no-prefix', '--no-ext-diff',
347 branch + "..." + branch_head] 347 branch + "..." + branch_head]
348 if not full_move: 348 if not full_move:
349 command.append('-C') 349 command.append('-C')
350 # TODO(maruel): --binary support. 350 # TODO(maruel): --binary support.
351 if files: 351 if files:
352 command.append('--') 352 command.append('--')
353 command.extend(files) 353 command.extend(files)
354 diff = GIT.Capture(command, cwd=cwd).splitlines(True) 354 diff = GIT.Capture(command, cwd=cwd).splitlines(True)
355 for i in range(len(diff)): 355 for i in range(len(diff)):
356 # In the case of added files, replace /dev/null with the path to the 356 # In the case of added files, replace /dev/null with the path to the
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 # revert, like for properties. 1048 # revert, like for properties.
1049 if not os.path.isdir(cwd): 1049 if not os.path.isdir(cwd):
1050 # '.' was deleted. It's not worth continuing. 1050 # '.' was deleted. It's not worth continuing.
1051 return 1051 return
1052 try: 1052 try:
1053 SVN.Capture(['revert', file_status[1]], cwd=cwd) 1053 SVN.Capture(['revert', file_status[1]], cwd=cwd)
1054 except subprocess2.CalledProcessError: 1054 except subprocess2.CalledProcessError:
1055 if not os.path.exists(file_path): 1055 if not os.path.exists(file_path):
1056 continue 1056 continue
1057 raise 1057 raise
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