OLD | NEW |
1 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2009 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 glob | 7 import glob |
8 import os | 8 import os |
9 import re | 9 import re |
10 import shutil | 10 import shutil |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 @staticmethod | 249 @staticmethod |
250 def GenerateDiff(cwd, branch=None, branch_head='HEAD', full_move=False, | 250 def GenerateDiff(cwd, branch=None, branch_head='HEAD', full_move=False, |
251 files=None): | 251 files=None): |
252 """Diffs against the upstream branch or optionally another branch. | 252 """Diffs against the upstream branch or optionally another branch. |
253 | 253 |
254 full_move means that move or copy operations should completely recreate the | 254 full_move means that move or copy operations should completely recreate the |
255 files, usually in the prospect to apply the patch for a try job.""" | 255 files, usually in the prospect to apply the patch for a try job.""" |
256 if not branch: | 256 if not branch: |
257 branch = GIT.GetUpstreamBranch(cwd) | 257 branch = GIT.GetUpstreamBranch(cwd) |
258 command = ['diff', '-p', '--no-prefix', branch + "..." + branch_head] | 258 command = ['diff', '-p', '--no-prefix', '--no-ext-diff', |
| 259 branch + "..." + branch_head] |
259 if not full_move: | 260 if not full_move: |
260 command.append('-C') | 261 command.append('-C') |
261 # TODO(maruel): --binary support. | 262 # TODO(maruel): --binary support. |
262 if files: | 263 if files: |
263 command.append('--') | 264 command.append('--') |
264 command.extend(files) | 265 command.extend(files) |
265 diff = GIT.Capture(command, cwd)[0].splitlines(True) | 266 diff = GIT.Capture(command, cwd)[0].splitlines(True) |
266 for i in range(len(diff)): | 267 for i in range(len(diff)): |
267 # In the case of added files, replace /dev/null with the path to the | 268 # In the case of added files, replace /dev/null with the path to the |
268 # file being added. | 269 # file being added. |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 if not SVN.current_version: | 800 if not SVN.current_version: |
800 SVN.current_version = SVN.Capture(['--version']).split()[2] | 801 SVN.current_version = SVN.Capture(['--version']).split()[2] |
801 current_version_list = map(only_int, SVN.current_version.split('.')) | 802 current_version_list = map(only_int, SVN.current_version.split('.')) |
802 for min_ver in map(int, min_version.split('.')): | 803 for min_ver in map(int, min_version.split('.')): |
803 ver = current_version_list.pop(0) | 804 ver = current_version_list.pop(0) |
804 if ver < min_ver: | 805 if ver < min_ver: |
805 return (False, SVN.current_version) | 806 return (False, SVN.current_version) |
806 elif ver > min_ver: | 807 elif ver > min_ver: |
807 return (True, SVN.current_version) | 808 return (True, SVN.current_version) |
808 return (True, SVN.current_version) | 809 return (True, SVN.current_version) |
OLD | NEW |